mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
67 lines
1.8 KiB
JavaScript
67 lines
1.8 KiB
JavaScript
var CloudCmd, Util, DOM;
|
|
(function(CloudCmd, Util, DOM){
|
|
'use strict';
|
|
|
|
CloudCmd.Markdown = MarkdownProto;
|
|
|
|
function MarkdownProto(nameParam, optionsParam) {
|
|
var Images = DOM.Images,
|
|
RESTful = DOM.RESTful,
|
|
Markdown = RESTful.Markdown,
|
|
MD = this;
|
|
|
|
function init() {
|
|
Images.showLoad({
|
|
top:true
|
|
});
|
|
|
|
Util.exec.series([
|
|
CloudCmd.View,
|
|
Util.exec.with(MD.show, null, null),
|
|
]);
|
|
}
|
|
|
|
this.show = function(name, options) {
|
|
var o = options,
|
|
relativeQuery = '?relative';
|
|
|
|
if (!name)
|
|
name = nameParam;
|
|
|
|
if (!options)
|
|
o =
|
|
options = optionsParam;
|
|
|
|
if (options) {
|
|
Images.showLoad({
|
|
top: o.topLoad
|
|
});
|
|
|
|
if (o.relative)
|
|
name += relativeQuery;
|
|
}
|
|
|
|
Markdown.read(name, function(result) {
|
|
var div = DOM.load({
|
|
name : 'div',
|
|
className : 'help',
|
|
inner : result
|
|
});
|
|
|
|
Images.hide();
|
|
|
|
CloudCmd.View.show(div);
|
|
|
|
nameParam =
|
|
optionsParam = null;
|
|
});
|
|
};
|
|
|
|
this.hide = function() {
|
|
CloudCmd.View.hide();
|
|
};
|
|
|
|
init();
|
|
}
|
|
|
|
})(CloudCmd, Util, DOM);
|