Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ckeditor-custom.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. "use strict";
  2. /*articl ckeditor*/
  3. CKEDITOR.replace('editor1', {
  4. // Define the toolbar: http://docs.ckeditor.com/#!/guide/dev_toolbar
  5. // The standard preset from CDN which we used as a base provides more features than we need.
  6. // Also by default it comes with a 2-line toolbar. Here we put all buttons in a single row.
  7. toolbar: [{
  8. name: 'clipboard',
  9. items: ['Undo', 'Redo']
  10. }, {
  11. name: 'styles',
  12. items: ['Styles', 'Format']
  13. }, {
  14. name: 'basicstyles',
  15. items: ['Bold', 'Italic', 'Strike', '-', 'RemoveFormat']
  16. }, {
  17. name: 'paragraph',
  18. items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote']
  19. }, {
  20. name: 'links',
  21. items: ['Link', 'Unlink']
  22. }, {
  23. name: 'insert',
  24. items: ['Image', 'EmbedSemantic', 'Table']
  25. }, {
  26. name: 'tools',
  27. items: ['Maximize']
  28. }, {
  29. name: 'editing',
  30. items: ['Scayt']
  31. }],
  32. // Since we define all configuration options here, let's instruct CKEditor to not load config.js which it does by default.
  33. // One HTTP request less will result in a faster startup time.
  34. // For more information check http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-customConfig
  35. customConfig: '',
  36. // Enabling extra plugins, available in the standard-all preset: http://ckeditor.com/presets-all
  37. extraPlugins: 'autoembed,embedsemantic,image2,uploadimage,uploadfile',
  38. imageUploadUrl: '/uploader/upload.php?type=Images',
  39. uploadUrl: '/uploader/upload.php',
  40. /*********************** File management support ***********************/
  41. // In order to turn on support for file uploads, CKEditor has to be configured to use some server side
  42. // solution with file upload/management capabilities, like for example CKFinder.
  43. // For more information see http://docs.ckeditor.com/#!/guide/dev_ckfinder_integration
  44. // Uncomment and correct these lines after you setup your local CKFinder instance.
  45. // filebrowserBrowseUrl: 'http://example.com/ckfinder/ckfinder.html',
  46. // filebrowserUploadUrl: 'http://example.com/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
  47. /*********************** File management support ***********************/
  48. // Remove the default image plugin because image2, which offers captions for images, was enabled above.
  49. removePlugins: 'image',
  50. // Make the editing area bigger than default.
  51. height: 461,
  52. // An array of stylesheets to style the WYSIWYG area.
  53. // Note: it is recommended to keep your own styles in a separate file in order to make future updates painless.
  54. contentsCss: ['assets/pages/ckeditor/contents.css', 'assets/pages/ckeditor/artical.css'],
  55. // This is optional, but will let us define multiple different styles for multiple editors using the same CSS file.
  56. bodyClass: 'article-editor',
  57. // Reduce the list of block elements listed in the Format dropdown to the most commonly used.
  58. format_tags: 'p;h1;h2;h3;pre',
  59. // Simplify the Image and Link dialog windows. The "Advanced" tab is not needed in most cases.
  60. removeDialogTabs: 'image:advanced;link:advanced',
  61. // Define the list of styles which should be available in the Styles dropdown list.
  62. // If the "class" attribute is used to style an element, make sure to define the style for the class in "mystyles.css"
  63. // (and on your website so that it rendered in the same way).
  64. // Note: by default CKEditor looks for styles.js file. Defining stylesSet inline (as below) stops CKEditor from loading
  65. // that file, which means one HTTP request less (and a faster startup).
  66. // For more information see http://docs.ckeditor.com/#!/guide/dev_styles
  67. stylesSet: [
  68. /* Inline Styles */
  69. {
  70. name: 'Marker',
  71. element: 'span',
  72. attributes: {
  73. 'class': 'marker'
  74. }
  75. }, {
  76. name: 'Cited Work',
  77. element: 'cite'
  78. }, {
  79. name: 'Inline Quotation',
  80. element: 'q'
  81. },
  82. /* Object Styles */
  83. {
  84. name: 'Special Container',
  85. element: 'div',
  86. styles: {
  87. padding: '5px 10px',
  88. background: '#eee',
  89. border: '1px solid #ccc'
  90. }
  91. }, {
  92. name: 'Compact table',
  93. element: 'table',
  94. attributes: {
  95. cellpadding: '5',
  96. cellspacing: '0',
  97. border: '1',
  98. bordercolor: '#ccc'
  99. },
  100. styles: {
  101. 'border-collapse': 'collapse'
  102. }
  103. }, {
  104. name: 'Borderless Table',
  105. element: 'table',
  106. styles: {
  107. 'border-style': 'hidden',
  108. 'background-color': '#E6E6FA'
  109. }
  110. }, {
  111. name: 'Square Bulleted List',
  112. element: 'ul',
  113. styles: {
  114. 'list-style-type': 'square'
  115. }
  116. },
  117. /* Widget Styles */
  118. // We use this one to style the brownie picture.
  119. {
  120. name: 'Illustration',
  121. type: 'widget',
  122. widget: 'image',
  123. attributes: {
  124. 'class': 'image-illustration'
  125. }
  126. },
  127. // Media embed
  128. {
  129. name: '240p',
  130. type: 'widget',
  131. widget: 'embedSemantic',
  132. attributes: {
  133. 'class': 'embed-240p'
  134. }
  135. }, {
  136. name: '360p',
  137. type: 'widget',
  138. widget: 'embedSemantic',
  139. attributes: {
  140. 'class': 'embed-360p'
  141. }
  142. }, {
  143. name: '480p',
  144. type: 'widget',
  145. widget: 'embedSemantic',
  146. attributes: {
  147. 'class': 'embed-480p'
  148. }
  149. }, {
  150. name: '720p',
  151. type: 'widget',
  152. widget: 'embedSemantic',
  153. attributes: {
  154. 'class': 'embed-720p'
  155. }
  156. }, {
  157. name: '1080p',
  158. type: 'widget',
  159. widget: 'embedSemantic',
  160. attributes: {
  161. 'class': 'embed-1080p'
  162. }
  163. }
  164. ]
  165. });
  166. /*document ckeditor*/
  167. CKEDITOR.replace('editor2', {
  168. // Define the toolbar: http://docs.ckeditor.com/#!/guide/dev_toolbar
  169. // The full preset from CDN which we used as a base provides more features than we need.
  170. // Also by default it comes with a 3-line toolbar. Here we put all buttons in a single row.
  171. toolbar: [{
  172. name: 'document',
  173. items: ['Print']
  174. }, {
  175. name: 'clipboard',
  176. items: ['Undo', 'Redo']
  177. }, {
  178. name: 'styles',
  179. items: ['Format', 'Font', 'FontSize']
  180. }, {
  181. name: 'basicstyles',
  182. items: ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'CopyFormatting']
  183. }, {
  184. name: 'colors',
  185. items: ['TextColor', 'BGColor']
  186. }, {
  187. name: 'align',
  188. items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']
  189. }, {
  190. name: 'links',
  191. items: ['Link', 'Unlink']
  192. }, {
  193. name: 'paragraph',
  194. items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote']
  195. }, {
  196. name: 'insert',
  197. items: ['Image', 'Table']
  198. }, {
  199. name: 'tools',
  200. items: ['Maximize']
  201. }, {
  202. name: 'editing',
  203. items: ['Scayt']
  204. }],
  205. // Since we define all configuration options here, let's instruct CKEditor to not load config.js which it does by default.
  206. // One HTTP request less will result in a faster startup time.
  207. // For more information check http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-customConfig
  208. customConfig: '',
  209. // Sometimes applications that convert HTML to PDF prefer setting image width through attributes instead of CSS styles.
  210. // For more information check:
  211. // - About Advanced Content Filter: http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
  212. // - About Disallowed Content: http://docs.ckeditor.com/#!/guide/dev_disallowed_content
  213. // - About Allowed Content: http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
  214. disallowedContent: 'img{width,height,float}',
  215. extraAllowedContent: 'img[width,height,align]',
  216. // Enabling extra plugins, available in the full-all preset: http://ckeditor.com/presets-all
  217. extraPlugins: 'tableresize,uploadimage,uploadfile',
  218. imageUploadUrl: '/uploader/upload.php?type=Images',
  219. uploadUrl: '/uploader/upload.php',
  220. /*********************** File management support ***********************/
  221. // In order to turn on support for file uploads, CKEditor has to be configured to use some server side
  222. // solution with file upload/management capabilities, like for example CKFinder.
  223. // For more information see http://docs.ckeditor.com/#!/guide/dev_ckfinder_integration
  224. // Uncomment and correct these lines after you setup your local CKFinder instance.
  225. // filebrowserBrowseUrl: 'http://example.com/ckfinder/ckfinder.html',
  226. // filebrowserUploadUrl: 'http://example.com/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
  227. /*********************** File management support ***********************/
  228. // Make the editing area bigger than default.
  229. height: 800,
  230. // An array of stylesheets to style the WYSIWYG area.
  231. // Note: it is recommended to keep your own styles in a separate file in order to make future updates painless.
  232. contentsCss: ['assets/pages/ckeditor/contents.css', 'assets/pages/ckeditor/document.css'],
  233. // This is optional, but will let us define multiple different styles for multiple editors using the same CSS file.
  234. bodyClass: 'document-editor',
  235. // Reduce the list of block elements listed in the Format dropdown to the most commonly used.
  236. format_tags: 'p;h1;h2;h3;pre',
  237. // Simplify the Image and Link dialog windows. The "Advanced" tab is not needed in most cases.
  238. removeDialogTabs: 'image:advanced;link:advanced',
  239. // Define the list of styles which should be available in the Styles dropdown list.
  240. // If the "class" attribute is used to style an element, make sure to define the style for the class in "mystyles.css"
  241. // (and on your website so that it rendered in the same way).
  242. // Note: by default CKEditor looks for styles.js file. Defining stylesSet inline (as below) stops CKEditor from loading
  243. // that file, which means one HTTP request less (and a faster startup).
  244. // For more information see http://docs.ckeditor.com/#!/guide/dev_styles
  245. stylesSet: [
  246. /* Inline Styles */
  247. {
  248. name: 'Marker',
  249. element: 'span',
  250. attributes: {
  251. 'class': 'marker'
  252. }
  253. }, {
  254. name: 'Cited Work',
  255. element: 'cite'
  256. }, {
  257. name: 'Inline Quotation',
  258. element: 'q'
  259. },
  260. /* Object Styles */
  261. {
  262. name: 'Special Container',
  263. element: 'div',
  264. styles: {
  265. padding: '5px 10px',
  266. background: '#eee',
  267. border: '1px solid #ccc'
  268. }
  269. }, {
  270. name: 'Compact table',
  271. element: 'table',
  272. attributes: {
  273. cellpadding: '5',
  274. cellspacing: '0',
  275. border: '1',
  276. bordercolor: '#ccc'
  277. },
  278. styles: {
  279. 'border-collapse': 'collapse'
  280. }
  281. }, {
  282. name: 'Borderless Table',
  283. element: 'table',
  284. styles: {
  285. 'border-style': 'hidden',
  286. 'background-color': '#E6E6FA'
  287. }
  288. }, {
  289. name: 'Square Bulleted List',
  290. element: 'ul',
  291. styles: {
  292. 'list-style-type': 'square'
  293. }
  294. }
  295. ]
  296. });
  297. /*inline ckeditor*/
  298. CKEDITOR.on('instanceCreated', function(event) {
  299. var editor = event.editor,
  300. element = editor.element;
  301. // Customize editors for headers and tag list.
  302. // These editors do not need features like smileys, templates, iframes etc.
  303. if (element.is('h1', 'h2', 'h3') || element.getAttribute('id') == 'taglist') {
  304. // Customize the editor configuration on "configLoaded" event,
  305. // which is fired after the configuration file loading and
  306. // execution. This makes it possible to change the
  307. // configuration before the editor initialization takes place.
  308. editor.on('configLoaded', function() {
  309. // Remove redundant plugins to make the editor simpler.
  310. editor.config.removePlugins = 'colorbutton,find,flash,font,' +
  311. 'forms,iframe,image,newpage,removeformat,' +
  312. 'smiley,specialchar,stylescombo,templates';
  313. // Rearrange the toolbar layout.
  314. editor.config.toolbarGroups = [{
  315. name: 'editing',
  316. groups: ['basicstyles', 'links']
  317. }, {
  318. name: 'undo'
  319. }, {
  320. name: 'clipboard',
  321. groups: ['selection', 'clipboard']
  322. }, {
  323. name: 'about'
  324. }];
  325. });
  326. }
  327. });