| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,53 @@ |
| 1 |
+/** |
|
| 2 |
+ * $Id$ |
|
| 3 |
+ * |
|
| 4 |
+ * @author Moxiecode |
|
| 5 |
+ * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved. |
|
| 6 |
+ * |
|
| 7 |
+ * The contents of this file will be wrapped in a class later on. |
|
| 8 |
+ */ |
|
| 9 |
+ |
|
| 10 |
+/**#@+ |
|
| 11 |
+ * @member TinyMCE_Engine |
|
| 12 |
+ * @method |
|
| 13 |
+ */ |
|
| 14 |
+tinyMCE.add(TinyMCE_Engine, {
|
|
| 15 |
+ /** |
|
| 16 |
+ * Returns a cleared array, since some external libraries tend to extend the Array core object |
|
| 17 |
+ * arrays needs to be cleaned from these extended functions. So this function simply setting any |
|
| 18 |
+ * named properties to null. |
|
| 19 |
+ * |
|
| 20 |
+ * @param {Array} Name/Value array to clear.
|
|
| 21 |
+ * @return Cleared name/value array. |
|
| 22 |
+ * @type Array |
|
| 23 |
+ */ |
|
| 24 |
+ clearArray : function(a) {
|
|
| 25 |
+ var n; |
|
| 26 |
+ |
|
| 27 |
+ for (n in a) |
|
| 28 |
+ a[n] = null; |
|
| 29 |
+ |
|
| 30 |
+ return a; |
|
| 31 |
+ }, |
|
| 32 |
+ |
|
| 33 |
+ /** |
|
| 34 |
+ * Splits a string by the specified delimiter and skips any empty items. |
|
| 35 |
+ * |
|
| 36 |
+ * @param {string} d Delimiter to split by.
|
|
| 37 |
+ * @param {string} s String to split.
|
|
| 38 |
+ * @return Array with chunks from string. |
|
| 39 |
+ * @type Array |
|
| 40 |
+ */ |
|
| 41 |
+ explode : function(d, s) {
|
|
| 42 |
+ var ar = s.split(d), oar = [], i; |
|
| 43 |
+ |
|
| 44 |
+ for (i = 0; i<ar.length; i++) {
|
|
| 45 |
+ if (ar[i] !== '') |
|
| 46 |
+ oar[oar.length] = ar[i]; |
|
| 47 |
+ } |
|
| 48 |
+ |
|
| 49 |
+ return oar; |
|
| 50 |
+ } |
|
| 51 |
+}); |
|
| 52 |
+ |
|
| 53 |
+/**#@-*/ |