|
1 |
| -(function(global) { |
| 1 | +(function (global) { |
2 | 2 | 'use strict';
|
3 | 3 |
|
4 |
| - $(function() { |
5 |
| - $('body').prepend( $('<toolbar></toolbar>') ); |
6 |
| - $('body').append( $('<media-library></media-library>') ); |
7 |
| - $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100') ); |
8 |
| - $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://fonts.googleapis.com/icon?family=Material+Icons') ); |
9 |
| - $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', config.CONTENT_SNIPPETS_EDIT_CSS_URL) ); |
10 |
| - $.getScript('https://cdn.ckeditor.com/4.5.10/standard/ckeditor.js', function() { |
11 |
| - global.CKEDITOR.config.autoParagraph = false; |
12 |
| - global.CKEDITOR.config.allowedContent = true; |
13 |
| - global.CKEDITOR.plugins.addExternal( 'media-selector', global.config.CKEDITOR_PLUGINS_URL + 'media-selector/', 'plugin.js' ); |
14 |
| - global.CKEDITOR.plugins.addExternal( 'sourcedialog', global.config.CKEDITOR_PLUGINS_URL + 'sourcedialog/', 'plugin.js' ); |
15 |
| - global.CKEDITOR.plugins.addExternal( 'codemirror', global.config.CKEDITOR_PLUGINS_URL + 'codemirror/', 'plugin.js' ); |
16 |
| - global.CKEDITOR.config.extraPlugins = 'media-selector,sourcedialog'; |
17 |
| - global.CKEDITOR.config.removePlugins = 'image,sourcearea'; |
18 |
| - |
19 |
| - var stores = { |
20 |
| - WebpageStore: new WebpageStore(), |
21 |
| - MediasStore: new MediasStore() |
22 |
| - }; |
23 |
| - |
24 |
| - _.each(stores, function(store) { |
25 |
| - RiotControl.addStore(store); |
26 |
| - }); |
| 4 | + $(function () { |
| 5 | + var body = $('body'), |
| 6 | + head = $('head'); |
| 7 | + |
| 8 | + body.prepend($('<toolbar></toolbar>')); |
| 9 | + body.append($('<media-library></media-library>')); |
| 10 | + |
| 11 | + head.append($('<link rel="stylesheet" type="text/css" />').attr('href', 'https://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100')); |
| 12 | + head.append($('<link rel="stylesheet" type="text/css" />').attr('href', 'https://fonts.googleapis.com/icon?family=Material+Icons')); |
| 13 | + head.append($('<link rel="stylesheet" type="text/css" />').attr('href', config.CONTENT_SNIPPETS_EDIT_CSS_URL)); |
| 14 | + |
| 15 | + $.getScript('https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/js/materialize.min.js', function () { |
| 16 | + $.getScript('https://cdn.ckeditor.com/4.6.2/standard/ckeditor.js', function () { |
| 17 | + global.CKEDITOR.plugins.addExternal('media-selector', global.config.CKEDITOR_PLUGINS_URL + 'media-selector/', 'plugin.js'); |
| 18 | + global.CKEDITOR.plugins.addExternal('sourcedialog', global.config.CKEDITOR_PLUGINS_URL + 'sourcedialog/', 'plugin.js'); |
| 19 | + global.CKEDITOR.plugins.addExternal('codemirror', global.config.CKEDITOR_PLUGINS_URL + 'codemirror/', 'plugin.js'); |
27 | 20 |
|
28 |
| - global.stores = stores; |
| 21 | + global.CKEDITOR.config.allowedContent = true; |
| 22 | + global.CKEDITOR.config.extraPlugins = 'media-selector,sourcedialog'; |
| 23 | + global.CKEDITOR.config.removePlugins = 'image,sourcearea'; |
29 | 24 |
|
30 |
| - riot.mount('snippet'); |
31 |
| - riot.mount('media-library'); |
32 |
| - riot.mount('toolbar'); |
| 25 | + var stores = { |
| 26 | + WebpageStore: new WebpageStore(), |
| 27 | + MediasStore: new MediasStore() |
| 28 | + }; |
| 29 | + |
| 30 | + _.each(stores, function (store) { |
| 31 | + RiotControl.addStore(store); |
| 32 | + }); |
| 33 | + |
| 34 | + global.stores = stores; |
| 35 | + |
| 36 | + riot.mount('snippet'); |
| 37 | + riot.mount('media-library'); |
| 38 | + riot.mount('toolbar'); |
| 39 | + }); |
33 | 40 | });
|
34 | 41 | });
|
35 | 42 | }(this));
|
0 commit comments