מדיה ויקי:Gadget-TemplateParamWizard.js: הבדלים בין גרסאות בדף

כבר לא רשימה
מ ניסיון להיפרד מהsetTimeout+ יצירה של קוד נקי יותר בלי פרמטרים ריקים
שורה 136: שורה 136:
hidden = f.parents('.tpw_hidden').length,
hidden = f.parents('.tpw_hidden').length,
val = $.trim(f.val());
val = $.trim(f.val());
if(val=="" && !f.attr('type') == 'checkbox') continue;//skip parameters with no value
if (f.attr('type') == 'checkbox' && ! f.prop('checked'))
if (f.attr('type') == 'checkbox' && ! f.prop('checked'))
val = "";
val = "";
שורה 488: שורה 489:
}
}


setTimeout(function() {
$(document).ready(function() {
var buttonImage = '//upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png';
var buttonImage = '//upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png';
if (typeof $.wikiEditor == 'object' && $.wikiEditor.supported)
if (typeof $.wikiEditor == 'object' && $.wikiEditor.supported)
$('#wpTextbox1').wikiEditor('addToToolbar', {
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
section: 'advanced',
group: 'more',
groups: {
tools: {
'wizards': {
'linkTemplatewizard': {
tools: {
label: i18n('button hint'),
'linkTemplatewizard': {
type: 'button',
label: i18n('button hint'),
icon: buttonImage,
type: 'button',
action: {type: 'callback', execute: doIt}
icon: buttonImage,
action: {type: 'callback', execute: doIt}
}
}
}
}
}
}
שורה 510: שורה 514:
);
);


}, 120);
});


});
});
});
});