// Global object if (typeof CiteTB == 'undefined') { var CiteTB = { "Templates" : {}, // All templates "Options" : {}, // Global options "UserOptions" : {}, // User options "DefaultOptions" : {}, // Script defaults "ErrorChecks" : {} // Error check functions }; } // Object for cite templates function citeTemplate(templatename, shortform, basicfields, expandedfields) { // Properties this.templatename = templatename; // The template name - "cite web", "cite book", etc. this.shortform = shortform; // A short form, used for the dropdown box this.basic = basicfields; // Basic fields - author, title, publisher... // Less common - quote, archiveurl - should be everything the template supports minus the basic ones this.extra = expandedfields; // Add it to the list CiteTB.Templates[this.templatename] = this; // Methods this.makeFormInner = function(fields) { var i=0; var trs = new Array(); for (i=0; i').attr('src', 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Nuvola_apps_date.svg/20px-Nuvola_apps_date.svg.png');; im.attr('alt', mw.usability.getMsg('cite-insert-date')).attr('title', mw.usability.getMsg('cite-insert-date')); var ad = $j('').attr('href', '#'); ad.append(im); ad.attr('id', 'cite-date-'+CiteTB.escStr(this.shortform)+'-'+field); $j('#cite-date-'+CiteTB.escStr(this.shortform)+'-'+field).live('click', CiteTB.fillAccessdate); } var display = fieldobj.label ? fieldobj.label : CiteTB.fixStr(field); var tooltip = fieldobj.tooltip ? $j('').attr('title', fieldobj.tooltip).text('*') : false; var input = ''; if (ad) { input = $j(''); } else { input = $j(''); } input.attr('id', 'cite-'+CiteTB.escStr(this.shortform)+'-'+field); var label = $j('