tinymce-rails 4.0.6 → 4.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- // 4.0.6 (2013-09-12)
1
+ // 4.0.7 (2013-10-02)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -822,7 +822,6 @@ define("tinymce/dom/EventUtils", [], function() {
822
822
  callbackList.nativeHandler = nativeHandler;
823
823
 
824
824
  eventMap[name] = callbackList;
825
- callbackList.splice(ci, 1);
826
825
  }
827
826
  }
828
827
  }
@@ -19991,6 +19990,13 @@ define("tinymce/ui/FloatPanel", [
19991
19990
  visiblePanels.splice(i, 1);
19992
19991
  }
19993
19992
  }
19993
+
19994
+ i = zOrder.length;
19995
+ while (i--) {
19996
+ if (zOrder[i] === panel) {
19997
+ zOrder.splice(i, 1);
19998
+ }
19999
+ }
19994
20000
  }
19995
20001
 
19996
20002
  return FloatPanel;
@@ -20653,7 +20659,7 @@ define("tinymce/ui/Window", [
20653
20659
  items.push(ctrl.getEl('inp'));
20654
20660
 
20655
20661
  if (ctrl.getEl('open')) {
20656
- items.push(ctrl.getEl('open').firstChild);
20662
+ items.push(ctrl.getEl('open'));
20657
20663
  }
20658
20664
  } else {
20659
20665
  items.push(ctrl.getEl());
@@ -20708,12 +20714,6 @@ define("tinymce/ui/Window", [
20708
20714
  * @return {Object} Event arguments object.
20709
20715
  */
20710
20716
  submit: function() {
20711
- // Blur current control so a onchange is fired before submit
20712
- var ctrl = this.getParentCtrl(document.activeElement);
20713
- if (ctrl) {
20714
- ctrl.blur();
20715
- }
20716
-
20717
20717
  return this.fire('submit', {data: this.toJSON()});
20718
20718
  },
20719
20719
 
@@ -20872,6 +20872,7 @@ define("tinymce/ui/MessageBox", [
20872
20872
  buttons = [
20873
20873
  {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
20874
20874
  e.control.parents()[1].close();
20875
+ callback(true);
20875
20876
  }}
20876
20877
  ];
20877
20878
  break;
@@ -21093,7 +21094,9 @@ define("tinymce/WindowManager", [
21093
21094
  */
21094
21095
  self.alert = function(message, callback, scope) {
21095
21096
  MessageBox.alert(message, function() {
21096
- callback.call(scope || this);
21097
+ if (callback) {
21098
+ callback.call(scope || this);
21099
+ }
21097
21100
  });
21098
21101
  };
21099
21102
 
@@ -22393,6 +22396,14 @@ define("tinymce/util/Observable", [
22393
22396
  }
22394
22397
 
22395
22398
  return self;
22399
+ },
22400
+
22401
+ hasEventListeners: function(name) {
22402
+ var bindings = this[bindingsName];
22403
+
22404
+ name = name.toLowerCase();
22405
+
22406
+ return !(!bindings || !bindings[name] || bindings[name].length === 0);
22396
22407
  }
22397
22408
  };
22398
22409
  });
@@ -22589,7 +22600,7 @@ define("tinymce/Editor", [
22589
22600
  var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
22590
22601
  var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
22591
22602
  var Event = EventUtils.Event;
22592
- var isGecko = Env.gecko, ie = Env.ie, isOpera = Env.opera;
22603
+ var isGecko = Env.gecko, ie = Env.ie;
22593
22604
 
22594
22605
  function getEventTarget(editor, eventName) {
22595
22606
  if (eventName == 'selectionchange' || eventName == 'drop') {
@@ -22826,6 +22837,7 @@ define("tinymce/Editor", [
22826
22837
  // Add hidden input for non input elements inside form elements
22827
22838
  if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
22828
22839
  DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
22840
+ self.hasHiddenInput = true;
22829
22841
  }
22830
22842
 
22831
22843
  // Pass submit/reset from form to editor instance
@@ -23115,11 +23127,6 @@ define("tinymce/Editor", [
23115
23127
  return self.initContentBody();
23116
23128
  }
23117
23129
 
23118
- // User specified a document.domain value
23119
- if (document.domain && location.hostname != document.domain) {
23120
- self.editorManager.relaxedDomain = document.domain;
23121
- }
23122
-
23123
23130
  self.iframeHTML = settings.doctype + '<html><head>';
23124
23131
 
23125
23132
  // We only need to override paths if we have to
@@ -23157,13 +23164,14 @@ define("tinymce/Editor", [
23157
23164
  self.iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" ' +
23158
23165
  'onload="window.parent.tinymce.get(\'' + self.id + '\').fire(\'load\');"><br></body></html>';
23159
23166
 
23160
- // Domain relaxing enabled, then set document domain
23161
- // TODO: Fix this old stuff
23162
- if (self.editorManager.relaxedDomain && (ie || (isOpera && parseFloat(window.opera.version()) < 11))) {
23163
- // We need to write the contents here in IE since multiple writes messes up refresh button and back button
23164
- url = 'javascript:(function(){document.open();document.domain="' + document.domain + '";' +
23165
- 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
23166
- 'document.close();ed.initContentBody();})()';
23167
+ var domainRelaxUrl = 'javascript:(function(){'+
23168
+ 'document.open();document.domain="' + document.domain + '";' +
23169
+ 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
23170
+ 'document.close();ed.initContentBody(true);})()';
23171
+
23172
+ // Domain relaxing is required since the user has messed around with document.domain
23173
+ if (document.domain != location.hostname) {
23174
+ url = domainRelaxUrl;
23167
23175
  }
23168
23176
 
23169
23177
  // Create iframe
@@ -23184,6 +23192,16 @@ define("tinymce/Editor", [
23184
23192
  }
23185
23193
  });
23186
23194
 
23195
+ // Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
23196
+ // Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
23197
+ if (ie) {
23198
+ try {
23199
+ self.getDoc();
23200
+ } catch (e) {
23201
+ n.src = url = domainRelaxUrl;
23202
+ }
23203
+ }
23204
+
23187
23205
  self.contentAreaContainer = o.iframeContainer;
23188
23206
 
23189
23207
  if (o.editorContainer) {
@@ -23193,7 +23211,7 @@ define("tinymce/Editor", [
23193
23211
  DOM.get(self.id).style.display = 'none';
23194
23212
  DOM.setAttrib(self.id, 'aria-hidden', true);
23195
23213
 
23196
- if (!self.editorManager.relaxedDomain || !url) {
23214
+ if (!url) {
23197
23215
  self.initContentBody();
23198
23216
  }
23199
23217
 
@@ -23207,7 +23225,7 @@ define("tinymce/Editor", [
23207
23225
  * @method initContentBody
23208
23226
  * @private
23209
23227
  */
23210
- initContentBody: function() {
23228
+ initContentBody: function(skipWrite) {
23211
23229
  var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText;
23212
23230
 
23213
23231
  // Restore visibility on target element
@@ -23216,14 +23234,10 @@ define("tinymce/Editor", [
23216
23234
  }
23217
23235
 
23218
23236
  // Setup iframe body
23219
- if ((!ie || !self.editorManager.relaxedDomain) && !settings.content_editable) {
23237
+ if (!skipWrite && !settings.content_editable) {
23220
23238
  doc.open();
23221
23239
  doc.write(self.iframeHTML);
23222
23240
  doc.close();
23223
-
23224
- if (self.editorManager.relaxedDomain) {
23225
- doc.domain = self.editorManager.relaxedDomain;
23226
- }
23227
23241
  }
23228
23242
 
23229
23243
  if (settings.content_editable) {
@@ -24524,12 +24538,18 @@ define("tinymce/Editor", [
24524
24538
  * @method remove
24525
24539
  */
24526
24540
  remove: function() {
24527
- var self = this, elm = self.getContainer(), doc = self.getDoc();
24541
+ var self = this;
24528
24542
 
24529
24543
  if (!self.removed) {
24530
24544
  self.removed = 1; // Cancels post remove event execution
24531
24545
 
24546
+ // Remove any hidden input
24547
+ if (self.hasHiddenInput) {
24548
+ DOM.remove(self.getElement().nextSibling);
24549
+ }
24550
+
24532
24551
  // Fixed bug where IE has a blinking cursor left from the editor
24552
+ var doc = self.getDoc();
24533
24553
  if (ie && doc) {
24534
24554
  doc.execCommand('SelectAll');
24535
24555
  }
@@ -24546,6 +24566,7 @@ define("tinymce/Editor", [
24546
24566
  Event.unbind(self.getDoc());
24547
24567
  }
24548
24568
 
24569
+ var elm = self.getContainer();
24549
24570
  Event.unbind(self.getBody());
24550
24571
  Event.unbind(elm);
24551
24572
 
@@ -24597,6 +24618,13 @@ define("tinymce/Editor", [
24597
24618
  return;
24598
24619
  }
24599
24620
 
24621
+ // If user manually calls destroy and not remove
24622
+ // Users seems to have logic that calls destroy instead of remove
24623
+ if (!automatic && !self.removed) {
24624
+ self.remove();
24625
+ return;
24626
+ }
24627
+
24600
24628
  // We must unbind on Gecko since it would otherwise produce the pesky "attempt
24601
24629
  // to run compile-and-go script on a cleared scope" message
24602
24630
  if (automatic && isGecko) {
@@ -24999,7 +25027,7 @@ define("tinymce/EditorManager", [
24999
25027
  * @property minorVersion
25000
25028
  * @type String
25001
25029
  */
25002
- minorVersion : '0.6',
25030
+ minorVersion : '0.7',
25003
25031
 
25004
25032
  /**
25005
25033
  * Release date of TinyMCE build.
@@ -25007,7 +25035,7 @@ define("tinymce/EditorManager", [
25007
25035
  * @property releaseDate
25008
25036
  * @type String
25009
25037
  */
25010
- releaseDate: '2013-09-12',
25038
+ releaseDate: '2013-10-02',
25011
25039
 
25012
25040
  /**
25013
25041
  * Collection of editor instances.
@@ -26992,12 +27020,24 @@ define("tinymce/ui/PanelButton", [
26992
27020
  showPanel: function() {
26993
27021
  var self = this, settings = self.settings;
26994
27022
 
26995
- settings.panel.popover = true;
26996
- settings.panel.autohide = true;
26997
27023
  self.active(true);
26998
27024
 
26999
27025
  if (!self.panel) {
27000
- self.panel = new FloatPanel(settings.panel).on('hide', function() {
27026
+ var panelSettings = settings.panel;
27027
+
27028
+ // Wrap panel in grid layout if type if specified
27029
+ // This makes it possible to add forms or other containers directly in the panel option
27030
+ if (panelSettings.type) {
27031
+ panelSettings = {
27032
+ layout: 'grid',
27033
+ items: panelSettings
27034
+ };
27035
+ }
27036
+
27037
+ panelSettings.popover = true;
27038
+ panelSettings.autohide = true;
27039
+
27040
+ self.panel = new FloatPanel(panelSettings).on('hide', function() {
27001
27041
  self.active(false);
27002
27042
  }).parent(self).renderTo(self.getContainerElm());
27003
27043
  self.panel.fire('show');
@@ -27006,7 +27046,7 @@ define("tinymce/ui/PanelButton", [
27006
27046
  self.panel.show();
27007
27047
  }
27008
27048
 
27009
- self.panel.moveRel(self.getEl(), settings.popoverAlign || 'bc-tc');
27049
+ self.panel.moveRel(self.getEl(), settings.popoverAlign || ['bc-tl', 'bc-tc']);
27010
27050
  },
27011
27051
 
27012
27052
  /**
@@ -27289,11 +27329,11 @@ define("tinymce/ui/ComboBox", [
27289
27329
  disabled: function(state) {
27290
27330
  var self = this;
27291
27331
 
27292
- self._super(state);
27293
-
27294
- if (self._rendered) {
27332
+ if (self._rendered && typeof(state) != 'undefined') {
27295
27333
  self.getEl('inp').disabled = state;
27296
27334
  }
27335
+
27336
+ return self._super(state);
27297
27337
  },
27298
27338
 
27299
27339
  /**
@@ -27387,7 +27427,7 @@ define("tinymce/ui/ComboBox", [
27387
27427
  return (
27388
27428
  '<div id="' + id + '" class="' + self.classes() + '">' +
27389
27429
  '<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
27390
- value + '" hidefocus="true">' +
27430
+ value + '" hidefocus="true"' + (self.disabled() ? ' disabled="disabled"' : '') + '>' +
27391
27431
  openBtnHtml +
27392
27432
  '</div>'
27393
27433
  );
@@ -27811,12 +27851,6 @@ define("tinymce/ui/Form", [
27811
27851
  * @return {Object} Event arguments object.
27812
27852
  */
27813
27853
  submit: function() {
27814
- // Blur current control so a onchange is fired before submit
27815
- var ctrl = this.getParentCtrl(document.activeElement);
27816
- if (ctrl) {
27817
- ctrl.blur();
27818
- }
27819
-
27820
27854
  return this.fire('submit', {data: this.toJSON()});
27821
27855
  },
27822
27856
 
@@ -29937,6 +29971,10 @@ define("tinymce/ui/MenuItem", [
29937
29971
  settings.icon = 'selected';
29938
29972
  }
29939
29973
 
29974
+ if (!settings.preview && !settings.selectable) {
29975
+ self.addClass('menu-item-normal');
29976
+ }
29977
+
29940
29978
  self.on('mousedown', function(e) {
29941
29979
  e.preventDefault();
29942
29980
  });
@@ -30616,7 +30654,7 @@ define("tinymce/ui/TabPanel", [
30616
30654
  "tinymce/ui/Panel",
30617
30655
  "tinymce/ui/DomUtils"
30618
30656
  ], function(Panel, DomUtils) {
30619
- "use stict";
30657
+ "use strict";
30620
30658
 
30621
30659
  return Panel.extend({
30622
30660
  lastIdx: 0,
@@ -30723,7 +30761,9 @@ define("tinymce/ui/TabPanel", [
30723
30761
  initLayoutRect: function() {
30724
30762
  var self = this, rect, minW, minH;
30725
30763
 
30726
- minW = minH = 0;
30764
+ minW = self.getEl('head').offsetWidth;
30765
+ minW = minW < 0 ? 0 : minW;
30766
+ minH = 0;
30727
30767
  self.items().each(function(item, i) {
30728
30768
  minW = Math.max(minW, item.layoutRect().minW);
30729
30769
  minH = Math.max(minH, item.layoutRect().minH);
@@ -30822,6 +30862,23 @@ define("tinymce/ui/TextBox", [
30822
30862
  }
30823
30863
  },
30824
30864
 
30865
+ /**
30866
+ * Getter/setter function for the disabled state.
30867
+ *
30868
+ * @method value
30869
+ * @param {Boolean} [state] State to be set.
30870
+ * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
30871
+ */
30872
+ disabled: function(state) {
30873
+ var self = this;
30874
+
30875
+ if (self._rendered && typeof(state) != 'undefined') {
30876
+ self.getEl().disabled = state;
30877
+ }
30878
+
30879
+ return self._super(state);
30880
+ },
30881
+
30825
30882
  /**
30826
30883
  * Getter/setter function for the control value.
30827
30884
  *
@@ -30922,6 +30979,10 @@ define("tinymce/ui/TextBox", [
30922
30979
  extraAttrs += ' type="' + settings.subtype + '"';
30923
30980
  }
30924
30981
 
30982
+ if (self.disabled()) {
30983
+ extraAttrs += ' disabled="disabled"';
30984
+ }
30985
+
30925
30986
  if (settings.multiline) {
30926
30987
  return (
30927
30988
  '<textarea id="' + id + '" class="' + self.classes() + '" ' +
@@ -1,4 +1,4 @@
1
- // 4.0.6 (2013-09-12)
1
+ // 4.0.7 (2013-10-02)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -486,7 +486,6 @@ define("tinymce/dom/EventUtils", [], function() {
486
486
  callbackList.nativeHandler = nativeHandler;
487
487
 
488
488
  eventMap[name] = callbackList;
489
- callbackList.splice(ci, 1);
490
489
  }
491
490
  }
492
491
  }
@@ -22610,6 +22609,13 @@ define("tinymce/ui/FloatPanel", [
22610
22609
  visiblePanels.splice(i, 1);
22611
22610
  }
22612
22611
  }
22612
+
22613
+ i = zOrder.length;
22614
+ while (i--) {
22615
+ if (zOrder[i] === panel) {
22616
+ zOrder.splice(i, 1);
22617
+ }
22618
+ }
22613
22619
  }
22614
22620
 
22615
22621
  return FloatPanel;
@@ -23272,7 +23278,7 @@ define("tinymce/ui/Window", [
23272
23278
  items.push(ctrl.getEl('inp'));
23273
23279
 
23274
23280
  if (ctrl.getEl('open')) {
23275
- items.push(ctrl.getEl('open').firstChild);
23281
+ items.push(ctrl.getEl('open'));
23276
23282
  }
23277
23283
  } else {
23278
23284
  items.push(ctrl.getEl());
@@ -23327,12 +23333,6 @@ define("tinymce/ui/Window", [
23327
23333
  * @return {Object} Event arguments object.
23328
23334
  */
23329
23335
  submit: function() {
23330
- // Blur current control so a onchange is fired before submit
23331
- var ctrl = this.getParentCtrl(document.activeElement);
23332
- if (ctrl) {
23333
- ctrl.blur();
23334
- }
23335
-
23336
23336
  return this.fire('submit', {data: this.toJSON()});
23337
23337
  },
23338
23338
 
@@ -23491,6 +23491,7 @@ define("tinymce/ui/MessageBox", [
23491
23491
  buttons = [
23492
23492
  {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
23493
23493
  e.control.parents()[1].close();
23494
+ callback(true);
23494
23495
  }}
23495
23496
  ];
23496
23497
  break;
@@ -23712,7 +23713,9 @@ define("tinymce/WindowManager", [
23712
23713
  */
23713
23714
  self.alert = function(message, callback, scope) {
23714
23715
  MessageBox.alert(message, function() {
23715
- callback.call(scope || this);
23716
+ if (callback) {
23717
+ callback.call(scope || this);
23718
+ }
23716
23719
  });
23717
23720
  };
23718
23721
 
@@ -25012,6 +25015,14 @@ define("tinymce/util/Observable", [
25012
25015
  }
25013
25016
 
25014
25017
  return self;
25018
+ },
25019
+
25020
+ hasEventListeners: function(name) {
25021
+ var bindings = this[bindingsName];
25022
+
25023
+ name = name.toLowerCase();
25024
+
25025
+ return !(!bindings || !bindings[name] || bindings[name].length === 0);
25015
25026
  }
25016
25027
  };
25017
25028
  });
@@ -25208,7 +25219,7 @@ define("tinymce/Editor", [
25208
25219
  var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
25209
25220
  var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
25210
25221
  var Event = EventUtils.Event;
25211
- var isGecko = Env.gecko, ie = Env.ie, isOpera = Env.opera;
25222
+ var isGecko = Env.gecko, ie = Env.ie;
25212
25223
 
25213
25224
  function getEventTarget(editor, eventName) {
25214
25225
  if (eventName == 'selectionchange' || eventName == 'drop') {
@@ -25445,6 +25456,7 @@ define("tinymce/Editor", [
25445
25456
  // Add hidden input for non input elements inside form elements
25446
25457
  if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
25447
25458
  DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
25459
+ self.hasHiddenInput = true;
25448
25460
  }
25449
25461
 
25450
25462
  // Pass submit/reset from form to editor instance
@@ -25734,11 +25746,6 @@ define("tinymce/Editor", [
25734
25746
  return self.initContentBody();
25735
25747
  }
25736
25748
 
25737
- // User specified a document.domain value
25738
- if (document.domain && location.hostname != document.domain) {
25739
- self.editorManager.relaxedDomain = document.domain;
25740
- }
25741
-
25742
25749
  self.iframeHTML = settings.doctype + '<html><head>';
25743
25750
 
25744
25751
  // We only need to override paths if we have to
@@ -25776,13 +25783,14 @@ define("tinymce/Editor", [
25776
25783
  self.iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" ' +
25777
25784
  'onload="window.parent.tinymce.get(\'' + self.id + '\').fire(\'load\');"><br></body></html>';
25778
25785
 
25779
- // Domain relaxing enabled, then set document domain
25780
- // TODO: Fix this old stuff
25781
- if (self.editorManager.relaxedDomain && (ie || (isOpera && parseFloat(window.opera.version()) < 11))) {
25782
- // We need to write the contents here in IE since multiple writes messes up refresh button and back button
25783
- url = 'javascript:(function(){document.open();document.domain="' + document.domain + '";' +
25784
- 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
25785
- 'document.close();ed.initContentBody();})()';
25786
+ var domainRelaxUrl = 'javascript:(function(){'+
25787
+ 'document.open();document.domain="' + document.domain + '";' +
25788
+ 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
25789
+ 'document.close();ed.initContentBody(true);})()';
25790
+
25791
+ // Domain relaxing is required since the user has messed around with document.domain
25792
+ if (document.domain != location.hostname) {
25793
+ url = domainRelaxUrl;
25786
25794
  }
25787
25795
 
25788
25796
  // Create iframe
@@ -25803,6 +25811,16 @@ define("tinymce/Editor", [
25803
25811
  }
25804
25812
  });
25805
25813
 
25814
+ // Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
25815
+ // Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
25816
+ if (ie) {
25817
+ try {
25818
+ self.getDoc();
25819
+ } catch (e) {
25820
+ n.src = url = domainRelaxUrl;
25821
+ }
25822
+ }
25823
+
25806
25824
  self.contentAreaContainer = o.iframeContainer;
25807
25825
 
25808
25826
  if (o.editorContainer) {
@@ -25812,7 +25830,7 @@ define("tinymce/Editor", [
25812
25830
  DOM.get(self.id).style.display = 'none';
25813
25831
  DOM.setAttrib(self.id, 'aria-hidden', true);
25814
25832
 
25815
- if (!self.editorManager.relaxedDomain || !url) {
25833
+ if (!url) {
25816
25834
  self.initContentBody();
25817
25835
  }
25818
25836
 
@@ -25826,7 +25844,7 @@ define("tinymce/Editor", [
25826
25844
  * @method initContentBody
25827
25845
  * @private
25828
25846
  */
25829
- initContentBody: function() {
25847
+ initContentBody: function(skipWrite) {
25830
25848
  var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText;
25831
25849
 
25832
25850
  // Restore visibility on target element
@@ -25835,14 +25853,10 @@ define("tinymce/Editor", [
25835
25853
  }
25836
25854
 
25837
25855
  // Setup iframe body
25838
- if ((!ie || !self.editorManager.relaxedDomain) && !settings.content_editable) {
25856
+ if (!skipWrite && !settings.content_editable) {
25839
25857
  doc.open();
25840
25858
  doc.write(self.iframeHTML);
25841
25859
  doc.close();
25842
-
25843
- if (self.editorManager.relaxedDomain) {
25844
- doc.domain = self.editorManager.relaxedDomain;
25845
- }
25846
25860
  }
25847
25861
 
25848
25862
  if (settings.content_editable) {
@@ -27143,12 +27157,18 @@ define("tinymce/Editor", [
27143
27157
  * @method remove
27144
27158
  */
27145
27159
  remove: function() {
27146
- var self = this, elm = self.getContainer(), doc = self.getDoc();
27160
+ var self = this;
27147
27161
 
27148
27162
  if (!self.removed) {
27149
27163
  self.removed = 1; // Cancels post remove event execution
27150
27164
 
27165
+ // Remove any hidden input
27166
+ if (self.hasHiddenInput) {
27167
+ DOM.remove(self.getElement().nextSibling);
27168
+ }
27169
+
27151
27170
  // Fixed bug where IE has a blinking cursor left from the editor
27171
+ var doc = self.getDoc();
27152
27172
  if (ie && doc) {
27153
27173
  doc.execCommand('SelectAll');
27154
27174
  }
@@ -27165,6 +27185,7 @@ define("tinymce/Editor", [
27165
27185
  Event.unbind(self.getDoc());
27166
27186
  }
27167
27187
 
27188
+ var elm = self.getContainer();
27168
27189
  Event.unbind(self.getBody());
27169
27190
  Event.unbind(elm);
27170
27191
 
@@ -27216,6 +27237,13 @@ define("tinymce/Editor", [
27216
27237
  return;
27217
27238
  }
27218
27239
 
27240
+ // If user manually calls destroy and not remove
27241
+ // Users seems to have logic that calls destroy instead of remove
27242
+ if (!automatic && !self.removed) {
27243
+ self.remove();
27244
+ return;
27245
+ }
27246
+
27219
27247
  // We must unbind on Gecko since it would otherwise produce the pesky "attempt
27220
27248
  // to run compile-and-go script on a cleared scope" message
27221
27249
  if (automatic && isGecko) {
@@ -27618,7 +27646,7 @@ define("tinymce/EditorManager", [
27618
27646
  * @property minorVersion
27619
27647
  * @type String
27620
27648
  */
27621
- minorVersion : '0.6',
27649
+ minorVersion : '0.7',
27622
27650
 
27623
27651
  /**
27624
27652
  * Release date of TinyMCE build.
@@ -27626,7 +27654,7 @@ define("tinymce/EditorManager", [
27626
27654
  * @property releaseDate
27627
27655
  * @type String
27628
27656
  */
27629
- releaseDate: '2013-09-12',
27657
+ releaseDate: '2013-10-02',
27630
27658
 
27631
27659
  /**
27632
27660
  * Collection of editor instances.
@@ -29611,12 +29639,24 @@ define("tinymce/ui/PanelButton", [
29611
29639
  showPanel: function() {
29612
29640
  var self = this, settings = self.settings;
29613
29641
 
29614
- settings.panel.popover = true;
29615
- settings.panel.autohide = true;
29616
29642
  self.active(true);
29617
29643
 
29618
29644
  if (!self.panel) {
29619
- self.panel = new FloatPanel(settings.panel).on('hide', function() {
29645
+ var panelSettings = settings.panel;
29646
+
29647
+ // Wrap panel in grid layout if type if specified
29648
+ // This makes it possible to add forms or other containers directly in the panel option
29649
+ if (panelSettings.type) {
29650
+ panelSettings = {
29651
+ layout: 'grid',
29652
+ items: panelSettings
29653
+ };
29654
+ }
29655
+
29656
+ panelSettings.popover = true;
29657
+ panelSettings.autohide = true;
29658
+
29659
+ self.panel = new FloatPanel(panelSettings).on('hide', function() {
29620
29660
  self.active(false);
29621
29661
  }).parent(self).renderTo(self.getContainerElm());
29622
29662
  self.panel.fire('show');
@@ -29625,7 +29665,7 @@ define("tinymce/ui/PanelButton", [
29625
29665
  self.panel.show();
29626
29666
  }
29627
29667
 
29628
- self.panel.moveRel(self.getEl(), settings.popoverAlign || 'bc-tc');
29668
+ self.panel.moveRel(self.getEl(), settings.popoverAlign || ['bc-tl', 'bc-tc']);
29629
29669
  },
29630
29670
 
29631
29671
  /**
@@ -29908,11 +29948,11 @@ define("tinymce/ui/ComboBox", [
29908
29948
  disabled: function(state) {
29909
29949
  var self = this;
29910
29950
 
29911
- self._super(state);
29912
-
29913
- if (self._rendered) {
29951
+ if (self._rendered && typeof(state) != 'undefined') {
29914
29952
  self.getEl('inp').disabled = state;
29915
29953
  }
29954
+
29955
+ return self._super(state);
29916
29956
  },
29917
29957
 
29918
29958
  /**
@@ -30006,7 +30046,7 @@ define("tinymce/ui/ComboBox", [
30006
30046
  return (
30007
30047
  '<div id="' + id + '" class="' + self.classes() + '">' +
30008
30048
  '<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
30009
- value + '" hidefocus="true">' +
30049
+ value + '" hidefocus="true"' + (self.disabled() ? ' disabled="disabled"' : '') + '>' +
30010
30050
  openBtnHtml +
30011
30051
  '</div>'
30012
30052
  );
@@ -30430,12 +30470,6 @@ define("tinymce/ui/Form", [
30430
30470
  * @return {Object} Event arguments object.
30431
30471
  */
30432
30472
  submit: function() {
30433
- // Blur current control so a onchange is fired before submit
30434
- var ctrl = this.getParentCtrl(document.activeElement);
30435
- if (ctrl) {
30436
- ctrl.blur();
30437
- }
30438
-
30439
30473
  return this.fire('submit', {data: this.toJSON()});
30440
30474
  },
30441
30475
 
@@ -32556,6 +32590,10 @@ define("tinymce/ui/MenuItem", [
32556
32590
  settings.icon = 'selected';
32557
32591
  }
32558
32592
 
32593
+ if (!settings.preview && !settings.selectable) {
32594
+ self.addClass('menu-item-normal');
32595
+ }
32596
+
32559
32597
  self.on('mousedown', function(e) {
32560
32598
  e.preventDefault();
32561
32599
  });
@@ -33235,7 +33273,7 @@ define("tinymce/ui/TabPanel", [
33235
33273
  "tinymce/ui/Panel",
33236
33274
  "tinymce/ui/DomUtils"
33237
33275
  ], function(Panel, DomUtils) {
33238
- "use stict";
33276
+ "use strict";
33239
33277
 
33240
33278
  return Panel.extend({
33241
33279
  lastIdx: 0,
@@ -33342,7 +33380,9 @@ define("tinymce/ui/TabPanel", [
33342
33380
  initLayoutRect: function() {
33343
33381
  var self = this, rect, minW, minH;
33344
33382
 
33345
- minW = minH = 0;
33383
+ minW = self.getEl('head').offsetWidth;
33384
+ minW = minW < 0 ? 0 : minW;
33385
+ minH = 0;
33346
33386
  self.items().each(function(item, i) {
33347
33387
  minW = Math.max(minW, item.layoutRect().minW);
33348
33388
  minH = Math.max(minH, item.layoutRect().minH);
@@ -33441,6 +33481,23 @@ define("tinymce/ui/TextBox", [
33441
33481
  }
33442
33482
  },
33443
33483
 
33484
+ /**
33485
+ * Getter/setter function for the disabled state.
33486
+ *
33487
+ * @method value
33488
+ * @param {Boolean} [state] State to be set.
33489
+ * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
33490
+ */
33491
+ disabled: function(state) {
33492
+ var self = this;
33493
+
33494
+ if (self._rendered && typeof(state) != 'undefined') {
33495
+ self.getEl().disabled = state;
33496
+ }
33497
+
33498
+ return self._super(state);
33499
+ },
33500
+
33444
33501
  /**
33445
33502
  * Getter/setter function for the control value.
33446
33503
  *
@@ -33541,6 +33598,10 @@ define("tinymce/ui/TextBox", [
33541
33598
  extraAttrs += ' type="' + settings.subtype + '"';
33542
33599
  }
33543
33600
 
33601
+ if (self.disabled()) {
33602
+ extraAttrs += ' disabled="disabled"';
33603
+ }
33604
+
33544
33605
  if (settings.multiline) {
33545
33606
  return (
33546
33607
  '<textarea id="' + id + '" class="' + self.classes() + '" ' +