tinymce-rails 4.2.4 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.jquery.js +500 -323
- data/app/assets/source/tinymce/tinymce.js +500 -323
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.jquery.js +11 -11
- data/vendor/assets/javascripts/tinymce/tinymce.js +12 -12
- metadata +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
// 4.2.
|
1
|
+
// 4.2.5 (2015-08-31)
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Compiled inline version. (Library mode)
|
@@ -65,10 +65,12 @@
|
|
65
65
|
}
|
66
66
|
|
67
67
|
function expose(ids) {
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
var i, target, id, fragments, privateModules;
|
69
|
+
|
70
|
+
for (i = 0; i < ids.length; i++) {
|
71
|
+
target = exports;
|
72
|
+
id = ids[i];
|
73
|
+
fragments = id.split(/[.\/]/);
|
72
74
|
|
73
75
|
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
74
76
|
if (target[fragments[fi]] === undefined) {
|
@@ -80,6 +82,21 @@
|
|
80
82
|
|
81
83
|
target[fragments[fragments.length - 1]] = modules[id];
|
82
84
|
}
|
85
|
+
|
86
|
+
// Expose private modules for unit tests
|
87
|
+
if (exports.AMDLC_TESTS) {
|
88
|
+
privateModules = exports.privateModules || {};
|
89
|
+
|
90
|
+
for (id in modules) {
|
91
|
+
privateModules[id] = modules[id];
|
92
|
+
}
|
93
|
+
|
94
|
+
for (i = 0; i < ids.length; i++) {
|
95
|
+
delete privateModules[ids[i]];
|
96
|
+
}
|
97
|
+
|
98
|
+
exports.privateModules = privateModules;
|
99
|
+
}
|
83
100
|
}
|
84
101
|
|
85
102
|
// Included from: js/tinymce/classes/dom/EventUtils.js
|
@@ -2857,6 +2874,134 @@ define("tinymce/Env", [], function() {
|
|
2857
2874
|
};
|
2858
2875
|
});
|
2859
2876
|
|
2877
|
+
// Included from: js/tinymce/classes/util/Arr.js
|
2878
|
+
|
2879
|
+
/**
|
2880
|
+
* Arr.js
|
2881
|
+
*
|
2882
|
+
* Released under LGPL License.
|
2883
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
2884
|
+
*
|
2885
|
+
* License: http://www.tinymce.com/license
|
2886
|
+
* Contributing: http://www.tinymce.com/contributing
|
2887
|
+
*/
|
2888
|
+
|
2889
|
+
/**
|
2890
|
+
* Array utility class.
|
2891
|
+
*
|
2892
|
+
* @private
|
2893
|
+
* @class tinymce.util.Arr
|
2894
|
+
*/
|
2895
|
+
define("tinymce/util/Arr", [], function() {
|
2896
|
+
var isArray = Array.isArray || function(obj) {
|
2897
|
+
return Object.prototype.toString.call(obj) === "[object Array]";
|
2898
|
+
};
|
2899
|
+
|
2900
|
+
function toArray(obj) {
|
2901
|
+
var array = obj, i, l;
|
2902
|
+
|
2903
|
+
if (!isArray(obj)) {
|
2904
|
+
array = [];
|
2905
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
2906
|
+
array[i] = obj[i];
|
2907
|
+
}
|
2908
|
+
}
|
2909
|
+
|
2910
|
+
return array;
|
2911
|
+
}
|
2912
|
+
|
2913
|
+
function each(o, cb, s) {
|
2914
|
+
var n, l;
|
2915
|
+
|
2916
|
+
if (!o) {
|
2917
|
+
return 0;
|
2918
|
+
}
|
2919
|
+
|
2920
|
+
s = s || o;
|
2921
|
+
|
2922
|
+
if (o.length !== undefined) {
|
2923
|
+
// Indexed arrays, needed for Safari
|
2924
|
+
for (n = 0, l = o.length; n < l; n++) {
|
2925
|
+
if (cb.call(s, o[n], n, o) === false) {
|
2926
|
+
return 0;
|
2927
|
+
}
|
2928
|
+
}
|
2929
|
+
} else {
|
2930
|
+
// Hashtables
|
2931
|
+
for (n in o) {
|
2932
|
+
if (o.hasOwnProperty(n)) {
|
2933
|
+
if (cb.call(s, o[n], n, o) === false) {
|
2934
|
+
return 0;
|
2935
|
+
}
|
2936
|
+
}
|
2937
|
+
}
|
2938
|
+
}
|
2939
|
+
|
2940
|
+
return 1;
|
2941
|
+
}
|
2942
|
+
|
2943
|
+
function map(array, callback) {
|
2944
|
+
var out = [];
|
2945
|
+
|
2946
|
+
each(array, function(item, index) {
|
2947
|
+
out.push(callback(item, index, array));
|
2948
|
+
});
|
2949
|
+
|
2950
|
+
return out;
|
2951
|
+
}
|
2952
|
+
|
2953
|
+
function filter(a, f) {
|
2954
|
+
var o = [];
|
2955
|
+
|
2956
|
+
each(a, function(v) {
|
2957
|
+
if (!f || f(v)) {
|
2958
|
+
o.push(v);
|
2959
|
+
}
|
2960
|
+
});
|
2961
|
+
|
2962
|
+
return o;
|
2963
|
+
}
|
2964
|
+
|
2965
|
+
function indexOf(a, v) {
|
2966
|
+
var i, l;
|
2967
|
+
|
2968
|
+
if (a) {
|
2969
|
+
for (i = 0, l = a.length; i < l; i++) {
|
2970
|
+
if (a[i] === v) {
|
2971
|
+
return i;
|
2972
|
+
}
|
2973
|
+
}
|
2974
|
+
}
|
2975
|
+
|
2976
|
+
return -1;
|
2977
|
+
}
|
2978
|
+
|
2979
|
+
function reduce(collection, iteratee, accumulator, thisArg) {
|
2980
|
+
var i = 0;
|
2981
|
+
|
2982
|
+
if (arguments.length < 3) {
|
2983
|
+
accumulator = collection[0];
|
2984
|
+
i = 1;
|
2985
|
+
}
|
2986
|
+
|
2987
|
+
for (; i < collection.length; i++) {
|
2988
|
+
accumulator = iteratee.call(thisArg, accumulator, collection[i], i);
|
2989
|
+
}
|
2990
|
+
|
2991
|
+
return accumulator;
|
2992
|
+
}
|
2993
|
+
|
2994
|
+
return {
|
2995
|
+
isArray: isArray,
|
2996
|
+
toArray: toArray,
|
2997
|
+
each: each,
|
2998
|
+
map: map,
|
2999
|
+
filter: filter,
|
3000
|
+
indexOf: indexOf,
|
3001
|
+
reduce: reduce
|
3002
|
+
};
|
3003
|
+
});
|
3004
|
+
|
2860
3005
|
// Included from: js/tinymce/classes/util/Tools.js
|
2861
3006
|
|
2862
3007
|
/**
|
@@ -2876,8 +3021,9 @@ define("tinymce/Env", [], function() {
|
|
2876
3021
|
* @class tinymce.util.Tools
|
2877
3022
|
*/
|
2878
3023
|
define("tinymce/util/Tools", [
|
2879
|
-
"tinymce/Env"
|
2880
|
-
|
3024
|
+
"tinymce/Env",
|
3025
|
+
"tinymce/util/Arr"
|
3026
|
+
], function(Env, Arr) {
|
2881
3027
|
/**
|
2882
3028
|
* Removes whitespace from the beginning and end of a string.
|
2883
3029
|
*
|
@@ -2891,17 +3037,6 @@ define("tinymce/util/Tools", [
|
|
2891
3037
|
return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
|
2892
3038
|
}
|
2893
3039
|
|
2894
|
-
/**
|
2895
|
-
* Returns true/false if the object is an array or not.
|
2896
|
-
*
|
2897
|
-
* @method isArray
|
2898
|
-
* @param {Object} obj Object to check.
|
2899
|
-
* @return {boolean} true/false state if the object is an array or not.
|
2900
|
-
*/
|
2901
|
-
var isArray = Array.isArray || function(obj) {
|
2902
|
-
return Object.prototype.toString.call(obj) === "[object Array]";
|
2903
|
-
};
|
2904
|
-
|
2905
3040
|
/**
|
2906
3041
|
* Checks if a object is of a specific type for example an array.
|
2907
3042
|
*
|
@@ -2915,33 +3050,13 @@ define("tinymce/util/Tools", [
|
|
2915
3050
|
return obj !== undefined;
|
2916
3051
|
}
|
2917
3052
|
|
2918
|
-
if (type == 'array' && isArray(obj)) {
|
3053
|
+
if (type == 'array' && Arr.isArray(obj)) {
|
2919
3054
|
return true;
|
2920
3055
|
}
|
2921
3056
|
|
2922
3057
|
return typeof obj == type;
|
2923
3058
|
}
|
2924
3059
|
|
2925
|
-
/**
|
2926
|
-
* Converts the specified object into a real JavaScript array.
|
2927
|
-
*
|
2928
|
-
* @method toArray
|
2929
|
-
* @param {Object} obj Object to convert into array.
|
2930
|
-
* @return {Array} Array object based in input.
|
2931
|
-
*/
|
2932
|
-
function toArray(obj) {
|
2933
|
-
var array = obj, i, l;
|
2934
|
-
|
2935
|
-
if (!isArray(obj)) {
|
2936
|
-
array = [];
|
2937
|
-
for (i = 0, l = obj.length; i < l; i++) {
|
2938
|
-
array[i] = obj[i];
|
2939
|
-
}
|
2940
|
-
}
|
2941
|
-
|
2942
|
-
return array;
|
2943
|
-
}
|
2944
|
-
|
2945
3060
|
/**
|
2946
3061
|
* Makes a name/object map out of an array with names.
|
2947
3062
|
*
|
@@ -2971,99 +3086,6 @@ define("tinymce/util/Tools", [
|
|
2971
3086
|
return map;
|
2972
3087
|
}
|
2973
3088
|
|
2974
|
-
/**
|
2975
|
-
* Performs an iteration of all items in a collection such as an object or array. This method will execure the
|
2976
|
-
* callback function for each item in the collection, if the callback returns false the iteration will terminate.
|
2977
|
-
* The callback has the following format: cb(value, key_or_index).
|
2978
|
-
*
|
2979
|
-
* @method each
|
2980
|
-
* @param {Object} o Collection to iterate.
|
2981
|
-
* @param {function} cb Callback function to execute for each item.
|
2982
|
-
* @param {Object} s Optional scope to execute the callback in.
|
2983
|
-
* @example
|
2984
|
-
* // Iterate an array
|
2985
|
-
* tinymce.each([1,2,3], function(v, i) {
|
2986
|
-
* console.debug("Value: " + v + ", Index: " + i);
|
2987
|
-
* });
|
2988
|
-
*
|
2989
|
-
* // Iterate an object
|
2990
|
-
* tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
|
2991
|
-
* console.debug("Value: " + v + ", Key: " + k);
|
2992
|
-
* });
|
2993
|
-
*/
|
2994
|
-
function each(o, cb, s) {
|
2995
|
-
var n, l;
|
2996
|
-
|
2997
|
-
if (!o) {
|
2998
|
-
return 0;
|
2999
|
-
}
|
3000
|
-
|
3001
|
-
s = s || o;
|
3002
|
-
|
3003
|
-
if (o.length !== undefined) {
|
3004
|
-
// Indexed arrays, needed for Safari
|
3005
|
-
for (n = 0, l = o.length; n < l; n++) {
|
3006
|
-
if (cb.call(s, o[n], n, o) === false) {
|
3007
|
-
return 0;
|
3008
|
-
}
|
3009
|
-
}
|
3010
|
-
} else {
|
3011
|
-
// Hashtables
|
3012
|
-
for (n in o) {
|
3013
|
-
if (o.hasOwnProperty(n)) {
|
3014
|
-
if (cb.call(s, o[n], n, o) === false) {
|
3015
|
-
return 0;
|
3016
|
-
}
|
3017
|
-
}
|
3018
|
-
}
|
3019
|
-
}
|
3020
|
-
|
3021
|
-
return 1;
|
3022
|
-
}
|
3023
|
-
|
3024
|
-
/**
|
3025
|
-
* Creates a new array by the return value of each iteration function call. This enables you to convert
|
3026
|
-
* one array list into another.
|
3027
|
-
*
|
3028
|
-
* @method map
|
3029
|
-
* @param {Array} array Array of items to iterate.
|
3030
|
-
* @param {function} callback Function to call for each item. It's return value will be the new value.
|
3031
|
-
* @return {Array} Array with new values based on function return values.
|
3032
|
-
*/
|
3033
|
-
function map(array, callback) {
|
3034
|
-
var out = [];
|
3035
|
-
|
3036
|
-
each(array, function(item) {
|
3037
|
-
out.push(callback(item));
|
3038
|
-
});
|
3039
|
-
|
3040
|
-
return out;
|
3041
|
-
}
|
3042
|
-
|
3043
|
-
/**
|
3044
|
-
* Filters out items from the input array by calling the specified function for each item.
|
3045
|
-
* If the function returns false the item will be excluded if it returns true it will be included.
|
3046
|
-
*
|
3047
|
-
* @method grep
|
3048
|
-
* @param {Array} a Array of items to loop though.
|
3049
|
-
* @param {function} f Function to call for each item. Include/exclude depends on it's return value.
|
3050
|
-
* @return {Array} New array with values imported and filtered based in input.
|
3051
|
-
* @example
|
3052
|
-
* // Filter out some items, this will return an array with 4 and 5
|
3053
|
-
* var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
|
3054
|
-
*/
|
3055
|
-
function grep(a, f) {
|
3056
|
-
var o = [];
|
3057
|
-
|
3058
|
-
each(a, function(v) {
|
3059
|
-
if (!f || f(v)) {
|
3060
|
-
o.push(v);
|
3061
|
-
}
|
3062
|
-
});
|
3063
|
-
|
3064
|
-
return o;
|
3065
|
-
}
|
3066
|
-
|
3067
3089
|
/**
|
3068
3090
|
* Creates a class, subclass or static singleton.
|
3069
3091
|
* More details on this method can be found in the Wiki.
|
@@ -3196,31 +3218,6 @@ define("tinymce/util/Tools", [
|
|
3196
3218
|
});
|
3197
3219
|
}
|
3198
3220
|
|
3199
|
-
/**
|
3200
|
-
* Returns the index of a value in an array, this method will return -1 if the item wasn't found.
|
3201
|
-
*
|
3202
|
-
* @method inArray
|
3203
|
-
* @param {Array} a Array/Object to search for value in.
|
3204
|
-
* @param {Object} v Value to check for inside the array.
|
3205
|
-
* @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found.
|
3206
|
-
* @example
|
3207
|
-
* // Get index of value in array this will alert 1 since 2 is at that index
|
3208
|
-
* alert(tinymce.inArray([1,2,3], 2));
|
3209
|
-
*/
|
3210
|
-
function inArray(a, v) {
|
3211
|
-
var i, l;
|
3212
|
-
|
3213
|
-
if (a) {
|
3214
|
-
for (i = 0, l = a.length; i < l; i++) {
|
3215
|
-
if (a[i] === v) {
|
3216
|
-
return i;
|
3217
|
-
}
|
3218
|
-
}
|
3219
|
-
}
|
3220
|
-
|
3221
|
-
return -1;
|
3222
|
-
}
|
3223
|
-
|
3224
3221
|
function extend(obj, ext) {
|
3225
3222
|
var i, l, name, args = arguments, value;
|
3226
3223
|
|
@@ -3257,7 +3254,7 @@ define("tinymce/util/Tools", [
|
|
3257
3254
|
o = o[n];
|
3258
3255
|
}
|
3259
3256
|
|
3260
|
-
each(o, function(o, i) {
|
3257
|
+
Arr.each(o, function(o, i) {
|
3261
3258
|
if (f.call(s, o, i, n) === false) {
|
3262
3259
|
return false;
|
3263
3260
|
}
|
@@ -3347,28 +3344,7 @@ define("tinymce/util/Tools", [
|
|
3347
3344
|
return s;
|
3348
3345
|
}
|
3349
3346
|
|
3350
|
-
return map(s.split(d || ','), trim);
|
3351
|
-
}
|
3352
|
-
|
3353
|
-
function constant(value) {
|
3354
|
-
return function() {
|
3355
|
-
return value;
|
3356
|
-
};
|
3357
|
-
}
|
3358
|
-
|
3359
|
-
function reduce(collection, iteratee, accumulator, thisArg) {
|
3360
|
-
var i = 0;
|
3361
|
-
|
3362
|
-
if (arguments.length < 3) {
|
3363
|
-
accumulator = collection[0];
|
3364
|
-
i = 1;
|
3365
|
-
}
|
3366
|
-
|
3367
|
-
for (; i < collection.length; i++) {
|
3368
|
-
accumulator = iteratee.call(thisArg, accumulator, collection[i], i);
|
3369
|
-
}
|
3370
|
-
|
3371
|
-
return accumulator;
|
3347
|
+
return Arr.map(s.split(d || ','), trim);
|
3372
3348
|
}
|
3373
3349
|
|
3374
3350
|
function _addCacheSuffix(url) {
|
@@ -3383,23 +3359,90 @@ define("tinymce/util/Tools", [
|
|
3383
3359
|
|
3384
3360
|
return {
|
3385
3361
|
trim: trim,
|
3386
|
-
|
3362
|
+
|
3363
|
+
/**
|
3364
|
+
* Returns true/false if the object is an array or not.
|
3365
|
+
*
|
3366
|
+
* @method isArray
|
3367
|
+
* @param {Object} obj Object to check.
|
3368
|
+
* @return {boolean} true/false state if the object is an array or not.
|
3369
|
+
*/
|
3370
|
+
isArray: Arr.isArray,
|
3371
|
+
|
3387
3372
|
is: is,
|
3388
|
-
|
3373
|
+
|
3374
|
+
/**
|
3375
|
+
* Converts the specified object into a real JavaScript array.
|
3376
|
+
*
|
3377
|
+
* @method toArray
|
3378
|
+
* @param {Object} obj Object to convert into array.
|
3379
|
+
* @return {Array} Array object based in input.
|
3380
|
+
*/
|
3381
|
+
toArray: Arr.toArray,
|
3389
3382
|
makeMap: makeMap,
|
3390
|
-
|
3391
|
-
|
3392
|
-
|
3393
|
-
|
3394
|
-
|
3383
|
+
|
3384
|
+
/**
|
3385
|
+
* Performs an iteration of all items in a collection such as an object or array. This method will execure the
|
3386
|
+
* callback function for each item in the collection, if the callback returns false the iteration will terminate.
|
3387
|
+
* The callback has the following format: cb(value, key_or_index).
|
3388
|
+
*
|
3389
|
+
* @method each
|
3390
|
+
* @param {Object} o Collection to iterate.
|
3391
|
+
* @param {function} cb Callback function to execute for each item.
|
3392
|
+
* @param {Object} s Optional scope to execute the callback in.
|
3393
|
+
* @example
|
3394
|
+
* // Iterate an array
|
3395
|
+
* tinymce.each([1,2,3], function(v, i) {
|
3396
|
+
* console.debug("Value: " + v + ", Index: " + i);
|
3397
|
+
* });
|
3398
|
+
*
|
3399
|
+
* // Iterate an object
|
3400
|
+
* tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
|
3401
|
+
* console.debug("Value: " + v + ", Key: " + k);
|
3402
|
+
* });
|
3403
|
+
*/
|
3404
|
+
each: Arr.each,
|
3405
|
+
|
3406
|
+
/**
|
3407
|
+
* Creates a new array by the return value of each iteration function call. This enables you to convert
|
3408
|
+
* one array list into another.
|
3409
|
+
*
|
3410
|
+
* @method map
|
3411
|
+
* @param {Array} array Array of items to iterate.
|
3412
|
+
* @param {function} callback Function to call for each item. It's return value will be the new value.
|
3413
|
+
* @return {Array} Array with new values based on function return values.
|
3414
|
+
*/
|
3415
|
+
map: Arr.map,
|
3416
|
+
|
3417
|
+
/**
|
3418
|
+
* Filters out items from the input array by calling the specified function for each item.
|
3419
|
+
* If the function returns false the item will be excluded if it returns true it will be included.
|
3420
|
+
*
|
3421
|
+
* @method grep
|
3422
|
+
* @param {Array} a Array of items to loop though.
|
3423
|
+
* @param {function} f Function to call for each item. Include/exclude depends on it's return value.
|
3424
|
+
* @return {Array} New array with values imported and filtered based in input.
|
3425
|
+
* @example
|
3426
|
+
* // Filter out some items, this will return an array with 4 and 5
|
3427
|
+
* var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
|
3428
|
+
*/
|
3429
|
+
grep: Arr.filter,
|
3430
|
+
|
3431
|
+
/**
|
3432
|
+
* Returns true/false if the object is an array or not.
|
3433
|
+
*
|
3434
|
+
* @method isArray
|
3435
|
+
* @param {Object} obj Object to check.
|
3436
|
+
* @return {boolean} true/false state if the object is an array or not.
|
3437
|
+
*/
|
3438
|
+
inArray: Arr.indexOf,
|
3439
|
+
|
3395
3440
|
extend: extend,
|
3396
3441
|
create: create,
|
3397
3442
|
walk: walk,
|
3398
3443
|
createNS: createNS,
|
3399
3444
|
resolve: resolve,
|
3400
3445
|
explode: explode,
|
3401
|
-
constant: constant,
|
3402
|
-
reduce: reduce,
|
3403
3446
|
_addCacheSuffix: _addCacheSuffix
|
3404
3447
|
};
|
3405
3448
|
});
|
@@ -5449,6 +5492,12 @@ define("tinymce/dom/TreeWalker", [], function() {
|
|
5449
5492
|
* Contributing: http://www.tinymce.com/contributing
|
5450
5493
|
*/
|
5451
5494
|
|
5495
|
+
/**
|
5496
|
+
* Old IE Range.
|
5497
|
+
*
|
5498
|
+
* @private
|
5499
|
+
* @class tinymce.dom.Range
|
5500
|
+
*/
|
5452
5501
|
define("tinymce/dom/Range", [
|
5453
5502
|
"tinymce/util/Tools"
|
5454
5503
|
], function(Tools) {
|
@@ -9601,7 +9650,7 @@ define("tinymce/dom/RangeUtils", [
|
|
9601
9650
|
*/
|
9602
9651
|
|
9603
9652
|
/**
|
9604
|
-
* This class handles the nodechange event dispatching both manual and
|
9653
|
+
* This class handles the nodechange event dispatching both manual and through selection change events.
|
9605
9654
|
*
|
9606
9655
|
* @class tinymce.NodeChange
|
9607
9656
|
* @private
|
@@ -9703,7 +9752,7 @@ define("tinymce/NodeChange", [
|
|
9703
9752
|
});
|
9704
9753
|
|
9705
9754
|
/**
|
9706
|
-
*
|
9755
|
+
* Dispatches out a onNodeChange event to all observers. This method should be called when you
|
9707
9756
|
* need to update the UI states or element path etc.
|
9708
9757
|
*
|
9709
9758
|
* @method nodeChanged
|
@@ -13334,6 +13383,7 @@ define("tinymce/dom/Serializer", [
|
|
13334
13383
|
* Selection class for old explorer versions. This one fakes the
|
13335
13384
|
* native selection object available on modern browsers.
|
13336
13385
|
*
|
13386
|
+
* @private
|
13337
13387
|
* @class tinymce.dom.TridentSelection
|
13338
13388
|
*/
|
13339
13389
|
define("tinymce/dom/TridentSelection", [], function() {
|
@@ -15305,7 +15355,7 @@ define("tinymce/dom/Selection", [
|
|
15305
15355
|
* Collapse the selection to start or end of range.
|
15306
15356
|
*
|
15307
15357
|
* @method collapse
|
15308
|
-
* @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to
|
15358
|
+
* @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to false.
|
15309
15359
|
*/
|
15310
15360
|
collapse: function(toStart) {
|
15311
15361
|
var self = this, rng = self.getRng(), node;
|
@@ -15886,6 +15936,7 @@ define("tinymce/dom/Selection", [
|
|
15886
15936
|
* Utility class for various element specific functions.
|
15887
15937
|
*
|
15888
15938
|
* @private
|
15939
|
+
* @class tinymce.dom.ElementUtils
|
15889
15940
|
*/
|
15890
15941
|
define("tinymce/dom/ElementUtils", [
|
15891
15942
|
"tinymce/dom/BookmarkManager",
|
@@ -16008,8 +16059,8 @@ define("tinymce/dom/ElementUtils", [
|
|
16008
16059
|
* Example:
|
16009
16060
|
* Preview.getCssText(editor, 'bold');
|
16010
16061
|
*
|
16011
|
-
* @class tinymce.fmt.Preview
|
16012
16062
|
* @private
|
16063
|
+
* @class tinymce.fmt.Preview
|
16013
16064
|
*/
|
16014
16065
|
define("tinymce/fmt/Preview", [
|
16015
16066
|
"tinymce/util/Tools"
|
@@ -16158,8 +16209,8 @@ define("tinymce/fmt/Preview", [
|
|
16158
16209
|
|
16159
16210
|
/**
|
16160
16211
|
* Text formatter engine class. This class is used to apply formats like bold, italic, font size
|
16161
|
-
* etc to the current selection or specific nodes. This engine was
|
16162
|
-
* default formatting logic for execCommand due to
|
16212
|
+
* etc to the current selection or specific nodes. This engine was built to replace the browser's
|
16213
|
+
* default formatting logic for execCommand due to its inconsistent and buggy behavior.
|
16163
16214
|
*
|
16164
16215
|
* @class tinymce.Formatter
|
16165
16216
|
* @example
|
@@ -18501,7 +18552,7 @@ define("tinymce/Formatter", [
|
|
18501
18552
|
*/
|
18502
18553
|
|
18503
18554
|
/**
|
18504
|
-
* This class handles the undo/redo history levels for the editor. Since the
|
18555
|
+
* This class handles the undo/redo history levels for the editor. Since the built-in undo/redo has major drawbacks a custom one was needed.
|
18505
18556
|
*
|
18506
18557
|
* @class tinymce.UndoManager
|
18507
18558
|
*/
|
@@ -18884,6 +18935,9 @@ define("tinymce/UndoManager", [
|
|
18884
18935
|
|
18885
18936
|
/**
|
18886
18937
|
* Contains logic for handling the enter key to split/generate block elements.
|
18938
|
+
*
|
18939
|
+
* @private
|
18940
|
+
* @class tinymce.EnterKey
|
18887
18941
|
*/
|
18888
18942
|
define("tinymce/EnterKey", [
|
18889
18943
|
"tinymce/dom/TreeWalker",
|
@@ -19534,6 +19588,12 @@ define("tinymce/EnterKey", [
|
|
19534
19588
|
* Contributing: http://www.tinymce.com/contributing
|
19535
19589
|
*/
|
19536
19590
|
|
19591
|
+
/**
|
19592
|
+
* Makes sure that everything gets wrapped in paragraphs.
|
19593
|
+
*
|
19594
|
+
* @private
|
19595
|
+
* @class tinymce.ForceBlocks
|
19596
|
+
*/
|
19537
19597
|
define("tinymce/ForceBlocks", [], function() {
|
19538
19598
|
return function(editor) {
|
19539
19599
|
var settings = editor.settings, dom = editor.dom, selection = editor.selection;
|
@@ -21561,6 +21621,7 @@ define("tinymce/util/EventDispatcher", [
|
|
21561
21621
|
* This class gets dynamically extended to provide a binding between two models. This makes it possible to
|
21562
21622
|
* sync the state of two properties in two models by a layer of abstraction.
|
21563
21623
|
*
|
21624
|
+
* @private
|
21564
21625
|
* @class tinymce.data.Binding
|
21565
21626
|
*/
|
21566
21627
|
define("tinymce/data/Binding", [], function() {
|
@@ -21773,6 +21834,7 @@ define("tinymce/util/Observable", [
|
|
21773
21834
|
/**
|
21774
21835
|
* This class is a object that is observable when properties changes a change event gets emitted.
|
21775
21836
|
*
|
21837
|
+
* @private
|
21776
21838
|
* @class tinymce.data.ObservableObject
|
21777
21839
|
*/
|
21778
21840
|
define("tinymce/data/ObservableObject", [
|
@@ -21781,6 +21843,11 @@ define("tinymce/data/ObservableObject", [
|
|
21781
21843
|
"tinymce/util/Class",
|
21782
21844
|
"tinymce/util/Tools"
|
21783
21845
|
], function(Binding, Observable, Class, Tools) {
|
21846
|
+
function isNode(node) {
|
21847
|
+
return node.nodeType > 0;
|
21848
|
+
}
|
21849
|
+
|
21850
|
+
// Todo: Maybe this should be shallow compare since it might be huge object references
|
21784
21851
|
function isEqual(a, b) {
|
21785
21852
|
var k, checked;
|
21786
21853
|
|
@@ -21813,6 +21880,11 @@ define("tinymce/data/ObservableObject", [
|
|
21813
21880
|
}
|
21814
21881
|
}
|
21815
21882
|
|
21883
|
+
// Shallow compare nodes
|
21884
|
+
if (isNode(a) || isNode(b)) {
|
21885
|
+
return a === b;
|
21886
|
+
}
|
21887
|
+
|
21816
21888
|
// Compare objects
|
21817
21889
|
checked = {};
|
21818
21890
|
for (k in b) {
|
@@ -22769,6 +22841,12 @@ define("tinymce/ui/Collection", [
|
|
22769
22841
|
* Contributing: http://www.tinymce.com/contributing
|
22770
22842
|
*/
|
22771
22843
|
|
22844
|
+
/**
|
22845
|
+
* Private UI DomUtils proxy.
|
22846
|
+
*
|
22847
|
+
* @private
|
22848
|
+
* @class tinymce.ui.DomUtils
|
22849
|
+
*/
|
22772
22850
|
define("tinymce/ui/DomUtils", [
|
22773
22851
|
"tinymce/util/Tools",
|
22774
22852
|
"tinymce/dom/DOMUtils"
|
@@ -22876,6 +22954,7 @@ define("tinymce/ui/DomUtils", [
|
|
22876
22954
|
/**
|
22877
22955
|
* Utility class for box parsing and measuing.
|
22878
22956
|
*
|
22957
|
+
* @private
|
22879
22958
|
* @class tinymce.ui.BoxUtils
|
22880
22959
|
*/
|
22881
22960
|
define("tinymce/ui/BoxUtils", [
|
@@ -22976,6 +23055,7 @@ define("tinymce/ui/BoxUtils", [
|
|
22976
23055
|
/**
|
22977
23056
|
* Handles adding and removal of classes.
|
22978
23057
|
*
|
23058
|
+
* @private
|
22979
23059
|
* @class tinymce.ui.ClassList
|
22980
23060
|
*/
|
22981
23061
|
define("tinymce/ui/ClassList", [
|
@@ -27511,6 +27591,7 @@ define("tinymce/WindowManager", [
|
|
27511
27591
|
/**
|
27512
27592
|
* This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes.
|
27513
27593
|
*
|
27594
|
+
* @private
|
27514
27595
|
* @class tinymce.util.Quirks
|
27515
27596
|
*/
|
27516
27597
|
define("tinymce/util/Quirks", [
|
@@ -29675,6 +29756,36 @@ define("tinymce/util/Promise", [], function() {
|
|
29675
29756
|
/* jshint ignore:end */
|
29676
29757
|
/* eslint-enable */
|
29677
29758
|
|
29759
|
+
// Included from: js/tinymce/classes/util/Fun.js
|
29760
|
+
|
29761
|
+
/**
|
29762
|
+
* Fun.js
|
29763
|
+
*
|
29764
|
+
* Released under LGPL License.
|
29765
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
29766
|
+
*
|
29767
|
+
* License: http://www.tinymce.com/license
|
29768
|
+
* Contributing: http://www.tinymce.com/contributing
|
29769
|
+
*/
|
29770
|
+
|
29771
|
+
/**
|
29772
|
+
* Functional utility class.
|
29773
|
+
*
|
29774
|
+
* @private
|
29775
|
+
* @class tinymce.util.Fun
|
29776
|
+
*/
|
29777
|
+
define("tinymce/util/Fun", [], function() {
|
29778
|
+
function constant(value) {
|
29779
|
+
return function() {
|
29780
|
+
return value;
|
29781
|
+
};
|
29782
|
+
}
|
29783
|
+
|
29784
|
+
return {
|
29785
|
+
constant: constant
|
29786
|
+
};
|
29787
|
+
});
|
29788
|
+
|
29678
29789
|
// Included from: js/tinymce/classes/file/Uploader.js
|
29679
29790
|
|
29680
29791
|
/**
|
@@ -29708,9 +29819,12 @@ define("tinymce/util/Promise", [], function() {
|
|
29708
29819
|
*/
|
29709
29820
|
define("tinymce/file/Uploader", [
|
29710
29821
|
"tinymce/util/Promise",
|
29711
|
-
"tinymce/util/Tools"
|
29712
|
-
|
29822
|
+
"tinymce/util/Tools",
|
29823
|
+
"tinymce/util/Fun"
|
29824
|
+
], function(Promise, Tools, Fun) {
|
29713
29825
|
return function(settings) {
|
29826
|
+
var cachedPromises = {};
|
29827
|
+
|
29714
29828
|
function fileName(blobInfo) {
|
29715
29829
|
var ext, extensions;
|
29716
29830
|
|
@@ -29739,7 +29853,7 @@ define("tinymce/file/Uploader", [
|
|
29739
29853
|
id: blobInfo.id,
|
29740
29854
|
blob: blobInfo.blob,
|
29741
29855
|
base64: blobInfo.base64,
|
29742
|
-
filename:
|
29856
|
+
filename: Fun.constant(fileName(blobInfo))
|
29743
29857
|
};
|
29744
29858
|
}
|
29745
29859
|
|
@@ -29747,8 +29861,8 @@ define("tinymce/file/Uploader", [
|
|
29747
29861
|
var xhr, formData;
|
29748
29862
|
|
29749
29863
|
xhr = new XMLHttpRequest();
|
29750
|
-
xhr.withCredentials = settings.credentials;
|
29751
29864
|
xhr.open('POST', settings.url);
|
29865
|
+
xhr.withCredentials = settings.credentials;
|
29752
29866
|
|
29753
29867
|
xhr.onload = function() {
|
29754
29868
|
var json;
|
@@ -29775,53 +29889,57 @@ define("tinymce/file/Uploader", [
|
|
29775
29889
|
}
|
29776
29890
|
|
29777
29891
|
function upload(blobInfos) {
|
29778
|
-
|
29779
|
-
var handler = settings.handler, queue, index = 0, uploadedIdMap = {};
|
29892
|
+
var promises;
|
29780
29893
|
|
29781
|
-
|
29782
|
-
|
29894
|
+
// If no url is configured then resolve
|
29895
|
+
if (!settings.url && settings.handler === defaultHandler) {
|
29896
|
+
return new Promise(function(resolve) {
|
29783
29897
|
resolve([]);
|
29784
|
-
return;
|
29785
|
-
}
|
29786
|
-
|
29787
|
-
queue = Tools.map(blobInfos, function(blobInfo) {
|
29788
|
-
return {
|
29789
|
-
status: false,
|
29790
|
-
blobInfo: blobInfo,
|
29791
|
-
url: ''
|
29792
|
-
};
|
29793
29898
|
});
|
29899
|
+
}
|
29794
29900
|
|
29795
|
-
|
29796
|
-
|
29797
|
-
|
29798
|
-
if (!queueItem) {
|
29799
|
-
resolve(queue);
|
29800
|
-
return;
|
29801
|
-
}
|
29802
|
-
|
29803
|
-
// Only upload unique blob once
|
29804
|
-
previousResult = uploadedIdMap[queueItem.blobInfo.id()];
|
29805
|
-
if (previousResult) {
|
29806
|
-
queueItem.url = previousResult;
|
29807
|
-
queueItem.status = true;
|
29808
|
-
uploadNext();
|
29809
|
-
return;
|
29810
|
-
}
|
29901
|
+
function uploadBlobInfo(blobInfo) {
|
29902
|
+
return new Promise(function(resolve) {
|
29903
|
+
var handler = settings.handler;
|
29811
29904
|
|
29812
|
-
handler(blobInfoToData(
|
29813
|
-
|
29814
|
-
|
29815
|
-
|
29816
|
-
|
29905
|
+
handler(blobInfoToData(blobInfo), function(url) {
|
29906
|
+
resolve({
|
29907
|
+
url: url,
|
29908
|
+
blobInfo: blobInfo,
|
29909
|
+
status: true
|
29910
|
+
});
|
29817
29911
|
}, function(failure) {
|
29818
|
-
|
29819
|
-
|
29912
|
+
resolve({
|
29913
|
+
url: '',
|
29914
|
+
blobInfo: blobInfo,
|
29915
|
+
status: false,
|
29916
|
+
error: failure
|
29917
|
+
});
|
29820
29918
|
});
|
29919
|
+
});
|
29920
|
+
}
|
29921
|
+
|
29922
|
+
promises = Tools.map(blobInfos, function(blobInfo) {
|
29923
|
+
var newPromise, id = blobInfo.id();
|
29924
|
+
|
29925
|
+
if (cachedPromises[id]) {
|
29926
|
+
return cachedPromises[id];
|
29821
29927
|
}
|
29822
29928
|
|
29823
|
-
|
29929
|
+
newPromise = uploadBlobInfo(blobInfo).then(function(result) {
|
29930
|
+
delete cachedPromises[id];
|
29931
|
+
return result;
|
29932
|
+
})['catch'](function(error) {
|
29933
|
+
delete cachedPromises[id];
|
29934
|
+
return error;
|
29935
|
+
});
|
29936
|
+
|
29937
|
+
cachedPromises[id] = newPromise;
|
29938
|
+
|
29939
|
+
return newPromise;
|
29824
29940
|
});
|
29941
|
+
|
29942
|
+
return Promise.all(promises);
|
29825
29943
|
}
|
29826
29944
|
|
29827
29945
|
settings = Tools.extend({
|
@@ -29849,6 +29967,9 @@ define("tinymce/file/Uploader", [
|
|
29849
29967
|
|
29850
29968
|
/**
|
29851
29969
|
* Converts blob/uris back and forth.
|
29970
|
+
*
|
29971
|
+
* @private
|
29972
|
+
* @class tinymce.file.Conversions
|
29852
29973
|
*/
|
29853
29974
|
define("tinymce/file/Conversions", [
|
29854
29975
|
"tinymce/util/Promise"
|
@@ -29961,39 +30082,20 @@ define("tinymce/file/Conversions", [
|
|
29961
30082
|
*/
|
29962
30083
|
define("tinymce/file/ImageScanner", [
|
29963
30084
|
"tinymce/util/Promise",
|
29964
|
-
"tinymce/util/
|
29965
|
-
"tinymce/file/Conversions"
|
29966
|
-
|
30085
|
+
"tinymce/util/Arr",
|
30086
|
+
"tinymce/file/Conversions",
|
30087
|
+
"tinymce/Env"
|
30088
|
+
], function(Promise, Arr, Conversions, Env) {
|
29967
30089
|
var count = 0;
|
29968
30090
|
|
29969
|
-
function
|
29970
|
-
|
29971
|
-
var result = [];
|
29972
|
-
|
29973
|
-
function next(index) {
|
29974
|
-
fn(array[index], function(value) {
|
29975
|
-
result.push(value);
|
30091
|
+
return function(blobCache) {
|
30092
|
+
var cachedPromises = {};
|
29976
30093
|
|
29977
|
-
|
29978
|
-
|
29979
|
-
} else {
|
29980
|
-
resolve(result);
|
29981
|
-
}
|
29982
|
-
});
|
29983
|
-
}
|
29984
|
-
|
29985
|
-
if (array.length === 0) {
|
29986
|
-
resolve(result);
|
29987
|
-
} else {
|
29988
|
-
next(0);
|
29989
|
-
}
|
29990
|
-
});
|
29991
|
-
}
|
30094
|
+
function findAll(elm) {
|
30095
|
+
var images, promises;
|
29992
30096
|
|
29993
|
-
return {
|
29994
|
-
findAll: function(elm, blobCache) {
|
29995
30097
|
function imageToBlobInfo(img, resolve) {
|
29996
|
-
var base64, blobInfo
|
30098
|
+
var base64, blobInfo;
|
29997
30099
|
|
29998
30100
|
if (img.src.indexOf('blob:') === 0) {
|
29999
30101
|
blobInfo = blobCache.getByUri(img.src);
|
@@ -30008,7 +30110,6 @@ define("tinymce/file/ImageScanner", [
|
|
30008
30110
|
return;
|
30009
30111
|
}
|
30010
30112
|
|
30011
|
-
blobInfoId = 'blobid' + (count++);
|
30012
30113
|
base64 = Conversions.parseDataUri(img.src).data;
|
30013
30114
|
blobInfo = blobCache.findFirst(function(cachedBlobInfo) {
|
30014
30115
|
return cachedBlobInfo.base64() === base64;
|
@@ -30021,7 +30122,8 @@ define("tinymce/file/ImageScanner", [
|
|
30021
30122
|
});
|
30022
30123
|
} else {
|
30023
30124
|
Conversions.uriToBlob(img.src).then(function(blob) {
|
30024
|
-
var
|
30125
|
+
var blobInfoId = 'blobid' + (count++),
|
30126
|
+
blobInfo = blobCache.create(blobInfoId, blob, base64);
|
30025
30127
|
|
30026
30128
|
blobCache.add(blobInfo);
|
30027
30129
|
|
@@ -30033,10 +30135,65 @@ define("tinymce/file/ImageScanner", [
|
|
30033
30135
|
}
|
30034
30136
|
}
|
30035
30137
|
|
30036
|
-
|
30037
|
-
|
30038
|
-
|
30138
|
+
images = Arr.filter(elm.getElementsByTagName('img'), function(img) {
|
30139
|
+
var src = img.src;
|
30140
|
+
|
30141
|
+
if (!Env.fileApi) {
|
30142
|
+
return false;
|
30143
|
+
}
|
30144
|
+
|
30145
|
+
if (img.hasAttribute('data-mce-bogus')) {
|
30146
|
+
return false;
|
30147
|
+
}
|
30148
|
+
|
30149
|
+
if (img.hasAttribute('data-mce-placeholder')) {
|
30150
|
+
return false;
|
30151
|
+
}
|
30152
|
+
|
30153
|
+
if (!src || src == Env.transparentSrc) {
|
30154
|
+
return false;
|
30155
|
+
}
|
30156
|
+
|
30157
|
+
return src.indexOf('data:') === 0 || src.indexOf('blob:') === 0;
|
30158
|
+
});
|
30159
|
+
|
30160
|
+
promises = Arr.map(images, function(img) {
|
30161
|
+
var newPromise;
|
30162
|
+
|
30163
|
+
if (cachedPromises[img.src]) {
|
30164
|
+
// Since the cached promise will return the cached image
|
30165
|
+
// We need to wrap it and resolve with the actual image
|
30166
|
+
return new Promise(function(resolve) {
|
30167
|
+
cachedPromises[img.src].then(function(imageInfo) {
|
30168
|
+
resolve({
|
30169
|
+
image: img,
|
30170
|
+
blobInfo: imageInfo.blobInfo
|
30171
|
+
});
|
30172
|
+
});
|
30173
|
+
});
|
30174
|
+
}
|
30175
|
+
|
30176
|
+
newPromise = new Promise(function(resolve) {
|
30177
|
+
imageToBlobInfo(img, resolve);
|
30178
|
+
}).then(function(result) {
|
30179
|
+
delete cachedPromises[result.image.src];
|
30180
|
+
return result;
|
30181
|
+
})['catch'](function(error) {
|
30182
|
+
delete cachedPromises[img.src];
|
30183
|
+
return error;
|
30184
|
+
});
|
30185
|
+
|
30186
|
+
cachedPromises[img.src] = newPromise;
|
30187
|
+
|
30188
|
+
return newPromise;
|
30189
|
+
});
|
30190
|
+
|
30191
|
+
return Promise.all(promises);
|
30039
30192
|
}
|
30193
|
+
|
30194
|
+
return {
|
30195
|
+
findAll: findAll
|
30196
|
+
};
|
30040
30197
|
};
|
30041
30198
|
});
|
30042
30199
|
|
@@ -30059,10 +30216,11 @@ define("tinymce/file/ImageScanner", [
|
|
30059
30216
|
* @class tinymce.file.BlobCache
|
30060
30217
|
*/
|
30061
30218
|
define("tinymce/file/BlobCache", [
|
30062
|
-
"tinymce/util/
|
30063
|
-
|
30219
|
+
"tinymce/util/Arr",
|
30220
|
+
"tinymce/util/Fun"
|
30221
|
+
], function(Arr, Fun) {
|
30064
30222
|
return function() {
|
30065
|
-
var cache = [], constant =
|
30223
|
+
var cache = [], constant = Fun.constant;
|
30066
30224
|
|
30067
30225
|
function create(id, blob, base64) {
|
30068
30226
|
return {
|
@@ -30086,7 +30244,7 @@ define("tinymce/file/BlobCache", [
|
|
30086
30244
|
}
|
30087
30245
|
|
30088
30246
|
function findFirst(predicate) {
|
30089
|
-
return
|
30247
|
+
return Arr.filter(cache, predicate)[0];
|
30090
30248
|
}
|
30091
30249
|
|
30092
30250
|
function getByUri(blobUri) {
|
@@ -30096,7 +30254,7 @@ define("tinymce/file/BlobCache", [
|
|
30096
30254
|
}
|
30097
30255
|
|
30098
30256
|
function destroy() {
|
30099
|
-
|
30257
|
+
Arr.each(cache, function(cachedBlobInfo) {
|
30100
30258
|
URL.revokeObjectURL(cachedBlobInfo.blobUri());
|
30101
30259
|
});
|
30102
30260
|
|
@@ -30133,13 +30291,13 @@ define("tinymce/file/BlobCache", [
|
|
30133
30291
|
* @class tinymce.EditorUpload
|
30134
30292
|
*/
|
30135
30293
|
define("tinymce/EditorUpload", [
|
30136
|
-
"tinymce/util/
|
30294
|
+
"tinymce/util/Arr",
|
30137
30295
|
"tinymce/file/Uploader",
|
30138
30296
|
"tinymce/file/ImageScanner",
|
30139
30297
|
"tinymce/file/BlobCache"
|
30140
|
-
], function(
|
30298
|
+
], function(Arr, Uploader, ImageScanner, BlobCache) {
|
30141
30299
|
return function(editor) {
|
30142
|
-
var blobCache = new BlobCache();
|
30300
|
+
var blobCache = new BlobCache(), uploader, imageScanner;
|
30143
30301
|
|
30144
30302
|
// Replaces strings without regexps to avoid FF regexp to big issue
|
30145
30303
|
function replaceString(content, search, replace) {
|
@@ -30165,60 +30323,61 @@ define("tinymce/EditorUpload", [
|
|
30165
30323
|
}
|
30166
30324
|
|
30167
30325
|
function replaceUrlInUndoStack(targetUrl, replacementUrl) {
|
30168
|
-
|
30326
|
+
Arr.each(editor.undoManager.data, function(level) {
|
30169
30327
|
level.content = replaceImageUrl(level.content, targetUrl, replacementUrl);
|
30170
30328
|
});
|
30171
30329
|
}
|
30172
30330
|
|
30173
30331
|
function uploadImages(callback) {
|
30174
|
-
|
30175
|
-
|
30176
|
-
|
30177
|
-
|
30178
|
-
|
30179
|
-
|
30180
|
-
|
30181
|
-
function imageInfosToBlobInfos(imageInfos) {
|
30182
|
-
return Tools.map(imageInfos, function(imageInfo) {
|
30183
|
-
return imageInfo.blobInfo;
|
30332
|
+
if (!uploader) {
|
30333
|
+
uploader = new Uploader({
|
30334
|
+
url: editor.settings.images_upload_url,
|
30335
|
+
basePath: editor.settings.images_upload_base_path,
|
30336
|
+
credentials: editor.settings.images_upload_credentials,
|
30337
|
+
handler: editor.settings.images_upload_handler
|
30184
30338
|
});
|
30185
30339
|
}
|
30186
30340
|
|
30187
|
-
return scanForImages().then(
|
30188
|
-
|
30189
|
-
var image;
|
30341
|
+
return scanForImages().then(function(imageInfos) {
|
30342
|
+
var blobInfos;
|
30190
30343
|
|
30191
|
-
|
30344
|
+
blobInfos = Arr.map(imageInfos, function(imageInfo) {
|
30345
|
+
return imageInfo.blobInfo;
|
30346
|
+
});
|
30347
|
+
|
30348
|
+
return uploader.upload(blobInfos).then(function(result) {
|
30349
|
+
result = Arr.map(result, function(uploadInfo, index) {
|
30350
|
+
var image = imageInfos[index].image;
|
30192
30351
|
|
30193
|
-
if (image) {
|
30194
30352
|
replaceUrlInUndoStack(image.src, uploadInfo.url);
|
30195
30353
|
|
30196
30354
|
editor.$(image).attr({
|
30197
30355
|
src: uploadInfo.url,
|
30198
30356
|
'data-mce-src': editor.convertURL(uploadInfo.url, 'src')
|
30199
30357
|
});
|
30200
|
-
}
|
30201
30358
|
|
30202
|
-
|
30203
|
-
|
30204
|
-
|
30205
|
-
|
30206
|
-
|
30359
|
+
return {
|
30360
|
+
element: image,
|
30361
|
+
status: uploadInfo.status
|
30362
|
+
};
|
30363
|
+
});
|
30207
30364
|
|
30208
|
-
|
30209
|
-
|
30210
|
-
|
30365
|
+
if (callback) {
|
30366
|
+
callback(result);
|
30367
|
+
}
|
30211
30368
|
|
30212
|
-
|
30213
|
-
|
30214
|
-
// Silent
|
30215
|
-
// TODO: Maybe execute some failure callback here?
|
30369
|
+
return result;
|
30370
|
+
});
|
30216
30371
|
});
|
30217
30372
|
}
|
30218
30373
|
|
30219
30374
|
function scanForImages() {
|
30220
|
-
|
30221
|
-
|
30375
|
+
if (!imageScanner) {
|
30376
|
+
imageScanner = new ImageScanner(blobCache);
|
30377
|
+
}
|
30378
|
+
|
30379
|
+
return imageScanner.findAll(editor.getBody()).then(function(result) {
|
30380
|
+
Arr.each(result, function(resultItem) {
|
30222
30381
|
replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());
|
30223
30382
|
resultItem.image.src = resultItem.blobInfo.blobUri();
|
30224
30383
|
});
|
@@ -30229,6 +30388,7 @@ define("tinymce/EditorUpload", [
|
|
30229
30388
|
|
30230
30389
|
function destroy() {
|
30231
30390
|
blobCache.destroy();
|
30391
|
+
imageScanner = uploader = null;
|
30232
30392
|
}
|
30233
30393
|
|
30234
30394
|
function replaceBlobWithBase64(content) {
|
@@ -30236,7 +30396,7 @@ define("tinymce/EditorUpload", [
|
|
30236
30396
|
var blobInfo = blobCache.getByUri(blobUri);
|
30237
30397
|
|
30238
30398
|
if (!blobInfo) {
|
30239
|
-
blobInfo =
|
30399
|
+
blobInfo = Arr.reduce(editor.editorManager.editors, function(result, editor) {
|
30240
30400
|
return result || editor.editorUpload.blobCache.getByUri(blobUri);
|
30241
30401
|
}, null);
|
30242
30402
|
}
|
@@ -30995,8 +31155,8 @@ define("tinymce/Editor", [
|
|
30995
31155
|
},
|
30996
31156
|
|
30997
31157
|
/**
|
30998
|
-
* This method get called by the init method
|
30999
|
-
* It will fill the iframe with contents,
|
31158
|
+
* This method get called by the init method once the iframe is loaded.
|
31159
|
+
* It will fill the iframe with contents, sets up DOM and selection objects for the iframe.
|
31000
31160
|
*
|
31001
31161
|
* @method initContentBody
|
31002
31162
|
* @private
|
@@ -31054,7 +31214,7 @@ define("tinymce/Editor", [
|
|
31054
31214
|
self.editorUpload = new EditorUpload(self);
|
31055
31215
|
|
31056
31216
|
/**
|
31057
|
-
* Schema instance, enables you to validate elements and
|
31217
|
+
* Schema instance, enables you to validate elements and its children.
|
31058
31218
|
*
|
31059
31219
|
* @property schema
|
31060
31220
|
* @type tinymce.html.Schema
|
@@ -31486,7 +31646,7 @@ define("tinymce/Editor", [
|
|
31486
31646
|
},
|
31487
31647
|
|
31488
31648
|
/**
|
31489
|
-
*
|
31649
|
+
* Dispatches out a onNodeChange event to all observers. This method should be called when you
|
31490
31650
|
* need to update the UI states or element path etc.
|
31491
31651
|
*
|
31492
31652
|
* @method nodeChanged
|
@@ -31641,7 +31801,7 @@ define("tinymce/Editor", [
|
|
31641
31801
|
*
|
31642
31802
|
* @method addQueryStateHandler
|
31643
31803
|
* @param {String} name Command name to add/override.
|
31644
|
-
* @param {addQueryStateHandlerCallback} callback Function to execute when the command state
|
31804
|
+
* @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrieval occurs.
|
31645
31805
|
* @param {Object} scope Optional scope to execute the function in.
|
31646
31806
|
*/
|
31647
31807
|
addQueryStateHandler: function(name, callback, scope) {
|
@@ -31660,7 +31820,7 @@ define("tinymce/Editor", [
|
|
31660
31820
|
*
|
31661
31821
|
* @method addQueryValueHandler
|
31662
31822
|
* @param {String} name Command name to add/override.
|
31663
|
-
* @param {addQueryValueHandlerCallback} callback Function to execute when the command value
|
31823
|
+
* @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrieval occurs.
|
31664
31824
|
* @param {Object} scope Optional scope to execute the function in.
|
31665
31825
|
*/
|
31666
31826
|
addQueryValueHandler: function(name, callback, scope) {
|
@@ -31805,7 +31965,7 @@ define("tinymce/Editor", [
|
|
31805
31965
|
|
31806
31966
|
/**
|
31807
31967
|
* Sets the progress state, this will display a throbber/progess for the editor.
|
31808
|
-
* This is ideal for
|
31968
|
+
* This is ideal for asynchronous operations like an AJAX save call.
|
31809
31969
|
*
|
31810
31970
|
* @method setProgressState
|
31811
31971
|
* @param {Boolean} state Boolean state if the progress should be shown or hidden.
|
@@ -32905,7 +33065,7 @@ define("tinymce/EditorManager", [
|
|
32905
33065
|
* @property minorVersion
|
32906
33066
|
* @type String
|
32907
33067
|
*/
|
32908
|
-
minorVersion: '2.
|
33068
|
+
minorVersion: '2.5',
|
32909
33069
|
|
32910
33070
|
/**
|
32911
33071
|
* Release date of TinyMCE build.
|
@@ -32913,7 +33073,7 @@ define("tinymce/EditorManager", [
|
|
32913
33073
|
* @property releaseDate
|
32914
33074
|
* @type String
|
32915
33075
|
*/
|
32916
|
-
releaseDate: '2015-08-
|
33076
|
+
releaseDate: '2015-08-31',
|
32917
33077
|
|
32918
33078
|
/**
|
32919
33079
|
* Collection of editor instances.
|
@@ -32976,8 +33136,9 @@ define("tinymce/EditorManager", [
|
|
32976
33136
|
// tinymce.js tinymce.min.js tinymce.dev.js
|
32977
33137
|
// tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js
|
32978
33138
|
// tinymce.full.js tinymce.full.min.js tinymce.full.dev.js
|
33139
|
+
var srcScript = src.substring(src.lastIndexOf('/'));
|
32979
33140
|
if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
|
32980
|
-
if (
|
33141
|
+
if (srcScript.indexOf('.min') != -1) {
|
32981
33142
|
suffix = '.min';
|
32982
33143
|
}
|
32983
33144
|
|
@@ -33480,6 +33641,12 @@ define("tinymce/EditorManager", [
|
|
33480
33641
|
* Contributing: http://www.tinymce.com/contributing
|
33481
33642
|
*/
|
33482
33643
|
|
33644
|
+
/**
|
33645
|
+
* Converts legacy input to modern HTML.
|
33646
|
+
*
|
33647
|
+
* @class tinymce.LegacyInput
|
33648
|
+
* @private
|
33649
|
+
*/
|
33483
33650
|
define("tinymce/LegacyInput", [
|
33484
33651
|
"tinymce/EditorManager",
|
33485
33652
|
"tinymce/util/Tools"
|
@@ -34221,6 +34388,12 @@ define("tinymce/Compat", [
|
|
34221
34388
|
* @namespace tinymce.util
|
34222
34389
|
*/
|
34223
34390
|
|
34391
|
+
/**
|
34392
|
+
* Contains modules to handle data binding.
|
34393
|
+
*
|
34394
|
+
* @namespace tinymce.data
|
34395
|
+
*/
|
34396
|
+
|
34224
34397
|
// Included from: js/tinymce/classes/ui/Layout.js
|
34225
34398
|
|
34226
34399
|
/**
|
@@ -34739,9 +34912,13 @@ define("tinymce/ui/Button", [
|
|
34739
34912
|
* @method repaint
|
34740
34913
|
*/
|
34741
34914
|
repaint: function() {
|
34742
|
-
var
|
34915
|
+
var btnElm = this.getEl().firstChild,
|
34916
|
+
btnStyle;
|
34743
34917
|
|
34744
|
-
|
34918
|
+
if (btnElm) {
|
34919
|
+
btnStyle = btnElm.style;
|
34920
|
+
btnStyle.width = btnStyle.height = "100%";
|
34921
|
+
}
|
34745
34922
|
|
34746
34923
|
this._super();
|
34747
34924
|
},
|
@@ -40190,5 +40367,5 @@ define("tinymce/ui/Throbber", [
|
|
40190
40367
|
};
|
40191
40368
|
});
|
40192
40369
|
|
40193
|
-
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/
|
40370
|
+
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/Formatter","tinymce/UndoManager","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/util/Observable","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/ReflowQueue","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/util/Promise","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/ListBox","tinymce/ui/Radio","tinymce/ui/Rect","tinymce/ui/ResizeHandle","tinymce/ui/Slider","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
|
40194
40371
|
})(this);
|