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,62 +0,0 @@
1
- asynctest('browser/core/MeasureTest', [
2
- 'ephox.mcagar.api.TinyLoader',
3
- 'tinymce/inlite/core/Measure',
4
- 'ephox.agar.api.Pipeline',
5
- 'ephox.mcagar.api.TinyApis',
6
- 'ephox.agar.api.Step',
7
- 'ephox.agar.api.Chain',
8
- 'ephox.agar.api.UiFinder',
9
- 'ephox.agar.api.Assertions'
10
- ], function (TinyLoader, Measure, Pipeline, TinyApis, Step, Chain, UiFinder, Assertions) {
11
- var success = arguments[arguments.length - 2];
12
- var failure = arguments[arguments.length - 1];
13
-
14
- var containsXY = function (r, x, y) {
15
- return x >= r.x && x <= r.x + r.w && y >= r.y && y <= r.y + r.h;
16
- };
17
-
18
- var contains = function (a, b) {
19
- return containsXY(a, b.x, b.y) && containsXY(a, b.x + b.w, b.y + b.h);
20
- };
21
-
22
- var sAssertRect = function (editor, measure) {
23
- return Step.sync(function () {
24
- var elementRect = measure();
25
- var pageAreaRect = Measure.getPageAreaRect(editor);
26
- var contentAreaRect = Measure.getContentAreaRect(editor);
27
-
28
- Assertions.assertEq('Rect is not in page area rect', contains(pageAreaRect, elementRect), true);
29
- Assertions.assertEq('Rect is not in content area rect', contains(contentAreaRect, elementRect), true);
30
- Assertions.assertEq('Rect should have width', elementRect.w > 0, true);
31
- Assertions.assertEq('Rect should have height', elementRect.h > 0, true);
32
- });
33
- };
34
-
35
- var getElementRectFromSelector = function (editor, selector) {
36
- return function () {
37
- var elm = editor.dom.select(selector)[0];
38
- var rect = Measure.getElementRect(editor, elm);
39
- return rect;
40
- };
41
- };
42
-
43
- var getSelectionRectFromSelector = function (editor) {
44
- return function () {
45
- var rect = Measure.getSelectionRect(editor);
46
- return rect;
47
- };
48
- };
49
-
50
- TinyLoader.setup(function (editor, onSuccess, onFailure) {
51
- var tinyApis = TinyApis(editor);
52
-
53
- Pipeline.async({}, [
54
- tinyApis.sSetContent('<p>a</p><div style="width: 50px; height: 300px">b</div><p>c</p>'),
55
- sAssertRect(editor, getElementRectFromSelector(editor, 'p:nth-child(1)')),
56
- tinyApis.sSetCursor([0, 0], 0),
57
- sAssertRect(editor, getSelectionRectFromSelector(editor))
58
- ], onSuccess, onFailure);
59
- }, {
60
- inline: true
61
- }, success, failure);
62
- });
@@ -1,26 +0,0 @@
1
- test('browser/core/PredicateIdTest', [
2
- 'ephox/tinymce',
3
- 'tinymce/inlite/core/PredicateId'
4
- ], function (tinymce, PredicateId) {
5
- var testFromContextToolbars = function () {
6
- var isTrue = function () {
7
- return true;
8
- };
9
-
10
- var isFalse = function () {
11
- return false;
12
- };
13
-
14
- var predIds = PredicateId.fromContextToolbars([
15
- {toolbar: 'a b c', predicate: isTrue, id: 'a'},
16
- {toolbar: 'd e', predicate: isFalse, id: 'b'}
17
- ]);
18
-
19
- assert.eq([
20
- PredicateId.create('a', isTrue),
21
- PredicateId.create('b', isFalse)
22
- ], predIds);
23
- };
24
-
25
- testFromContextToolbars();
26
- });
@@ -1,76 +0,0 @@
1
- asynctest('browser/core/SelectionMatcherTest', [
2
- 'ephox.mcagar.api.TinyLoader',
3
- 'ephox.mcagar.api.TinyApis',
4
- 'ephox.agar.api.Step',
5
- 'ephox.agar.api.Assertions',
6
- 'tinymce/inlite/core/SelectionMatcher',
7
- 'tinymce/inlite/core/PredicateId',
8
- 'ephox.agar.api.GeneralSteps',
9
- 'ephox.agar.api.Pipeline'
10
- ], function (TinyLoader, TinyApis, Step, Assertions, SelectionMatcher, PredicateId, GeneralSteps, Pipeline) {
11
- var success = arguments[arguments.length - 2];
12
- var failure = arguments[arguments.length - 1];
13
-
14
- var assertResult = function (expectedResultState, result) {
15
- Assertions.assertEq('Should not be null', result !== null, expectedResultState);
16
-
17
- if (expectedResultState === true) {
18
- Assertions.assertEq('Should be matching a', result.id, 'a');
19
- Assertions.assertEq('Should be have width', result.rect.w > 0, true);
20
- }
21
- };
22
-
23
- var sTextSelectionTest = function (tinyApis, editor, inputHtml, spath, soffset, fpath, foffset, expectedResultState) {
24
- var sAssertTextSelectionResult = Step.sync(function () {
25
- var result = SelectionMatcher.textSelection('a')(editor);
26
- assertResult(expectedResultState, result);
27
- });
28
-
29
- return GeneralSteps.sequence([
30
- tinyApis.sSetContent(inputHtml),
31
- tinyApis.sSetSelection(spath, soffset, fpath, foffset),
32
- sAssertTextSelectionResult
33
- ]);
34
- };
35
-
36
- var sTextSelectionTests = function (tinyApis, editor) {
37
- return GeneralSteps.sequence([
38
- sTextSelectionTest(tinyApis, editor, '<p>a</p>', [0], 0, [0], 1, true),
39
- sTextSelectionTest(tinyApis, editor, '<p>a</p>', [0], 0, [0], 0, false)
40
- ]);
41
- };
42
-
43
- var sEmptyTextBlockTest = function (tinyApis, editor, inputHtml, spath, soffset, fpath, foffset, expectedResultState) {
44
- var sAssertTextSelectionResult = Step.sync(function () {
45
- var elements = editor.dom.getParents(editor.selection.getStart());
46
- var result = SelectionMatcher.emptyTextBlock(elements, 'a')(editor);
47
- assertResult(expectedResultState, result);
48
- });
49
-
50
- return GeneralSteps.sequence([
51
- tinyApis.sSetContent(inputHtml),
52
- tinyApis.sSetSelection(spath, soffset, fpath, foffset),
53
- sAssertTextSelectionResult
54
- ]);
55
- };
56
-
57
- var sEmptyTextBlockTests = function (tinyApis, editor) {
58
- return GeneralSteps.sequence([
59
- sEmptyTextBlockTest(tinyApis, editor, '<p>a</p>', [0], 0, [0], 0, false),
60
- sEmptyTextBlockTest(tinyApis, editor, '<p>a</p>', [0], 0, [0], 1, false),
61
- sEmptyTextBlockTest(tinyApis, editor, '<p><br></p>', [0], 0, [0], 0, true),
62
- sEmptyTextBlockTest(tinyApis, editor, '<p><em><br></em></p>', [0, 0], 0, [0, 0], 0, true)
63
- ]);
64
- };
65
-
66
- TinyLoader.setup(function (editor, onSuccess, onFailure) {
67
- var tinyApis = TinyApis(editor);
68
-
69
- Pipeline.async({}, [
70
- sTextSelectionTests(tinyApis, editor),
71
- sEmptyTextBlockTests(tinyApis, editor)
72
- ], onSuccess, onFailure);
73
- }, {
74
- inline: true
75
- }, success, failure);
76
- });
@@ -1,41 +0,0 @@
1
- asynctest('atomic/core/ConvertTest', [
2
- 'ephox/tinymce',
3
- 'tinymce/inlite/file/Conversions',
4
- 'ephox.agar.api.Step',
5
- 'ephox.agar.api.Pipeline',
6
- 'ephox.agar.api.Assertions'
7
- ], function (tinymce, Conversions, Step, Pipeline, Assertions) {
8
- var success = arguments[arguments.length - 2];
9
- var failure = arguments[arguments.length - 1];
10
-
11
- var base64ToBlob = function (base64, type) {
12
- var buff = atob(base64);
13
- var bytes = new Uint8Array(buff.length);
14
-
15
- for (var i = 0; i < bytes.length; i++) {
16
- bytes[i] = buff.charCodeAt(i);
17
- }
18
-
19
- return new Blob([bytes], {type: type});
20
- };
21
-
22
- var sBlobToBase64 = function () {
23
- return Step.async(function (next) {
24
- var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
25
- var blob = base64ToBlob(base64, 'image/gif');
26
-
27
- Conversions.blobToBase64(blob).then(function (convertedBase64) {
28
- Assertions.assertEq('Not the correct base64', base64, convertedBase64);
29
- next();
30
- });
31
- });
32
- };
33
-
34
- Pipeline.async({}, [
35
- sBlobToBase64()
36
- ], function () {
37
- success();
38
- }, function () {
39
- failure();
40
- });
41
- });
@@ -1,55 +0,0 @@
1
- /**
2
- * SelectionMatcher.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/SelectionMatcher', [
12
- 'tinymce/inlite/core/Matcher',
13
- 'tinymce/inlite/core/Measure'
14
- ], function (Matcher, Measure) {
15
- // textSelection :: String -> (Editor -> Matcher.result | Null)
16
- var textSelection = function (id) {
17
- return function (editor) {
18
- if (!editor.selection.isCollapsed()) {
19
- return Matcher.result(id, Measure.getSelectionRect(editor));
20
- }
21
-
22
- return null;
23
- };
24
- };
25
-
26
- // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null)
27
- var emptyTextBlock = function (elements, id) {
28
- return function (editor) {
29
- var i, textBlockElementsMap = editor.schema.getTextBlockElements();
30
-
31
- for (i = 0; i < elements.length; i++) {
32
- if (elements[i].nodeName === 'TABLE') {
33
- return null;
34
- }
35
- }
36
-
37
- for (i = 0; i < elements.length; i++) {
38
- if (elements[i].nodeName in textBlockElementsMap) {
39
- if (editor.dom.isEmpty(elements[i])) {
40
- return Matcher.result(id, Measure.getSelectionRect(editor));
41
- }
42
-
43
- return null;
44
- }
45
- }
46
-
47
- return null;
48
- };
49
- };
50
-
51
- return {
52
- textSelection: textSelection,
53
- emptyTextBlock: emptyTextBlock
54
- };
55
- });