📄 addscrip.ssc
字号:
<!--SCRIPT PSOBJMOD
import( site.GetRootDocument().location + "/ObjMod80.ssc" );
session.active = true;
InitObjects(session);
-->
<!--SCRIPT // {{ SCRIPT()
var webRoot = site.GetRootDocument();
import ( webRoot.location + '/system/utils/strtable.ssc' );
import ( webRoot.location + '/system/utils/wizard.ssc' );
var wiz;
wiz.namepage = new wizardPage( 'Text',
IntlStr.wizNewScript.p1.title,
IntlStr.wizNewScript.p1.explanation,
IntlStr.wizNewScript.p1.question
);
wiz.descpage = new wizardPage( 'TextArea',
IntlStr.wizNewScript.p2.title,
IntlStr.wizNewScript.p2.explanation,
IntlStr.wizNewScript.p2.question
);
// Display the wizard
if( site.CreateWizard( wiz ) ) {
var scriptname = wiz.namepage.value;
/* Check if the name already contains an extension */
/* If not, add the extension .ssc */
if( scriptname.indexOf( '.' ) == -1 ) {
scriptname += '.ssc';
}
var fullname = document.location + '/' + scriptname;
var scriptdesc = wiz.descpage.value;
var today = new Date();
// Note that we don't allow script markers inside strings or comments
var text = '<!' + '--SCRIPT ' + formatString( IntlStr.createdOn, scriptname, today.toLocaleString() );
text += '\r\n/* ' + scriptdesc + ' */\r\n\r\n-' + '->';
// Create the new script
var newdoc = site.CreateDocument( fullname, 'script', scriptdesc, text );
if( newdoc == null ) {
document.writeln( formatString(IntlStr.unableToCreate, fullname ) );
}
}
// }}
-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -