123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="utf-8" />
- <title>Expanded Editor.md - Editor.md examples</title>
- <link rel="stylesheet" href="css/style.css" />
- <link rel="stylesheet" href="../css/editormd.css" />
- <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
- </head>
- <body>
- <div id="layout">
- <header>
- <h1>Expanded Editor.md</h1>
- <p>Expanded of member methods and properties</p>
- </header>
- <div id="test-editormd">
- <textarea style="display:none;">### Expanded Editor.md
- ```javascript
- var testEditor;
- function EditormdExtend() {
- this.extend("methodC", function() {
- console.log("methodC");
- });
- // or
- testEditor.extend("methodA", function() {
- console.log("methodA");
- });
- // one by one setting
- this.set("propertyA", "propertyA");
- this.set("methodE", function() {
- console.log("mothodE", this);
- });
- // mutil
- this.extend({
- propertyA : "propertyAAAA", // override, you can override other default method.
- propertyB : "propertyB",
- methodD : function() {
- console.log("methodD");
- }
- });
- this.methodB = function() {
- console.log("methodB");
- };
- testEditor.methodA();
- testEditor.methodB();
- this.methodC();
- this.methodE();
- editormd.methodOne();
- console.log(this, this.propertyA);
- }
- editormd.fn.customMethod = function(){
- console.log("customMethod", this);
- };
- $(function() {
- editormd.methodOne = function(){
- console.log("editormd.methodOne");
- };
- testEditor = editormd("test-editormd", {
- width : "90%",
- height : 720,
- path : '../lib/',
- onload : function() {
- this.customMethod();
- $.proxy(EditormdExtend, this)();
- }
- });
- editormd.methodOne();
- });
- ```
- </textarea>
- </div>
- </div>
- <script src="js/jquery.min.js"></script>
- <script src="../editormd.js"></script>
- <script type="text/javascript">
- var testEditor;
-
- function EditormdExtend() {
- this.extend("methodC", function() {
- console.log("methodC");
- });
- // or
- testEditor.extend("methodA", function() {
- console.log("methodA");
- });
- // one by one setting
- this.set("propertyA", "propertyA");
- this.set("methodE", function() {
- console.log("mothodE", this);
- });
- // mutil
- this.extend({
- propertyA : "propertyAAAA", // override, you can override other default method.
- propertyB : "propertyB",
- methodD : function() {
- console.log("methodD");
- }
- });
- this.methodB = function() {
- console.log("methodB");
- };
- testEditor.methodA();
- testEditor.methodB();
- this.methodC();
- this.methodE();
- editormd.methodOne();
- console.log(this, this.propertyA);
- }
-
- editormd.fn.customMethod = function() {
- console.log("customMethod", this);
- };
-
- $(function() {
- editormd.methodOne = function() {
- console.log("editormd.methodOne");
- };
-
- testEditor = editormd("test-editormd", {
- width : "90%",
- height : 720,
- path : '../lib/',
- onload : function() {
- this.customMethod();
- $.proxy(EditormdExtend, this)();
- }
- });
-
- editormd.methodOne();
- });
- </script>
- </body>
- </html>
|