More loads, but really small plugin text for into lexonomy
This commit is contained in:
parent
476d139005
commit
46d6448e3b
|
@ -1,12 +1,7 @@
|
||||||
{
|
function plugin_load(config, div, entry) {
|
||||||
plugin: '//plugins.lexonomy.cjvt.si/vsms',
|
$("#load-pre-status").text("Loading...");
|
||||||
editor: function(div, entry, uneditable) {
|
|
||||||
var self = this;
|
|
||||||
var div = $(div);
|
|
||||||
div.append('<p>Loading... <span id="load-status"></span></p>');
|
|
||||||
|
|
||||||
var status_span = $('#load-status');
|
var status_span = $('#load-status');
|
||||||
$.getJSON(self.plugin + "/config.json", function(config) {
|
|
||||||
var len1 = config.javascript && config.javascript.length || 0;
|
var len1 = config.javascript && config.javascript.length || 0;
|
||||||
var len2 = config.globals && config.javascript.length || 0;
|
var len2 = config.globals && config.javascript.length || 0;
|
||||||
var num_progress = len1 + len2;
|
var num_progress = len1 + len2;
|
||||||
|
@ -50,9 +45,4 @@ editor: function(div, entry, uneditable) {
|
||||||
link.media = 'all';
|
link.media = 'all';
|
||||||
$('head').append(link);
|
$('head').append(link);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
|
||||||
harvester: function(div) {
|
|
||||||
if(typeof plugin_save !== 'undefined') return plugin_save(div);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
21
plugin.js
Normal file
21
plugin.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
plugin: 'vsms',
|
||||||
|
url: '//plugins.lexonomy.cjvt.si',
|
||||||
|
editor: function(div, entry, uneditable) {
|
||||||
|
$(div).append('<p><span id="load-pre-status">INIT</span><span id="load-status"></span></p>');
|
||||||
|
var progress_ctr = 2, config = null;
|
||||||
|
|
||||||
|
$.getJSON(this.url + "/" + this.plugin + "/config.json", function(local_config) {
|
||||||
|
config = local_config;
|
||||||
|
if(--progress_ctr == 0) plugin_load(config, div, entry);
|
||||||
|
});
|
||||||
|
|
||||||
|
var script_url = this.url + "/plugin-loader.js";
|
||||||
|
$.ajax({ dataType: "script", cache: true, url: script_url, success: function () {
|
||||||
|
if(--progress_ctr == 0) plugin_load(config, div, entry);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
harvester: function(div) {
|
||||||
|
if(typeof plugin_save !== 'undefined') return plugin_save(div);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user