tinymce-rails 4.4.1 → 4.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/source/tinymce/tinymce.js +406 -197
  3. data/lib/tinymce/rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  5. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  12. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/tinymce.js +14 -13
  15. metadata +2 -55
  16. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/atomic.js +0 -5
  17. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js +0 -1491
  18. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/bootstrap-browser.js +0 -1491
  19. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/bootstrap-demo.js +0 -1491
  20. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/bootstrap-prod.js +0 -1491
  21. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/browser.js +0 -10
  22. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/demo.js +0 -8
  23. data/vendor/assets/javascripts/tinymce/themes/inlite/config/bolt/prod.js +0 -5
  24. data/vendor/assets/javascripts/tinymce/themes/inlite/config/dent/depend.js +0 -21
  25. data/vendor/assets/javascripts/tinymce/themes/inlite/scratch/compile/bootstrap.js +0 -1526
  26. data/vendor/assets/javascripts/tinymce/themes/inlite/scratch/compile/theme.js +0 -1594
  27. data/vendor/assets/javascripts/tinymce/themes/inlite/scratch/inline/theme.js +0 -1679
  28. data/vendor/assets/javascripts/tinymce/themes/inlite/scratch/inline/theme.raw.js +0 -1679
  29. data/vendor/assets/javascripts/tinymce/themes/inlite/src/demo/css/demo.css +0 -25
  30. data/vendor/assets/javascripts/tinymce/themes/inlite/src/demo/html/demo.html +0 -69
  31. data/vendor/assets/javascripts/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js +0 -28
  32. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js +0 -150
  33. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js +0 -22
  34. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js +0 -130
  35. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js +0 -84
  36. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js +0 -34
  37. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js +0 -106
  38. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js +0 -37
  39. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js +0 -47
  40. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js +0 -95
  41. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js +0 -39
  42. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js +0 -61
  43. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js +0 -32
  44. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js +0 -55
  45. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js +0 -45
  46. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js +0 -27
  47. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js +0 -31
  48. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js +0 -40
  49. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js +0 -80
  50. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js +0 -102
  51. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js +0 -218
  52. data/vendor/assets/javascripts/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js +0 -126
  53. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js +0 -9
  54. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js +0 -10
  55. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js +0 -12
  56. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js +0 -51
  57. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js +0 -33
  58. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js +0 -202
  59. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js +0 -65
  60. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js +0 -38
  61. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js +0 -177
  62. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js +0 -69
  63. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js +0 -118
  64. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js +0 -62
  65. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js +0 -26
  66. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js +0 -76
  67. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js +0 -41
  68. data/vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js +0 -55
@@ -1,34 +0,0 @@
1
- /**
2
- * Uuid.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- /**
12
- * Generates unique ids this is the same as in core but since
13
- * it's not exposed as a global we can't access it.
14
- */
15
- define("tinymce/inlite/alien/Uuid", [
16
- ], function() {
17
- var count = 0;
18
-
19
- var seed = function () {
20
- var rnd = function () {
21
- return Math.round(Math.random() * 0xFFFFFFFF).toString(36);
22
- };
23
-
24
- return 's' + Date.now().toString(36) + rnd() + rnd() + rnd();
25
- };
26
-
27
- var uuid = function (prefix) {
28
- return prefix + (count++) + seed();
29
- };
30
-
31
- return {
32
- uuid: uuid
33
- };
34
- });
@@ -1,106 +0,0 @@
1
- /**
2
- * Actions.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/Actions', [
12
- 'tinymce/inlite/alien/Uuid',
13
- 'tinymce/inlite/alien/Unlink'
14
- ], function (Uuid, Unlink) {
15
- var createTableHtml = function (cols, rows) {
16
- var x, y, html;
17
-
18
- html = '<table data-mce-id="mce" style="width: 100%">';
19
- html += '<tbody>';
20
-
21
- for (y = 0; y < rows; y++) {
22
- html += '<tr>';
23
-
24
- for (x = 0; x < cols; x++) {
25
- html += '<td><br></td>';
26
- }
27
-
28
- html += '</tr>';
29
- }
30
-
31
- html += '</tbody>';
32
- html += '</table>';
33
-
34
- return html;
35
- };
36
-
37
- var getInsertedElement = function (editor) {
38
- var elms = editor.dom.select('*[data-mce-id]');
39
- return elms[0];
40
- };
41
-
42
- var insertTable = function (editor, cols, rows) {
43
- editor.undoManager.transact(function () {
44
- var tableElm, cellElm;
45
-
46
- editor.insertContent(createTableHtml(cols, rows));
47
-
48
- tableElm = getInsertedElement(editor);
49
- tableElm.removeAttribute('data-mce-id');
50
- cellElm = editor.dom.select('td,th', tableElm);
51
- editor.selection.setCursorLocation(cellElm[0], 0);
52
- });
53
- };
54
-
55
- var formatBlock = function (editor, formatName) {
56
- editor.execCommand('FormatBlock', false, formatName);
57
- };
58
-
59
- var insertBlob = function (editor, base64, blob) {
60
- var blobCache, blobInfo;
61
-
62
- blobCache = editor.editorUpload.blobCache;
63
- blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64);
64
- blobCache.add(blobInfo);
65
-
66
- editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()}));
67
- };
68
-
69
- var collapseSelectionToEnd = function (editor) {
70
- editor.selection.collapse(false);
71
- };
72
-
73
- var unlink = function (editor) {
74
- editor.focus();
75
- Unlink.unlinkSelection(editor);
76
- collapseSelectionToEnd(editor);
77
- };
78
-
79
- var changeHref = function (editor, elm, url) {
80
- editor.focus();
81
- editor.dom.setAttrib(elm, 'href', url);
82
- collapseSelectionToEnd(editor);
83
- };
84
-
85
- var insertLink = function (editor, url) {
86
- editor.execCommand('mceInsertLink', false, {href: url});
87
- collapseSelectionToEnd(editor);
88
- };
89
-
90
- var updateOrInsertLink = function (editor, url) {
91
- var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
92
- elm ? changeHref(editor, elm, url) : insertLink(editor, url);
93
- };
94
-
95
- var createLink = function (editor, url) {
96
- url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url);
97
- };
98
-
99
- return {
100
- insertTable: insertTable,
101
- formatBlock: formatBlock,
102
- insertBlob: insertBlob,
103
- createLink: createLink,
104
- unlink: unlink
105
- };
106
- });
@@ -1,37 +0,0 @@
1
- /**
2
- * Convert.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/Convert', [
12
- ], function () {
13
- var fromClientRect = function (clientRect) {
14
- return {
15
- x: clientRect.left,
16
- y: clientRect.top,
17
- w: clientRect.width,
18
- h: clientRect.height
19
- };
20
- };
21
-
22
- var toClientRect = function (geomRect) {
23
- return {
24
- left: geomRect.x,
25
- top: geomRect.y,
26
- width: geomRect.w,
27
- height: geomRect.h,
28
- right: geomRect.x + geomRect.w,
29
- bottom: geomRect.y + geomRect.h
30
- };
31
- };
32
-
33
- return {
34
- fromClientRect: fromClientRect,
35
- toClientRect: toClientRect
36
- };
37
- });
@@ -1,47 +0,0 @@
1
- /**
2
- * ElementMatcher.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/ElementMatcher', [
12
- 'tinymce/inlite/core/Matcher',
13
- 'tinymce/inlite/core/Measure'
14
- ], function (Matcher, Measure) {
15
- // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null)
16
- var element = function (element, predicateIds) {
17
- return function (editor) {
18
- for (var i = 0; i < predicateIds.length; i++) {
19
- if (predicateIds[i].predicate(element)) {
20
- return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element));
21
- }
22
- }
23
-
24
- return null;
25
- };
26
- };
27
-
28
- // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null)
29
- var parent = function (elements, predicateIds) {
30
- return function (editor) {
31
- for (var i = 0; i < elements.length; i++) {
32
- for (var x = 0; x < predicateIds.length; x++) {
33
- if (predicateIds[x].predicate(elements[i])) {
34
- return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i]));
35
- }
36
- }
37
- }
38
-
39
- return null;
40
- };
41
- };
42
-
43
- return {
44
- element: element,
45
- parent: parent
46
- };
47
- });
@@ -1,95 +0,0 @@
1
- /**
2
- * Layout.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/Layout', [
12
- 'global!tinymce.geom.Rect',
13
- 'tinymce/inlite/core/Convert'
14
- ], function (Rect, Convert) {
15
- var result = function (rect, position) {
16
- return {
17
- rect: rect,
18
- position: position
19
- };
20
- };
21
-
22
- var moveTo = function (rect, toRect) {
23
- return {x: toRect.x, y: toRect.y, w: rect.w, h: rect.h};
24
- };
25
-
26
- var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) {
27
- var relPos, relRect, outputPanelRect;
28
-
29
- relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions1);
30
- targetRect = Rect.clamp(targetRect, contentAreaRect);
31
-
32
- if (relPos) {
33
- relRect = Rect.relativePosition(panelRect, targetRect, relPos);
34
- outputPanelRect = moveTo(panelRect, relRect);
35
- return result(outputPanelRect, relPos);
36
- }
37
-
38
- targetRect = Rect.intersect(contentAreaRect, targetRect);
39
- if (targetRect) {
40
- relPos = Rect.findBestRelativePosition(panelRect, targetRect, contentAreaRect, testPositions2);
41
- if (relPos) {
42
- relRect = Rect.relativePosition(panelRect, targetRect, relPos);
43
- outputPanelRect = moveTo(panelRect, relRect);
44
- return result(outputPanelRect, relPos);
45
- }
46
-
47
- outputPanelRect = moveTo(panelRect, targetRect);
48
- return result(outputPanelRect, relPos);
49
- }
50
-
51
- return null;
52
- };
53
-
54
- var calcInsert = function (targetRect, contentAreaRect, panelRect) {
55
- return calcByPositions(
56
- ['cr-cl', 'cl-cr'],
57
- ['bc-tc', 'bl-tl', 'br-tr'],
58
- targetRect,
59
- contentAreaRect,
60
- panelRect
61
- );
62
- };
63
-
64
- var calc = function (targetRect, contentAreaRect, panelRect) {
65
- return calcByPositions(
66
- ['tc-bc', 'bc-tc', 'tl-bl', 'bl-tl', 'tr-br', 'br-tr'],
67
- ['bc-tc', 'bl-tl', 'br-tr'],
68
- targetRect,
69
- contentAreaRect,
70
- panelRect
71
- );
72
- };
73
-
74
- var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) {
75
- var userConstrainedPanelRect;
76
-
77
- if (typeof handler === 'function') {
78
- userConstrainedPanelRect = handler({
79
- elementRect: Convert.toClientRect(targetRect),
80
- contentAreaRect: Convert.toClientRect(contentAreaRect),
81
- panelRect: Convert.toClientRect(panelRect)
82
- });
83
-
84
- return Convert.fromClientRect(userConstrainedPanelRect);
85
- }
86
-
87
- return panelRect;
88
- };
89
-
90
- return {
91
- calcInsert: calcInsert,
92
- calc: calc,
93
- userConstrain: userConstrain
94
- };
95
- });
@@ -1,39 +0,0 @@
1
- /**
2
- * Matcher.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/Matcher', [
12
- ], function () {
13
- // result :: String, Rect -> Matcher.result
14
- var result = function (id, rect) {
15
- return {
16
- id: id,
17
- rect: rect
18
- };
19
- };
20
-
21
- // match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null
22
- var match = function (editor, matchers) {
23
- for (var i = 0; i < matchers.length; i++) {
24
- var f = matchers[i];
25
- var result = f(editor);
26
-
27
- if (result) {
28
- return result;
29
- }
30
- }
31
-
32
- return null;
33
- };
34
-
35
- return {
36
- match: match,
37
- result: result
38
- };
39
- });
@@ -1,61 +0,0 @@
1
- /**
2
- * Measure.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/Measure', [
12
- 'global!tinymce.DOM',
13
- 'global!tinymce.geom.Rect',
14
- 'tinymce/inlite/core/Convert'
15
- ], function (DOM, Rect, Convert) {
16
- var toAbsolute = function (rect) {
17
- var vp = DOM.getViewPort();
18
-
19
- return {
20
- x: rect.x + vp.x,
21
- y: rect.y + vp.y,
22
- w: rect.w,
23
- h: rect.h
24
- };
25
- };
26
-
27
- var measureElement = function (elm) {
28
- var clientRect = elm.getBoundingClientRect();
29
-
30
- return toAbsolute({
31
- x: clientRect.left,
32
- y: clientRect.top,
33
- w: Math.max(elm.clientWidth, elm.offsetWidth),
34
- h: Math.max(elm.clientHeight, elm.offsetHeight)
35
- });
36
- };
37
-
38
- var getElementRect = function (editor, elm) {
39
- return measureElement(elm);
40
- };
41
-
42
- var getPageAreaRect = function (editor) {
43
- return measureElement(editor.getElement().ownerDocument.body);
44
- };
45
-
46
- var getContentAreaRect = function (editor) {
47
- return measureElement(editor.getContentAreaContainer() || editor.getBody());
48
- };
49
-
50
- var getSelectionRect = function (editor) {
51
- var clientRect = editor.selection.getBoundingClientRect();
52
- return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null;
53
- };
54
-
55
- return {
56
- getElementRect: getElementRect,
57
- getPageAreaRect: getPageAreaRect,
58
- getContentAreaRect: getContentAreaRect,
59
- getSelectionRect: getSelectionRect
60
- };
61
- });
@@ -1,32 +0,0 @@
1
- /**
2
- * PredicateId.js
3
- *
4
- * Released under LGPL License.
5
- * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- define('tinymce/inlite/core/PredicateId', [
12
- 'global!tinymce.util.Tools'
13
- ], function (Tools) {
14
- var create = function (id, predicate) {
15
- return {
16
- id: id,
17
- predicate: predicate
18
- };
19
- };
20
-
21
- // fromContextToolbars :: [ContextToolbar] -> [PredicateId]
22
- var fromContextToolbars = function (toolbars) {
23
- return Tools.map(toolbars, function (toolbar) {
24
- return create(toolbar.id, toolbar.predicate);
25
- });
26
- };
27
-
28
- return {
29
- create: create,
30
- fromContextToolbars: fromContextToolbars
31
- };
32
- });