From: <cra...@us...> - 2003-03-15 16:07:28
|
Update of /cvsroot/twikiplugins/twikiplugins/PowerEditPlugin/templates In directory sc8-pr-cvs1:/tmp/cvs-serv11118/PowerEditPlugin/templates Added Files: applet.power.tmpl edit.power.tmpl Log Message: Rewritten completely as a plugin instead of an addon --- NEW FILE: applet.power.tmpl --- <SCRIPT LANGUAGE="JavaScript"><!-- function _P(name,value){return '<PARAM NAME="'+name+'" VALUE="'+value+'">'; } function _A(name,value){return " "+name+'="'+value+'" '; } //document.writeln("PLUGINS<pre>"+navigator.plugins.length); //for (var i = 0; i < navigator.plugins.length; i++) { // document.writeln(navigator.plugins[i]); //} //document.writeln("</pre>END OF PLUGINS"); // set this if you want to use OBJECT or EMBED in preference to APPLET var _usePlugins=false; var _info=navigator.userAgent;var _ns=false;var _ns6=false; var _ns=(navigator.appName.indexOf("Netscape")>=0&&((_info.indexOf("Win")>0&&_info.indexOf("Win16")<0&&java.lang.System.getProperty("os.version").indexOf("3.5")<0)||(_info.indexOf("Sun")>0)||(_info.indexOf("Linux")>0)||(_info.indexOf("AIX")>0)||(_info.indexOf("OS/2")>0))); var _ns6=((_ns==true)&&(_info.indexOf("Mozilla/5")>=0)); var _ie =(_info.indexOf("MSIE")>0&&_info.indexOf("Win")>0&&_info.indexOf("Windows 3.1")<0); var _jar="%PUBURLPATH%/TWiki/PowerEditPlugin/poweredit.jar"; var _aStd=_A("ARCHIVE",_jar)+ _A("MAYSCRIPT","true")+_A("SCRIPTABLE","true")+ _A("CODE","com.ccsoft.edit.TWikiEdit") + _A("NAME","TWikiEdit"); var _tag; var _attrs; var_alt=""; var _jpp="http://java.sun.com/products/plugin/1.3.1/"; if (_usePlugins && _ie == true) { _tag="OBJECT"; _attrs=_A("CLASSID","clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA") + _A("CODEBASE",_jpp+"jinstall-131-win32.cab#Version=1,3,1,0"); _needParams=true; } else if (_usePlugins && _ns == true && _ns6 == false) { _tag="EMBED"; _attrs=_A("TYPE","application/x-java-applet;jpi-version=1.3.1")+ _A("PLUGINSPAGE",_jpp+"plugin-install.html") + _aStd + _A("useframe","no") + _A("editboxwidth","%EDITBOXWIDTH%")+ _A("editboxheight","%EDITBOXHEIGHT%"); _needParams=false; } else { _tag="APPLET"; _attrs=_aStd; _needParams=true; _alt="You need a Java enabled browser"; } document.writeln("<"+_tag+_attrs+_A("WIDTH","100%")+_A("HEIGHT","75%")+">"); if (_needParams) { document.writeln(_P("NAME","TWikiEdit")); document.writeln(_P("CODE", "com.ccsoft.edit.TWikiEdit")); document.writeln(_P("ARCHIVE", _jar)); document.writeln(_P("TYPE", "application/x-java-applet;jpi-version=1.3.1")); document.writeln(_P("SCRIPTABLE", "true")); document.writeln(_P("MAYSCRIPT", "true")); document.writeln(_P("useframe", "no")); document.writeln(_P("editboxwidth", "%EDITBOXWIDTH%")); document.writeln(_P("editboxheight", "%EDITBOXHEIGHT%")); } document.writeln(_alt+"</" + _tag + ">"); //--></SCRIPT> %CONTROLS% %TEXT% --- NEW FILE: edit.power.tmpl --- %TMPL:INCLUDE{"twiki"}% %TMPL:P{"htmldoctype"}% <head> <title> %WIKITOOLNAME% . %WEB% . %TOPIC% %TMPL:P{"titleaction"}%</title> <meta http-equiv="Content-Type" content="text/html; charset=%CHARSET%" /> <meta name="robots" content="noindex" /> %HTTP_EQUIV_ON_EDIT% <base href="%SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%" /> <script language="JavaScript"> <!--HIDE function initForm() { document.main.text.focus(); } function checkAll( theButton, theButtonOffset, theNum, theCheck ) { // find button element index var j = 0; for( var i = 0; i <= document.main.length; i++ ) { if( theButton == document.main.elements[i] ) { j = i; break; } } // set/clear all checkboxes var last = j+theButtonOffset+theNum; for( i = last-theNum; i < last; i++ ) { document.main.elements[i].checked = theCheck; } } function launchWindow( theWeb, theTopic ) { win = open( "%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/" + theWeb + "/" + theTopic + "?skin=plain", theTopic, "titlebar=0,width=500,height=480,resizable,scrollbars"); if( win ) { win.focus(); } return false; } //STOP HIDING--> </script> </head> <body bgcolor="#ffffff" onLoad="initForm()"> #PageTop <form name="main" action="%SCRIPTURLPATH%/preview%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%/%TOPIC%"}%" method="post"> %TMPL:DEF{"titleaction"}%(edit)%TMPL:END% %TMPL:DEF{"titlehelp"}% %TMPL:END% %TMPL:DEF{"webaction"}%Change topic%TMPL:END% %TMPL:P{"simpleheader"}% %TEXT% <input type="hidden" name="formtemplate" value="%FORMTEMPLATE%" /> <input type="hidden" name="topicparent" value="%TOPICPARENT%" /> <input type="hidden" name="cmd" value="%CMD%" /> <br /> Don't forget - if you change something, do it in <a target="GoodStyle" onClick="return launchWindow('%TWIKIWEB%','GoodStyle')" href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%TWIKIWEB%/GoodStyle">GoodStyle</a> and follow the <a target="TextFormattingRules" onClick="return launchWindow('%TWIKIWEB%','TextFormattingRules')" href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%TWIKIWEB%/TextFormattingRules">TextFormattingRules</a>. <br /> <b>-- <nop>%WIKIUSERNAME% - %DATE%</b> <code><==</code> This is your signature for easy copy & paste operation <br /> %FORMFIELDS% %TMPL:DEF{"topicaction"}% <input type="submit" value=" Preview Changes " onClick="document.main.text.value=document.TWikiEdit.getText()" /> %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END% %TMPL:P{"standardfooter"}% <table width="100%" border="0" cellpadding="3" cellspacing="0"> <tr> <td width="50%" valign="top"> </td> <td width="50%" valign="top"> %WEBCOPYRIGHT% </td> </tr> </table> </form> #PageBottom </body> </html> |