|
@ -60,7 +60,8 @@ var configuratorApp = (function(){ |
|
|
boards_list = {}, |
|
|
boards_list = {}, |
|
|
therms_list = {}, |
|
|
therms_list = {}, |
|
|
total_config_lines, |
|
|
total_config_lines, |
|
|
total_config_adv_lines; |
|
|
total_config_adv_lines, |
|
|
|
|
|
hover_timer; |
|
|
|
|
|
|
|
|
// Return this anonymous object as configuratorApp
|
|
|
// Return this anonymous object as configuratorApp
|
|
|
return { |
|
|
return { |
|
@ -111,14 +112,12 @@ var configuratorApp = (function(){ |
|
|
var loaded_items = {}; |
|
|
var loaded_items = {}; |
|
|
var config_files = [boards_file, config_file, config_adv_file]; |
|
|
var config_files = [boards_file, config_file, config_adv_file]; |
|
|
$.each(config_files, function(i,fname){ |
|
|
$.each(config_files, function(i,fname){ |
|
|
self.log("Loading " + fname + "...", 3); |
|
|
|
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: marlin_config+'/'+fname, |
|
|
url: marlin_config+'/'+fname, |
|
|
type: 'GET', |
|
|
type: 'GET', |
|
|
async: true, |
|
|
async: true, |
|
|
cache: false, |
|
|
cache: false, |
|
|
success: function(txt) { |
|
|
success: function(txt) { |
|
|
self.log("Loaded " + fname + "...", 3); |
|
|
|
|
|
loaded_items[fname] = function(){ self.fileLoaded(fname, txt); }; |
|
|
loaded_items[fname] = function(){ self.fileLoaded(fname, txt); }; |
|
|
success_count++; |
|
|
success_count++; |
|
|
}, |
|
|
}, |
|
@ -358,12 +357,31 @@ var configuratorApp = (function(){ |
|
|
if (elm.defineInfo == null) { |
|
|
if (elm.defineInfo == null) { |
|
|
var inf = elm.defineInfo = this.getDefineInfo(name, adv); |
|
|
var inf = elm.defineInfo = this.getDefineInfo(name, adv); |
|
|
$elm.on($elm.attr('type') == 'text' ? 'input' : 'change', this.handleChange); |
|
|
$elm.on($elm.attr('type') == 'text' ? 'input' : 'change', this.handleChange); |
|
|
var comm = inf.comment; |
|
|
|
|
|
var $tipme = $elm.prev('label'); |
|
|
if (inf.comment) { |
|
|
if ($tipme.length) { |
|
|
var $tipme = $elm.prev('label'); |
|
|
comm ? |
|
|
if (inf.comment && $tipme.length) { |
|
|
$tipme.addClass('tooltip').attr('data-tooltip',comm) : |
|
|
var $tt = $('#tooltip'); |
|
|
$tipme.removeClass('tooltip').removeAttr('data-tooltip'); |
|
|
$tipme.hover( |
|
|
|
|
|
function() { |
|
|
|
|
|
var offs = $tipme.offset(); |
|
|
|
|
|
$tt.text(inf.comment) |
|
|
|
|
|
.append('<span>') |
|
|
|
|
|
.css({bottom:($tt.parent().height()-offs.top+20)+'px',left:(offs.left+70)+'px'}) |
|
|
|
|
|
.show(); |
|
|
|
|
|
if (hover_timer) { |
|
|
|
|
|
clearTimeout(hover_timer); |
|
|
|
|
|
hover_timer = null; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
function() { |
|
|
|
|
|
hover_timer = setTimeout(function(){ |
|
|
|
|
|
hover_timer = null; |
|
|
|
|
|
$tt.fadeOut(400); |
|
|
|
|
|
}, 400); |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.setFieldFromDefine(name); |
|
|
this.setFieldFromDefine(name); |
|
@ -622,7 +640,7 @@ var configuratorApp = (function(){ |
|
|
var r, s; |
|
|
var r, s; |
|
|
findDef = new RegExp('([ \\t]*(//|#)[^\n]+\n){1,4}\\s{0,1}' + info.line, 'g'); |
|
|
findDef = new RegExp('([ \\t]*(//|#)[^\n]+\n){1,4}\\s{0,1}' + info.line, 'g'); |
|
|
if (r = findDef.exec(txt)) { |
|
|
if (r = findDef.exec(txt)) { |
|
|
findDef = new RegExp('^[ \\t]*//+[ \\t]*(.*)[ \\t]*$', 'gm'); |
|
|
findDef = new RegExp('^[ \\t]*//+[ \\t]*([^#].*)[ \\t]*$', 'gm'); |
|
|
while((s = findDef.exec(r[0])) !== null) { |
|
|
while((s = findDef.exec(r[0])) !== null) { |
|
|
if (s[1].match(/\/\/[ \\t]*#define/) == null) |
|
|
if (s[1].match(/\/\/[ \\t]*#define/) == null) |
|
|
comment += s[1] + "\n"; |
|
|
comment += s[1] + "\n"; |
|
|