地质所 沉降监测网建设项目
zmk
2024-05-22 28e168f05d3eb48223e69064188c6fce786442d4
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*!
 * Test plugin for Editor.md
 *
 * @file        test-plugin.js
 * @author      pandao
 * @version     1.2.0
 * @updateTime  2015-03-07
 * {@link       https://github.com/pandao/editor.md}
 * @license     MIT
 */
 
(function() {
 
    var factory = function (exports) {
 
        var $            = jQuery;           // if using module loader(Require.js/Sea.js).
 
        exports.testPlugin = function(){
            alert("testPlugin");
        };
 
        exports.fn.testPluginMethodA = function() {
            /*
            var _this       = this; // this == the current instance object of Editor.md
            var lang        = _this.lang;
            var settings    = _this.settings;
            var editor      = this.editor;
            var cursor      = cm.getCursor();
            var selection   = cm.getSelection();
            var classPrefix = this.classPrefix;
 
            cm.focus();
            */
            //....
 
            alert("testPluginMethodA");
        };
 
    };
    
    // CommonJS/Node.js
    if (typeof require === "function" && typeof exports === "object" && typeof module === "object")
    { 
        module.exports = factory;
    }
    else if (typeof define === "function")  // AMD/CMD/Sea.js
    {
        if (define.amd) { // for Require.js
 
            define(["editormd"], function(editormd) {
                factory(editormd);
            });
 
        } else { // for Sea.js
            define(function(require) {
                var editormd = require("./../../editormd");
                factory(editormd);
            });
        }
    } 
    else
    {
        factory(window.editormd);
    }
 
})();