tinymce-rails 4.0.12 → 4.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -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)
@@ -232,7 +232,7 @@ define("tinymce/dom/EventUtils", [], function() {
232
232
  }
233
233
 
234
234
  function waitForDomLoaded() {
235
- if (doc.readyState === "complete") {
235
+ if (doc.readyState === "complete" || doc.readyState === "interactive") {
236
236
  removeEvent(doc, "readystatechange", waitForDomLoaded);
237
237
  readyHandler();
238
238
  }
@@ -263,7 +263,7 @@ define("tinymce/dom/EventUtils", [], function() {
263
263
  addEvent(doc, "readystatechange", waitForDomLoaded);
264
264
 
265
265
  // Wait until we can scroll, when we can the DOM is initialized
266
- if (doc.documentElement.doScroll && win === win.top) {
266
+ if (doc.documentElement.doScroll && win.self === win.top) {
267
267
  tryScroll();
268
268
  }
269
269
  }
@@ -5390,6 +5390,194 @@ define("tinymce/Env", [], function() {
5390
5390
  };
5391
5391
  });
5392
5392
 
5393
+ // Included from: js/tinymce/classes/dom/StyleSheetLoader.js
5394
+
5395
+ /**
5396
+ * StyleSheetLoader.js
5397
+ *
5398
+ * Copyright, Moxiecode Systems AB
5399
+ * Released under LGPL License.
5400
+ *
5401
+ * License: http://www.tinymce.com/license
5402
+ * Contributing: http://www.tinymce.com/contributing
5403
+ */
5404
+
5405
+ /**
5406
+ * This class handles loading of external stylesheets and fires events when these are loaded.
5407
+ *
5408
+ * @class tinymce.dom.StyleSheetLoader
5409
+ * @private
5410
+ */
5411
+ define("tinymce/dom/StyleSheetLoader", [], function() {
5412
+ "use strict";
5413
+
5414
+ return function(document, settings) {
5415
+ var idCount = 0, loadedStates = {}, maxLoadTime;
5416
+
5417
+ settings = settings || {};
5418
+ maxLoadTime = settings.maxLoadTime || 5000;
5419
+
5420
+ function appendToHead(node) {
5421
+ document.getElementsByTagName('head')[0].appendChild(node);
5422
+ }
5423
+
5424
+ /**
5425
+ * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
5426
+ *
5427
+ * @method load
5428
+ * @param {String} url Url to be loaded.
5429
+ * @param {Function} loadedCallback Callback to be executed when loaded.
5430
+ * @param {Function} errorCallback Callback to be executed when failed loading.
5431
+ */
5432
+ function load(url, loadedCallback, errorCallback) {
5433
+ var link, style, startTime, state;
5434
+
5435
+ function passed() {
5436
+ var callbacks = state.passed, i = callbacks.length;
5437
+
5438
+ while (i--) {
5439
+ callbacks[i]();
5440
+ }
5441
+
5442
+ state.status = 2;
5443
+ state.passed = [];
5444
+ state.failed = [];
5445
+ }
5446
+
5447
+ function failed() {
5448
+ var callbacks = state.failed, i = callbacks.length;
5449
+
5450
+ while (i--) {
5451
+ callbacks[i]();
5452
+ }
5453
+
5454
+ state.status = 3;
5455
+ state.passed = [];
5456
+ state.failed = [];
5457
+ }
5458
+
5459
+ // Sniffs for older WebKit versions that have the link.onload but a broken one
5460
+ function isOldWebKit() {
5461
+ var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
5462
+ return !!(webKitChunks && webKitChunks[1] < 536);
5463
+ }
5464
+
5465
+ // Calls the waitCallback until the test returns true or the timeout occurs
5466
+ function wait(testCallback, waitCallback) {
5467
+ if (!testCallback()) {
5468
+ // Wait for timeout
5469
+ if ((new Date().getTime()) - startTime < maxLoadTime) {
5470
+ window.setTimeout(waitCallback, 0);
5471
+ } else {
5472
+ failed();
5473
+ }
5474
+ }
5475
+ }
5476
+
5477
+ // Workaround for WebKit that doesn't properly support the onload event for link elements
5478
+ // Or WebKit that fires the onload event before the StyleSheet is added to the document
5479
+ function waitForWebKitLinkLoaded() {
5480
+ wait(function() {
5481
+ var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
5482
+
5483
+ while (i--) {
5484
+ styleSheet = styleSheets[i];
5485
+ owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
5486
+ if (owner && owner.id === link.id) {
5487
+ passed();
5488
+ return true;
5489
+ }
5490
+ }
5491
+ }, waitForWebKitLinkLoaded);
5492
+ }
5493
+
5494
+ // Workaround for older Geckos that doesn't have any onload event for StyleSheets
5495
+ function waitForGeckoLinkLoaded() {
5496
+ wait(function() {
5497
+ try {
5498
+ // Accessing the cssRules will throw an exception until the CSS file is loaded
5499
+ var cssRules = style.sheet.cssRules;
5500
+ passed();
5501
+ return !!cssRules;
5502
+ } catch (ex) {
5503
+ // Ignore
5504
+ }
5505
+ }, waitForGeckoLinkLoaded);
5506
+ }
5507
+
5508
+ if (!loadedStates[url]) {
5509
+ state = {
5510
+ passed: [],
5511
+ failed: []
5512
+ };
5513
+
5514
+ loadedStates[url] = state;
5515
+ } else {
5516
+ state = loadedStates[url];
5517
+ }
5518
+
5519
+ if (loadedCallback) {
5520
+ state.passed.push(loadedCallback);
5521
+ }
5522
+
5523
+ if (errorCallback) {
5524
+ state.failed.push(errorCallback);
5525
+ }
5526
+
5527
+ // Is loading wait for it to pass
5528
+ if (state.status == 1) {
5529
+ return;
5530
+ }
5531
+
5532
+ // Has finished loading and was success
5533
+ if (state.status == 2) {
5534
+ passed();
5535
+ return;
5536
+ }
5537
+
5538
+ // Has finished loading and was a failure
5539
+ if (state.status == 3) {
5540
+ failed();
5541
+ return;
5542
+ }
5543
+
5544
+ // Start loading
5545
+ state.status = 1;
5546
+ link = document.createElement('link');
5547
+ link.rel = 'stylesheet';
5548
+ link.type = 'text/css';
5549
+ link.id = 'u' + (idCount++);
5550
+ link.async = false;
5551
+ link.defer = false;
5552
+ startTime = new Date().getTime();
5553
+
5554
+ // Feature detect onload on link element and sniff older webkits since it has an broken onload event
5555
+ if ("onload" in link && !isOldWebKit()) {
5556
+ link.onload = waitForWebKitLinkLoaded;
5557
+ link.onerror = failed;
5558
+ } else {
5559
+ // Sniff for old Firefox that doesn't support the onload event on link elements
5560
+ // TODO: Remove this in the future when everyone uses modern browsers
5561
+ if (navigator.userAgent.indexOf("Firefox") > 0) {
5562
+ style = document.createElement('style');
5563
+ style.textContent = '@import "' + url + '"';
5564
+ waitForGeckoLinkLoaded();
5565
+ appendToHead(style);
5566
+ return;
5567
+ } else {
5568
+ // Use the id owner on older webkits
5569
+ waitForWebKitLinkLoaded();
5570
+ }
5571
+ }
5572
+
5573
+ appendToHead(link);
5574
+ link.href = url;
5575
+ }
5576
+
5577
+ this.load = load;
5578
+ };
5579
+ });
5580
+
5393
5581
  // Included from: js/tinymce/classes/dom/DOMUtils.js
5394
5582
 
5395
5583
  /**
@@ -5421,8 +5609,9 @@ define("tinymce/dom/DOMUtils", [
5421
5609
  "tinymce/dom/Range",
5422
5610
  "tinymce/html/Entities",
5423
5611
  "tinymce/Env",
5424
- "tinymce/util/Tools"
5425
- ], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools) {
5612
+ "tinymce/util/Tools",
5613
+ "tinymce/dom/StyleSheetLoader"
5614
+ ], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
5426
5615
  // Shorten names
5427
5616
  var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend;
5428
5617
  var isWebKit = Env.webkit, isIE = Env.ie;
@@ -5448,6 +5637,7 @@ define("tinymce/dom/DOMUtils", [
5448
5637
  self.stdMode = !isIE || doc.documentMode >= 8;
5449
5638
  self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
5450
5639
  self.hasOuterHTML = "outerHTML" in doc.createElement("a");
5640
+ self.styleSheetLoader = new StyleSheetLoader(doc);
5451
5641
  this.boundEvents = [];
5452
5642
 
5453
5643
  self.settings = settings = extend({
@@ -6395,8 +6585,8 @@ define("tinymce/dom/DOMUtils", [
6395
6585
 
6396
6586
  // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
6397
6587
  // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
6398
- x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientTop;
6399
- y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientLeft;
6588
+ x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientLeft;
6589
+ y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientTop;
6400
6590
 
6401
6591
  return {x: x, y: y};
6402
6592
  }
@@ -12189,11 +12379,13 @@ define("tinymce/dom/ControlSelection", [
12189
12379
  var controlElm;
12190
12380
 
12191
12381
  function isChildOrEqual(node, parent) {
12192
- do {
12193
- if (node === parent) {
12194
- return true;
12195
- }
12196
- } while ((node = node.parentNode));
12382
+ if (node) {
12383
+ do {
12384
+ if (node === parent) {
12385
+ return true;
12386
+ }
12387
+ } while ((node = node.parentNode));
12388
+ }
12197
12389
  }
12198
12390
 
12199
12391
  // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
@@ -12204,7 +12396,7 @@ define("tinymce/dom/ControlSelection", [
12204
12396
  controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
12205
12397
  controlElm = dom.getParent(controlElm, isIE ? 'table' : 'table,img,hr');
12206
12398
 
12207
- if (controlElm) {
12399
+ if (isChildOrEqual(controlElm, editor.getBody())) {
12208
12400
  disableGeckoResize();
12209
12401
 
12210
12402
  if (isChildOrEqual(selection.getStart(), controlElm) && isChildOrEqual(selection.getEnd(), controlElm)) {
@@ -12366,6 +12558,10 @@ define("tinymce/dom/ControlSelection", [
12366
12558
  }
12367
12559
 
12368
12560
  return {
12561
+ isResizable: isResizable,
12562
+ showResizeRect: showResizeRect,
12563
+ hideResizeRect: hideResizeRect,
12564
+ updateResizeRect: updateResizeRect,
12369
12565
  controlSelect: controlSelect,
12370
12566
  destroy: destroy
12371
12567
  };
@@ -12800,7 +12996,7 @@ define("tinymce/dom/Selection", [
12800
12996
 
12801
12997
  if (type == 2) {
12802
12998
  element = t.getNode();
12803
- name = element.nodeName;
12999
+ name = element ? element.nodeName : null;
12804
13000
 
12805
13001
  if (name == 'IMG') {
12806
13002
  return {name: name, index: findIndex(name, element)};
@@ -13184,7 +13380,8 @@ define("tinymce/dom/Selection", [
13184
13380
  }
13185
13381
 
13186
13382
  // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
13187
- if (isIE && rng && rng.setStart) {
13383
+ // IE 11 doesn't support the selection object so we check for that as well
13384
+ if (isIE && rng && rng.setStart && doc.selection) {
13188
13385
  try {
13189
13386
  // IE will sometimes throw an exception here
13190
13387
  ieRng = doc.selection.createRange();
@@ -15969,7 +16166,7 @@ define("tinymce/Formatter", [
15969
16166
  next = next ? 'nextSibling' : 'previousSibling';
15970
16167
 
15971
16168
  for (node = inc ? node : node[next]; node; node = node[next]) {
15972
- if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
16169
+ if (node.nodeType == 1 && !isWhiteSpaceNode(node)) {
15973
16170
  return node;
15974
16171
  }
15975
16172
  }
@@ -16027,7 +16224,7 @@ define("tinymce/Formatter", [
16027
16224
  var name = attr.nodeName.toLowerCase();
16028
16225
 
16029
16226
  // Don't compare internal attributes or style
16030
- if (name.indexOf('_') !== 0 && name !== 'style') {
16227
+ if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') {
16031
16228
  attribs[name] = dom.getAttrib(node, name);
16032
16229
  }
16033
16230
  });
@@ -18166,10 +18363,10 @@ define("tinymce/EditorCommands", [
18166
18363
  }
18167
18364
 
18168
18365
  each(selection.getSelectedBlocks(), function(element) {
18169
- var indentStyleName;
18170
-
18171
18366
  if (element.nodeName != "LI") {
18172
- indentStyleName = dom.getStyle(element, 'direction', true) == 'rtl' ? 'paddingRight' : 'paddingLeft';
18367
+ var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding';
18368
+
18369
+ indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left';
18173
18370
 
18174
18371
  if (command == 'outdent') {
18175
18372
  value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
@@ -19835,7 +20032,6 @@ define("tinymce/ui/Control", [
19835
20032
 
19836
20033
  var Control = Class.extend({
19837
20034
  Statics: {
19838
- controlIdLookup: {},
19839
20035
  elementIdCache: elementIdCache
19840
20036
  },
19841
20037
 
@@ -19957,10 +20153,10 @@ define("tinymce/ui/Control", [
19957
20153
  * @return {tinymce.ui.Control} Control instance or undefined.
19958
20154
  */
19959
20155
  getParentCtrl: function(elm) {
19960
- var ctrl;
20156
+ var ctrl, lookup = this.getRoot().controlIdLookup;
19961
20157
 
19962
- while (elm) {
19963
- ctrl = Control.controlIdLookup[elm.id];
20158
+ while (elm && lookup) {
20159
+ ctrl = lookup[elm.id];
19964
20160
  if (ctrl) {
19965
20161
  break;
19966
20162
  }
@@ -20840,7 +21036,7 @@ define("tinymce/ui/Control", [
20840
21036
 
20841
21037
  if (self._rendered) {
20842
21038
  if (name == 'label') {
20843
- elm.setAttribute('aria-labeledby', self._id);
21039
+ elm.setAttribute('aria-labelledby', self._id);
20844
21040
  }
20845
21041
 
20846
21042
  elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
@@ -20936,7 +21132,11 @@ define("tinymce/ui/Control", [
20936
21132
  DomUtils.off(elm);
20937
21133
  }
20938
21134
 
20939
- delete Control.controlIdLookup[self._id];
21135
+ var lookup = self.getRoot().controlIdLookup;
21136
+ if (lookup) {
21137
+ delete lookup[self._id];
21138
+ }
21139
+
20940
21140
  delete elementIdCache[self._id];
20941
21141
 
20942
21142
  if (elm && elm.parentNode) {
@@ -20950,6 +21150,8 @@ define("tinymce/ui/Control", [
20950
21150
  elm.parentNode.removeChild(elm);
20951
21151
  }
20952
21152
 
21153
+ self._rendered = false;
21154
+
20953
21155
  return self;
20954
21156
  },
20955
21157
 
@@ -21039,7 +21241,12 @@ define("tinymce/ui/Control", [
21039
21241
  }
21040
21242
 
21041
21243
  // Add instance to lookup
21042
- Control.controlIdLookup[self._id] = self;
21244
+ var root = self.getRoot();
21245
+ if (!root.controlIdLookup) {
21246
+ root.controlIdLookup = {};
21247
+ }
21248
+
21249
+ root.controlIdLookup[self._id] = self;
21043
21250
 
21044
21251
  for (var key in self._aria) {
21045
21252
  self.aria(key, self._aria[key]);
@@ -21235,6 +21442,32 @@ define("tinymce/ui/Control", [
21235
21442
  }
21236
21443
  },
21237
21444
 
21445
+ getRoot: function() {
21446
+ var ctrl = this, rootControl, parents = [];
21447
+
21448
+ while (ctrl) {
21449
+ if (ctrl.rootControl) {
21450
+ rootControl = ctrl.rootControl;
21451
+ break;
21452
+ }
21453
+
21454
+ parents.push(ctrl);
21455
+ rootControl = ctrl;
21456
+ ctrl = ctrl.parent();
21457
+ }
21458
+
21459
+ if (!rootControl) {
21460
+ rootControl = this;
21461
+ }
21462
+
21463
+ var i = parents.length;
21464
+ while (i--) {
21465
+ parents[i].rootControl = rootControl;
21466
+ }
21467
+
21468
+ return rootControl;
21469
+ },
21470
+
21238
21471
  /**
21239
21472
  * Reflows the current control and it's parents.
21240
21473
  * This should be used after you for example append children to the current control so
@@ -21783,13 +22016,13 @@ define("tinymce/ui/Container", [
21783
22016
  * @return {String} HTML representing the control.
21784
22017
  */
21785
22018
  renderHtml: function() {
21786
- var self = this, layout = self._layout;
22019
+ var self = this, layout = self._layout, role = this.settings.role;
21787
22020
 
21788
22021
  self.preRender();
21789
22022
  layout.preRender(self);
21790
22023
 
21791
22024
  return (
21792
- '<div id="' + self._id + '" class="' + self.classes() + '" role="' + this.settings.role + '">' +
22025
+ '<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
21793
22026
  '<div id="' + self._id + '-body" class="' + self.classes('body') + '">'+
21794
22027
  (self.settings.html || '') + layout.renderHtml(self) +
21795
22028
  '</div>' +
@@ -22668,13 +22901,11 @@ define("tinymce/ui/FloatPanel", [
22668
22901
  if (settings.autohide) {
22669
22902
  if (!documentClickHandler) {
22670
22903
  documentClickHandler = function(e) {
22671
- var i, clickCtrl = self.getParentCtrl(e.target);
22672
-
22673
22904
  // Hide any float panel when a click is out side that float panel and the
22674
22905
  // float panels direct parent for example a click on a menu button
22675
- i = visiblePanels.length;
22906
+ var i = visiblePanels.length;
22676
22907
  while (i--) {
22677
- var panel = visiblePanels[i];
22908
+ var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
22678
22909
 
22679
22910
  if (panel.settings.autohide) {
22680
22911
  if (clickCtrl) {
@@ -23561,7 +23792,7 @@ define("tinymce/ui/Window", [
23561
23792
  focusCtrl = focusCtrl || ctrl;
23562
23793
 
23563
23794
  // TODO: Figure out a better way
23564
- if (ctrl.type == 'filepicker') {
23795
+ if (ctrl.subinput) {
23565
23796
  items.push(ctrl.getEl('inp'));
23566
23797
 
23567
23798
  if (ctrl.getEl('open')) {
@@ -24264,7 +24495,7 @@ define("tinymce/util/Quirks", [
24264
24495
  });
24265
24496
 
24266
24497
  editor.on('keypress', function(e) {
24267
- if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode) {
24498
+ if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) {
24268
24499
  e.preventDefault();
24269
24500
  customDelete(true);
24270
24501
  editor.selection.setContent(String.fromCharCode(e.charCode));
@@ -24415,7 +24646,7 @@ define("tinymce/util/Quirks", [
24415
24646
  // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
24416
24647
  dom.bind(editor.getDoc(), 'mousedown', function(e) {
24417
24648
  if (e.target == editor.getDoc().documentElement) {
24418
- editor.getWin().focus();
24649
+ editor.getBody().focus();
24419
24650
  selection.setRng(selection.getRng());
24420
24651
  }
24421
24652
  });
@@ -25064,6 +25295,13 @@ define("tinymce/util/Quirks", [
25064
25295
  }
25065
25296
  }
25066
25297
 
25298
+ /**
25299
+ * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin.
25300
+ */
25301
+ function disableAutoUrlDetect() {
25302
+ setEditorCommandState("AutoUrlDetect", false);
25303
+ }
25304
+
25067
25305
  // All browsers
25068
25306
  disableBackspaceIntoATable();
25069
25307
  removeBlockQuoteOnBackSpace();
@@ -25105,6 +25343,7 @@ define("tinymce/util/Quirks", [
25105
25343
 
25106
25344
  if (Env.ie) {
25107
25345
  selectAll();
25346
+ disableAutoUrlDetect();
25108
25347
  }
25109
25348
 
25110
25349
  // Gecko
@@ -25560,13 +25799,13 @@ define("tinymce/Editor", [
25560
25799
  var isGecko = Env.gecko, ie = Env.ie;
25561
25800
 
25562
25801
  function getEventTarget(editor, eventName) {
25563
- if (eventName == 'selectionchange' || eventName == 'drop') {
25802
+ if (eventName == 'selectionchange') {
25564
25803
  return editor.getDoc();
25565
25804
  }
25566
25805
 
25567
25806
  // Need to bind mousedown/mouseup etc to document not body in iframe mode
25568
25807
  // Since the user might click on the HTML element not the BODY
25569
- if (!editor.inline && /^mouse|click|contextmenu/.test(eventName)) {
25808
+ if (!editor.inline && /^mouse|click|contextmenu|drop/.test(eventName)) {
25570
25809
  return editor.getDoc();
25571
25810
  }
25572
25811
 
@@ -25745,8 +25984,8 @@ define("tinymce/Editor", [
25745
25984
  self.inline = settings.inline;
25746
25985
 
25747
25986
  // Call setup
25748
- self.execCallback('setup', self);
25749
25987
  editorManager.fire('SetupEditor', self);
25988
+ self.execCallback('setup', self);
25750
25989
  }
25751
25990
 
25752
25991
  Editor.prototype = {
@@ -25872,7 +26111,7 @@ define("tinymce/Editor", [
25872
26111
  function loadScripts() {
25873
26112
  var scriptLoader = ScriptLoader.ScriptLoader;
25874
26113
 
25875
- if (settings.language && settings.language != 'en') {
26114
+ if (settings.language && settings.language != 'en' && !settings.language_url) {
25876
26115
  settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
25877
26116
  }
25878
26117
 
@@ -27917,7 +28156,11 @@ define("tinymce/FocusManager", [
27917
28156
  if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
27918
28157
  editor.fire('blur', {focusedEditor: null});
27919
28158
  editorManager.focusedEditor = null;
27920
- editor.selection.lastFocusBookmark = null;
28159
+
28160
+ // Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs
28161
+ if (editor.selection) {
28162
+ editor.selection.lastFocusBookmark = null;
28163
+ }
27921
28164
  }
27922
28165
  }, 0);
27923
28166
  });
@@ -27929,7 +28172,11 @@ define("tinymce/FocusManager", [
27929
28172
  var activeEditor = editorManager.activeEditor;
27930
28173
 
27931
28174
  if (activeEditor && e.target.ownerDocument == document) {
27932
- activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
28175
+
28176
+ // Check to make sure we have a valid selection
28177
+ if (activeEditor.selection) {
28178
+ activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
28179
+ }
27933
28180
 
27934
28181
  // Fire a blur event if the element isn't a UI element
27935
28182
  if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
@@ -28007,7 +28254,7 @@ define("tinymce/EditorManager", [
28007
28254
  * @property minorVersion
28008
28255
  * @type String
28009
28256
  */
28010
- minorVersion : '0.12',
28257
+ minorVersion : '0.16',
28011
28258
 
28012
28259
  /**
28013
28260
  * Release date of TinyMCE build.
@@ -28015,7 +28262,7 @@ define("tinymce/EditorManager", [
28015
28262
  * @property releaseDate
28016
28263
  * @type String
28017
28264
  */
28018
- releaseDate: '2013-12-18',
28265
+ releaseDate: '2014-01-31',
28019
28266
 
28020
28267
  /**
28021
28268
  * Collection of editor instances.
@@ -30023,7 +30270,7 @@ define("tinymce/ui/Checkbox", [
30023
30270
  var self = this, id = self._id, prefix = self.classPrefix;
30024
30271
 
30025
30272
  return (
30026
- '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labeledby="' + id + '-al" tabindex="-1">' +
30273
+ '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
30027
30274
  '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
30028
30275
  '<span id="' + id +'-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
30029
30276
  '</div>'
@@ -30258,8 +30505,9 @@ define("tinymce/ui/ColorButton", [
30258
30505
  */
30259
30506
  define("tinymce/ui/ComboBox", [
30260
30507
  "tinymce/ui/Widget",
30508
+ "tinymce/ui/Factory",
30261
30509
  "tinymce/ui/DomUtils"
30262
- ], function(Widget, DomUtils) {
30510
+ ], function(Widget, Factory, DomUtils) {
30263
30511
  "use strict";
30264
30512
 
30265
30513
  return Widget.extend({
@@ -30275,6 +30523,14 @@ define("tinymce/ui/ComboBox", [
30275
30523
 
30276
30524
  self._super(settings);
30277
30525
  self.addClass('combobox');
30526
+ self.subinput = true;
30527
+
30528
+ settings = self.settings;
30529
+ settings.menu = settings.menu || settings.values;
30530
+
30531
+ if (settings.menu) {
30532
+ settings.icon = 'caret';
30533
+ }
30278
30534
 
30279
30535
  self.on('click', function(e) {
30280
30536
  var elm = e.target;
@@ -30282,6 +30538,14 @@ define("tinymce/ui/ComboBox", [
30282
30538
  while (elm) {
30283
30539
  if (elm.id && elm.id.indexOf('-open') != -1) {
30284
30540
  self.fire('action');
30541
+
30542
+ if (settings.menu) {
30543
+ self.showMenu();
30544
+
30545
+ if (e.keyboard) {
30546
+ self.menu.items()[0].focus();
30547
+ }
30548
+ }
30285
30549
  }
30286
30550
 
30287
30551
  elm = elm.parentNode;
@@ -30330,6 +30594,55 @@ define("tinymce/ui/ComboBox", [
30330
30594
  }
30331
30595
  },
30332
30596
 
30597
+ showMenu: function() {
30598
+ var self = this, settings = self.settings, menu;
30599
+
30600
+ if (!self.menu) {
30601
+ menu = settings.menu || [];
30602
+
30603
+ // Is menu array then auto constuct menu control
30604
+ if (menu.length) {
30605
+ menu = {
30606
+ type: 'menu',
30607
+ items: menu
30608
+ };
30609
+ } else {
30610
+ menu.type = menu.type || 'menu';
30611
+ }
30612
+
30613
+ self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
30614
+ self.fire('createmenu');
30615
+ self.menu.reflow();
30616
+ self.menu.on('cancel', function(e) {
30617
+ if (e.control === self.menu) {
30618
+ self.focus();
30619
+ }
30620
+ });
30621
+
30622
+ self.menu.on('show hide', function(e) {
30623
+ e.control.items().each(function(ctrl) {
30624
+ ctrl.active(ctrl.value() == self.value());
30625
+ });
30626
+ }).fire('show');
30627
+
30628
+ self.menu.on('select', function(e) {
30629
+ self.value(e.control.value());
30630
+ });
30631
+
30632
+ self.on('focusin', function(e) {
30633
+ if (e.target.tagName == 'INPUT') {
30634
+ self.menu.hide();
30635
+ }
30636
+ });
30637
+
30638
+ self.aria('expanded', true);
30639
+ }
30640
+
30641
+ self.menu.show();
30642
+ self.menu.layoutRect({w: self.layoutRect().w});
30643
+ self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
30644
+ },
30645
+
30333
30646
  /**
30334
30647
  * Getter/setter function for the control value.
30335
30648
  *
@@ -30451,16 +30764,40 @@ define("tinymce/ui/ComboBox", [
30451
30764
  renderHtml: function() {
30452
30765
  var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
30453
30766
  var value = settings.value || settings.placeholder || '';
30454
- var icon, text, openBtnHtml = '';
30767
+ var icon, text, openBtnHtml = '', extraAttrs = '';
30768
+
30769
+ if ("spellcheck" in settings) {
30770
+ extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
30771
+ }
30772
+
30773
+ if (settings.maxLength) {
30774
+ extraAttrs += ' maxlength="' + settings.maxLength + '"';
30775
+ }
30776
+
30777
+ if (settings.size) {
30778
+ extraAttrs += ' size="' + settings.size + '"';
30779
+ }
30780
+
30781
+ if (settings.subtype) {
30782
+ extraAttrs += ' type="' + settings.subtype + '"';
30783
+ }
30784
+
30785
+ if (self.disabled()) {
30786
+ extraAttrs += ' disabled="disabled"';
30787
+ }
30788
+
30789
+ icon = settings.icon;
30790
+ if (icon && icon != 'caret') {
30791
+ icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
30792
+ }
30455
30793
 
30456
- icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + settings.icon : '';
30457
30794
  text = self._text;
30458
30795
 
30459
30796
  if (icon || text) {
30460
30797
  openBtnHtml = (
30461
30798
  '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1">' +
30462
30799
  '<button id="' + id + '-action" type="button" hidefocus tabindex="-1">' +
30463
- (icon ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
30800
+ (icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
30464
30801
  (text ? (icon ? ' ' : '') + text : '') +
30465
30802
  '</button>' +
30466
30803
  '</div>'
@@ -30472,7 +30809,7 @@ define("tinymce/ui/ComboBox", [
30472
30809
  return (
30473
30810
  '<div id="' + id + '" class="' + self.classes() + '">' +
30474
30811
  '<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
30475
- value + '" hidefocus="true"' + (self.disabled() ? ' disabled="disabled"' : '') + '>' +
30812
+ value + '" hidefocus="true"' + extraAttrs + '>' +
30476
30813
  openBtnHtml +
30477
30814
  '</div>'
30478
30815
  );
@@ -30844,7 +31181,7 @@ define("tinymce/ui/Form", [
30844
31181
  autoResize: "overflow",
30845
31182
  defaults: {flex: 1},
30846
31183
  items: [
30847
- {type: 'label', text: label, flex: 0, forId: ctrl._id}
31184
+ {type: 'label', text: label, flex: 0, forId: ctrl._id, disabled: ctrl.disabled()}
30848
31185
  ]
30849
31186
  });
30850
31187
 
@@ -31457,7 +31794,7 @@ define("tinymce/ui/FormatControls", [
31457
31794
  // Default preview
31458
31795
  if (!previewStyles) {
31459
31796
  previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
31460
- 'text-transform color background-color border border-radius';
31797
+ 'text-transform color background-color border border-radius outline text-shadow';
31461
31798
  }
31462
31799
 
31463
31800
  // Removes any variables since these can't be previewed
@@ -31679,17 +32016,31 @@ define("tinymce/ui/FormatControls", [
31679
32016
  return menu;
31680
32017
  }
31681
32018
 
32019
+ function createStylesMenu() {
32020
+ var menu;
32021
+
32022
+ if (editor.settings.style_formats_merge) {
32023
+ if (editor.settings.style_formats) {
32024
+ menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
32025
+ } else {
32026
+ menu = createMenu(defaultStyleFormats);
32027
+ }
32028
+ } else {
32029
+ menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
32030
+ }
32031
+
32032
+ return menu;
32033
+ }
32034
+
31682
32035
  editor.on('init', function() {
31683
32036
  each(newFormats, function(format) {
31684
32037
  editor.formatter.register(format.name, format);
31685
32038
  });
31686
32039
  });
31687
32040
 
31688
- var menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
31689
-
31690
- menu = {
32041
+ return {
31691
32042
  type: 'menu',
31692
- items: menu,
32043
+ items: createStylesMenu(),
31693
32044
  onPostRender: function(e) {
31694
32045
  editor.fire('renderFormatsMenu', {control: e.control});
31695
32046
  },
@@ -31720,8 +32071,6 @@ define("tinymce/ui/FormatControls", [
31720
32071
  }
31721
32072
  }
31722
32073
  };
31723
-
31724
- return menu;
31725
32074
  }
31726
32075
 
31727
32076
  formatMenu = createFormatMenu();
@@ -31781,7 +32130,7 @@ define("tinymce/ui/FormatControls", [
31781
32130
 
31782
32131
  // Simple command controls with format state
31783
32132
  each({
31784
- blockquote: ['Toggle blockquote', 'mceBlockQuote'],
32133
+ blockquote: ['Blockquote', 'mceBlockQuote'],
31785
32134
  numlist: ['Numbered list', 'InsertOrderedList'],
31786
32135
  bullist: ['Bullet list', 'InsertUnorderedList'],
31787
32136
  subscript: ['Subscript', 'Subscript'],
@@ -32476,7 +32825,7 @@ define("tinymce/ui/Label", [
32476
32825
  var self = this, forId = self.settings.forId;
32477
32826
 
32478
32827
  return (
32479
- '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId : '') + '">' +
32828
+ '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId +'"' : '') + '>' +
32480
32829
  self.encode(self._text) +
32481
32830
  '</label>'
32482
32831
  );
@@ -33478,7 +33827,7 @@ define("tinymce/ui/ResizeHandle", [
33478
33827
  self.fire('Resize', e);
33479
33828
  },
33480
33829
 
33481
- end: function() {
33830
+ stop: function() {
33482
33831
  self.fire('ResizeEnd');
33483
33832
  }
33484
33833
  });
@@ -34152,5 +34501,5 @@ define("tinymce/ui/Throbber", [
34152
34501
  };
34153
34502
  });
34154
34503
 
34155
- expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","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"]);
34504
+ expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","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"]);
34156
34505
  })(this);