Skip to content

improved page style #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions codetabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ p a.modulelink:hover {
pre samp {
overflow-x: auto;
display: block; /* for overflow-x to work */
line-height: 100%!important; /*to have original line height after changing it in grassdocs.css */
}

/* class to override pre style
Expand All @@ -159,3 +160,7 @@ pre samp {
font-family: arial,sans-serif;
font-size: initial;
}

img.switchimg {
padding: 0px!important;
}
42 changes: 21 additions & 21 deletions codetabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ function getMatches(string, regex, index) {
function parse_code(code, lang) {

var lines = code.split('\n');

// in theory, can contain also empty lines and comments
parsed_lines = [];

for(var i = 0; i < lines.length; i++) {

try {
line = lines[i]
line = line.trim()

if (!line) {
continue;
}
//console.log(line)

var command = {
module: null,
flags: '', // as string, e.g. abcd
Expand All @@ -115,6 +115,7 @@ function parse_code(code, lang) {
}

module_re = / *[a-z][3]?\.[a-z3][a-z3\.]*[a-z3]/ // / *([a-z][3]?\.[a-z][a-z.]?) /

module = module_re.exec(line)
if (!module)
// probably comment or something else
Expand Down Expand Up @@ -146,14 +147,14 @@ function parse_code(code, lang) {
}
value = match[1];
//console.log('option ' + option + ': ' + value)

var key_value_option = {
key: option,
value: value,
quote: quotes_char
}
command.options.push(key_value_option)

// safer for the rest would be removing of match from string
}

Expand All @@ -176,7 +177,7 @@ function parse_code(code, lang) {
//console.log('command.flags: ' + command.flags)
//console.log('command.flags: ' + command.flags)
}

if ((command.module == 'r.mapcalc' || command.module == 'r3.mapcalc' ) && !command.options.length) {
var flag_re = /"(.+ = .+)"/
var matches = flag_re.exec(line)
Expand All @@ -187,9 +188,9 @@ function parse_code(code, lang) {
}
command.options.push(key_value_option)
}

parsed_lines.push(command);

} catch (err) {
var text = "There was an error on this page.\n\n";
text += "Error description: " + err.message + "\n\n";
Expand All @@ -207,7 +208,7 @@ function parse_code(code, lang) {
}
alert(text);
}

}
return parsed_lines;
}
Expand Down Expand Up @@ -396,7 +397,6 @@ $(document).ready(function() {
element.css('display', 'block');
element.addClass("visible");
});


// using has to really get only those created above
$('.tabs-container').has('pre').each(function() {
Expand All @@ -409,7 +409,7 @@ $(document).ready(function() {
$(this).children('samp').each(function() {
$(this).text($(this).text().trim());
});

});

$('pre code').each(function() {
Expand All @@ -418,29 +418,29 @@ $(document).ready(function() {
var description = ''
if (tabcontent.hasClass('python')) {
lang = 'python'
description = '<img src="python.png" style="height: 1em; width: 1em; margin-right: 0.2em;">Python'
description = '<img src="python.png" style="height: 1em; width: 1em; margin-right: 0.2em;" class="switchimg">Python'
}
else if (tabcontent.hasClass('bash')) {
lang = 'bash'
description = '<img src="bash.png" style="height: 1em; width: 1em; margin-right: 0.2em;">Bash'
description = '<img src="bash.png" style="height: 1em; width: 1em; margin-right: 0.2em;" class="switchimg">Bash'
}
else if (tabcontent.hasClass('gui')) {
lang = 'gui'
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;">GUI'
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;" class="switchimg">GUI'
}
else if (tabcontent.hasClass(NEUTRAL_LANG)) {
lang = NEUTRAL_LANG
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;">' + NEUTRAL_LANG_LABEL
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;" class="switchimg">' + NEUTRAL_LANG_LABEL
}
else {
lang = NEUTRAL_LANG
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;">' + NEUTRAL_LANG_LABEL
description = '<img src="grass.png" style="height: 1em; width: 1em; margin-right: 0.2em;" class="switchimg">' + NEUTRAL_LANG_LABEL
}

var parentid = tabcontent.parent().attr('id');
var tabid = parentid + '-' + lang;
tabcontent.attr('id', tabid);

ul = tabcontent.parent().parent().children('ul')
var menuitem = '<li';
//if (lang == NEUTRAL_LANG) {
Expand All @@ -453,9 +453,9 @@ $(document).ready(function() {
//menuitem.addClass('current');
menuitem += ' class="current"';
}

menuitem += '><a href="#' + tabid + '">' + description + '</a></li>';

ul.append(menuitem)

if (tabcontent.hasClass('generate')) {
Expand Down
16 changes: 16 additions & 0 deletions grassdocs.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ hr.header {
width: 100%;
}

p {
text-align: justify;
}

.justify {
text-align: justify;
}

h1{
background-color: transparent;
color: rgb(25%, 60%, 25%);
Expand All @@ -56,6 +64,10 @@ h2{
font-family: arial,sans-serif;
font-weight: bold;
font-size: x-large;
padding-top: 0.8em;
padding-bottom: 0.1em;
margin: 0px;
-webkit-margin-after: 0.1em;
}

h3{
Expand All @@ -64,6 +76,10 @@ h3{
font-family: arial,sans-serif;
font-weight: bold;
font-size: large;
padding-top: 0.8em;
padding-bottom: 0em;
margin: 0px;
-webkit-margin-after: 0.1em;
}

h4{
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ <h3>Basic commands and visualizations</h3>
</code>
</pre>

<p>
To better handle the long time series of maps, we create temporal datasets
which serve as containers for the time series and we will further manipulate
them instead of the individual maps. First, we create empty datasets of type
Expand Down
Loading