obj-page.js
Summary
No overview generated for 'obj-page.js'
function Page(p,id,ty,nu,te) {
this.objname = "page";
this.par = p;
this.oid = id;
this.type = ty;
this.num = nu;
this.contenttext = new String(te);
this.media = null;
this.parseLinksInText();
}
Page.prototype.parseLinksInText = function() {
if (this.contenttext.indexOf("asfunction:_global.core.gui.pglossary.getGlossaryTerm") > -1) {
var s = this.contenttext.indexOf("asfunction:_global.core.gui.pglossary.getGlossaryTerm");
var e = this.contenttext.indexOf("\"",s);
var sub = this.contenttext.substring(s,e);
var id = sub.substr(sub.indexOf(",")+1,sub.length);
this.contenttext = this.contenttext.replace(sub,"javascript:top.popup('pglossary','"+id+"');");
if (this.contenttext.indexOf("asfunction:_global.core.gui.pglossary.getGlossaryTerm") > -1) {
this.parseLinksInText();
}
}
}
/**
* Sends the command to get the page text
*/
Page.prototype.getText = function() {
sendCommand("pagetext");
}
/**
* Sets the page text
* @param {string} d page text
*/
Page.prototype.setText = function(d) {
this.contenttext = d;
this.dump();
}
/**
* Sends debug information on all properties to the debug window
*/
Page.prototype.dump = function() {
var d = "Page Dump\n";
d += "\tthis.objname: "+this.objname+"\n";
d += "\tthis.oid: "+this.oid+"\n";
d += "\tthis.par: "+this.par+"\n";
d += "\tthis.num: "+this.num+"\n";
d += "\tthis.type: "+this.type+"\n";
d += "\tthis.contenttext: "+this.contenttext+"\n";
dump(d);
}
Documentation generated by
JSDoc on Tue Mar 4 12:01:48 2008