|
@@ -60,7 +60,8 @@ var configuratorApp = (function(){
|
60
|
60
|
boards_list = {},
|
61
|
61
|
therms_list = {},
|
62
|
62
|
total_config_lines,
|
63
|
|
- total_config_adv_lines;
|
|
63
|
+ total_config_adv_lines,
|
|
64
|
+ hover_timer;
|
64
|
65
|
|
65
|
66
|
// Return this anonymous object as configuratorApp
|
66
|
67
|
return {
|
|
@@ -111,14 +112,12 @@ var configuratorApp = (function(){
|
111
|
112
|
var loaded_items = {};
|
112
|
113
|
var config_files = [boards_file, config_file, config_adv_file];
|
113
|
114
|
$.each(config_files, function(i,fname){
|
114
|
|
- self.log("Loading " + fname + "...", 3);
|
115
|
115
|
$.ajax({
|
116
|
116
|
url: marlin_config+'/'+fname,
|
117
|
117
|
type: 'GET',
|
118
|
118
|
async: true,
|
119
|
119
|
cache: false,
|
120
|
120
|
success: function(txt) {
|
121
|
|
- self.log("Loaded " + fname + "...", 3);
|
122
|
121
|
loaded_items[fname] = function(){ self.fileLoaded(fname, txt); };
|
123
|
122
|
success_count++;
|
124
|
123
|
},
|
|
@@ -358,12 +357,31 @@ var configuratorApp = (function(){
|
358
|
357
|
if (elm.defineInfo == null) {
|
359
|
358
|
var inf = elm.defineInfo = this.getDefineInfo(name, adv);
|
360
|
359
|
$elm.on($elm.attr('type') == 'text' ? 'input' : 'change', this.handleChange);
|
361
|
|
- var comm = inf.comment;
|
362
|
|
- var $tipme = $elm.prev('label');
|
363
|
|
- if ($tipme.length) {
|
364
|
|
- comm ?
|
365
|
|
- $tipme.addClass('tooltip').attr('data-tooltip',comm) :
|
366
|
|
- $tipme.removeClass('tooltip').removeAttr('data-tooltip');
|
|
360
|
+
|
|
361
|
+ if (inf.comment) {
|
|
362
|
+ var $tipme = $elm.prev('label');
|
|
363
|
+ if (inf.comment && $tipme.length) {
|
|
364
|
+ var $tt = $('#tooltip');
|
|
365
|
+ $tipme.hover(
|
|
366
|
+ function() {
|
|
367
|
+ var offs = $tipme.offset();
|
|
368
|
+ $tt.text(inf.comment)
|
|
369
|
+ .append('<span>')
|
|
370
|
+ .css({bottom:($tt.parent().height()-offs.top+20)+'px',left:(offs.left+70)+'px'})
|
|
371
|
+ .show();
|
|
372
|
+ if (hover_timer) {
|
|
373
|
+ clearTimeout(hover_timer);
|
|
374
|
+ hover_timer = null;
|
|
375
|
+ }
|
|
376
|
+ },
|
|
377
|
+ function() {
|
|
378
|
+ hover_timer = setTimeout(function(){
|
|
379
|
+ hover_timer = null;
|
|
380
|
+ $tt.fadeOut(400);
|
|
381
|
+ }, 400);
|
|
382
|
+ }
|
|
383
|
+ );
|
|
384
|
+ }
|
367
|
385
|
}
|
368
|
386
|
}
|
369
|
387
|
this.setFieldFromDefine(name);
|
|
@@ -622,7 +640,7 @@ var configuratorApp = (function(){
|
622
|
640
|
var r, s;
|
623
|
641
|
findDef = new RegExp('([ \\t]*(//|#)[^\n]+\n){1,4}\\s{0,1}' + info.line, 'g');
|
624
|
642
|
if (r = findDef.exec(txt)) {
|
625
|
|
- findDef = new RegExp('^[ \\t]*//+[ \\t]*(.*)[ \\t]*$', 'gm');
|
|
643
|
+ findDef = new RegExp('^[ \\t]*//+[ \\t]*([^#].*)[ \\t]*$', 'gm');
|
626
|
644
|
while((s = findDef.exec(r[0])) !== null) {
|
627
|
645
|
if (s[1].match(/\/\/[ \\t]*#define/) == null)
|
628
|
646
|
comment += s[1] + "\n";
|