tinymce-rails 4.1.4 → 4.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd66fea9a1e427a976f204236381836e8d9b43a5
4
- data.tar.gz: 7d482f906a0324485ecb1d62ace6e68c348b62ff
3
+ metadata.gz: a8649340667e7ef05b3c60dcbc66ff313894bc65
4
+ data.tar.gz: 8490b2824f51aa4b4d42a668147d106849c47912
5
5
  SHA512:
6
- metadata.gz: 060349ddf2b7d47d47f180cb777b5c62fb2801dcd597b9c5fb7ffb51c6aa5fa9096cb2992d583ceeff683b0ab56298843c11ae943fa56e323dd8ace5a6c446c2
7
- data.tar.gz: a6541df63a955101ec3248ef0f4c62e1917393fc79e8f9b94d0f85f2b740d3fbd2111f8dd21a7da0b3442a399da8063a6f5712fb38cc533d595f9bc775486171
6
+ metadata.gz: 0bbf6b99ad46262d1798e692b6c03acfc2850a94bbdae0e663cee89593f1dff9ee0df6a534526f83dffc40de52afe6a22ec24cff65ec55f176fd107aa5cc0a0a
7
+ data.tar.gz: d6461a8c7d98715d1e0f59cba023a9c9c147808705e1936685fc848d441d26dbd63ece5a9349170cfcbd29ed92e7b6979a8b1b7efa8b2bb76c1176f8d076f6ef
data/README.md CHANGED
@@ -26,11 +26,11 @@ Be sure to add to the global group, not the `assets` group. Then run `bundle ins
26
26
 
27
27
  ```yml
28
28
  toolbar:
29
- - styleselect | bold italic | link image | undo redo
30
- - table | fullscreen
29
+ - styleselect | bold italic | undo redo
30
+ - image | link
31
31
  plugins:
32
- - table
33
- - fullscreen
32
+ - image
33
+ - link
34
34
  ```
35
35
 
36
36
  The Rails server no longer needs to be restarted when this file is updated in development mode.
@@ -45,7 +45,7 @@ default:
45
45
 
46
46
  alternate:
47
47
  selector: textarea.table-editor
48
- toolbar: styleselect | bold italic | link image | undo redo | table
48
+ toolbar: styleselect | bold italic | undo redo | table
49
49
  plugins:
50
50
  - table
51
51
  ```
@@ -1,4 +1,4 @@
1
- // 4.1.4 (2014-08-21)
1
+ // 4.1.5 (2014-09-09)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -5273,7 +5273,11 @@ define("tinymce/dom/DOMUtils", [
5273
5273
  * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
5274
5274
  */
5275
5275
  setStyles: function(elm, styles) {
5276
- this.$$(elm).css(styles);
5276
+ elm = this.$$(elm).css(styles);
5277
+
5278
+ if (this.settings.update_styles) {
5279
+ elm.attr('data-mce-style', null);
5280
+ }
5277
5281
  },
5278
5282
 
5279
5283
  /**
@@ -6002,7 +6006,7 @@ define("tinymce/dom/DOMUtils", [
6002
6006
  node = node.firstChild;
6003
6007
  if (node) {
6004
6008
  walker = new TreeWalker(node, node.parentNode);
6005
- elements = elements || self.schema ? self.schema.getNonEmptyElements() : null;
6009
+ elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
6006
6010
 
6007
6011
  do {
6008
6012
  type = node.nodeType;
@@ -7525,7 +7529,11 @@ define("tinymce/NodeChange", [
7525
7529
  // Fire an extra nodeChange on mouseup for compatibility reasons
7526
7530
  editor.on('MouseUp', function(e) {
7527
7531
  if (!e.isDefaultPrevented()) {
7528
- editor.nodeChanged();
7532
+ // Delay nodeChanged call for WebKit edge case issue where the range
7533
+ // isn't updated until after you click outside a selected image
7534
+ setTimeout(function() {
7535
+ editor.nodeChanged();
7536
+ }, 0);
7529
7537
  }
7530
7538
  });
7531
7539
 
@@ -7540,7 +7548,7 @@ define("tinymce/NodeChange", [
7540
7548
  var selection = editor.selection, node, parents, root;
7541
7549
 
7542
7550
  // Fix for bug #1896577 it seems that this can not be fired while the editor is loading
7543
- if (editor.initialized && !editor.settings.disable_nodechange && !editor.settings.readonly) {
7551
+ if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
7544
7552
  // Get start node
7545
7553
  root = editor.getBody();
7546
7554
  node = selection.getStart() || root;
@@ -10116,7 +10124,13 @@ define("tinymce/html/DomParser", [
10116
10124
  // Leave nodes that have a name like <a name="name">
10117
10125
  if (!node.attributes.map.name && !node.attributes.map.id) {
10118
10126
  tempNode = node.parent;
10119
- node.unwrap();
10127
+
10128
+ if (blockElements[node.name]) {
10129
+ node.empty().remove();
10130
+ } else {
10131
+ node.unwrap();
10132
+ }
10133
+
10120
10134
  node = tempNode;
10121
10135
  return;
10122
10136
  }
@@ -14168,6 +14182,20 @@ define("tinymce/Formatter", [
14168
14182
  }
14169
14183
  }
14170
14184
 
14185
+ /**
14186
+ * Unregister a specific format by name.
14187
+ *
14188
+ * @method unregister
14189
+ * @param {String} name Name of the format for example "bold".
14190
+ */
14191
+ function unregister(name) {
14192
+ if (name && formats[name]) {
14193
+ delete formats[name];
14194
+ }
14195
+
14196
+ return formats;
14197
+ }
14198
+
14171
14199
  function getTextDecoration(node) {
14172
14200
  var decoration;
14173
14201
 
@@ -15065,6 +15093,7 @@ define("tinymce/Formatter", [
15065
15093
  extend(this, {
15066
15094
  get: get,
15067
15095
  register: register,
15096
+ unregister: unregister,
15068
15097
  apply: apply,
15069
15098
  remove: remove,
15070
15099
  toggle: toggle,
@@ -15949,12 +15978,12 @@ define("tinymce/Formatter", [
15949
15978
  child.deleteData(0, 1);
15950
15979
 
15951
15980
  // Fix for bug #6976
15952
- if (rng.startContainer == child) {
15953
- rng.startOffset--;
15981
+ if (rng.startContainer == child && rng.startOffset > 0) {
15982
+ rng.setStart(child, rng.startOffset - 1);
15954
15983
  }
15955
15984
 
15956
- if (rng.endContainer == child) {
15957
- rng.endOffset--;
15985
+ if (rng.endContainer == child && rng.endOffset > 0) {
15986
+ rng.setEnd(child, rng.endOffset - 1);
15958
15987
  }
15959
15988
  }
15960
15989
 
@@ -19950,6 +19979,10 @@ define("tinymce/ui/DomUtils", [
19950
19979
  return DOMUtils.DOM.setStyle(elm, name, value);
19951
19980
  },
19952
19981
 
19982
+ getRuntimeStyle: function(elm, name) {
19983
+ return DOMUtils.DOM.getStyle(elm, name, true);
19984
+ },
19985
+
19953
19986
  on: function(target, name, callback, scope) {
19954
19987
  return DOMUtils.DOM.bind(target, name, callback, scope);
19955
19988
  },
@@ -22850,7 +22883,7 @@ define("tinymce/ui/Movable", [
22850
22883
  x = pos.x;
22851
22884
  y = pos.y;
22852
22885
 
22853
- if (ctrl._fixed) {
22886
+ if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
22854
22887
  x -= viewport.x;
22855
22888
  y -= viewport.y;
22856
22889
  }
@@ -23239,6 +23272,46 @@ define("tinymce/ui/FloatPanel", [
23239
23272
  }
23240
23273
  }
23241
23274
 
23275
+ function addRemove(add, ctrl) {
23276
+ var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
23277
+
23278
+ if (add) {
23279
+ zOrder.push(ctrl);
23280
+ } else {
23281
+ i = zOrder.length;
23282
+
23283
+ while (i--) {
23284
+ if (zOrder[i] === ctrl) {
23285
+ zOrder.splice(i, 1);
23286
+ }
23287
+ }
23288
+ }
23289
+
23290
+ if (zOrder.length) {
23291
+ for (i = 0; i < zOrder.length; i++) {
23292
+ if (zOrder[i].modal) {
23293
+ zIndex++;
23294
+ topModal = zOrder[i];
23295
+ }
23296
+
23297
+ zOrder[i].getEl().style.zIndex = zIndex;
23298
+ zOrder[i].zIndex = zIndex;
23299
+ zIndex++;
23300
+ }
23301
+ }
23302
+
23303
+ var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
23304
+
23305
+ if (topModal) {
23306
+ DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
23307
+ } else if (modalBlockEl) {
23308
+ modalBlockEl.parentNode.removeChild(modalBlockEl);
23309
+ hasModal = false;
23310
+ }
23311
+
23312
+ FloatPanel.currentZIndex = zIndex;
23313
+ }
23314
+
23242
23315
  var FloatPanel = Panel.extend({
23243
23316
  Mixins: [Movable, Resizable],
23244
23317
 
@@ -23252,34 +23325,6 @@ define("tinymce/ui/FloatPanel", [
23252
23325
  init: function(settings) {
23253
23326
  var self = this;
23254
23327
 
23255
- function reorder() {
23256
- var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
23257
-
23258
- if (zOrder.length) {
23259
- for (i = 0; i < zOrder.length; i++) {
23260
- if (zOrder[i].modal) {
23261
- zIndex++;
23262
- topModal = zOrder[i];
23263
- }
23264
-
23265
- zOrder[i].getEl().style.zIndex = zIndex;
23266
- zOrder[i].zIndex = zIndex;
23267
- zIndex++;
23268
- }
23269
- }
23270
-
23271
- var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block');
23272
-
23273
- if (topModal) {
23274
- DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
23275
- } else if (modalBlockEl) {
23276
- modalBlockEl.parentNode.removeChild(modalBlockEl);
23277
- hasModal = false;
23278
- }
23279
-
23280
- FloatPanel.currentZIndex = zIndex;
23281
- }
23282
-
23283
23328
  self._super(settings);
23284
23329
  self._eventsRoot = self;
23285
23330
 
@@ -23319,22 +23364,7 @@ define("tinymce/ui/FloatPanel", [
23319
23364
  hasModal = true;
23320
23365
  }
23321
23366
 
23322
- zOrder.push(self);
23323
- reorder();
23324
- }
23325
- });
23326
-
23327
- self.on('close hide', function(e) {
23328
- if (e.control == self) {
23329
- var i = zOrder.length;
23330
-
23331
- while (i--) {
23332
- if (zOrder[i] === self) {
23333
- zOrder.splice(i, 1);
23334
- }
23335
- }
23336
-
23337
- reorder();
23367
+ addRemove(true, self);
23338
23368
  }
23339
23369
  });
23340
23370
 
@@ -23405,6 +23435,8 @@ define("tinymce/ui/FloatPanel", [
23405
23435
  */
23406
23436
  hide: function() {
23407
23437
  removeVisiblePanel(this);
23438
+ addRemove(false, this);
23439
+
23408
23440
  return this._super();
23409
23441
  },
23410
23442
 
@@ -23426,9 +23458,12 @@ define("tinymce/ui/FloatPanel", [
23426
23458
  close: function() {
23427
23459
  var self = this;
23428
23460
 
23429
- self.fire('close');
23461
+ if (!self.fire('close').isDefaultPrevented()) {
23462
+ self.remove();
23463
+ addRemove(false, self);
23464
+ }
23430
23465
 
23431
- return self.remove();
23466
+ return self;
23432
23467
  },
23433
23468
 
23434
23469
  /**
@@ -24207,7 +24242,9 @@ define("tinymce/WindowManager", [
24207
24242
  }
24208
24243
  }
24209
24244
 
24210
- editor.focus();
24245
+ if (!windows.length) {
24246
+ editor.focus();
24247
+ }
24211
24248
  });
24212
24249
 
24213
24250
  // Handle data
@@ -24228,7 +24265,9 @@ define("tinymce/WindowManager", [
24228
24265
  win.params = params || {};
24229
24266
 
24230
24267
  // Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
24231
- editor.nodeChanged();
24268
+ if (windows.length === 1) {
24269
+ editor.nodeChanged();
24270
+ }
24232
24271
 
24233
24272
  return win.renderTo().reflow();
24234
24273
  };
@@ -24745,10 +24784,17 @@ define("tinymce/util/Quirks", [
24745
24784
  });
24746
24785
 
24747
24786
  // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
24748
- dom.bind(editor.getDoc(), 'mousedown', function(e) {
24787
+ // Needs to be both down/up due to weird rendering bug on Chrome Windows
24788
+ dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
24749
24789
  if (e.target == editor.getDoc().documentElement) {
24750
24790
  editor.getBody().focus();
24751
- selection.setRng(selection.getRng());
24791
+
24792
+ if (e.type == 'mousedown') {
24793
+ // Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
24794
+ selection.placeCaretAt(e.clientX, e.clientY);
24795
+ } else {
24796
+ selection.setRng(selection.getRng());
24797
+ }
24752
24798
  }
24753
24799
  });
24754
24800
  }
@@ -24824,10 +24870,11 @@ define("tinymce/util/Quirks", [
24824
24870
 
24825
24871
  // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
24826
24872
  // WebKit can't even do simple things like selecting an image
24827
- // Needs tobe the setBaseAndExtend or it will fail to select floated images
24873
+ // Needs to be the setBaseAndExtend or it will fail to select floated images
24828
24874
  if (/^(IMG|HR)$/.test(target.nodeName)) {
24829
24875
  e.preventDefault();
24830
24876
  selection.getSel().setBaseAndExtent(target, 0, target, 1);
24877
+ editor.nodeChanged();
24831
24878
  }
24832
24879
 
24833
24880
  if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
@@ -25471,6 +25518,7 @@ define("tinymce/util/Quirks", [
25471
25518
  // you bind touch events so we need to do this manually
25472
25519
  // TODO: Expand to the closest word? Touble tap still works.
25473
25520
  editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
25521
+ editor.nodeChanged();
25474
25522
  }
25475
25523
  });
25476
25524
  });
@@ -28647,7 +28695,7 @@ define("tinymce/EditorManager", [
28647
28695
  * @property minorVersion
28648
28696
  * @type String
28649
28697
  */
28650
- minorVersion: '1.4',
28698
+ minorVersion: '1.5',
28651
28699
 
28652
28700
  /**
28653
28701
  * Release date of TinyMCE build.
@@ -28655,7 +28703,7 @@ define("tinymce/EditorManager", [
28655
28703
  * @property releaseDate
28656
28704
  * @type String
28657
28705
  */
28658
- releaseDate: '2014-08-21',
28706
+ releaseDate: '2014-09-09',
28659
28707
 
28660
28708
  /**
28661
28709
  * Collection of editor instances.
@@ -34023,14 +34071,30 @@ define("tinymce/ui/MenuButton", [
34023
34071
  */
34024
34072
  renderHtml: function() {
34025
34073
  var self = this, id = self._id, prefix = self.classPrefix;
34026
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
34074
+ var icon = self.settings.icon, image;
34075
+
34076
+ image = self.settings.image;
34077
+ if (image) {
34078
+ icon = 'none';
34079
+
34080
+ // Support for [high dpi, low dpi] image sources
34081
+ if (typeof image != "string") {
34082
+ image = window.getSelection ? image[0] : image[1];
34083
+ }
34084
+
34085
+ image = ' style="background-image: url(\'' + image + '\')"';
34086
+ } else {
34087
+ image = '';
34088
+ }
34089
+
34090
+ icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
34027
34091
 
34028
34092
  self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
34029
34093
 
34030
34094
  return (
34031
34095
  '<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
34032
34096
  '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
34033
- (icon ? '<i class="' + icon + '"></i>' : '') +
34097
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
34034
34098
  '<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
34035
34099
  ' <i class="' + prefix + 'caret"></i>' +
34036
34100
  '</button>' +
@@ -34942,13 +35006,29 @@ define("tinymce/ui/SplitButton", [
34942
35006
  * @return {String} HTML representing the control.
34943
35007
  */
34944
35008
  renderHtml: function() {
34945
- var self = this, id = self._id, prefix = self.classPrefix;
34946
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
35009
+ var self = this, id = self._id, prefix = self.classPrefix, image;
35010
+ var icon = self.settings.icon;
35011
+
35012
+ image = self.settings.image;
35013
+ if (image) {
35014
+ icon = 'none';
35015
+
35016
+ // Support for [high dpi, low dpi] image sources
35017
+ if (typeof image != "string") {
35018
+ image = window.getSelection ? image[0] : image[1];
35019
+ }
35020
+
35021
+ image = ' style="background-image: url(\'' + image + '\')"';
35022
+ } else {
35023
+ image = '';
35024
+ }
35025
+
35026
+ icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
34947
35027
 
34948
35028
  return (
34949
35029
  '<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
34950
35030
  '<button type="button" hidefocus="1" tabindex="-1">' +
34951
- (icon ? '<i class="' + icon + '"></i>' : '') +
35031
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
34952
35032
  (self._text ? (icon ? ' ' : '') + self._text : '') +
34953
35033
  '</button>' +
34954
35034
  '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
@@ -1,4 +1,4 @@
1
- // 4.1.4 (2014-08-21)
1
+ // 4.1.5 (2014-09-09)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -7288,7 +7288,11 @@ define("tinymce/dom/DOMUtils", [
7288
7288
  * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
7289
7289
  */
7290
7290
  setStyles: function(elm, styles) {
7291
- this.$$(elm).css(styles);
7291
+ elm = this.$$(elm).css(styles);
7292
+
7293
+ if (this.settings.update_styles) {
7294
+ elm.attr('data-mce-style', null);
7295
+ }
7292
7296
  },
7293
7297
 
7294
7298
  /**
@@ -8017,7 +8021,7 @@ define("tinymce/dom/DOMUtils", [
8017
8021
  node = node.firstChild;
8018
8022
  if (node) {
8019
8023
  walker = new TreeWalker(node, node.parentNode);
8020
- elements = elements || self.schema ? self.schema.getNonEmptyElements() : null;
8024
+ elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
8021
8025
 
8022
8026
  do {
8023
8027
  type = node.nodeType;
@@ -9540,7 +9544,11 @@ define("tinymce/NodeChange", [
9540
9544
  // Fire an extra nodeChange on mouseup for compatibility reasons
9541
9545
  editor.on('MouseUp', function(e) {
9542
9546
  if (!e.isDefaultPrevented()) {
9543
- editor.nodeChanged();
9547
+ // Delay nodeChanged call for WebKit edge case issue where the range
9548
+ // isn't updated until after you click outside a selected image
9549
+ setTimeout(function() {
9550
+ editor.nodeChanged();
9551
+ }, 0);
9544
9552
  }
9545
9553
  });
9546
9554
 
@@ -9555,7 +9563,7 @@ define("tinymce/NodeChange", [
9555
9563
  var selection = editor.selection, node, parents, root;
9556
9564
 
9557
9565
  // Fix for bug #1896577 it seems that this can not be fired while the editor is loading
9558
- if (editor.initialized && !editor.settings.disable_nodechange && !editor.settings.readonly) {
9566
+ if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
9559
9567
  // Get start node
9560
9568
  root = editor.getBody();
9561
9569
  node = selection.getStart() || root;
@@ -12131,7 +12139,13 @@ define("tinymce/html/DomParser", [
12131
12139
  // Leave nodes that have a name like <a name="name">
12132
12140
  if (!node.attributes.map.name && !node.attributes.map.id) {
12133
12141
  tempNode = node.parent;
12134
- node.unwrap();
12142
+
12143
+ if (blockElements[node.name]) {
12144
+ node.empty().remove();
12145
+ } else {
12146
+ node.unwrap();
12147
+ }
12148
+
12135
12149
  node = tempNode;
12136
12150
  return;
12137
12151
  }
@@ -16183,6 +16197,20 @@ define("tinymce/Formatter", [
16183
16197
  }
16184
16198
  }
16185
16199
 
16200
+ /**
16201
+ * Unregister a specific format by name.
16202
+ *
16203
+ * @method unregister
16204
+ * @param {String} name Name of the format for example "bold".
16205
+ */
16206
+ function unregister(name) {
16207
+ if (name && formats[name]) {
16208
+ delete formats[name];
16209
+ }
16210
+
16211
+ return formats;
16212
+ }
16213
+
16186
16214
  function getTextDecoration(node) {
16187
16215
  var decoration;
16188
16216
 
@@ -17080,6 +17108,7 @@ define("tinymce/Formatter", [
17080
17108
  extend(this, {
17081
17109
  get: get,
17082
17110
  register: register,
17111
+ unregister: unregister,
17083
17112
  apply: apply,
17084
17113
  remove: remove,
17085
17114
  toggle: toggle,
@@ -17964,12 +17993,12 @@ define("tinymce/Formatter", [
17964
17993
  child.deleteData(0, 1);
17965
17994
 
17966
17995
  // Fix for bug #6976
17967
- if (rng.startContainer == child) {
17968
- rng.startOffset--;
17996
+ if (rng.startContainer == child && rng.startOffset > 0) {
17997
+ rng.setStart(child, rng.startOffset - 1);
17969
17998
  }
17970
17999
 
17971
- if (rng.endContainer == child) {
17972
- rng.endOffset--;
18000
+ if (rng.endContainer == child && rng.endOffset > 0) {
18001
+ rng.setEnd(child, rng.endOffset - 1);
17973
18002
  }
17974
18003
  }
17975
18004
 
@@ -21965,6 +21994,10 @@ define("tinymce/ui/DomUtils", [
21965
21994
  return DOMUtils.DOM.setStyle(elm, name, value);
21966
21995
  },
21967
21996
 
21997
+ getRuntimeStyle: function(elm, name) {
21998
+ return DOMUtils.DOM.getStyle(elm, name, true);
21999
+ },
22000
+
21968
22001
  on: function(target, name, callback, scope) {
21969
22002
  return DOMUtils.DOM.bind(target, name, callback, scope);
21970
22003
  },
@@ -24865,7 +24898,7 @@ define("tinymce/ui/Movable", [
24865
24898
  x = pos.x;
24866
24899
  y = pos.y;
24867
24900
 
24868
- if (ctrl._fixed) {
24901
+ if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
24869
24902
  x -= viewport.x;
24870
24903
  y -= viewport.y;
24871
24904
  }
@@ -25254,6 +25287,46 @@ define("tinymce/ui/FloatPanel", [
25254
25287
  }
25255
25288
  }
25256
25289
 
25290
+ function addRemove(add, ctrl) {
25291
+ var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
25292
+
25293
+ if (add) {
25294
+ zOrder.push(ctrl);
25295
+ } else {
25296
+ i = zOrder.length;
25297
+
25298
+ while (i--) {
25299
+ if (zOrder[i] === ctrl) {
25300
+ zOrder.splice(i, 1);
25301
+ }
25302
+ }
25303
+ }
25304
+
25305
+ if (zOrder.length) {
25306
+ for (i = 0; i < zOrder.length; i++) {
25307
+ if (zOrder[i].modal) {
25308
+ zIndex++;
25309
+ topModal = zOrder[i];
25310
+ }
25311
+
25312
+ zOrder[i].getEl().style.zIndex = zIndex;
25313
+ zOrder[i].zIndex = zIndex;
25314
+ zIndex++;
25315
+ }
25316
+ }
25317
+
25318
+ var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
25319
+
25320
+ if (topModal) {
25321
+ DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
25322
+ } else if (modalBlockEl) {
25323
+ modalBlockEl.parentNode.removeChild(modalBlockEl);
25324
+ hasModal = false;
25325
+ }
25326
+
25327
+ FloatPanel.currentZIndex = zIndex;
25328
+ }
25329
+
25257
25330
  var FloatPanel = Panel.extend({
25258
25331
  Mixins: [Movable, Resizable],
25259
25332
 
@@ -25267,34 +25340,6 @@ define("tinymce/ui/FloatPanel", [
25267
25340
  init: function(settings) {
25268
25341
  var self = this;
25269
25342
 
25270
- function reorder() {
25271
- var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
25272
-
25273
- if (zOrder.length) {
25274
- for (i = 0; i < zOrder.length; i++) {
25275
- if (zOrder[i].modal) {
25276
- zIndex++;
25277
- topModal = zOrder[i];
25278
- }
25279
-
25280
- zOrder[i].getEl().style.zIndex = zIndex;
25281
- zOrder[i].zIndex = zIndex;
25282
- zIndex++;
25283
- }
25284
- }
25285
-
25286
- var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block');
25287
-
25288
- if (topModal) {
25289
- DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
25290
- } else if (modalBlockEl) {
25291
- modalBlockEl.parentNode.removeChild(modalBlockEl);
25292
- hasModal = false;
25293
- }
25294
-
25295
- FloatPanel.currentZIndex = zIndex;
25296
- }
25297
-
25298
25343
  self._super(settings);
25299
25344
  self._eventsRoot = self;
25300
25345
 
@@ -25334,22 +25379,7 @@ define("tinymce/ui/FloatPanel", [
25334
25379
  hasModal = true;
25335
25380
  }
25336
25381
 
25337
- zOrder.push(self);
25338
- reorder();
25339
- }
25340
- });
25341
-
25342
- self.on('close hide', function(e) {
25343
- if (e.control == self) {
25344
- var i = zOrder.length;
25345
-
25346
- while (i--) {
25347
- if (zOrder[i] === self) {
25348
- zOrder.splice(i, 1);
25349
- }
25350
- }
25351
-
25352
- reorder();
25382
+ addRemove(true, self);
25353
25383
  }
25354
25384
  });
25355
25385
 
@@ -25420,6 +25450,8 @@ define("tinymce/ui/FloatPanel", [
25420
25450
  */
25421
25451
  hide: function() {
25422
25452
  removeVisiblePanel(this);
25453
+ addRemove(false, this);
25454
+
25423
25455
  return this._super();
25424
25456
  },
25425
25457
 
@@ -25441,9 +25473,12 @@ define("tinymce/ui/FloatPanel", [
25441
25473
  close: function() {
25442
25474
  var self = this;
25443
25475
 
25444
- self.fire('close');
25476
+ if (!self.fire('close').isDefaultPrevented()) {
25477
+ self.remove();
25478
+ addRemove(false, self);
25479
+ }
25445
25480
 
25446
- return self.remove();
25481
+ return self;
25447
25482
  },
25448
25483
 
25449
25484
  /**
@@ -26222,7 +26257,9 @@ define("tinymce/WindowManager", [
26222
26257
  }
26223
26258
  }
26224
26259
 
26225
- editor.focus();
26260
+ if (!windows.length) {
26261
+ editor.focus();
26262
+ }
26226
26263
  });
26227
26264
 
26228
26265
  // Handle data
@@ -26243,7 +26280,9 @@ define("tinymce/WindowManager", [
26243
26280
  win.params = params || {};
26244
26281
 
26245
26282
  // Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
26246
- editor.nodeChanged();
26283
+ if (windows.length === 1) {
26284
+ editor.nodeChanged();
26285
+ }
26247
26286
 
26248
26287
  return win.renderTo().reflow();
26249
26288
  };
@@ -26760,10 +26799,17 @@ define("tinymce/util/Quirks", [
26760
26799
  });
26761
26800
 
26762
26801
  // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
26763
- dom.bind(editor.getDoc(), 'mousedown', function(e) {
26802
+ // Needs to be both down/up due to weird rendering bug on Chrome Windows
26803
+ dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
26764
26804
  if (e.target == editor.getDoc().documentElement) {
26765
26805
  editor.getBody().focus();
26766
- selection.setRng(selection.getRng());
26806
+
26807
+ if (e.type == 'mousedown') {
26808
+ // Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
26809
+ selection.placeCaretAt(e.clientX, e.clientY);
26810
+ } else {
26811
+ selection.setRng(selection.getRng());
26812
+ }
26767
26813
  }
26768
26814
  });
26769
26815
  }
@@ -26839,10 +26885,11 @@ define("tinymce/util/Quirks", [
26839
26885
 
26840
26886
  // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
26841
26887
  // WebKit can't even do simple things like selecting an image
26842
- // Needs tobe the setBaseAndExtend or it will fail to select floated images
26888
+ // Needs to be the setBaseAndExtend or it will fail to select floated images
26843
26889
  if (/^(IMG|HR)$/.test(target.nodeName)) {
26844
26890
  e.preventDefault();
26845
26891
  selection.getSel().setBaseAndExtent(target, 0, target, 1);
26892
+ editor.nodeChanged();
26846
26893
  }
26847
26894
 
26848
26895
  if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
@@ -27486,6 +27533,7 @@ define("tinymce/util/Quirks", [
27486
27533
  // you bind touch events so we need to do this manually
27487
27534
  // TODO: Expand to the closest word? Touble tap still works.
27488
27535
  editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
27536
+ editor.nodeChanged();
27489
27537
  }
27490
27538
  });
27491
27539
  });
@@ -30662,7 +30710,7 @@ define("tinymce/EditorManager", [
30662
30710
  * @property minorVersion
30663
30711
  * @type String
30664
30712
  */
30665
- minorVersion: '1.4',
30713
+ minorVersion: '1.5',
30666
30714
 
30667
30715
  /**
30668
30716
  * Release date of TinyMCE build.
@@ -30670,7 +30718,7 @@ define("tinymce/EditorManager", [
30670
30718
  * @property releaseDate
30671
30719
  * @type String
30672
30720
  */
30673
- releaseDate: '2014-08-21',
30721
+ releaseDate: '2014-09-09',
30674
30722
 
30675
30723
  /**
30676
30724
  * Collection of editor instances.
@@ -36038,14 +36086,30 @@ define("tinymce/ui/MenuButton", [
36038
36086
  */
36039
36087
  renderHtml: function() {
36040
36088
  var self = this, id = self._id, prefix = self.classPrefix;
36041
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
36089
+ var icon = self.settings.icon, image;
36090
+
36091
+ image = self.settings.image;
36092
+ if (image) {
36093
+ icon = 'none';
36094
+
36095
+ // Support for [high dpi, low dpi] image sources
36096
+ if (typeof image != "string") {
36097
+ image = window.getSelection ? image[0] : image[1];
36098
+ }
36099
+
36100
+ image = ' style="background-image: url(\'' + image + '\')"';
36101
+ } else {
36102
+ image = '';
36103
+ }
36104
+
36105
+ icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
36042
36106
 
36043
36107
  self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
36044
36108
 
36045
36109
  return (
36046
36110
  '<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
36047
36111
  '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
36048
- (icon ? '<i class="' + icon + '"></i>' : '') +
36112
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
36049
36113
  '<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
36050
36114
  ' <i class="' + prefix + 'caret"></i>' +
36051
36115
  '</button>' +
@@ -36957,13 +37021,29 @@ define("tinymce/ui/SplitButton", [
36957
37021
  * @return {String} HTML representing the control.
36958
37022
  */
36959
37023
  renderHtml: function() {
36960
- var self = this, id = self._id, prefix = self.classPrefix;
36961
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
37024
+ var self = this, id = self._id, prefix = self.classPrefix, image;
37025
+ var icon = self.settings.icon;
37026
+
37027
+ image = self.settings.image;
37028
+ if (image) {
37029
+ icon = 'none';
37030
+
37031
+ // Support for [high dpi, low dpi] image sources
37032
+ if (typeof image != "string") {
37033
+ image = window.getSelection ? image[0] : image[1];
37034
+ }
37035
+
37036
+ image = ' style="background-image: url(\'' + image + '\')"';
37037
+ } else {
37038
+ image = '';
37039
+ }
37040
+
37041
+ icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
36962
37042
 
36963
37043
  return (
36964
37044
  '<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
36965
37045
  '<button type="button" hidefocus="1" tabindex="-1">' +
36966
- (icon ? '<i class="' + icon + '"></i>' : '') +
37046
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
36967
37047
  (self._text ? (icon ? ' ' : '') + self._text : '') +
36968
37048
  '</button>' +
36969
37049
  '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +