tinymce-rails 4.0.18 → 4.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/app/assets/source/tinymce/tinymce.jquery.js +466 -420
  4. data/app/assets/source/tinymce/tinymce.js +480 -427
  5. data/lib/tinymce/rails/version.rb +2 -2
  6. data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/example/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/layer/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  26. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/tinymce.jquery.js +10 -10
  31. data/vendor/assets/javascripts/tinymce/tinymce.js +10 -10
  32. metadata +2 -2
@@ -1,4 +1,4 @@
1
- // 4.0.18 (2014-02-27)
1
+ // 4.0.19 (2014-03-11)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -95,6 +95,7 @@
95
95
  */
96
96
 
97
97
  /*jshint loopfunc:true*/
98
+ /*eslint no-loop-func:0 */
98
99
 
99
100
  define("tinymce/dom/EventUtils", [], function() {
100
101
  "use strict";
@@ -653,6 +654,7 @@ define("tinymce/dom/EventUtils", [], function() {
653
654
  */
654
655
 
655
656
  /*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */
657
+ /*eslint dot-notation:0, no-empty:0, no-cond-assign:0, no-unused-expressions:0, new-cap:0, no-nested-ternary:0, func-style:0, no-bitwise: 0 */
656
658
 
657
659
  /*
658
660
  * Sizzle CSS Selector Engine
@@ -2673,6 +2675,7 @@ define("tinymce/dom/DomQuery", [
2673
2675
  var numericCssMap = makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom');
2674
2676
 
2675
2677
  function DomQuery(selector, context) {
2678
+ /*eslint new-cap:0 */
2676
2679
  return new DomQuery.fn.init(selector, context);
2677
2680
  }
2678
2681
 
@@ -2752,9 +2755,10 @@ define("tinymce/dom/DomQuery", [
2752
2755
  };
2753
2756
 
2754
2757
  var whiteSpaceRegExp = /^\s*|\s*$/g;
2755
- var trim = function(str) {
2758
+
2759
+ function trim(str) {
2756
2760
  return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
2757
- };
2761
+ }
2758
2762
 
2759
2763
  /**
2760
2764
  * Executes the callback function for each item in array/object. If you return false in the
@@ -3049,8 +3053,8 @@ define("tinymce/dom/DomQuery", [
3049
3053
  self.toggleClass(this, state);
3050
3054
  });
3051
3055
  } else {
3052
- self.each(function() {
3053
- var node = this, existingClassName;
3056
+ self.each(function(node) {
3057
+ var existingClassName;
3054
3058
 
3055
3059
  if (hasClass(node, className) !== state) {
3056
3060
  existingClassName = node.className;
@@ -3190,9 +3194,13 @@ define("tinymce/dom/DomQuery", [
3190
3194
  expr = ":not(" + expr + ")";
3191
3195
  }
3192
3196
 
3193
- return elems.length === 1 ?
3194
- DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] :
3195
- DomQuery.find.matches(expr, elems);
3197
+ if (elems.length === 1) {
3198
+ elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
3199
+ } else {
3200
+ elems = DomQuery.find.matches(expr, elems);
3201
+ }
3202
+
3203
+ return elems;
3196
3204
  }
3197
3205
  });
3198
3206
 
@@ -3328,6 +3336,7 @@ define("tinymce/dom/DomQuery", [
3328
3336
  define("tinymce/html/Styles", [], function() {
3329
3337
  return function(settings, schema) {
3330
3338
  /*jshint maxlen:255 */
3339
+ /*eslint max-len:0 */
3331
3340
  var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
3332
3341
  urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
3333
3342
  styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,
@@ -3730,9 +3739,10 @@ define("tinymce/util/Tools", [], function() {
3730
3739
  * @return {String} New string with removed whitespace.
3731
3740
  */
3732
3741
  var whiteSpaceRegExp = /^\s*|\s*$/g;
3733
- var trim = function(str) {
3742
+
3743
+ function trim(str) {
3734
3744
  return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
3735
- };
3745
+ }
3736
3746
 
3737
3747
  /**
3738
3748
  * Returns true/false if the object is an array or not.
@@ -3842,7 +3852,7 @@ define("tinymce/util/Tools", [], function() {
3842
3852
 
3843
3853
  if (o.length !== undefined) {
3844
3854
  // Indexed arrays, needed for Safari
3845
- for (n=0, l = o.length; n < l; n++) {
3855
+ for (n = 0, l = o.length; n < l; n++) {
3846
3856
  if (cb.call(s, o[n], n, o) === false) {
3847
3857
  return 0;
3848
3858
  }
@@ -3951,14 +3961,14 @@ define("tinymce/util/Tools", [], function() {
3951
3961
  * });
3952
3962
  */
3953
3963
  function create(s, p, root) {
3954
- var t = this, sp, ns, cn, scn, c, de = 0;
3964
+ var self = this, sp, ns, cn, scn, c, de = 0;
3955
3965
 
3956
3966
  // Parse : <prefix> <class>:<super class>
3957
3967
  s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
3958
3968
  cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
3959
3969
 
3960
3970
  // Create namespace for new class
3961
- ns = t.createNS(s[3].replace(/\.\w+$/, ''), root);
3971
+ ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
3962
3972
 
3963
3973
  // Class already exists
3964
3974
  if (ns[cn]) {
@@ -3984,11 +3994,11 @@ define("tinymce/util/Tools", [], function() {
3984
3994
 
3985
3995
  // Add constructor and methods
3986
3996
  ns[cn] = p[cn];
3987
- t.extend(ns[cn].prototype, p);
3997
+ self.extend(ns[cn].prototype, p);
3988
3998
 
3989
3999
  // Extend
3990
4000
  if (s[5]) {
3991
- sp = t.resolve(s[5]).prototype;
4001
+ sp = self.resolve(s[5]).prototype;
3992
4002
  scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
3993
4003
 
3994
4004
  // Extend constructor
@@ -4008,12 +4018,12 @@ define("tinymce/util/Tools", [], function() {
4008
4018
  ns[cn].prototype[cn] = ns[cn];
4009
4019
 
4010
4020
  // Add super methods
4011
- t.each(sp, function(f, n) {
4021
+ self.each(sp, function(f, n) {
4012
4022
  ns[cn].prototype[n] = sp[n];
4013
4023
  });
4014
4024
 
4015
4025
  // Add overridden methods
4016
- t.each(p, function(f, n) {
4026
+ self.each(p, function(f, n) {
4017
4027
  // Extend methods if needed
4018
4028
  if (sp[n]) {
4019
4029
  ns[cn].prototype[n] = function() {
@@ -4030,7 +4040,7 @@ define("tinymce/util/Tools", [], function() {
4030
4040
 
4031
4041
  // Add static methods
4032
4042
  /*jshint sub:true*/
4033
- t.each(p['static'], function(f, n) {
4043
+ self.each(p['static'], function(f, n) {
4034
4044
  ns[cn][n] = f;
4035
4045
  });
4036
4046
  }
@@ -4130,7 +4140,7 @@ define("tinymce/util/Tools", [], function() {
4130
4140
  o = o || window;
4131
4141
 
4132
4142
  n = n.split('.');
4133
- for (i=0; i<n.length; i++) {
4143
+ for (i = 0; i < n.length; i++) {
4134
4144
  v = n[i];
4135
4145
 
4136
4146
  if (!o[v]) {
@@ -4225,7 +4235,7 @@ define("tinymce/dom/Range", [
4225
4235
  ], function(Tools) {
4226
4236
  // Range constructor
4227
4237
  function Range(dom) {
4228
- var t = this,
4238
+ var self = this,
4229
4239
  doc = dom.doc,
4230
4240
  EXTRACT = 0,
4231
4241
  CLONE = 1,
@@ -4269,14 +4279,14 @@ define("tinymce/dom/Range", [
4269
4279
 
4270
4280
  function collapse(ts) {
4271
4281
  if (ts) {
4272
- t[END_CONTAINER] = t[START_CONTAINER];
4273
- t[END_OFFSET] = t[START_OFFSET];
4282
+ self[END_CONTAINER] = self[START_CONTAINER];
4283
+ self[END_OFFSET] = self[START_OFFSET];
4274
4284
  } else {
4275
- t[START_CONTAINER] = t[END_CONTAINER];
4276
- t[START_OFFSET] = t[END_OFFSET];
4285
+ self[START_CONTAINER] = self[END_CONTAINER];
4286
+ self[START_OFFSET] = self[END_OFFSET];
4277
4287
  }
4278
4288
 
4279
- t.collapsed = TRUE;
4289
+ self.collapsed = TRUE;
4280
4290
  }
4281
4291
 
4282
4292
  function selectNode(n) {
@@ -4290,7 +4300,7 @@ define("tinymce/dom/Range", [
4290
4300
  }
4291
4301
 
4292
4302
  function compareBoundaryPoints(h, r) {
4293
- var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET],
4303
+ var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET],
4294
4304
  rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
4295
4305
 
4296
4306
  // Check START_TO_START
@@ -4362,21 +4372,21 @@ define("tinymce/dom/Range", [
4362
4372
  }
4363
4373
 
4364
4374
  function surroundContents(n) {
4365
- var f = t.extractContents();
4375
+ var f = self.extractContents();
4366
4376
 
4367
- t.insertNode(n);
4377
+ self.insertNode(n);
4368
4378
  n.appendChild(f);
4369
- t.selectNode(n);
4379
+ self.selectNode(n);
4370
4380
  }
4371
4381
 
4372
4382
  function cloneRange() {
4373
4383
  return extend(new Range(dom), {
4374
- startContainer: t[START_CONTAINER],
4375
- startOffset: t[START_OFFSET],
4376
- endContainer: t[END_CONTAINER],
4377
- endOffset: t[END_OFFSET],
4378
- collapsed: t.collapsed,
4379
- commonAncestorContainer: t.commonAncestorContainer
4384
+ startContainer: self[START_CONTAINER],
4385
+ startOffset: self[START_OFFSET],
4386
+ endContainer: self[END_CONTAINER],
4387
+ endOffset: self[END_OFFSET],
4388
+ collapsed: self.collapsed,
4389
+ commonAncestorContainer: self.commonAncestorContainer
4380
4390
  });
4381
4391
  }
4382
4392
 
@@ -4407,7 +4417,7 @@ define("tinymce/dom/Range", [
4407
4417
  }
4408
4418
 
4409
4419
  function _isCollapsed() {
4410
- return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);
4420
+ return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]);
4411
4421
  }
4412
4422
 
4413
4423
  function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
@@ -4523,23 +4533,23 @@ define("tinymce/dom/Range", [
4523
4533
  var ec, sc;
4524
4534
 
4525
4535
  if (st) {
4526
- t[START_CONTAINER] = n;
4527
- t[START_OFFSET] = o;
4536
+ self[START_CONTAINER] = n;
4537
+ self[START_OFFSET] = o;
4528
4538
  } else {
4529
- t[END_CONTAINER] = n;
4530
- t[END_OFFSET] = o;
4539
+ self[END_CONTAINER] = n;
4540
+ self[END_OFFSET] = o;
4531
4541
  }
4532
4542
 
4533
4543
  // If one boundary-point of a Range is set to have a root container
4534
4544
  // other than the current one for the Range, the Range is collapsed to
4535
4545
  // the new position. This enforces the restriction that both boundary-
4536
4546
  // points of a Range must have the same root container.
4537
- ec = t[END_CONTAINER];
4547
+ ec = self[END_CONTAINER];
4538
4548
  while (ec.parentNode) {
4539
4549
  ec = ec.parentNode;
4540
4550
  }
4541
4551
 
4542
- sc = t[START_CONTAINER];
4552
+ sc = self[START_CONTAINER];
4543
4553
  while (sc.parentNode) {
4544
4554
  sc = sc.parentNode;
4545
4555
  }
@@ -4549,34 +4559,34 @@ define("tinymce/dom/Range", [
4549
4559
  // end position. To enforce this restriction, if the start is set to
4550
4560
  // be at a position after the end, the Range is collapsed to that
4551
4561
  // position.
4552
- if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) {
4553
- t.collapse(st);
4562
+ if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) {
4563
+ self.collapse(st);
4554
4564
  }
4555
4565
  } else {
4556
- t.collapse(st);
4566
+ self.collapse(st);
4557
4567
  }
4558
4568
 
4559
- t.collapsed = _isCollapsed();
4560
- t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);
4569
+ self.collapsed = _isCollapsed();
4570
+ self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]);
4561
4571
  }
4562
4572
 
4563
4573
  function _traverse(how) {
4564
4574
  var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
4565
4575
 
4566
- if (t[START_CONTAINER] == t[END_CONTAINER]) {
4576
+ if (self[START_CONTAINER] == self[END_CONTAINER]) {
4567
4577
  return _traverseSameContainer(how);
4568
4578
  }
4569
4579
 
4570
- for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
4571
- if (p == t[START_CONTAINER]) {
4580
+ for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
4581
+ if (p == self[START_CONTAINER]) {
4572
4582
  return _traverseCommonStartContainer(c, how);
4573
4583
  }
4574
4584
 
4575
4585
  ++endContainerDepth;
4576
4586
  }
4577
4587
 
4578
- for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
4579
- if (p == t[END_CONTAINER]) {
4588
+ for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
4589
+ if (p == self[END_CONTAINER]) {
4580
4590
  return _traverseCommonEndContainer(c, how);
4581
4591
  }
4582
4592
 
@@ -4585,13 +4595,13 @@ define("tinymce/dom/Range", [
4585
4595
 
4586
4596
  depthDiff = startContainerDepth - endContainerDepth;
4587
4597
 
4588
- startNode = t[START_CONTAINER];
4598
+ startNode = self[START_CONTAINER];
4589
4599
  while (depthDiff > 0) {
4590
4600
  startNode = startNode.parentNode;
4591
4601
  depthDiff--;
4592
4602
  }
4593
4603
 
4594
- endNode = t[END_CONTAINER];
4604
+ endNode = self[END_CONTAINER];
4595
4605
  while (depthDiff < 0) {
4596
4606
  endNode = endNode.parentNode;
4597
4607
  depthDiff++;
@@ -4614,21 +4624,21 @@ define("tinymce/dom/Range", [
4614
4624
  }
4615
4625
 
4616
4626
  // If selection is empty, just return the fragment
4617
- if (t[START_OFFSET] == t[END_OFFSET]) {
4627
+ if (self[START_OFFSET] == self[END_OFFSET]) {
4618
4628
  return frag;
4619
4629
  }
4620
4630
 
4621
4631
  // Text node needs special case handling
4622
- if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
4632
+ if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
4623
4633
  // get the substring
4624
- s = t[START_CONTAINER].nodeValue;
4625
- sub = s.substring(t[START_OFFSET], t[END_OFFSET]);
4634
+ s = self[START_CONTAINER].nodeValue;
4635
+ sub = s.substring(self[START_OFFSET], self[END_OFFSET]);
4626
4636
 
4627
4637
  // set the original text node to its new value
4628
4638
  if (how != CLONE) {
4629
- n = t[START_CONTAINER];
4630
- start = t[START_OFFSET];
4631
- len = t[END_OFFSET] - t[START_OFFSET];
4639
+ n = self[START_CONTAINER];
4640
+ start = self[START_OFFSET];
4641
+ len = self[END_OFFSET] - self[START_OFFSET];
4632
4642
 
4633
4643
  if (start === 0 && len >= n.nodeValue.length - 1) {
4634
4644
  n.parentNode.removeChild(n);
@@ -4637,7 +4647,7 @@ define("tinymce/dom/Range", [
4637
4647
  }
4638
4648
 
4639
4649
  // Nothing is partially selected, so collapse to start point
4640
- t.collapse(TRUE);
4650
+ self.collapse(TRUE);
4641
4651
  }
4642
4652
 
4643
4653
  if (how == DELETE) {
@@ -4652,8 +4662,8 @@ define("tinymce/dom/Range", [
4652
4662
  }
4653
4663
 
4654
4664
  // Copy nodes between the start/end offsets.
4655
- n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);
4656
- cnt = t[END_OFFSET] - t[START_OFFSET];
4665
+ n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]);
4666
+ cnt = self[END_OFFSET] - self[START_OFFSET];
4657
4667
 
4658
4668
  while (n && cnt > 0) {
4659
4669
  sibling = n.nextSibling;
@@ -4669,7 +4679,7 @@ define("tinymce/dom/Range", [
4669
4679
 
4670
4680
  // Nothing is partially selected, so collapse to start point
4671
4681
  if (how != CLONE) {
4672
- t.collapse(TRUE);
4682
+ self.collapse(TRUE);
4673
4683
  }
4674
4684
 
4675
4685
  return frag;
@@ -4689,14 +4699,14 @@ define("tinymce/dom/Range", [
4689
4699
  }
4690
4700
 
4691
4701
  endIdx = nodeIndex(endAncestor);
4692
- cnt = endIdx - t[START_OFFSET];
4702
+ cnt = endIdx - self[START_OFFSET];
4693
4703
 
4694
4704
  if (cnt <= 0) {
4695
4705
  // Collapse to just before the endAncestor, which
4696
4706
  // is partially selected.
4697
4707
  if (how != CLONE) {
4698
- t.setEndBefore(endAncestor);
4699
- t.collapse(FALSE);
4708
+ self.setEndBefore(endAncestor);
4709
+ self.collapse(FALSE);
4700
4710
  }
4701
4711
 
4702
4712
  return frag;
@@ -4718,8 +4728,8 @@ define("tinymce/dom/Range", [
4718
4728
  // Collapse to just before the endAncestor, which
4719
4729
  // is partially selected.
4720
4730
  if (how != CLONE) {
4721
- t.setEndBefore(endAncestor);
4722
- t.collapse(FALSE);
4731
+ self.setEndBefore(endAncestor);
4732
+ self.collapse(FALSE);
4723
4733
  }
4724
4734
 
4725
4735
  return frag;
@@ -4740,7 +4750,7 @@ define("tinymce/dom/Range", [
4740
4750
  startIdx = nodeIndex(startAncestor);
4741
4751
  ++startIdx; // Because we already traversed it
4742
4752
 
4743
- cnt = t[END_OFFSET] - startIdx;
4753
+ cnt = self[END_OFFSET] - startIdx;
4744
4754
  n = startAncestor.nextSibling;
4745
4755
  while (n && cnt > 0) {
4746
4756
  sibling = n.nextSibling;
@@ -4755,15 +4765,15 @@ define("tinymce/dom/Range", [
4755
4765
  }
4756
4766
 
4757
4767
  if (how != CLONE) {
4758
- t.setStartAfter(startAncestor);
4759
- t.collapse(TRUE);
4768
+ self.setStartAfter(startAncestor);
4769
+ self.collapse(TRUE);
4760
4770
  }
4761
4771
 
4762
4772
  return frag;
4763
4773
  }
4764
4774
 
4765
4775
  function _traverseCommonAncestors(startAncestor, endAncestor, how) {
4766
- var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;
4776
+ var n, frag, startOffset, endOffset, cnt, sibling, nextSibling;
4767
4777
 
4768
4778
  if (how != DELETE) {
4769
4779
  frag = createDocumentFragment();
@@ -4774,7 +4784,6 @@ define("tinymce/dom/Range", [
4774
4784
  frag.appendChild(n);
4775
4785
  }
4776
4786
 
4777
- commonParent = startAncestor.parentNode;
4778
4787
  startOffset = nodeIndex(startAncestor);
4779
4788
  endOffset = nodeIndex(endAncestor);
4780
4789
  ++startOffset;
@@ -4801,16 +4810,16 @@ define("tinymce/dom/Range", [
4801
4810
  }
4802
4811
 
4803
4812
  if (how != CLONE) {
4804
- t.setStartAfter(startAncestor);
4805
- t.collapse(TRUE);
4813
+ self.setStartAfter(startAncestor);
4814
+ self.collapse(TRUE);
4806
4815
  }
4807
4816
 
4808
4817
  return frag;
4809
4818
  }
4810
4819
 
4811
4820
  function _traverseRightBoundary(root, how) {
4812
- var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent;
4813
- var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];
4821
+ var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent;
4822
+ var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER];
4814
4823
 
4815
4824
  if (next == root) {
4816
4825
  return _traverseNode(next, isFullySelected, FALSE, how);
@@ -4850,7 +4859,7 @@ define("tinymce/dom/Range", [
4850
4859
  }
4851
4860
 
4852
4861
  function _traverseLeftBoundary(root, how) {
4853
- var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER];
4862
+ var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER];
4854
4863
  var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
4855
4864
 
4856
4865
  if (next == root) {
@@ -4901,11 +4910,11 @@ define("tinymce/dom/Range", [
4901
4910
  txtValue = n.nodeValue;
4902
4911
 
4903
4912
  if (isLeft) {
4904
- offset = t[START_OFFSET];
4913
+ offset = self[START_OFFSET];
4905
4914
  newNodeValue = txtValue.substring(offset);
4906
4915
  oldNodeValue = txtValue.substring(0, offset);
4907
4916
  } else {
4908
- offset = t[END_OFFSET];
4917
+ offset = self[END_OFFSET];
4909
4918
  newNodeValue = txtValue.substring(0, offset);
4910
4919
  oldNodeValue = txtValue.substring(offset);
4911
4920
  }
@@ -4943,7 +4952,7 @@ define("tinymce/dom/Range", [
4943
4952
  return dom.create('body', null, cloneContents()).outerText;
4944
4953
  }
4945
4954
 
4946
- extend(t, {
4955
+ extend(self, {
4947
4956
  // Inital states
4948
4957
  startContainer: doc,
4949
4958
  startOffset: 0,
@@ -4978,7 +4987,7 @@ define("tinymce/dom/Range", [
4978
4987
  toStringIE: toStringIE
4979
4988
  });
4980
4989
 
4981
- return t;
4990
+ return self;
4982
4991
  }
4983
4992
 
4984
4993
  // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
@@ -5002,6 +5011,7 @@ define("tinymce/dom/Range", [
5002
5011
  */
5003
5012
 
5004
5013
  /*jshint bitwise:false */
5014
+ /*eslint no-bitwise:0 */
5005
5015
 
5006
5016
  /**
5007
5017
  * Entity encoder class.
@@ -5394,190 +5404,190 @@ define("tinymce/Env", [], function() {
5394
5404
 
5395
5405
  // Included from: js/tinymce/classes/dom/StyleSheetLoader.js
5396
5406
 
5397
- /**
5398
- * StyleSheetLoader.js
5399
- *
5400
- * Copyright, Moxiecode Systems AB
5401
- * Released under LGPL License.
5402
- *
5403
- * License: http://www.tinymce.com/license
5404
- * Contributing: http://www.tinymce.com/contributing
5405
- */
5406
-
5407
- /**
5408
- * This class handles loading of external stylesheets and fires events when these are loaded.
5409
- *
5410
- * @class tinymce.dom.StyleSheetLoader
5411
- * @private
5412
- */
5413
- define("tinymce/dom/StyleSheetLoader", [], function() {
5414
- "use strict";
5415
-
5416
- return function(document, settings) {
5417
- var idCount = 0, loadedStates = {}, maxLoadTime;
5418
-
5419
- settings = settings || {};
5420
- maxLoadTime = settings.maxLoadTime || 5000;
5421
-
5422
- function appendToHead(node) {
5423
- document.getElementsByTagName('head')[0].appendChild(node);
5424
- }
5425
-
5426
- /**
5427
- * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
5428
- *
5429
- * @method load
5430
- * @param {String} url Url to be loaded.
5431
- * @param {Function} loadedCallback Callback to be executed when loaded.
5432
- * @param {Function} errorCallback Callback to be executed when failed loading.
5433
- */
5434
- function load(url, loadedCallback, errorCallback) {
5435
- var link, style, startTime, state;
5436
-
5437
- function passed() {
5438
- var callbacks = state.passed, i = callbacks.length;
5439
-
5440
- while (i--) {
5441
- callbacks[i]();
5442
- }
5443
-
5444
- state.status = 2;
5445
- state.passed = [];
5446
- state.failed = [];
5447
- }
5448
-
5449
- function failed() {
5450
- var callbacks = state.failed, i = callbacks.length;
5451
-
5452
- while (i--) {
5453
- callbacks[i]();
5454
- }
5455
-
5456
- state.status = 3;
5457
- state.passed = [];
5458
- state.failed = [];
5459
- }
5460
-
5461
- // Sniffs for older WebKit versions that have the link.onload but a broken one
5462
- function isOldWebKit() {
5463
- var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
5464
- return !!(webKitChunks && webKitChunks[1] < 536);
5465
- }
5466
-
5467
- // Calls the waitCallback until the test returns true or the timeout occurs
5468
- function wait(testCallback, waitCallback) {
5469
- if (!testCallback()) {
5470
- // Wait for timeout
5471
- if ((new Date().getTime()) - startTime < maxLoadTime) {
5472
- window.setTimeout(waitCallback, 0);
5473
- } else {
5474
- failed();
5475
- }
5476
- }
5477
- }
5478
-
5479
- // Workaround for WebKit that doesn't properly support the onload event for link elements
5480
- // Or WebKit that fires the onload event before the StyleSheet is added to the document
5481
- function waitForWebKitLinkLoaded() {
5482
- wait(function() {
5483
- var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
5484
-
5485
- while (i--) {
5486
- styleSheet = styleSheets[i];
5487
- owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
5488
- if (owner && owner.id === link.id) {
5489
- passed();
5490
- return true;
5491
- }
5492
- }
5493
- }, waitForWebKitLinkLoaded);
5494
- }
5495
-
5496
- // Workaround for older Geckos that doesn't have any onload event for StyleSheets
5497
- function waitForGeckoLinkLoaded() {
5498
- wait(function() {
5499
- try {
5500
- // Accessing the cssRules will throw an exception until the CSS file is loaded
5501
- var cssRules = style.sheet.cssRules;
5502
- passed();
5503
- return !!cssRules;
5504
- } catch (ex) {
5505
- // Ignore
5506
- }
5507
- }, waitForGeckoLinkLoaded);
5508
- }
5509
-
5510
- if (!loadedStates[url]) {
5511
- state = {
5512
- passed: [],
5513
- failed: []
5514
- };
5515
-
5516
- loadedStates[url] = state;
5517
- } else {
5518
- state = loadedStates[url];
5519
- }
5520
-
5521
- if (loadedCallback) {
5522
- state.passed.push(loadedCallback);
5523
- }
5524
-
5525
- if (errorCallback) {
5526
- state.failed.push(errorCallback);
5527
- }
5528
-
5529
- // Is loading wait for it to pass
5530
- if (state.status == 1) {
5531
- return;
5532
- }
5533
-
5534
- // Has finished loading and was success
5535
- if (state.status == 2) {
5536
- passed();
5537
- return;
5538
- }
5539
-
5540
- // Has finished loading and was a failure
5541
- if (state.status == 3) {
5542
- failed();
5543
- return;
5544
- }
5545
-
5546
- // Start loading
5547
- state.status = 1;
5548
- link = document.createElement('link');
5549
- link.rel = 'stylesheet';
5550
- link.type = 'text/css';
5551
- link.id = 'u' + (idCount++);
5552
- link.async = false;
5553
- link.defer = false;
5554
- startTime = new Date().getTime();
5555
-
5556
- // Feature detect onload on link element and sniff older webkits since it has an broken onload event
5557
- if ("onload" in link && !isOldWebKit()) {
5558
- link.onload = waitForWebKitLinkLoaded;
5559
- link.onerror = failed;
5560
- } else {
5561
- // Sniff for old Firefox that doesn't support the onload event on link elements
5562
- // TODO: Remove this in the future when everyone uses modern browsers
5563
- if (navigator.userAgent.indexOf("Firefox") > 0) {
5564
- style = document.createElement('style');
5565
- style.textContent = '@import "' + url + '"';
5566
- waitForGeckoLinkLoaded();
5567
- appendToHead(style);
5568
- return;
5569
- } else {
5570
- // Use the id owner on older webkits
5571
- waitForWebKitLinkLoaded();
5572
- }
5573
- }
5574
-
5575
- appendToHead(link);
5576
- link.href = url;
5577
- }
5578
-
5579
- this.load = load;
5580
- };
5407
+ /**
5408
+ * StyleSheetLoader.js
5409
+ *
5410
+ * Copyright, Moxiecode Systems AB
5411
+ * Released under LGPL License.
5412
+ *
5413
+ * License: http://www.tinymce.com/license
5414
+ * Contributing: http://www.tinymce.com/contributing
5415
+ */
5416
+
5417
+ /**
5418
+ * This class handles loading of external stylesheets and fires events when these are loaded.
5419
+ *
5420
+ * @class tinymce.dom.StyleSheetLoader
5421
+ * @private
5422
+ */
5423
+ define("tinymce/dom/StyleSheetLoader", [], function() {
5424
+ "use strict";
5425
+
5426
+ return function(document, settings) {
5427
+ var idCount = 0, loadedStates = {}, maxLoadTime;
5428
+
5429
+ settings = settings || {};
5430
+ maxLoadTime = settings.maxLoadTime || 5000;
5431
+
5432
+ function appendToHead(node) {
5433
+ document.getElementsByTagName('head')[0].appendChild(node);
5434
+ }
5435
+
5436
+ /**
5437
+ * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
5438
+ *
5439
+ * @method load
5440
+ * @param {String} url Url to be loaded.
5441
+ * @param {Function} loadedCallback Callback to be executed when loaded.
5442
+ * @param {Function} errorCallback Callback to be executed when failed loading.
5443
+ */
5444
+ function load(url, loadedCallback, errorCallback) {
5445
+ var link, style, startTime, state;
5446
+
5447
+ function passed() {
5448
+ var callbacks = state.passed, i = callbacks.length;
5449
+
5450
+ while (i--) {
5451
+ callbacks[i]();
5452
+ }
5453
+
5454
+ state.status = 2;
5455
+ state.passed = [];
5456
+ state.failed = [];
5457
+ }
5458
+
5459
+ function failed() {
5460
+ var callbacks = state.failed, i = callbacks.length;
5461
+
5462
+ while (i--) {
5463
+ callbacks[i]();
5464
+ }
5465
+
5466
+ state.status = 3;
5467
+ state.passed = [];
5468
+ state.failed = [];
5469
+ }
5470
+
5471
+ // Sniffs for older WebKit versions that have the link.onload but a broken one
5472
+ function isOldWebKit() {
5473
+ var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
5474
+ return !!(webKitChunks && webKitChunks[1] < 536);
5475
+ }
5476
+
5477
+ // Calls the waitCallback until the test returns true or the timeout occurs
5478
+ function wait(testCallback, waitCallback) {
5479
+ if (!testCallback()) {
5480
+ // Wait for timeout
5481
+ if ((new Date().getTime()) - startTime < maxLoadTime) {
5482
+ window.setTimeout(waitCallback, 0);
5483
+ } else {
5484
+ failed();
5485
+ }
5486
+ }
5487
+ }
5488
+
5489
+ // Workaround for WebKit that doesn't properly support the onload event for link elements
5490
+ // Or WebKit that fires the onload event before the StyleSheet is added to the document
5491
+ function waitForWebKitLinkLoaded() {
5492
+ wait(function() {
5493
+ var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
5494
+
5495
+ while (i--) {
5496
+ styleSheet = styleSheets[i];
5497
+ owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
5498
+ if (owner && owner.id === link.id) {
5499
+ passed();
5500
+ return true;
5501
+ }
5502
+ }
5503
+ }, waitForWebKitLinkLoaded);
5504
+ }
5505
+
5506
+ // Workaround for older Geckos that doesn't have any onload event for StyleSheets
5507
+ function waitForGeckoLinkLoaded() {
5508
+ wait(function() {
5509
+ try {
5510
+ // Accessing the cssRules will throw an exception until the CSS file is loaded
5511
+ var cssRules = style.sheet.cssRules;
5512
+ passed();
5513
+ return !!cssRules;
5514
+ } catch (ex) {
5515
+ // Ignore
5516
+ }
5517
+ }, waitForGeckoLinkLoaded);
5518
+ }
5519
+
5520
+ if (!loadedStates[url]) {
5521
+ state = {
5522
+ passed: [],
5523
+ failed: []
5524
+ };
5525
+
5526
+ loadedStates[url] = state;
5527
+ } else {
5528
+ state = loadedStates[url];
5529
+ }
5530
+
5531
+ if (loadedCallback) {
5532
+ state.passed.push(loadedCallback);
5533
+ }
5534
+
5535
+ if (errorCallback) {
5536
+ state.failed.push(errorCallback);
5537
+ }
5538
+
5539
+ // Is loading wait for it to pass
5540
+ if (state.status == 1) {
5541
+ return;
5542
+ }
5543
+
5544
+ // Has finished loading and was success
5545
+ if (state.status == 2) {
5546
+ passed();
5547
+ return;
5548
+ }
5549
+
5550
+ // Has finished loading and was a failure
5551
+ if (state.status == 3) {
5552
+ failed();
5553
+ return;
5554
+ }
5555
+
5556
+ // Start loading
5557
+ state.status = 1;
5558
+ link = document.createElement('link');
5559
+ link.rel = 'stylesheet';
5560
+ link.type = 'text/css';
5561
+ link.id = 'u' + (idCount++);
5562
+ link.async = false;
5563
+ link.defer = false;
5564
+ startTime = new Date().getTime();
5565
+
5566
+ // Feature detect onload on link element and sniff older webkits since it has an broken onload event
5567
+ if ("onload" in link && !isOldWebKit()) {
5568
+ link.onload = waitForWebKitLinkLoaded;
5569
+ link.onerror = failed;
5570
+ } else {
5571
+ // Sniff for old Firefox that doesn't support the onload event on link elements
5572
+ // TODO: Remove this in the future when everyone uses modern browsers
5573
+ if (navigator.userAgent.indexOf("Firefox") > 0) {
5574
+ style = document.createElement('style');
5575
+ style.textContent = '@import "' + url + '"';
5576
+ waitForGeckoLinkLoaded();
5577
+ appendToHead(style);
5578
+ return;
5579
+ } else {
5580
+ // Use the id owner on older webkits
5581
+ waitForWebKitLinkLoaded();
5582
+ }
5583
+ }
5584
+
5585
+ appendToHead(link);
5586
+ link.href = url;
5587
+ }
5588
+
5589
+ this.load = load;
5590
+ };
5581
5591
  });
5582
5592
 
5583
5593
  // Included from: js/tinymce/classes/dom/DOMUtils.js
@@ -6330,7 +6340,7 @@ define("tinymce/dom/DOMUtils", [
6330
6340
  * tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
6331
6341
  */
6332
6342
  setAttrib: function(e, n, v) {
6333
- var t = this;
6343
+ var self = this;
6334
6344
 
6335
6345
  // What's the point
6336
6346
  if (!e || !n) {
@@ -6338,14 +6348,14 @@ define("tinymce/dom/DOMUtils", [
6338
6348
  }
6339
6349
 
6340
6350
  return this.run(e, function(e) {
6341
- var s = t.settings;
6351
+ var s = self.settings;
6342
6352
  var originalValue = e.getAttribute(n);
6343
6353
  if (v !== null) {
6344
6354
  switch (n) {
6345
6355
  case "style":
6346
6356
  if (!is(v, 'string')) {
6347
6357
  each(v, function(v, n) {
6348
- t.setStyle(e, n, v);
6358
+ self.setStyle(e, n, v);
6349
6359
  });
6350
6360
 
6351
6361
  return;
@@ -6371,10 +6381,10 @@ define("tinymce/dom/DOMUtils", [
6371
6381
  case "href":
6372
6382
  if (s.keep_values) {
6373
6383
  if (s.url_converter) {
6374
- v = s.url_converter.call(s.url_converter_scope || t, v, n, e);
6384
+ v = s.url_converter.call(s.url_converter_scope || self, v, n, e);
6375
6385
  }
6376
6386
 
6377
- t.setAttrib(e, 'data-mce-' + n, v, 2);
6387
+ self.setAttrib(e, 'data-mce-' + n, v, 2);
6378
6388
  }
6379
6389
 
6380
6390
  break;
@@ -6943,7 +6953,7 @@ define("tinymce/dom/DOMUtils", [
6943
6953
  newElement.innerHTML = '<br />' + html;
6944
6954
 
6945
6955
  // Add all children from div to target
6946
- each (grep(newElement.childNodes), function(node, i) {
6956
+ each(grep(newElement.childNodes), function(node, i) {
6947
6957
  // Skip br element
6948
6958
  if (i && element.canHaveHTML) {
6949
6959
  element.appendChild(node);
@@ -7355,10 +7365,10 @@ define("tinymce/dom/DOMUtils", [
7355
7365
  * @return {Number} Index of the specified node.
7356
7366
  */
7357
7367
  nodeIndex: function(node, normalized) {
7358
- var idx = 0, lastNodeType, lastNode, nodeType;
7368
+ var idx = 0, lastNodeType, nodeType;
7359
7369
 
7360
7370
  if (node) {
7361
- for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {
7371
+ for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
7362
7372
  nodeType = node.nodeType;
7363
7373
 
7364
7374
  // Normalize text nodes
@@ -7740,6 +7750,8 @@ define("tinymce/dom/ScriptLoader", [
7740
7750
  }
7741
7751
 
7742
7752
  function error() {
7753
+ /*eslint no-console:0 */
7754
+
7743
7755
  // Report the error so it's easier for people to spot loading errors
7744
7756
  if (typeof(console) !== "undefined" && console.log) {
7745
7757
  console.log("Failed to load: " + url);
@@ -8052,10 +8064,10 @@ define("tinymce/AddOnManager", [
8052
8064
  * Loads an add-on from a specific url.
8053
8065
  *
8054
8066
  * @method load
8055
- * @param {String} n Short name of the add-on that gets loaded.
8056
- * @param {String} u URL to the add-on that will get loaded.
8057
- * @param {function} cb Optional callback to execute ones the add-on is loaded.
8058
- * @param {Object} s Optional scope to execute the callback in.
8067
+ * @param {String} name Short name of the add-on that gets loaded.
8068
+ * @param {String} addOnUrl URL to the add-on that will get loaded.
8069
+ * @param {function} callback Optional callback to execute ones the add-on is loaded.
8070
+ * @param {Object} scope Optional scope to execute the callback in.
8059
8071
  * @example
8060
8072
  * // Loads a plugin from an external URL
8061
8073
  * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
@@ -8066,45 +8078,45 @@ define("tinymce/AddOnManager", [
8066
8078
  * plugins: '-myplugin' // Don't try to load it again
8067
8079
  * });
8068
8080
  */
8069
- load: function(n, u, cb, s) {
8070
- var t = this, url = u;
8081
+ load: function(name, addOnUrl, callback, scope) {
8082
+ var self = this, url = addOnUrl;
8071
8083
 
8072
8084
  function loadDependencies() {
8073
- var dependencies = t.dependencies(n);
8085
+ var dependencies = self.dependencies(name);
8074
8086
 
8075
8087
  each(dependencies, function(dep) {
8076
- var newUrl = t.createUrl(u, dep);
8088
+ var newUrl = self.createUrl(addOnUrl, dep);
8077
8089
 
8078
- t.load(newUrl.resource, newUrl, undefined, undefined);
8090
+ self.load(newUrl.resource, newUrl, undefined, undefined);
8079
8091
  });
8080
8092
 
8081
- if (cb) {
8082
- if (s) {
8083
- cb.call(s);
8093
+ if (callback) {
8094
+ if (scope) {
8095
+ callback.call(scope);
8084
8096
  } else {
8085
- cb.call(ScriptLoader);
8097
+ callback.call(ScriptLoader);
8086
8098
  }
8087
8099
  }
8088
8100
  }
8089
8101
 
8090
- if (t.urls[n]) {
8102
+ if (self.urls[name]) {
8091
8103
  return;
8092
8104
  }
8093
8105
 
8094
- if (typeof u === "object") {
8095
- url = u.prefix + u.resource + u.suffix;
8106
+ if (typeof addOnUrl === "object") {
8107
+ url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
8096
8108
  }
8097
8109
 
8098
8110
  if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) {
8099
8111
  url = AddOnManager.baseURL + '/' + url;
8100
8112
  }
8101
8113
 
8102
- t.urls[n] = url.substring(0, url.lastIndexOf('/'));
8114
+ self.urls[name] = url.substring(0, url.lastIndexOf('/'));
8103
8115
 
8104
- if (t.lookup[n]) {
8116
+ if (self.lookup[name]) {
8105
8117
  loadDependencies();
8106
8118
  } else {
8107
- ScriptLoader.ScriptLoader.add(url, loadDependencies, s);
8119
+ ScriptLoader.ScriptLoader.add(url, loadDependencies, scope);
8108
8120
  }
8109
8121
  }
8110
8122
  };
@@ -8718,7 +8730,7 @@ define("tinymce/html/Schema", [
8718
8730
  * @return {Object} Schema lookup table.
8719
8731
  */
8720
8732
  function compileSchema(type) {
8721
- var schema = {}, globalAttributes, eventAttributes, blockContent;
8733
+ var schema = {}, globalAttributes, blockContent;
8722
8734
  var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
8723
8735
 
8724
8736
  function add(name, attributes, children) {
@@ -8786,13 +8798,13 @@ define("tinymce/html/Schema", [
8786
8798
  globalAttributes = split("id accesskey class dir lang style tabindex title");
8787
8799
 
8788
8800
  // Event attributes can be opt-in/opt-out
8789
- eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " +
8801
+ /*eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " +
8790
8802
  "ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended " +
8791
8803
  "onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart " +
8792
8804
  "onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange " +
8793
8805
  "onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange " +
8794
8806
  "onwaiting"
8795
- );
8807
+ );*/
8796
8808
 
8797
8809
  // Block content elements
8798
8810
  blockContent = split(
@@ -9619,6 +9631,8 @@ define("tinymce/html/Schema", [
9619
9631
  * Contributing: http://www.tinymce.com/contributing
9620
9632
  */
9621
9633
 
9634
+ /*eslint max-depth:[2, 9] */
9635
+
9622
9636
  /**
9623
9637
  * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will
9624
9638
  * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements
@@ -9675,7 +9689,9 @@ define("tinymce/html/SaxParser", [
9675
9689
  * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
9676
9690
  */
9677
9691
  return function(settings, schema) {
9678
- var self = this, noop = function() {};
9692
+ var self = this;
9693
+
9694
+ function noop() {}
9679
9695
 
9680
9696
  settings = settings || {};
9681
9697
  self.schema = schema = schema || new Schema();
@@ -11283,6 +11299,7 @@ define("tinymce/dom/Serializer", [
11283
11299
 
11284
11300
  function trim(value) {
11285
11301
  /*jshint maxlen:255 */
11302
+ /*eslint max-len:0 */
11286
11303
  return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n')
11287
11304
  .replace(/^[\r\n]*|[\r\n]*$/g, '')
11288
11305
  .replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '')
@@ -12154,19 +12171,21 @@ define("tinymce/dom/ControlSelection", [
12154
12171
  );
12155
12172
 
12156
12173
  function isResizable(elm) {
12157
- if (editor.settings.object_resizing === false) {
12174
+ var selector = editor.settings.object_resizing;
12175
+
12176
+ if (selector === false || Env.iOS) {
12158
12177
  return false;
12159
12178
  }
12160
12179
 
12161
- if (!/TABLE|IMG|DIV/.test(elm.nodeName)) {
12162
- return false;
12180
+ if (typeof selector != 'string') {
12181
+ selector = 'table,img,div';
12163
12182
  }
12164
12183
 
12165
12184
  if (elm.getAttribute('data-mce-resize') === 'false') {
12166
12185
  return false;
12167
12186
  }
12168
12187
 
12169
- return true;
12188
+ return editor.dom.is(elm, selector);
12170
12189
  }
12171
12190
 
12172
12191
  function resizeGhostElement(e) {
@@ -12536,6 +12555,14 @@ define("tinymce/dom/ControlSelection", [
12536
12555
  editor.dom.bind(editor.getBody(), 'mscontrolselect', function(e) {
12537
12556
  if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
12538
12557
  e.preventDefault();
12558
+
12559
+ // This moves the selection from being a control selection to a text like selection like in WebKit #6753
12560
+ // TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections.
12561
+ if (e.target.tagName == 'IMG') {
12562
+ window.setTimeout(function() {
12563
+ editor.selection.select(e.target);
12564
+ }, 0);
12565
+ }
12539
12566
  }
12540
12567
  });
12541
12568
  }
@@ -13401,7 +13428,7 @@ define("tinymce/dom/Selection", [
13401
13428
  * tinymce.activeEditor.selection.moveToBookmark(bm);
13402
13429
  */
13403
13430
  getBookmark: function(type, normalized) {
13404
- var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
13431
+ var self = this, dom = self.dom, rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
13405
13432
 
13406
13433
  function findIndex(name, element) {
13407
13434
  var index = 0;
@@ -13439,7 +13466,7 @@ define("tinymce/dom/Selection", [
13439
13466
  }
13440
13467
 
13441
13468
  function getLocation() {
13442
- var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};
13469
+ var rng = self.getRng(true), root = dom.getRoot(), bookmark = {};
13443
13470
 
13444
13471
  function getPoint(rng, start) {
13445
13472
  var container = rng[start ? 'startContainer' : 'endContainer'],
@@ -13461,11 +13488,11 @@ define("tinymce/dom/Selection", [
13461
13488
  offset = Math.max(0, childNodes.length - 1);
13462
13489
  }
13463
13490
 
13464
- point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);
13491
+ point.push(self.dom.nodeIndex(childNodes[offset], normalized) + after);
13465
13492
  }
13466
13493
 
13467
13494
  for (; container && container != root; container = container.parentNode) {
13468
- point.push(t.dom.nodeIndex(container, normalized));
13495
+ point.push(self.dom.nodeIndex(container, normalized));
13469
13496
  }
13470
13497
 
13471
13498
  return point;
@@ -13473,7 +13500,7 @@ define("tinymce/dom/Selection", [
13473
13500
 
13474
13501
  bookmark.start = getPoint(rng, true);
13475
13502
 
13476
- if (!t.isCollapsed()) {
13503
+ if (!self.isCollapsed()) {
13477
13504
  bookmark.end = getPoint(rng);
13478
13505
  }
13479
13506
 
@@ -13481,15 +13508,15 @@ define("tinymce/dom/Selection", [
13481
13508
  }
13482
13509
 
13483
13510
  if (type == 2) {
13484
- element = t.getNode();
13511
+ element = self.getNode();
13485
13512
  name = element ? element.nodeName : null;
13486
13513
 
13487
13514
  if (name == 'IMG') {
13488
13515
  return {name: name, index: findIndex(name, element)};
13489
13516
  }
13490
13517
 
13491
- if (t.tridentSel) {
13492
- return t.tridentSel.getBookmark(type);
13518
+ if (self.tridentSel) {
13519
+ return self.tridentSel.getBookmark(type);
13493
13520
  }
13494
13521
 
13495
13522
  return getLocation();
@@ -13497,12 +13524,12 @@ define("tinymce/dom/Selection", [
13497
13524
 
13498
13525
  // Handle simple range
13499
13526
  if (type) {
13500
- return {rng: t.getRng()};
13527
+ return {rng: self.getRng()};
13501
13528
  }
13502
13529
 
13503
- rng = t.getRng();
13530
+ rng = self.getRng();
13504
13531
  id = dom.uniqueId();
13505
- collapsed = t.isCollapsed();
13532
+ collapsed = self.isCollapsed();
13506
13533
  styles = 'overflow:hidden;line-height:0px';
13507
13534
 
13508
13535
  // Explorer method
@@ -13541,7 +13568,7 @@ define("tinymce/dom/Selection", [
13541
13568
  return {name: name, index: findIndex(name, element)};
13542
13569
  }
13543
13570
  } else {
13544
- element = t.getNode();
13571
+ element = self.getNode();
13545
13572
  name = element.nodeName;
13546
13573
  if (name == 'IMG') {
13547
13574
  return {name: name, index: findIndex(name, element)};
@@ -13561,7 +13588,7 @@ define("tinymce/dom/Selection", [
13561
13588
  rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
13562
13589
  }
13563
13590
 
13564
- t.moveToBookmark({id: id, keep: 1});
13591
+ self.moveToBookmark({id: id, keep: 1});
13565
13592
 
13566
13593
  return {id: id};
13567
13594
  },
@@ -13582,7 +13609,7 @@ define("tinymce/dom/Selection", [
13582
13609
  * tinymce.activeEditor.selection.moveToBookmark(bm);
13583
13610
  */
13584
13611
  moveToBookmark: function(bookmark) {
13585
- var t = this, dom = t.dom, rng, root, startContainer, endContainer, startOffset, endOffset;
13612
+ var self = this, dom = self.dom, rng, root, startContainer, endContainer, startOffset, endOffset;
13586
13613
 
13587
13614
  function setEndPoint(start) {
13588
13615
  var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
@@ -13702,12 +13729,12 @@ define("tinymce/dom/Selection", [
13702
13729
  rng = dom.createRng();
13703
13730
  root = dom.getRoot();
13704
13731
 
13705
- if (t.tridentSel) {
13706
- return t.tridentSel.moveToBookmark(bookmark);
13732
+ if (self.tridentSel) {
13733
+ return self.tridentSel.moveToBookmark(bookmark);
13707
13734
  }
13708
13735
 
13709
13736
  if (setEndPoint(true) && setEndPoint()) {
13710
- t.setRng(rng);
13737
+ self.setRng(rng);
13711
13738
  }
13712
13739
  } else if (bookmark.id) {
13713
13740
  // Restore start/end points
@@ -13718,12 +13745,12 @@ define("tinymce/dom/Selection", [
13718
13745
  rng = dom.createRng();
13719
13746
  rng.setStart(addBogus(startContainer), startOffset);
13720
13747
  rng.setEnd(addBogus(endContainer), endOffset);
13721
- t.setRng(rng);
13748
+ self.setRng(rng);
13722
13749
  }
13723
13750
  } else if (bookmark.name) {
13724
- t.select(dom.select(bookmark.name)[bookmark.index]);
13751
+ self.select(dom.select(bookmark.name)[bookmark.index]);
13725
13752
  } else if (bookmark.rng) {
13726
- t.setRng(bookmark.rng);
13753
+ self.setRng(bookmark.rng);
13727
13754
  }
13728
13755
  }
13729
13756
  },
@@ -15694,7 +15721,8 @@ define("tinymce/Formatter", [
15694
15721
  }
15695
15722
  }
15696
15723
 
15697
- for (;;) {
15724
+ /*eslint no-constant-condition:0 */
15725
+ while (true) {
15698
15726
  // Stop expanding on block elements
15699
15727
  if (!format[0].block_expand && isBlock(parent)) {
15700
15728
  return parent;
@@ -16773,7 +16801,7 @@ define("tinymce/UndoManager", [
16773
16801
  ].join('|'), 'gi');
16774
16802
 
16775
16803
  return function(editor) {
16776
- var self, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock;
16804
+ var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock;
16777
16805
 
16778
16806
  // Returns a trimmed version of the current editor contents
16779
16807
  function getContent() {
@@ -18681,6 +18709,7 @@ define("tinymce/util/URI", [
18681
18709
  url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
18682
18710
 
18683
18711
  /*jshint maxlen: 255 */
18712
+ /*eslint max-len: 0 */
18684
18713
  url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
18685
18714
 
18686
18715
  each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {
@@ -19014,16 +19043,14 @@ define("tinymce/util/Class", [
19014
19043
 
19015
19044
  // Provides classical inheritance, based on code made by John Resig
19016
19045
  Class.extend = extendClass = function(prop) {
19017
- var Self = this, _super = Self.prototype, prototype, name, member;
19046
+ var self = this, _super = self.prototype, prototype, name, member;
19018
19047
 
19019
19048
  // The dummy class constructor
19020
19049
  function Class() {
19021
- var i, mixins, mixin, self;
19050
+ var i, mixins, mixin, self = this;
19022
19051
 
19023
19052
  // All construction is actually done in the init method
19024
19053
  if (!initializing) {
19025
- self = this;
19026
-
19027
19054
  // Run class constuctor
19028
19055
  if (self.init) {
19029
19056
  self.init.apply(self, arguments);
@@ -19065,7 +19092,7 @@ define("tinymce/util/Class", [
19065
19092
  // Instantiate a base class (but only create the instance,
19066
19093
  // don't run the init constructor)
19067
19094
  initializing = true;
19068
- prototype = new Self();
19095
+ prototype = new self();
19069
19096
  initializing = false;
19070
19097
 
19071
19098
  // Add mixins
@@ -19163,6 +19190,8 @@ define("tinymce/util/Class", [
19163
19190
  * Contributing: http://www.tinymce.com/contributing
19164
19191
  */
19165
19192
 
19193
+ /*eslint no-nested-ternary:0 */
19194
+
19166
19195
  /**
19167
19196
  * Selector engine, enables you to select controls by using CSS like expressions.
19168
19197
  * We currently only support basic CSS expressions to reduce the size of the core
@@ -19227,6 +19256,7 @@ define("tinymce/ui/Selector", [
19227
19256
  var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
19228
19257
 
19229
19258
  /*jshint maxlen:255 */
19259
+ /*eslint max-len:0 */
19230
19260
  var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
19231
19261
  whiteSpace = /^\s*|\s*$/g,
19232
19262
  Collection;
@@ -20063,6 +20093,8 @@ define("tinymce/ui/DomUtils", [
20063
20093
  * Contributing: http://www.tinymce.com/contributing
20064
20094
  */
20065
20095
 
20096
+ /*eslint consistent-this:0 */
20097
+
20066
20098
  /**
20067
20099
  * This is the base class for all controls and containers. All UI control instances inherit
20068
20100
  * from this one as it has the base logic needed by all of them.
@@ -20774,10 +20806,10 @@ define("tinymce/ui/Control", [
20774
20806
  * @return {tinymce.ui.Collection} Collection with all parent controls.
20775
20807
  */
20776
20808
  parents: function(selector) {
20777
- var ctrl = this, parents = new Collection();
20809
+ var self = this, ctrl, parents = new Collection();
20778
20810
 
20779
20811
  // Add each parent to collection
20780
- for (ctrl = ctrl.parent(); ctrl; ctrl = ctrl.parent()) {
20812
+ for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
20781
20813
  parents.add(ctrl);
20782
20814
  }
20783
20815
 
@@ -21422,10 +21454,10 @@ define("tinymce/ui/Control", [
21422
21454
  e.preventDefault();
21423
21455
 
21424
21456
  if (e.type == "mousewheel") {
21425
- e.deltaY = - 1/40 * e.wheelDelta;
21457
+ e.deltaY = -1 / 40 * e.wheelDelta;
21426
21458
 
21427
21459
  if (e.wheelDeltaX) {
21428
- e.deltaX = -1/40 * e.wheelDeltaX;
21460
+ e.deltaX = -1 / 40 * e.wheelDeltaX;
21429
21461
  }
21430
21462
  } else {
21431
21463
  e.deltaX = 0;
@@ -22493,7 +22525,7 @@ define("tinymce/ui/Container", [
22493
22525
 
22494
22526
  return (
22495
22527
  '<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
22496
- '<div id="' + self._id + '-body" class="' + self.classes('body') + '">'+
22528
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
22497
22529
  (self.settings.html || '') + layout.renderHtml(self) +
22498
22530
  '</div>' +
22499
22531
  '</div>'
@@ -22584,13 +22616,13 @@ define("tinymce/ui/Container", [
22584
22616
  * @return {tinymce.ui.Container} Current container instance.
22585
22617
  */
22586
22618
  reflow: function() {
22587
- var i, items;
22619
+ var i;
22588
22620
 
22589
22621
  if (this.visible()) {
22590
22622
  Control.repaintControls = [];
22591
22623
  Control.repaintControls.map = {};
22592
22624
 
22593
- items = this.recalc();
22625
+ this.recalc();
22594
22626
  i = Control.repaintControls.length;
22595
22627
 
22596
22628
  while (i--) {
@@ -24515,7 +24547,7 @@ define("tinymce/util/Quirks", [
24515
24547
  * fix seemed like a huge task. I hope we can remove this before the year 2030.
24516
24548
  */
24517
24549
  function cleanupStylesWhenDeleting() {
24518
- var doc = editor.getDoc();
24550
+ var doc = editor.getDoc(), urlPrefix = 'data:text/mce-internal,';
24519
24551
 
24520
24552
  if (!window.MutationObserver) {
24521
24553
  return;
@@ -24630,14 +24662,20 @@ define("tinymce/util/Quirks", [
24630
24662
  });
24631
24663
 
24632
24664
  editor.on('dragstart', function(e) {
24633
- e.dataTransfer.setData('mce-internal', editor.selection.getContent());
24665
+ // Safari doesn't support custom dataTransfer items so we can only use URL and Text
24666
+ e.dataTransfer.setData('URL', 'data:text/mce-internal,' + escape(editor.selection.getContent()));
24634
24667
  });
24635
24668
 
24636
24669
  editor.on('drop', function(e) {
24637
24670
  if (!isDefaultPrevented(e)) {
24638
- var internalContent = e.dataTransfer.getData('mce-internal');
24671
+ var internalContent = e.dataTransfer.getData('URL');
24639
24672
 
24640
- if (internalContent && doc.caretRangeFromPoint) {
24673
+ if (!internalContent || internalContent.indexOf(urlPrefix) == -1 || !doc.caretRangeFromPoint) {
24674
+ return;
24675
+ }
24676
+
24677
+ internalContent = unescape(internalContent.substr(urlPrefix.length));
24678
+ if (doc.caretRangeFromPoint) {
24641
24679
  e.preventDefault();
24642
24680
  customDelete();
24643
24681
  editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
@@ -25423,16 +25461,20 @@ define("tinymce/util/Quirks", [
25423
25461
 
25424
25462
  /**
25425
25463
  * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when
25426
- * the iframe is hidden by display: none. This workaround solves this by switching
25427
- * on designMode on the whole document.
25464
+ * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync
25465
+ * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML
25466
+ * but not as the lastChild of the body. However is we add a BR element to the body then remove it
25467
+ * it doesn't seem to add these BR elements makes sence right?!
25428
25468
  *
25429
- * Example this: <body>text</body> becomes <body>text<br><br></body>
25469
+ * Example of what happens: <body>text</body> becomes <body>text<br><br></body>
25430
25470
  */
25431
25471
  function doubleTrailingBrElements() {
25432
25472
  if (!editor.inline) {
25433
- editor.on('init', function() {
25434
- editor.getDoc().designMode = 'on';
25435
- });
25473
+ editor.on('focus blur', function() {
25474
+ var br = editor.dom.create('br');
25475
+ editor.getBody().appendChild(br);
25476
+ br.parentNode.removeChild(br);
25477
+ }, true);
25436
25478
  }
25437
25479
  }
25438
25480
 
@@ -25544,6 +25586,10 @@ define("tinymce/util/Observable", [
25544
25586
  fire: function(name, args, bubble) {
25545
25587
  var self = this, handlers, i, l, callback, parent;
25546
25588
 
25589
+ if (self.removed) {
25590
+ return;
25591
+ }
25592
+
25547
25593
  name = name.toLowerCase();
25548
25594
  args = args || {};
25549
25595
  args.type = name;
@@ -25617,13 +25663,14 @@ define("tinymce/util/Observable", [
25617
25663
  * @method on
25618
25664
  * @param {String} name Event name or space separated list of events to bind.
25619
25665
  * @param {callback} callback Callback to be executed when the event occurs.
25666
+ * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
25620
25667
  * @return {Object} Current class instance.
25621
25668
  * @example
25622
25669
  * instance.on('event', function(e) {
25623
25670
  * // Callback logic
25624
25671
  * });
25625
25672
  */
25626
- on: function(name, callback) {
25673
+ on: function(name, callback, prepend) {
25627
25674
  var self = this, bindings, handlers, names, i;
25628
25675
 
25629
25676
  if (callback === false) {
@@ -25651,7 +25698,11 @@ define("tinymce/util/Observable", [
25651
25698
  }
25652
25699
  }
25653
25700
 
25654
- handlers.push(callback);
25701
+ if (prepend) {
25702
+ handlers.unshift(callback);
25703
+ } else {
25704
+ handlers.push(callback);
25705
+ }
25655
25706
  }
25656
25707
  }
25657
25708
 
@@ -26324,7 +26375,7 @@ define("tinymce/Editor", [
26324
26375
  */
26325
26376
  init: function() {
26326
26377
  var self = this, settings = self.settings, elm = self.getElement();
26327
- var w, h, minHeight, n, o, url, bodyId, bodyClass, re, i, initializedPlugins = [];
26378
+ var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = [];
26328
26379
 
26329
26380
  self.rtl = this.editorManager.i18n.rtl;
26330
26381
  self.editorManager.add(self);
@@ -26343,8 +26394,8 @@ define("tinymce/Editor", [
26343
26394
  if (settings.theme) {
26344
26395
  if (typeof settings.theme != "function") {
26345
26396
  settings.theme = settings.theme.replace(/-/, '');
26346
- o = ThemeManager.get(settings.theme);
26347
- self.theme = new o(self, ThemeManager.urls[settings.theme]);
26397
+ Theme = ThemeManager.get(settings.theme);
26398
+ self.theme = new Theme(self, ThemeManager.urls[settings.theme]);
26348
26399
 
26349
26400
  if (self.theme.init) {
26350
26401
  self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, ''));
@@ -26355,21 +26406,21 @@ define("tinymce/Editor", [
26355
26406
  }
26356
26407
 
26357
26408
  function initPlugin(plugin) {
26358
- var constr = PluginManager.get(plugin), url, pluginInstance;
26409
+ var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance;
26359
26410
 
26360
- url = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
26411
+ pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
26361
26412
  plugin = trim(plugin);
26362
- if (constr && inArray(initializedPlugins, plugin) === -1) {
26413
+ if (Plugin && inArray(initializedPlugins, plugin) === -1) {
26363
26414
  each(PluginManager.dependencies(plugin), function(dep){
26364
26415
  initPlugin(dep);
26365
26416
  });
26366
26417
 
26367
- pluginInstance = new constr(self, url);
26418
+ pluginInstance = new Plugin(self, pluginUrl);
26368
26419
 
26369
26420
  self.plugins[plugin] = pluginInstance;
26370
26421
 
26371
26422
  if (pluginInstance.init) {
26372
- pluginInstance.init(self, url);
26423
+ pluginInstance.init(self, pluginUrl);
26373
26424
  initializedPlugins.push(plugin);
26374
26425
  }
26375
26426
  }
@@ -26389,11 +26440,11 @@ define("tinymce/Editor", [
26389
26440
  re = /^[0-9\.]+(|px)$/i;
26390
26441
 
26391
26442
  if (re.test('' + w)) {
26392
- w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
26443
+ w = Math.max(parseInt(w, 10), 100);
26393
26444
  }
26394
26445
 
26395
26446
  if (re.test('' + h)) {
26396
- h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), minHeight);
26447
+ h = Math.max(parseInt(h, 10), minHeight);
26397
26448
  }
26398
26449
 
26399
26450
  // Render UI
@@ -26493,7 +26544,8 @@ define("tinymce/Editor", [
26493
26544
  self.iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" ' +
26494
26545
  'onload="window.parent.tinymce.get(\'' + self.id + '\').fire(\'load\');"><br></body></html>';
26495
26546
 
26496
- var domainRelaxUrl = 'javascript:(function(){'+
26547
+ /*eslint no-script-url:0 */
26548
+ var domainRelaxUrl = 'javascript:(function(){' +
26497
26549
  'document.open();document.domain="' + document.domain + '";' +
26498
26550
  'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
26499
26551
  'document.close();ed.initContentBody(true);})()';
@@ -26571,12 +26623,12 @@ define("tinymce/Editor", [
26571
26623
 
26572
26624
  if (settings.content_editable) {
26573
26625
  self.on('remove', function() {
26574
- var body = this.getBody();
26626
+ var bodyEl = this.getBody();
26575
26627
 
26576
- DOM.removeClass(body, 'mce-content-body');
26577
- DOM.removeClass(body, 'mce-edit-focus');
26578
- DOM.setAttrib(body, 'tabIndex', null);
26579
- DOM.setAttrib(body, 'contentEditable', null);
26628
+ DOM.removeClass(bodyEl, 'mce-content-body');
26629
+ DOM.removeClass(bodyEl, 'mce-edit-focus');
26630
+ DOM.setAttrib(bodyEl, 'tabIndex', null);
26631
+ DOM.setAttrib(bodyEl, 'contentEditable', null);
26580
26632
  });
26581
26633
 
26582
26634
  DOM.addClass(targetElm, 'mce-content-body');
@@ -27036,7 +27088,7 @@ define("tinymce/Editor", [
27036
27088
  var self = this, selection = self.selection, node, parents, root;
27037
27089
 
27038
27090
  // Fix for bug #1896577 it seems that this can not be fired while the editor is loading
27039
- if (self.initialized && !self.settings.disable_nodechange) {
27091
+ if (self.initialized && !self.settings.disable_nodechange && !self.settings.readonly) {
27040
27092
  // Get start node
27041
27093
  root = self.getBody();
27042
27094
  node = selection.getStart() || root;
@@ -27568,7 +27620,7 @@ define("tinymce/Editor", [
27568
27620
  // Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly
27569
27621
  content = ie && ie < 11 ? '' : '<br data-mce-bogus="1">';
27570
27622
  content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content);
27571
- } else if (!ie || ie < 11) {
27623
+ } else if (!ie) {
27572
27624
  // We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret
27573
27625
  content = '<br data-mce-bogus="1">';
27574
27626
  }
@@ -27867,6 +27919,8 @@ define("tinymce/Editor", [
27867
27919
  var self = this;
27868
27920
 
27869
27921
  if (!self.removed) {
27922
+ self.fire('remove');
27923
+ self.off();
27870
27924
  self.removed = 1; // Cancels post remove event execution
27871
27925
 
27872
27926
  // Remove any hidden input
@@ -27874,12 +27928,6 @@ define("tinymce/Editor", [
27874
27928
  DOM.remove(self.getElement().nextSibling);
27875
27929
  }
27876
27930
 
27877
- // Fixed bug where IE has a blinking cursor left from the editor
27878
- var doc = self.getDoc();
27879
- if (ie && doc && !self.inline) {
27880
- doc.execCommand('SelectAll');
27881
- }
27882
-
27883
27931
  // We must save before we hide so Safari doesn't crash
27884
27932
  self.save();
27885
27933
 
@@ -27896,8 +27944,6 @@ define("tinymce/Editor", [
27896
27944
  Event.unbind(self.getBody());
27897
27945
  Event.unbind(elm);
27898
27946
 
27899
- self.fire('remove');
27900
-
27901
27947
  self.editorManager.remove(self);
27902
27948
  DOM.remove(elm);
27903
27949
  self.destroy();
@@ -27986,7 +28032,7 @@ define("tinymce/Editor", [
27986
28032
  DOM.unbind(form, 'submit reset', self.formEventDelegate);
27987
28033
  }
27988
28034
 
27989
- self.contentAreaContainer = self.formElement = self.container = null;
28035
+ self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null;
27990
28036
  self.settings.content_element = self.bodyElement = self.contentDocument = self.contentWindow = null;
27991
28037
 
27992
28038
  if (self.selection) {
@@ -28139,6 +28185,8 @@ define("tinymce/FocusManager", [
28139
28185
  "tinymce/dom/DOMUtils",
28140
28186
  "tinymce/Env"
28141
28187
  ], function(DOMUtils, Env) {
28188
+ var selectionChangeHandler, documentFocusInHandler, DOM = DOMUtils.DOM;
28189
+
28142
28190
  /**
28143
28191
  * Constructs a new focus manager instance.
28144
28192
  *
@@ -28186,7 +28234,7 @@ define("tinymce/FocusManager", [
28186
28234
  }
28187
28235
 
28188
28236
  function isUIElement(elm) {
28189
- return !!DOMUtils.DOM.getParent(elm, FocusManager.isEditorUIElement);
28237
+ return !!DOM.getParent(elm, FocusManager.isEditorUIElement);
28190
28238
  }
28191
28239
 
28192
28240
  function isNodeInBodyOfEditor(node, editor) {
@@ -28202,7 +28250,7 @@ define("tinymce/FocusManager", [
28202
28250
  }
28203
28251
 
28204
28252
  function registerEvents(e) {
28205
- var editor = e.editor, selectionChangeHandler;
28253
+ var editor = e.editor;
28206
28254
 
28207
28255
  editor.on('init', function() {
28208
28256
  // On IE take selection snapshot onbeforedeactivate
@@ -28242,25 +28290,22 @@ define("tinymce/FocusManager", [
28242
28290
  });
28243
28291
 
28244
28292
  // Handles the issue with WebKit not retaining selection within inline document
28245
- // If the user releases the mouse out side the body while selecting a nodeChange won't
28246
- // fire and there for the selection snapshot won't be stored
28247
- // TODO: Optimize this since we only need to bind these on the active editor
28248
- if (Env.webkit) {
28293
+ // If the user releases the mouse out side the body since a mouse up event wont occur on the body
28294
+ if (Env.webkit && !selectionChangeHandler) {
28249
28295
  selectionChangeHandler = function() {
28250
- var rng = editor.selection.getRng();
28296
+ var activeEditor = editorManager.activeEditor;
28251
28297
 
28252
- // Store when it's non collapsed
28253
- if (!rng.collapsed) {
28254
- editor.lastRng = rng;
28298
+ if (activeEditor && activeEditor.selection) {
28299
+ var rng = activeEditor.selection.getRng();
28300
+
28301
+ // Store when it's non collapsed
28302
+ if (rng && !rng.collapsed) {
28303
+ editor.lastRng = rng;
28304
+ }
28255
28305
  }
28256
28306
  };
28257
28307
 
28258
- // Bind selection handler
28259
- DOMUtils.DOM.bind(document, 'selectionchange', selectionChangeHandler);
28260
-
28261
- editor.on('remove', function() {
28262
- DOMUtils.DOM.unbind(document, 'selectionchange', selectionChangeHandler);
28263
- });
28308
+ DOM.bind(document, 'selectionchange', selectionChangeHandler);
28264
28309
  }
28265
28310
  }
28266
28311
  });
@@ -28312,28 +28357,41 @@ define("tinymce/FocusManager", [
28312
28357
  }
28313
28358
  }, 0);
28314
28359
  });
28315
- }
28316
28360
 
28317
- // Check if focus is moved to an element outside the active editor by checking if the target node
28318
- // isn't within the body of the activeEditor nor a UI element such as a dialog child control
28319
- DOMUtils.DOM.bind(document, 'focusin', function(e) {
28320
- var activeEditor = editorManager.activeEditor;
28361
+ if (!documentFocusInHandler) {
28362
+ documentFocusInHandler = function(e) {
28363
+ var activeEditor = editorManager.activeEditor;
28321
28364
 
28322
- if (activeEditor && e.target.ownerDocument == document) {
28323
- // Check to make sure we have a valid selection
28324
- if (activeEditor.selection) {
28325
- activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
28326
- }
28365
+ if (activeEditor && e.target.ownerDocument == document) {
28366
+ // Check to make sure we have a valid selection
28367
+ if (activeEditor.selection) {
28368
+ activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
28369
+ }
28327
28370
 
28328
- // Fire a blur event if the element isn't a UI element
28329
- if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
28330
- activeEditor.fire('blur', {focusedEditor: null});
28331
- editorManager.focusedEditor = null;
28332
- }
28371
+ // Fire a blur event if the element isn't a UI element
28372
+ if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
28373
+ activeEditor.fire('blur', {focusedEditor: null});
28374
+ editorManager.focusedEditor = null;
28375
+ }
28376
+ }
28377
+ };
28378
+
28379
+ // Check if focus is moved to an element outside the active editor by checking if the target node
28380
+ // isn't within the body of the activeEditor nor a UI element such as a dialog child control
28381
+ DOM.bind(document, 'focusin', documentFocusInHandler);
28333
28382
  }
28334
- });
28383
+ }
28384
+
28385
+ function unregisterDocumentEvents() {
28386
+ if (!editorManager.activeEditor) {
28387
+ DOM.unbind(document, 'selectionchange', selectionChangeHandler);
28388
+ DOM.unbind(document, 'focusin', documentFocusInHandler);
28389
+ selectionChangeHandler = documentFocusInHandler = null;
28390
+ }
28391
+ }
28335
28392
 
28336
28393
  editorManager.on('AddEditor', registerEvents);
28394
+ editorManager.on('RemoveEditor', unregisterDocumentEvents);
28337
28395
  }
28338
28396
 
28339
28397
  /**
@@ -28401,7 +28459,7 @@ define("tinymce/EditorManager", [
28401
28459
  * @property minorVersion
28402
28460
  * @type String
28403
28461
  */
28404
- minorVersion : '0.18',
28462
+ minorVersion : '0.19',
28405
28463
 
28406
28464
  /**
28407
28465
  * Release date of TinyMCE build.
@@ -28409,7 +28467,7 @@ define("tinymce/EditorManager", [
28409
28467
  * @property releaseDate
28410
28468
  * @type String
28411
28469
  */
28412
- releaseDate: '2014-02-27',
28470
+ releaseDate: '2014-03-11',
28413
28471
 
28414
28472
  /**
28415
28473
  * Collection of editor instances.
@@ -29149,7 +29207,7 @@ define("tinymce/util/JSON", [], function() {
29149
29207
 
29150
29208
  if (t == 'object') {
29151
29209
  if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
29152
- for (i=0, v = '['; i<o.length; i++) {
29210
+ for (i = 0, v = '['; i < o.length; i++) {
29153
29211
  v += (i > 0 ? ',' : '') + serialize(o[i], quote);
29154
29212
  }
29155
29213
 
@@ -29161,7 +29219,7 @@ define("tinymce/util/JSON", [], function() {
29161
29219
  for (name in o) {
29162
29220
  if (o.hasOwnProperty(name)) {
29163
29221
  v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name +
29164
- quote +':' + serialize(o[name], quote) : '';
29222
+ quote + ':' + serialize(o[name], quote) : '';
29165
29223
  }
29166
29224
  }
29167
29225
 
@@ -30289,8 +30347,8 @@ define("tinymce/ui/ButtonGroup", [
30289
30347
  layout.preRender(self);
30290
30348
 
30291
30349
  return (
30292
- '<div id="' + self._id + '" class="' + self.classes() + '">'+
30293
- '<div id="' + self._id + '-body">'+
30350
+ '<div id="' + self._id + '" class="' + self.classes() + '">' +
30351
+ '<div id="' + self._id + '-body">' +
30294
30352
  (self.settings.html || '') + layout.renderHtml(self) +
30295
30353
  '</div>' +
30296
30354
  '</div>'
@@ -30414,7 +30472,7 @@ define("tinymce/ui/Checkbox", [
30414
30472
  return (
30415
30473
  '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
30416
30474
  '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
30417
- '<span id="' + id +'-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
30475
+ '<span id="' + id + '-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
30418
30476
  '</div>'
30419
30477
  );
30420
30478
  }
@@ -31102,9 +31160,9 @@ define("tinymce/ui/Path", [
31102
31160
 
31103
31161
  for (i = 0, l = parts.length; i < l; i++) {
31104
31162
  html += (
31105
- (i > 0 ? '<div class="'+ prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
31163
+ (i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
31106
31164
  '<div role="button" class="' + prefix + 'path-item' + (i == l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' +
31107
- i + '" tabindex="-1" id="' + self._id + '-' + i +'" aria-level="' + i + '">' + parts[i].name + '</div>'
31165
+ i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + i + '">' + parts[i].name + '</div>'
31108
31166
  );
31109
31167
  }
31110
31168
 
@@ -31627,8 +31685,8 @@ define("tinymce/ui/FlexLayout", [
31627
31685
  // A ton of variables, needs to be in the same scope for performance
31628
31686
  var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
31629
31687
  var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos;
31630
- var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, afterName, deltaSizeName, contentSizeName;
31631
- var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignMaxSizeName, alignBeforeName, alignAfterName;
31688
+ var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
31689
+ var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
31632
31690
  var alignDeltaSizeName, alignContentSizeName;
31633
31691
  var max = Math.max, min = Math.min;
31634
31692
 
@@ -31655,7 +31713,6 @@ define("tinymce/ui/FlexLayout", [
31655
31713
  maxSizeName = "maxH";
31656
31714
  innerSizeName = "innerH";
31657
31715
  beforeName = 'top';
31658
- afterName = 'bottom';
31659
31716
  deltaSizeName = "deltaH";
31660
31717
  contentSizeName = "contentH";
31661
31718
 
@@ -31664,7 +31721,6 @@ define("tinymce/ui/FlexLayout", [
31664
31721
  alignAxisName = "x";
31665
31722
  alignInnerSizeName = "innerW";
31666
31723
  alignMinSizeName = "minW";
31667
- alignMaxSizeName = "maxW";
31668
31724
  alignAfterName = "right";
31669
31725
  alignDeltaSizeName = "deltaW";
31670
31726
  alignContentSizeName = "contentW";
@@ -31675,7 +31731,6 @@ define("tinymce/ui/FlexLayout", [
31675
31731
  maxSizeName = "maxW";
31676
31732
  innerSizeName = "innerW";
31677
31733
  beforeName = 'left';
31678
- afterName = 'right';
31679
31734
  deltaSizeName = "deltaW";
31680
31735
  contentSizeName = "contentW";
31681
31736
 
@@ -31684,7 +31739,6 @@ define("tinymce/ui/FlexLayout", [
31684
31739
  alignAxisName = "y";
31685
31740
  alignInnerSizeName = "innerH";
31686
31741
  alignMinSizeName = "minH";
31687
- alignMaxSizeName = "maxH";
31688
31742
  alignAfterName = "bottom";
31689
31743
  alignDeltaSizeName = "deltaH";
31690
31744
  alignContentSizeName = "contentH";
@@ -32582,7 +32636,7 @@ define("tinymce/ui/GridLayout", [
32582
32636
  recalc: function(container) {
32583
32637
  var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect,
32584
32638
  ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY,
32585
- colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, alignX, alignY, availableWidth, availableHeight;
32639
+ colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight;
32586
32640
 
32587
32641
  // Get layout settings
32588
32642
  settings = container.settings;
@@ -32732,7 +32786,6 @@ define("tinymce/ui/GridLayout", [
32732
32786
  ctrlSettings = ctrl.settings;
32733
32787
  ctrlLayoutRect = ctrl.layoutRect();
32734
32788
  width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
32735
- alignX = alignY = 0;
32736
32789
  ctrlLayoutRect.x = posX;
32737
32790
  ctrlLayoutRect.y = posY;
32738
32791
 
@@ -32977,7 +33030,7 @@ define("tinymce/ui/Label", [
32977
33030
  var self = this, forId = self.settings.forId;
32978
33031
 
32979
33032
  return (
32980
- '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId +'"' : '') + '>' +
33033
+ '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId + '"' : '') + '>' +
32981
33034
  self.encode(self._text) +
32982
33035
  '</label>'
32983
33036
  );
@@ -34295,7 +34348,7 @@ define("tinymce/ui/TabPanel", [
34295
34348
  ctrl.aria('labelledby', id);
34296
34349
 
34297
34350
  tabsHtml += (
34298
- '<div id="' + id + '" class="' + prefix + 'tab" '+
34351
+ '<div id="' + id + '" class="' + prefix + 'tab" ' +
34299
34352
  'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
34300
34353
  self.encode(ctrl.settings.title) +
34301
34354
  '</div>'