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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| seajs.use(['./a', './b'], function(a, b) { a.init(); b.init(); });
------------------------------------------------------------------
<script type="text/javascript"> seajs.config({ base : "./", alias : { jquery : "js/jquery.min", editormd : "../editormd" } }); var deps = [ "jquery", "editormd", "../languages/en", "../plugins/link-dialog/link-dialog", "../plugins/reference-link-dialog/reference-link-dialog", "../plugins/image-dialog/image-dialog", "../plugins/code-block-dialog/code-block-dialog", "../plugins/table-dialog/table-dialog", "../plugins/emoji-dialog/emoji-dialog", "../plugins/goto-line-dialog/goto-line-dialog", "../plugins/help-dialog/help-dialog", "../plugins/html-entities-dialog/html-entities-dialog", "../plugins/preformatted-text-dialog/preformatted-text-dialog" ]; seajs.use(deps, function($, editormd) { var testEditor; $.get("./test.md", function(md){ testEditor = editormd("test-editormd", { width: "90%", height: 640, path : '../lib/', markdown : md, codeFold : true, searchReplace : true, saveHTMLToTextarea : true, htmlDecode : "style,script,iframe|on*", emoji : true, taskList : true, tocm : true, tex : true, flowChart : true, sequenceDiagram : true, imageUpload : true, imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"], imageUploadURL : "./php/upload.php", onload : function() { console.log('onload', this);
} }); }); }); </script>
|