Jump to content

User:逆襲的天邪鬼/Twinkle-lzh/friendlytag.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 44:
 
Window.setTitle( "條目维护標記" );
 
form.append({
type: 'div',
id: 'tagWorkArea',
className: 'morebits-scrollbox',
style: 'max-height: 28em'
});
 
 
console.log('A');
var container = new Morebits.quickForm.element({ type: "fragment" });
 
// function to generate a checkbox, with appropriate subgroup if needed
Line 102 ⟶ 91:
var checkboxes = [];
$.each(Twinkle.tag.article.tags, function(tag, description) {
checkboxesform.push(makeCheckbox(tag, description));
});
containerform.append({
type: "checkbox",
name: "articleTags",
list: checkboxes
});
console.log('B');
 
// append any custom tags
if (Twinkle.getFriendlyPref('customTagList').length) {
containerform.append({ type: 'header', label: '自定義模板' });
containerform.append({ type: 'checkbox', name: 'articleTags', list: Twinkle.getFriendlyPref('customTagList') });
}
 
/*
var $workarea = $(form).find("div#tagWorkArea");
var rendered = container.render();
$workarea.empty().append(rendered);
 
// style adjustments
$workarea.find("h5").css({ 'font-size': '110%' });
$workarea.find("h5:not(:first-child)").css({ 'margin-top': '1em' });
$workarea.find("div").filter(":has(span.quickformDescription)").css({ 'margin-top': '0.4em' });
console.log('C');
 
 
// add a link to each template's description page
$.each(Morebits.quickForm.getElements(form, "articleTags"), function(index, checkbox) {
var $checkbox = $(checkbox);
var link = Morebits.htmlNode("a", ">");
link.setAttribute("class", "tag-template-link");
link.setAttribute("href", mw.util.getUrl("Template:" +
Morebits.string.toUpperCaseFirstChar(checkbox.values)));
link.setAttribute("target", "_blank");
$checkbox.parent().append(["\u00A0", link]);
});
 
console.log('D');
*/
 
form.append(container);
 
form.append( { type:'submit' } );
Cookies help us deliver our services. By using our services, you agree to our use of cookies.