1,728 bytes added ,  19:14, 4 April 2011
no edit summary
Line 1: Line 1:  
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 +
 +
// for image upload page to automate the image information template insertion
 +
function imageInfo()
 +
{
 +
//    var res = prompt("Result?","Keep - No Consensus");
 +
//    if(!res) return;
 +
//    var afddate = prompt("Nomination date?",cur_date());
 +
//    document.editform.wpSummary.value = 'AFD result - ' + res.replace(/'/g, '');
 +
 +
    // a page edit box is called wpTextbox1
 +
    // the description box on an upload page is called wpUploadDescription
 +
 +
    // works for edit box but not here, wrong form and field
 +
    // var txt = document.editform.wpTextbox1;
 +
 +
    // upload is the ID but not the name... so this fails   
 +
    // var txt = document.upload.wpUploadDescription;
 +
 +
    // this works but it is brittle
 +
    // var txt=document.forms[0].wpUploadDescription;
 +
   
 +
//var txt=document.getElementById('upload').wpUploadDescription;
 +
// stopped working with new screens
 +
 +
    var txt=document.getElementById('mw-upload-form').wpUploadDescription;
 +
 +
    if(txt.value.length > 0) txt.value += '\n';
 +
    txt.value += "{{Information " +'\n'
 +
              + "|Description=  " +'\n'
 +
              + "|Source=Picture taken by [[User:Lar]]" +'\n'
 +
              + "|Date=" + cur_date_year() +'\n'
 +
              + "|Author= Larry Pieniazek, [[User:Lar]], [[en:User:Lar]] (primary)" +'\n'
 +
              + "|Permission=Dual licensed under [[w:GNU_Free_Documentation_License|GFDL]] and [[w:Creative Commons|Creative Commons]] [http://creativecommons.org/licenses/by/2.5/ Attribution 2.5] (CC-BY 2.5)" +'\n'
 +
              + "|other_versions= none but contact author for other similar images" +'\n'
 +
              + "}}" +'\n'
 +
              + "== Licensing ==" +'\n'
 +
              + "{{self2|GFDL|cc-by-2.5}}" +'\n';
 +
    txt.focus();
 +
}
 +
 +
    
function includePage( name )
 
function includePage( name )