Wikiwyg.ClientServer = function() {};
Wikiwyg.ClientServer.prototype = new Wikiwyg();
Wikiwyg.ClientServer.prototype.saveChanges = function() {
var self = this;
this.current_mode.toHtml( function(html) { self.fromHtml(html) });
this.displayMode();
}
Wikiwyg.ClientServer.prototype.modeList = [
'Wikiwyg.Wysiwyg',
'Wikiwyg.Wikitext.ClientServer',
'Wikiwyg.Preview.ClientServer'
];
Wikiwyg.Wikitext.ClientServer = function() {};
Wikiwyg.Wikitext.ClientServer.prototype = new Wikiwyg.Wikitext();
Wikiwyg.Wikitext.ClientServer.prototype.className =
'Wikiwyg.Wikitext.ClientServer';
Wikiwyg.Wikitext.ClientServer.prototype.convertWikitextToHtml =
function(wikitext, func) {
var postdata = 'action=wikiwyg_wikitext_to_html;html=' +
Wikiwyg.escape_plus(wikitext);
Wikiwyg.live_update(
'http://demo.wikiwyg.net/server/index.cgi',
postdata,
func
);
}
Wikiwyg.Wikitext.ClientServer.prototype.convertHtmlToWikitext =
function(html, func) {
var postdata = 'action=wikiwyg_html_to_wikitext;html=' +
Wikiwyg.escape_plus(html);
Wikiwyg.live_update(
'http://demo.wikiwyg.net/server/index.cgi',
postdata,
func
);
}
Wikiwyg.Preview.ClientServer = function() {};
Wikiwyg.Preview.ClientServer.prototype = new Wikiwyg.Preview();
Wikiwyg.Preview.ClientServer.prototype.className =
'Wikiwyg.Preview.ClientServer';
Wikiwyg.Preview.ClientServer.prototype.fromHtml = function(html) {
var postdata = 'action=wikiwyg_html_to_html;html=' +
Wikiwyg.escape_plus(html);
var self = this;
Wikiwyg.live_update(
'http://demo.wikiwyg.net/server/index.cgi',
postdata,
function(value) {
self.div.innerHTML = value;
}
);
}