|
// ToDoList Protocol (TDL) Script Editoin, Version 1.0 Beta2
function TdlMain() {
this.tdlShell = new TdlShell();
}
TdlMain.prototype.init = function() {
TdlMain.prototype.ERROR_NO_PARAMETER = 1;
}
TdlMain.prototype.main = function(args) {
if (args.Length == 0) {
this.usage();
WScript.Quit(this.ERROR_NO_PARAMETER);
return;
}
try {
var exe = this.tdlShell.getExecutable();
if (exe == null) {
this.noConfiguration();
return;
}
var tdl = new TdlParser(args(0));
this.tdlShell.openTodolist(tdl.getFilename(), tdl.getTid());
} catch (err) {
if (err instanceof Error) {
if (err == TdlParser.prototype.ParseError) {
WScript.Echo("Parse error! please use follow format url...\n\n"
+ "tdl:///long%20filename.tdl?int_tid");
} else {
WScript.Echo(err.message);
}
} else {
WScript.Echo(err);
}
}
}
TdlMain.prototype.usage = function() {
var r = this.tdlShell.confirm("Would you want to open tdl.html?");
if (r) {
this.tdlShell.configure();
}
}
TdlMain.prototype.noConfiguration = function() {
var r = this.tdlShell.confirm("You haven't configured TDL: protocol.\n"
+ "Please open 'tdl.html' to CONFIGURE, then try again.\n\n"
+ "Would you want to open 'tdl.html' immediately?");
if (r) {
this.tdlShell.configure();
}
}
TdlMain.prototype.init();
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
James Fancy, is a software engineer from China. He enjoys and familiar with Java, C++ and some script languages.
If you can read Chinese word, here is one of James Fancy's BLOG:
http://hi.baidu.com/jamesfancy