forked from Codiad/Codiad-Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
42 lines (30 loc) · 863 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Place copyright or other info here...
*/
(function(global, $){
// Define core
var codiad = global.codiad,
scripts= document.getElementsByTagName('script'),
path = scripts[scripts.length-1].src.split('?')[0],
curpath = path.split('/').slice(0, -1).join('/')+'/';
// Instantiates plugin
$(function() {
codiad.MY_PLUGIN.init();
});
codiad.MY_PLUGIN = {
// Allows relative `this.path` linkage
path: curpath,
init: function() {
// Start your plugin here...
},
/**
*
* This is where the core functionality goes, any call, references,
* script-loads, etc...
*
*/
SOME_METHOD: function() {
alert('Hello World');
}
};
})(this, jQuery);