diff options
Diffstat (limited to 'lib/scripts/script.js')
-rw-r--r-- | lib/scripts/script.js | 126 |
1 files changed, 3 insertions, 123 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 490394dfb..44409c712 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -131,102 +131,16 @@ function hideLoadBar(){ } } -/** - * Checks if a summary was entered - if not the style is changed - * - * @author Andreas Gohr <andi@splitbrain.org> - */ -function summaryCheck(){ - if(document.getElementById){ - var sum = document.getElementById('summary'); - if(sum.value == ''){ - sum.className='missing'; - }else{ - sum.className='edit'; - } - } -} - -/** - * This function generates the actual toolbar buttons with localized text - * we use it to avoid creating the toolbar where javascript is not enabled - * @deprecated - */ -function formatButton(imageFile, speedTip, tagOpen, tagClose, sampleText, accessKey) { - speedTip=escapeQuotes(speedTip); - tagOpen=escapeQuotes(tagOpen); - tagClose=escapeQuotes(tagClose); - sampleText=escapeQuotes(sampleText); - - document.write("<a "); - if(accessKey){ - document.write("accesskey=\""+accessKey+"\" "); - speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']'; - } - document.write("href=\"javascript:insertTags"); - document.write("('"+tagOpen+"','"+tagClose+"','"+sampleText+"');\">"); - - document.write("<img width=\"24\" height=\"24\" src=\""+ - DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ - speedTip+"\" title=\""+speedTip+"\">"); - document.write("</a>"); - return; -} - -/** - * This function generates the actual toolbar buttons with localized text - * we use it to avoid creating the toolbar where javascript is not enabled - * @deprecated - */ -function insertButton(imageFile, speedTip, value, accessKey) { - speedTip=escapeQuotes(speedTip); - value=escapeQuotes(value); - - document.write("<a "); - if(accessKey){ - document.write("accesskey=\""+accessKey+"\" "); - speedTip = speedTip+' [ALT+'+accessKey.toUpperCase()+']'; - } - document.write("href=\"javascript:insertAtCarret"); - document.write("(document.editform.wikitext,'"+value+"');\">"); - - document.write("<img width=\"24\" height=\"24\" src=\""+ - DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ - speedTip+"\" title=\""+speedTip+"\">"); - document.write("</a>"); - return; -} - -/** - * This adds a button for the MediaSelection Popup - * @deprecated - */ -function mediaButton(imageFile, speedTip, accessKey, namespace) { - speedTip=escapeQuotes(speedTip); - document.write("<a "); - if(accessKey){ - document.write("accesskey=\""+accessKey+"\" "); - } - document.write("href=\"javascript:void(window.open('"+DOKU_BASE+"lib/exe/media.php?ns="+ - namespace+"','mediaselect','width=600,height=320,left=70,top=50,scrollbars=yes,resizable=yes'));\">"); - document.write("<img width=\"24\" height=\"24\" src=\""+ - DOKU_BASE+'lib/images/toolbar/'+imageFile+"\" border=\"0\" alt=\""+ - speedTip+"\" title=\""+speedTip+"\">"); - document.write("</a>"); - return; -} - /* * Insert the selected filename and close the window * * @see http://www.alexking.org/index.php?content=software/javascript/content.php */ function mediaSelect(file){ - insertAtCarret(opener.document.editform.wikitext,'{{'+file+'}}'); + opener.insertAtCarret('wikitext','{{'+file+'}}'); window.close(); } - /** * For the upload Dialog. Prefills the wikiname. */ @@ -274,42 +188,6 @@ function toggleToc() { } } - -/** - * global var used for not saved yet warning - */ -var textChanged = false; - -function svchk(){ - if(textChanged){ - return confirm(notSavedYet); - }else{ - return true; - } -} - -/** - * global variable for the locktimer - */ -var locktimerID; - -/** - * This starts a timer to remind the user of an expiring lock - * Accepts the delay in seconds and a text to display. - */ -function init_locktimer(delay,txt){ - txt = escapeQuotes(txt); - locktimerID = self.setTimeout("locktimer('"+txt+"')", delay*1000); -} - -/** - * This stops the timer and displays a message about the expiring lock - */ -function locktimer(txt){ - clearTimeout(locktimerID); - alert(txt); -} - /* * This sets a cookie by JavaScript * @@ -424,6 +302,8 @@ function fnt(id, e, evt) { * Add the edit window size controls */ function initSizeCtl(ctlid,edid){ + if(!document.getElementById) return; + var ctl = document.getElementById(ctlid); var textarea = document.getElementById(edid); |