tinymce-rails 4.0.12 → 4.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. data/README.md +5 -1
  2. data/app/assets/source/tinymce/tinymce.jquery.js +411 -62
  3. data/app/assets/source/tinymce/tinymce.js +411 -62
  4. data/lib/tinymce/rails/version.rb +2 -2
  5. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  6. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  7. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  8. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  9. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  10. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
  11. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
  13. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
  14. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
  16. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +1 -1
  18. data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +1 -1
  19. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.min.css +1 -1
  20. data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +1 -1
  21. data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/tinymce.jquery.js +9 -9
  23. data/vendor/assets/javascripts/tinymce/tinymce.js +10 -10
  24. metadata +2 -3
  25. data/vendor/assets/javascripts/tinymce/skins/lightgray/img/wline.gif +0 -0
data/README.md CHANGED
@@ -68,7 +68,11 @@ or (2) with jQuery integration:
68
68
 
69
69
  For each textarea that you want to use with TinyMCE, add the "tinymce" class and ensure it has a unique ID:
70
70
 
71
- <%= text_area_tag :editor, "", :class => "tinymce", :rows => 40, :cols => 120 %>
71
+ <%= text_area_tag :content, "", :class => "tinymce", :rows => 40, :cols => 120 %>
72
+
73
+ or if you are using Rails' form builders:
74
+
75
+ <%= f.text_area :content, :class => "tinymce", :rows => 40, :cols => 120 %>
72
76
 
73
77
  Then invoke the `tinymce` helper to initialize TinyMCE:
74
78
 
@@ -1,4 +1,4 @@
1
- // 4.0.12 (2013-12-18)
1
+ // 4.0.16 (2014-01-31)
2
2
 
3
3
  /**
4
4
  * Compiled inline version. (Library mode)
@@ -584,7 +584,7 @@ define("tinymce/dom/EventUtils", [], function() {
584
584
  }
585
585
 
586
586
  function waitForDomLoaded() {
587
- if (doc.readyState === "complete") {
587
+ if (doc.readyState === "complete" || doc.readyState === "interactive") {
588
588
  removeEvent(doc, "readystatechange", waitForDomLoaded);
589
589
  readyHandler();
590
590
  }
@@ -615,7 +615,7 @@ define("tinymce/dom/EventUtils", [], function() {
615
615
  addEvent(doc, "readystatechange", waitForDomLoaded);
616
616
 
617
617
  // Wait until we can scroll, when we can the DOM is initialized
618
- if (doc.documentElement.doScroll && win === win.top) {
618
+ if (doc.documentElement.doScroll && win.self === win.top) {
619
619
  tryScroll();
620
620
  }
621
621
  }
@@ -2759,6 +2759,194 @@ define("tinymce/Env", [], function() {
2759
2759
  };
2760
2760
  });
2761
2761
 
2762
+ // Included from: js/tinymce/classes/dom/StyleSheetLoader.js
2763
+
2764
+ /**
2765
+ * StyleSheetLoader.js
2766
+ *
2767
+ * Copyright, Moxiecode Systems AB
2768
+ * Released under LGPL License.
2769
+ *
2770
+ * License: http://www.tinymce.com/license
2771
+ * Contributing: http://www.tinymce.com/contributing
2772
+ */
2773
+
2774
+ /**
2775
+ * This class handles loading of external stylesheets and fires events when these are loaded.
2776
+ *
2777
+ * @class tinymce.dom.StyleSheetLoader
2778
+ * @private
2779
+ */
2780
+ define("tinymce/dom/StyleSheetLoader", [], function() {
2781
+ "use strict";
2782
+
2783
+ return function(document, settings) {
2784
+ var idCount = 0, loadedStates = {}, maxLoadTime;
2785
+
2786
+ settings = settings || {};
2787
+ maxLoadTime = settings.maxLoadTime || 5000;
2788
+
2789
+ function appendToHead(node) {
2790
+ document.getElementsByTagName('head')[0].appendChild(node);
2791
+ }
2792
+
2793
+ /**
2794
+ * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
2795
+ *
2796
+ * @method load
2797
+ * @param {String} url Url to be loaded.
2798
+ * @param {Function} loadedCallback Callback to be executed when loaded.
2799
+ * @param {Function} errorCallback Callback to be executed when failed loading.
2800
+ */
2801
+ function load(url, loadedCallback, errorCallback) {
2802
+ var link, style, startTime, state;
2803
+
2804
+ function passed() {
2805
+ var callbacks = state.passed, i = callbacks.length;
2806
+
2807
+ while (i--) {
2808
+ callbacks[i]();
2809
+ }
2810
+
2811
+ state.status = 2;
2812
+ state.passed = [];
2813
+ state.failed = [];
2814
+ }
2815
+
2816
+ function failed() {
2817
+ var callbacks = state.failed, i = callbacks.length;
2818
+
2819
+ while (i--) {
2820
+ callbacks[i]();
2821
+ }
2822
+
2823
+ state.status = 3;
2824
+ state.passed = [];
2825
+ state.failed = [];
2826
+ }
2827
+
2828
+ // Sniffs for older WebKit versions that have the link.onload but a broken one
2829
+ function isOldWebKit() {
2830
+ var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
2831
+ return !!(webKitChunks && webKitChunks[1] < 536);
2832
+ }
2833
+
2834
+ // Calls the waitCallback until the test returns true or the timeout occurs
2835
+ function wait(testCallback, waitCallback) {
2836
+ if (!testCallback()) {
2837
+ // Wait for timeout
2838
+ if ((new Date().getTime()) - startTime < maxLoadTime) {
2839
+ window.setTimeout(waitCallback, 0);
2840
+ } else {
2841
+ failed();
2842
+ }
2843
+ }
2844
+ }
2845
+
2846
+ // Workaround for WebKit that doesn't properly support the onload event for link elements
2847
+ // Or WebKit that fires the onload event before the StyleSheet is added to the document
2848
+ function waitForWebKitLinkLoaded() {
2849
+ wait(function() {
2850
+ var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
2851
+
2852
+ while (i--) {
2853
+ styleSheet = styleSheets[i];
2854
+ owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
2855
+ if (owner && owner.id === link.id) {
2856
+ passed();
2857
+ return true;
2858
+ }
2859
+ }
2860
+ }, waitForWebKitLinkLoaded);
2861
+ }
2862
+
2863
+ // Workaround for older Geckos that doesn't have any onload event for StyleSheets
2864
+ function waitForGeckoLinkLoaded() {
2865
+ wait(function() {
2866
+ try {
2867
+ // Accessing the cssRules will throw an exception until the CSS file is loaded
2868
+ var cssRules = style.sheet.cssRules;
2869
+ passed();
2870
+ return !!cssRules;
2871
+ } catch (ex) {
2872
+ // Ignore
2873
+ }
2874
+ }, waitForGeckoLinkLoaded);
2875
+ }
2876
+
2877
+ if (!loadedStates[url]) {
2878
+ state = {
2879
+ passed: [],
2880
+ failed: []
2881
+ };
2882
+
2883
+ loadedStates[url] = state;
2884
+ } else {
2885
+ state = loadedStates[url];
2886
+ }
2887
+
2888
+ if (loadedCallback) {
2889
+ state.passed.push(loadedCallback);
2890
+ }
2891
+
2892
+ if (errorCallback) {
2893
+ state.failed.push(errorCallback);
2894
+ }
2895
+
2896
+ // Is loading wait for it to pass
2897
+ if (state.status == 1) {
2898
+ return;
2899
+ }
2900
+
2901
+ // Has finished loading and was success
2902
+ if (state.status == 2) {
2903
+ passed();
2904
+ return;
2905
+ }
2906
+
2907
+ // Has finished loading and was a failure
2908
+ if (state.status == 3) {
2909
+ failed();
2910
+ return;
2911
+ }
2912
+
2913
+ // Start loading
2914
+ state.status = 1;
2915
+ link = document.createElement('link');
2916
+ link.rel = 'stylesheet';
2917
+ link.type = 'text/css';
2918
+ link.id = 'u' + (idCount++);
2919
+ link.async = false;
2920
+ link.defer = false;
2921
+ startTime = new Date().getTime();
2922
+
2923
+ // Feature detect onload on link element and sniff older webkits since it has an broken onload event
2924
+ if ("onload" in link && !isOldWebKit()) {
2925
+ link.onload = waitForWebKitLinkLoaded;
2926
+ link.onerror = failed;
2927
+ } else {
2928
+ // Sniff for old Firefox that doesn't support the onload event on link elements
2929
+ // TODO: Remove this in the future when everyone uses modern browsers
2930
+ if (navigator.userAgent.indexOf("Firefox") > 0) {
2931
+ style = document.createElement('style');
2932
+ style.textContent = '@import "' + url + '"';
2933
+ waitForGeckoLinkLoaded();
2934
+ appendToHead(style);
2935
+ return;
2936
+ } else {
2937
+ // Use the id owner on older webkits
2938
+ waitForWebKitLinkLoaded();
2939
+ }
2940
+ }
2941
+
2942
+ appendToHead(link);
2943
+ link.href = url;
2944
+ }
2945
+
2946
+ this.load = load;
2947
+ };
2948
+ });
2949
+
2762
2950
  // Included from: js/tinymce/classes/dom/DOMUtils.js
2763
2951
 
2764
2952
  /**
@@ -2790,8 +2978,9 @@ define("tinymce/dom/DOMUtils", [
2790
2978
  "tinymce/dom/Range",
2791
2979
  "tinymce/html/Entities",
2792
2980
  "tinymce/Env",
2793
- "tinymce/util/Tools"
2794
- ], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools) {
2981
+ "tinymce/util/Tools",
2982
+ "tinymce/dom/StyleSheetLoader"
2983
+ ], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
2795
2984
  // Shorten names
2796
2985
  var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend;
2797
2986
  var isWebKit = Env.webkit, isIE = Env.ie;
@@ -2817,6 +3006,7 @@ define("tinymce/dom/DOMUtils", [
2817
3006
  self.stdMode = !isIE || doc.documentMode >= 8;
2818
3007
  self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
2819
3008
  self.hasOuterHTML = "outerHTML" in doc.createElement("a");
3009
+ self.styleSheetLoader = new StyleSheetLoader(doc);
2820
3010
  this.boundEvents = [];
2821
3011
 
2822
3012
  self.settings = settings = extend({
@@ -3764,8 +3954,8 @@ define("tinymce/dom/DOMUtils", [
3764
3954
 
3765
3955
  // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
3766
3956
  // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
3767
- x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientTop;
3768
- y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientLeft;
3957
+ x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientLeft;
3958
+ y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientTop;
3769
3959
 
3770
3960
  return {x: x, y: y};
3771
3961
  }
@@ -9558,11 +9748,13 @@ define("tinymce/dom/ControlSelection", [
9558
9748
  var controlElm;
9559
9749
 
9560
9750
  function isChildOrEqual(node, parent) {
9561
- do {
9562
- if (node === parent) {
9563
- return true;
9564
- }
9565
- } while ((node = node.parentNode));
9751
+ if (node) {
9752
+ do {
9753
+ if (node === parent) {
9754
+ return true;
9755
+ }
9756
+ } while ((node = node.parentNode));
9757
+ }
9566
9758
  }
9567
9759
 
9568
9760
  // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
@@ -9573,7 +9765,7 @@ define("tinymce/dom/ControlSelection", [
9573
9765
  controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
9574
9766
  controlElm = dom.getParent(controlElm, isIE ? 'table' : 'table,img,hr');
9575
9767
 
9576
- if (controlElm) {
9768
+ if (isChildOrEqual(controlElm, editor.getBody())) {
9577
9769
  disableGeckoResize();
9578
9770
 
9579
9771
  if (isChildOrEqual(selection.getStart(), controlElm) && isChildOrEqual(selection.getEnd(), controlElm)) {
@@ -9735,6 +9927,10 @@ define("tinymce/dom/ControlSelection", [
9735
9927
  }
9736
9928
 
9737
9929
  return {
9930
+ isResizable: isResizable,
9931
+ showResizeRect: showResizeRect,
9932
+ hideResizeRect: hideResizeRect,
9933
+ updateResizeRect: updateResizeRect,
9738
9934
  controlSelect: controlSelect,
9739
9935
  destroy: destroy
9740
9936
  };
@@ -10169,7 +10365,7 @@ define("tinymce/dom/Selection", [
10169
10365
 
10170
10366
  if (type == 2) {
10171
10367
  element = t.getNode();
10172
- name = element.nodeName;
10368
+ name = element ? element.nodeName : null;
10173
10369
 
10174
10370
  if (name == 'IMG') {
10175
10371
  return {name: name, index: findIndex(name, element)};
@@ -10553,7 +10749,8 @@ define("tinymce/dom/Selection", [
10553
10749
  }
10554
10750
 
10555
10751
  // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
10556
- if (isIE && rng && rng.setStart) {
10752
+ // IE 11 doesn't support the selection object so we check for that as well
10753
+ if (isIE && rng && rng.setStart && doc.selection) {
10557
10754
  try {
10558
10755
  // IE will sometimes throw an exception here
10559
10756
  ieRng = doc.selection.createRange();
@@ -13338,7 +13535,7 @@ define("tinymce/Formatter", [
13338
13535
  next = next ? 'nextSibling' : 'previousSibling';
13339
13536
 
13340
13537
  for (node = inc ? node : node[next]; node; node = node[next]) {
13341
- if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
13538
+ if (node.nodeType == 1 && !isWhiteSpaceNode(node)) {
13342
13539
  return node;
13343
13540
  }
13344
13541
  }
@@ -13396,7 +13593,7 @@ define("tinymce/Formatter", [
13396
13593
  var name = attr.nodeName.toLowerCase();
13397
13594
 
13398
13595
  // Don't compare internal attributes or style
13399
- if (name.indexOf('_') !== 0 && name !== 'style') {
13596
+ if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') {
13400
13597
  attribs[name] = dom.getAttrib(node, name);
13401
13598
  }
13402
13599
  });
@@ -15535,10 +15732,10 @@ define("tinymce/EditorCommands", [
15535
15732
  }
15536
15733
 
15537
15734
  each(selection.getSelectedBlocks(), function(element) {
15538
- var indentStyleName;
15539
-
15540
15735
  if (element.nodeName != "LI") {
15541
- indentStyleName = dom.getStyle(element, 'direction', true) == 'rtl' ? 'paddingRight' : 'paddingLeft';
15736
+ var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding';
15737
+
15738
+ indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left';
15542
15739
 
15543
15740
  if (command == 'outdent') {
15544
15741
  value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
@@ -17204,7 +17401,6 @@ define("tinymce/ui/Control", [
17204
17401
 
17205
17402
  var Control = Class.extend({
17206
17403
  Statics: {
17207
- controlIdLookup: {},
17208
17404
  elementIdCache: elementIdCache
17209
17405
  },
17210
17406
 
@@ -17326,10 +17522,10 @@ define("tinymce/ui/Control", [
17326
17522
  * @return {tinymce.ui.Control} Control instance or undefined.
17327
17523
  */
17328
17524
  getParentCtrl: function(elm) {
17329
- var ctrl;
17525
+ var ctrl, lookup = this.getRoot().controlIdLookup;
17330
17526
 
17331
- while (elm) {
17332
- ctrl = Control.controlIdLookup[elm.id];
17527
+ while (elm && lookup) {
17528
+ ctrl = lookup[elm.id];
17333
17529
  if (ctrl) {
17334
17530
  break;
17335
17531
  }
@@ -18209,7 +18405,7 @@ define("tinymce/ui/Control", [
18209
18405
 
18210
18406
  if (self._rendered) {
18211
18407
  if (name == 'label') {
18212
- elm.setAttribute('aria-labeledby', self._id);
18408
+ elm.setAttribute('aria-labelledby', self._id);
18213
18409
  }
18214
18410
 
18215
18411
  elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
@@ -18305,7 +18501,11 @@ define("tinymce/ui/Control", [
18305
18501
  DomUtils.off(elm);
18306
18502
  }
18307
18503
 
18308
- delete Control.controlIdLookup[self._id];
18504
+ var lookup = self.getRoot().controlIdLookup;
18505
+ if (lookup) {
18506
+ delete lookup[self._id];
18507
+ }
18508
+
18309
18509
  delete elementIdCache[self._id];
18310
18510
 
18311
18511
  if (elm && elm.parentNode) {
@@ -18319,6 +18519,8 @@ define("tinymce/ui/Control", [
18319
18519
  elm.parentNode.removeChild(elm);
18320
18520
  }
18321
18521
 
18522
+ self._rendered = false;
18523
+
18322
18524
  return self;
18323
18525
  },
18324
18526
 
@@ -18408,7 +18610,12 @@ define("tinymce/ui/Control", [
18408
18610
  }
18409
18611
 
18410
18612
  // Add instance to lookup
18411
- Control.controlIdLookup[self._id] = self;
18613
+ var root = self.getRoot();
18614
+ if (!root.controlIdLookup) {
18615
+ root.controlIdLookup = {};
18616
+ }
18617
+
18618
+ root.controlIdLookup[self._id] = self;
18412
18619
 
18413
18620
  for (var key in self._aria) {
18414
18621
  self.aria(key, self._aria[key]);
@@ -18604,6 +18811,32 @@ define("tinymce/ui/Control", [
18604
18811
  }
18605
18812
  },
18606
18813
 
18814
+ getRoot: function() {
18815
+ var ctrl = this, rootControl, parents = [];
18816
+
18817
+ while (ctrl) {
18818
+ if (ctrl.rootControl) {
18819
+ rootControl = ctrl.rootControl;
18820
+ break;
18821
+ }
18822
+
18823
+ parents.push(ctrl);
18824
+ rootControl = ctrl;
18825
+ ctrl = ctrl.parent();
18826
+ }
18827
+
18828
+ if (!rootControl) {
18829
+ rootControl = this;
18830
+ }
18831
+
18832
+ var i = parents.length;
18833
+ while (i--) {
18834
+ parents[i].rootControl = rootControl;
18835
+ }
18836
+
18837
+ return rootControl;
18838
+ },
18839
+
18607
18840
  /**
18608
18841
  * Reflows the current control and it's parents.
18609
18842
  * This should be used after you for example append children to the current control so
@@ -19152,13 +19385,13 @@ define("tinymce/ui/Container", [
19152
19385
  * @return {String} HTML representing the control.
19153
19386
  */
19154
19387
  renderHtml: function() {
19155
- var self = this, layout = self._layout;
19388
+ var self = this, layout = self._layout, role = this.settings.role;
19156
19389
 
19157
19390
  self.preRender();
19158
19391
  layout.preRender(self);
19159
19392
 
19160
19393
  return (
19161
- '<div id="' + self._id + '" class="' + self.classes() + '" role="' + this.settings.role + '">' +
19394
+ '<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
19162
19395
  '<div id="' + self._id + '-body" class="' + self.classes('body') + '">'+
19163
19396
  (self.settings.html || '') + layout.renderHtml(self) +
19164
19397
  '</div>' +
@@ -20037,13 +20270,11 @@ define("tinymce/ui/FloatPanel", [
20037
20270
  if (settings.autohide) {
20038
20271
  if (!documentClickHandler) {
20039
20272
  documentClickHandler = function(e) {
20040
- var i, clickCtrl = self.getParentCtrl(e.target);
20041
-
20042
20273
  // Hide any float panel when a click is out side that float panel and the
20043
20274
  // float panels direct parent for example a click on a menu button
20044
- i = visiblePanels.length;
20275
+ var i = visiblePanels.length;
20045
20276
  while (i--) {
20046
- var panel = visiblePanels[i];
20277
+ var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
20047
20278
 
20048
20279
  if (panel.settings.autohide) {
20049
20280
  if (clickCtrl) {
@@ -20930,7 +21161,7 @@ define("tinymce/ui/Window", [
20930
21161
  focusCtrl = focusCtrl || ctrl;
20931
21162
 
20932
21163
  // TODO: Figure out a better way
20933
- if (ctrl.type == 'filepicker') {
21164
+ if (ctrl.subinput) {
20934
21165
  items.push(ctrl.getEl('inp'));
20935
21166
 
20936
21167
  if (ctrl.getEl('open')) {
@@ -21633,7 +21864,7 @@ define("tinymce/util/Quirks", [
21633
21864
  });
21634
21865
 
21635
21866
  editor.on('keypress', function(e) {
21636
- if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode) {
21867
+ if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) {
21637
21868
  e.preventDefault();
21638
21869
  customDelete(true);
21639
21870
  editor.selection.setContent(String.fromCharCode(e.charCode));
@@ -21784,7 +22015,7 @@ define("tinymce/util/Quirks", [
21784
22015
  // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
21785
22016
  dom.bind(editor.getDoc(), 'mousedown', function(e) {
21786
22017
  if (e.target == editor.getDoc().documentElement) {
21787
- editor.getWin().focus();
22018
+ editor.getBody().focus();
21788
22019
  selection.setRng(selection.getRng());
21789
22020
  }
21790
22021
  });
@@ -22433,6 +22664,13 @@ define("tinymce/util/Quirks", [
22433
22664
  }
22434
22665
  }
22435
22666
 
22667
+ /**
22668
+ * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin.
22669
+ */
22670
+ function disableAutoUrlDetect() {
22671
+ setEditorCommandState("AutoUrlDetect", false);
22672
+ }
22673
+
22436
22674
  // All browsers
22437
22675
  disableBackspaceIntoATable();
22438
22676
  removeBlockQuoteOnBackSpace();
@@ -22474,6 +22712,7 @@ define("tinymce/util/Quirks", [
22474
22712
 
22475
22713
  if (Env.ie) {
22476
22714
  selectAll();
22715
+ disableAutoUrlDetect();
22477
22716
  }
22478
22717
 
22479
22718
  // Gecko
@@ -22929,13 +23168,13 @@ define("tinymce/Editor", [
22929
23168
  var isGecko = Env.gecko, ie = Env.ie;
22930
23169
 
22931
23170
  function getEventTarget(editor, eventName) {
22932
- if (eventName == 'selectionchange' || eventName == 'drop') {
23171
+ if (eventName == 'selectionchange') {
22933
23172
  return editor.getDoc();
22934
23173
  }
22935
23174
 
22936
23175
  // Need to bind mousedown/mouseup etc to document not body in iframe mode
22937
23176
  // Since the user might click on the HTML element not the BODY
22938
- if (!editor.inline && /^mouse|click|contextmenu/.test(eventName)) {
23177
+ if (!editor.inline && /^mouse|click|contextmenu|drop/.test(eventName)) {
22939
23178
  return editor.getDoc();
22940
23179
  }
22941
23180
 
@@ -23114,8 +23353,8 @@ define("tinymce/Editor", [
23114
23353
  self.inline = settings.inline;
23115
23354
 
23116
23355
  // Call setup
23117
- self.execCallback('setup', self);
23118
23356
  editorManager.fire('SetupEditor', self);
23357
+ self.execCallback('setup', self);
23119
23358
  }
23120
23359
 
23121
23360
  Editor.prototype = {
@@ -23241,7 +23480,7 @@ define("tinymce/Editor", [
23241
23480
  function loadScripts() {
23242
23481
  var scriptLoader = ScriptLoader.ScriptLoader;
23243
23482
 
23244
- if (settings.language && settings.language != 'en') {
23483
+ if (settings.language && settings.language != 'en' && !settings.language_url) {
23245
23484
  settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
23246
23485
  }
23247
23486
 
@@ -25286,7 +25525,11 @@ define("tinymce/FocusManager", [
25286
25525
  if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
25287
25526
  editor.fire('blur', {focusedEditor: null});
25288
25527
  editorManager.focusedEditor = null;
25289
- editor.selection.lastFocusBookmark = null;
25528
+
25529
+ // Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs
25530
+ if (editor.selection) {
25531
+ editor.selection.lastFocusBookmark = null;
25532
+ }
25290
25533
  }
25291
25534
  }, 0);
25292
25535
  });
@@ -25298,7 +25541,11 @@ define("tinymce/FocusManager", [
25298
25541
  var activeEditor = editorManager.activeEditor;
25299
25542
 
25300
25543
  if (activeEditor && e.target.ownerDocument == document) {
25301
- activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
25544
+
25545
+ // Check to make sure we have a valid selection
25546
+ if (activeEditor.selection) {
25547
+ activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
25548
+ }
25302
25549
 
25303
25550
  // Fire a blur event if the element isn't a UI element
25304
25551
  if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
@@ -25376,7 +25623,7 @@ define("tinymce/EditorManager", [
25376
25623
  * @property minorVersion
25377
25624
  * @type String
25378
25625
  */
25379
- minorVersion : '0.12',
25626
+ minorVersion : '0.16',
25380
25627
 
25381
25628
  /**
25382
25629
  * Release date of TinyMCE build.
@@ -25384,7 +25631,7 @@ define("tinymce/EditorManager", [
25384
25631
  * @property releaseDate
25385
25632
  * @type String
25386
25633
  */
25387
- releaseDate: '2013-12-18',
25634
+ releaseDate: '2014-01-31',
25388
25635
 
25389
25636
  /**
25390
25637
  * Collection of editor instances.
@@ -27392,7 +27639,7 @@ define("tinymce/ui/Checkbox", [
27392
27639
  var self = this, id = self._id, prefix = self.classPrefix;
27393
27640
 
27394
27641
  return (
27395
- '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labeledby="' + id + '-al" tabindex="-1">' +
27642
+ '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
27396
27643
  '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
27397
27644
  '<span id="' + id +'-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
27398
27645
  '</div>'
@@ -27627,8 +27874,9 @@ define("tinymce/ui/ColorButton", [
27627
27874
  */
27628
27875
  define("tinymce/ui/ComboBox", [
27629
27876
  "tinymce/ui/Widget",
27877
+ "tinymce/ui/Factory",
27630
27878
  "tinymce/ui/DomUtils"
27631
- ], function(Widget, DomUtils) {
27879
+ ], function(Widget, Factory, DomUtils) {
27632
27880
  "use strict";
27633
27881
 
27634
27882
  return Widget.extend({
@@ -27644,6 +27892,14 @@ define("tinymce/ui/ComboBox", [
27644
27892
 
27645
27893
  self._super(settings);
27646
27894
  self.addClass('combobox');
27895
+ self.subinput = true;
27896
+
27897
+ settings = self.settings;
27898
+ settings.menu = settings.menu || settings.values;
27899
+
27900
+ if (settings.menu) {
27901
+ settings.icon = 'caret';
27902
+ }
27647
27903
 
27648
27904
  self.on('click', function(e) {
27649
27905
  var elm = e.target;
@@ -27651,6 +27907,14 @@ define("tinymce/ui/ComboBox", [
27651
27907
  while (elm) {
27652
27908
  if (elm.id && elm.id.indexOf('-open') != -1) {
27653
27909
  self.fire('action');
27910
+
27911
+ if (settings.menu) {
27912
+ self.showMenu();
27913
+
27914
+ if (e.keyboard) {
27915
+ self.menu.items()[0].focus();
27916
+ }
27917
+ }
27654
27918
  }
27655
27919
 
27656
27920
  elm = elm.parentNode;
@@ -27699,6 +27963,55 @@ define("tinymce/ui/ComboBox", [
27699
27963
  }
27700
27964
  },
27701
27965
 
27966
+ showMenu: function() {
27967
+ var self = this, settings = self.settings, menu;
27968
+
27969
+ if (!self.menu) {
27970
+ menu = settings.menu || [];
27971
+
27972
+ // Is menu array then auto constuct menu control
27973
+ if (menu.length) {
27974
+ menu = {
27975
+ type: 'menu',
27976
+ items: menu
27977
+ };
27978
+ } else {
27979
+ menu.type = menu.type || 'menu';
27980
+ }
27981
+
27982
+ self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
27983
+ self.fire('createmenu');
27984
+ self.menu.reflow();
27985
+ self.menu.on('cancel', function(e) {
27986
+ if (e.control === self.menu) {
27987
+ self.focus();
27988
+ }
27989
+ });
27990
+
27991
+ self.menu.on('show hide', function(e) {
27992
+ e.control.items().each(function(ctrl) {
27993
+ ctrl.active(ctrl.value() == self.value());
27994
+ });
27995
+ }).fire('show');
27996
+
27997
+ self.menu.on('select', function(e) {
27998
+ self.value(e.control.value());
27999
+ });
28000
+
28001
+ self.on('focusin', function(e) {
28002
+ if (e.target.tagName == 'INPUT') {
28003
+ self.menu.hide();
28004
+ }
28005
+ });
28006
+
28007
+ self.aria('expanded', true);
28008
+ }
28009
+
28010
+ self.menu.show();
28011
+ self.menu.layoutRect({w: self.layoutRect().w});
28012
+ self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
28013
+ },
28014
+
27702
28015
  /**
27703
28016
  * Getter/setter function for the control value.
27704
28017
  *
@@ -27820,16 +28133,40 @@ define("tinymce/ui/ComboBox", [
27820
28133
  renderHtml: function() {
27821
28134
  var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
27822
28135
  var value = settings.value || settings.placeholder || '';
27823
- var icon, text, openBtnHtml = '';
28136
+ var icon, text, openBtnHtml = '', extraAttrs = '';
28137
+
28138
+ if ("spellcheck" in settings) {
28139
+ extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
28140
+ }
28141
+
28142
+ if (settings.maxLength) {
28143
+ extraAttrs += ' maxlength="' + settings.maxLength + '"';
28144
+ }
28145
+
28146
+ if (settings.size) {
28147
+ extraAttrs += ' size="' + settings.size + '"';
28148
+ }
28149
+
28150
+ if (settings.subtype) {
28151
+ extraAttrs += ' type="' + settings.subtype + '"';
28152
+ }
28153
+
28154
+ if (self.disabled()) {
28155
+ extraAttrs += ' disabled="disabled"';
28156
+ }
28157
+
28158
+ icon = settings.icon;
28159
+ if (icon && icon != 'caret') {
28160
+ icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
28161
+ }
27824
28162
 
27825
- icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + settings.icon : '';
27826
28163
  text = self._text;
27827
28164
 
27828
28165
  if (icon || text) {
27829
28166
  openBtnHtml = (
27830
28167
  '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1">' +
27831
28168
  '<button id="' + id + '-action" type="button" hidefocus tabindex="-1">' +
27832
- (icon ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
28169
+ (icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
27833
28170
  (text ? (icon ? ' ' : '') + text : '') +
27834
28171
  '</button>' +
27835
28172
  '</div>'
@@ -27841,7 +28178,7 @@ define("tinymce/ui/ComboBox", [
27841
28178
  return (
27842
28179
  '<div id="' + id + '" class="' + self.classes() + '">' +
27843
28180
  '<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
27844
- value + '" hidefocus="true"' + (self.disabled() ? ' disabled="disabled"' : '') + '>' +
28181
+ value + '" hidefocus="true"' + extraAttrs + '>' +
27845
28182
  openBtnHtml +
27846
28183
  '</div>'
27847
28184
  );
@@ -28213,7 +28550,7 @@ define("tinymce/ui/Form", [
28213
28550
  autoResize: "overflow",
28214
28551
  defaults: {flex: 1},
28215
28552
  items: [
28216
- {type: 'label', text: label, flex: 0, forId: ctrl._id}
28553
+ {type: 'label', text: label, flex: 0, forId: ctrl._id, disabled: ctrl.disabled()}
28217
28554
  ]
28218
28555
  });
28219
28556
 
@@ -28826,7 +29163,7 @@ define("tinymce/ui/FormatControls", [
28826
29163
  // Default preview
28827
29164
  if (!previewStyles) {
28828
29165
  previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
28829
- 'text-transform color background-color border border-radius';
29166
+ 'text-transform color background-color border border-radius outline text-shadow';
28830
29167
  }
28831
29168
 
28832
29169
  // Removes any variables since these can't be previewed
@@ -29048,17 +29385,31 @@ define("tinymce/ui/FormatControls", [
29048
29385
  return menu;
29049
29386
  }
29050
29387
 
29388
+ function createStylesMenu() {
29389
+ var menu;
29390
+
29391
+ if (editor.settings.style_formats_merge) {
29392
+ if (editor.settings.style_formats) {
29393
+ menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
29394
+ } else {
29395
+ menu = createMenu(defaultStyleFormats);
29396
+ }
29397
+ } else {
29398
+ menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
29399
+ }
29400
+
29401
+ return menu;
29402
+ }
29403
+
29051
29404
  editor.on('init', function() {
29052
29405
  each(newFormats, function(format) {
29053
29406
  editor.formatter.register(format.name, format);
29054
29407
  });
29055
29408
  });
29056
29409
 
29057
- var menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
29058
-
29059
- menu = {
29410
+ return {
29060
29411
  type: 'menu',
29061
- items: menu,
29412
+ items: createStylesMenu(),
29062
29413
  onPostRender: function(e) {
29063
29414
  editor.fire('renderFormatsMenu', {control: e.control});
29064
29415
  },
@@ -29089,8 +29440,6 @@ define("tinymce/ui/FormatControls", [
29089
29440
  }
29090
29441
  }
29091
29442
  };
29092
-
29093
- return menu;
29094
29443
  }
29095
29444
 
29096
29445
  formatMenu = createFormatMenu();
@@ -29150,7 +29499,7 @@ define("tinymce/ui/FormatControls", [
29150
29499
 
29151
29500
  // Simple command controls with format state
29152
29501
  each({
29153
- blockquote: ['Toggle blockquote', 'mceBlockQuote'],
29502
+ blockquote: ['Blockquote', 'mceBlockQuote'],
29154
29503
  numlist: ['Numbered list', 'InsertOrderedList'],
29155
29504
  bullist: ['Bullet list', 'InsertUnorderedList'],
29156
29505
  subscript: ['Subscript', 'Subscript'],
@@ -29845,7 +30194,7 @@ define("tinymce/ui/Label", [
29845
30194
  var self = this, forId = self.settings.forId;
29846
30195
 
29847
30196
  return (
29848
- '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId : '') + '">' +
30197
+ '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId +'"' : '') + '>' +
29849
30198
  self.encode(self._text) +
29850
30199
  '</label>'
29851
30200
  );
@@ -30847,7 +31196,7 @@ define("tinymce/ui/ResizeHandle", [
30847
31196
  self.fire('Resize', e);
30848
31197
  },
30849
31198
 
30850
- end: function() {
31199
+ stop: function() {
30851
31200
  self.fire('ResizeEnd');
30852
31201
  }
30853
31202
  });
@@ -31521,5 +31870,5 @@ define("tinymce/ui/Throbber", [
31521
31870
  };
31522
31871
  });
31523
31872
 
31524
- expose(["tinymce/dom/Sizzle","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/Selection","tinymce/dom/RangeUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/KeyboardNavigation","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
31873
+ expose(["tinymce/dom/Sizzle","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/Selection","tinymce/dom/RangeUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/KeyboardNavigation","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
31525
31874
  })(this);