plugin-template.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*!
  2. * Link dialog plugin for Editor.md
  3. *
  4. * @file link-dialog.js
  5. * @author pandao
  6. * @version 1.2.0
  7. * @updateTime 2015-03-07
  8. * {@link https://github.com/pandao/editor.md}
  9. * @license MIT
  10. */
  11. (function() {
  12. var factory = function (exports) {
  13. var $ = jQuery; // if using module loader(Require.js/Sea.js).
  14. var langs = {
  15. "zh-cn" : {
  16. toolbar : {
  17. table : "表格"
  18. },
  19. dialog : {
  20. table : {
  21. title : "添加表格",
  22. cellsLabel : "单元格数",
  23. alignLabel : "对齐方式",
  24. rows : "行数",
  25. cols : "列数",
  26. aligns : ["默认", "左对齐", "居中对齐", "右对齐"]
  27. }
  28. }
  29. },
  30. "zh-tw" : {
  31. toolbar : {
  32. table : "添加表格"
  33. },
  34. dialog : {
  35. table : {
  36. title : "添加表格",
  37. cellsLabel : "單元格數",
  38. alignLabel : "對齊方式",
  39. rows : "行數",
  40. cols : "列數",
  41. aligns : ["默認", "左對齊", "居中對齊", "右對齊"]
  42. }
  43. }
  44. },
  45. "en" : {
  46. toolbar : {
  47. table : "Tables"
  48. },
  49. dialog : {
  50. table : {
  51. title : "Tables",
  52. cellsLabel : "Cells",
  53. alignLabel : "Align",
  54. rows : "Rows",
  55. cols : "Cols",
  56. aligns : ["Default", "Left align", "Center align", "Right align"]
  57. }
  58. }
  59. }
  60. };
  61. exports.fn.htmlEntities = function() {
  62. /*
  63. var _this = this; // this == the current instance object of Editor.md
  64. var lang = _this.lang;
  65. var settings = _this.settings;
  66. var editor = this.editor;
  67. var cursor = cm.getCursor();
  68. var selection = cm.getSelection();
  69. var classPrefix = this.classPrefix;
  70. $.extend(true, this.lang, langs[this.lang.name]); // l18n
  71. this.setToolbar();
  72. cm.focus();
  73. */
  74. //....
  75. };
  76. };
  77. // CommonJS/Node.js
  78. if (typeof require === "function" && typeof exports === "object" && typeof module === "object")
  79. {
  80. module.exports = factory;
  81. }
  82. else if (typeof define === "function") // AMD/CMD/Sea.js
  83. {
  84. if (define.amd) { // for Require.js
  85. define(["editormd"], function(editormd) {
  86. factory(editormd);
  87. });
  88. } else { // for Sea.js
  89. define(function(require) {
  90. var editormd = require("./../../editormd");
  91. factory(editormd);
  92. });
  93. }
  94. }
  95. else
  96. {
  97. factory(window.editormd);
  98. }
  99. })();