Comparing version 1.11.5 to 1.11.6
@@ -147,3 +147,4 @@ define([ | ||
try{ | ||
enabled = !disabled && e.queryCommandEnabled(c); | ||
var implFunc = e._implCommand(c); | ||
enabled = !disabled && (this[implFunc] ? this[implFunc](c) : e.queryCommandEnabled(c)); | ||
if(this.enabled !== enabled){ | ||
@@ -150,0 +151,0 @@ this.enabled = enabled; |
@@ -8,2 +8,3 @@ define([ | ||
"dojo/_base/lang", // lang.delegate lang.hitch lang.isString | ||
"dojo/string", | ||
"dojo/store/Memory", // MemoryStore | ||
@@ -18,3 +19,3 @@ "../../registry", // registry.getUniqueId | ||
"dojo/i18n!../nls/FontChoice" | ||
], function(require, array, declare, domConstruct, i18n, lang, MemoryStore, | ||
], function(require, array, declare, domConstruct, i18n, lang, stringUtil, MemoryStore, | ||
registry, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, FilteringSelect, _Plugin, rangeapi){ | ||
@@ -185,2 +186,23 @@ | ||
_normalizeFontName: function (value) { | ||
// summary: | ||
// Function used to choose one font name when the value is a list of font names | ||
// like "Verdana, Arial, Helvetica, sans-serif" | ||
var allowedValues = this.values; | ||
if (!value || !allowedValues) { | ||
return value; | ||
} | ||
var fontNames = value.split(','); | ||
if (fontNames.length > 1) { | ||
for (var i = 0, l = fontNames.length; i < l; i++) { | ||
var fontName = stringUtil.trim(fontNames[i]); | ||
var pos = array.indexOf(allowedValues, fontName); | ||
if (pos > -1) { | ||
return fontName; | ||
} | ||
} | ||
} | ||
return value; | ||
}, | ||
_setValueAttr: function(value, priorityChange){ | ||
@@ -192,2 +214,3 @@ // summary: | ||
priorityChange = priorityChange !== false; | ||
value = this._normalizeFontName(value); | ||
if(this.generic){ | ||
@@ -546,3 +569,5 @@ var map = { | ||
} | ||
if (_c === "fontSize" && !value) { | ||
value = 3; // default to "small" since Editor starts out with 16px font which is considered "small". | ||
} | ||
if(_c === "formatBlock"){ | ||
@@ -549,0 +574,0 @@ if(!value || value == "p"){ |
@@ -222,2 +222,3 @@ define([ | ||
this.editor.onLoadDeferred.then(lang.hitch(this, function(){ | ||
this.own(on(this.editor.editNode, "mouseup", lang.hitch(this, "_onMouseUp"))); | ||
this.own(on(this.editor.editNode, "dblclick", lang.hitch(this, "_onDblClick"))); | ||
@@ -258,2 +259,12 @@ })); | ||
_createlinkEnabledImpl: function() { | ||
// summary: | ||
// This function implements the test for if the create link | ||
// command should be enabled or not. This plugin supports | ||
// link creation even without selected text. | ||
// tags: | ||
// protected | ||
return true; | ||
}, | ||
setValue: function(args){ | ||
@@ -436,2 +447,30 @@ // summary: | ||
} | ||
}, | ||
_onMouseUp: function(){ | ||
// summary: | ||
// Function to define a behavior on mouse up on the element | ||
// type this dialog edits to move the cursor just outside | ||
// anchor tags when clicking on their edges. | ||
// tags: | ||
// protected. | ||
if(has('ff')){ | ||
var a = this.editor.selection.getAncestorElement(this.tag); | ||
if(a){ | ||
var selection = rangeapi.getSelection(this.editor.window); | ||
var range = selection.getRangeAt(0); | ||
if(range.collapsed && a.childNodes.length){ | ||
var test = range.cloneRange(); | ||
test.selectNodeContents(a.childNodes[a.childNodes.length - 1]); | ||
test.setStart(a.childNodes[0], 0); | ||
if(range.compareBoundaryPoints(test.START_TO_START, test) !== 1){ | ||
// cursor is before or at the test start | ||
range.setStartBefore(a); | ||
}else if(range.compareBoundaryPoints(test.END_TO_START, test) !== -1){ | ||
// cursor is before or at the test end | ||
range.setStartAfter(a); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
@@ -438,0 +477,0 @@ }); |
@@ -48,2 +48,8 @@ define([ | ||
// stripEventHandlers: [public] Boolean | ||
// Boolean flag used to indicate if event handler attributes like onload should be | ||
// stripped from the document. | ||
// Defaults to true. | ||
stripEventHandlers: true, | ||
// readOnly: [const] Boolean | ||
@@ -481,2 +487,18 @@ // Boolean flag used to indicate if the source view should be readonly or not. | ||
_stripEventHandlers: function (html) { | ||
if(html){ | ||
// Find all tags that contain an event handler attribute (an on* attribute). | ||
var matches = html.match(/<[a-z]+?\b(.*?on.*?(['"]).*?\2.*?)+>/gim); | ||
if(matches){ | ||
for(var i = 0, l = matches.length; i < l; i++){ | ||
// For each tag, remove only the event handler attributes. | ||
var match = matches[i]; | ||
var replacement = match.replace(/\s+on[a-z]*\s*=\s*(['"])(.*?)\1/igm, ""); | ||
html = html.replace(match, replacement); | ||
} | ||
} | ||
} | ||
return html; | ||
}, | ||
_filter: function(html){ | ||
@@ -499,2 +521,5 @@ // summary: | ||
} | ||
if(this.stripEventHandlers){ | ||
html = this._stripEventHandlers(html); | ||
} | ||
} | ||
@@ -549,3 +574,4 @@ return html; | ||
stripScripts: ("stripScripts" in args) ? args.stripScripts : true, | ||
stripIFrames: ("stripIFrames" in args) ? args.stripIFrames : true | ||
stripIFrames: ("stripIFrames" in args) ? args.stripIFrames : true, | ||
stripEventHandlers: ("stripEventHandlers" in args) ? args.stripEventHandlers : true | ||
}); | ||
@@ -552,0 +578,0 @@ }; |
@@ -18,3 +18,3 @@ { | ||
"dependencies": { | ||
"dojo": "1.11.5" | ||
"dojo": "1.11.6" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -822,2 +822,3 @@ define([ | ||
domStyle.set(this.document.body, "color", domStyle.get(this.iframe, "color")); | ||
domStyle.set(this.document.body, "background-color", domStyle.get(this.iframe, "background-color")); | ||
} | ||
@@ -824,0 +825,0 @@ }catch(e){ /* Squelch any errors caused by focus change if hidden during a state change */ |
@@ -7,4 +7,5 @@ define([ | ||
"dojo/on", | ||
"dojo/sniff", // has("webkit") | ||
"./_FormWidgetMixin" | ||
], function(declare, domAttr, keys, lang, on, _FormWidgetMixin){ | ||
], function(declare, domAttr, keys, lang, on, has, _FormWidgetMixin){ | ||
@@ -30,3 +31,9 @@ // module: | ||
_setReadOnlyAttr: function(/*Boolean*/ value){ | ||
domAttr.set(this.focusNode, 'readOnly', value); | ||
// IE has a Caret Browsing mode (hit F7 to activate) where disabled textboxes can be modified | ||
// focusNode enforced readonly if currently disabled to avoid this issue. | ||
if (has('trident') && 'disabled' in this) { | ||
domAttr.set(this.focusNode, 'readOnly', value || this.disabled); | ||
} else { | ||
domAttr.set(this.focusNode, 'readOnly', value); | ||
} | ||
this._set("readOnly", value); | ||
@@ -33,0 +40,0 @@ }, |
@@ -78,2 +78,7 @@ define([ | ||
domAttr.set(this.focusNode, 'disabled', value); | ||
// IE has a Caret Browsing mode (hit F7 to activate) where disabled textboxes can be modified | ||
// textboxes marked readonly if disabled to avoid this issue. | ||
if (has('trident') && 'readOnly' in this) { | ||
domAttr.set(this.focusNode, 'readonly', value || this.readOnly); | ||
} | ||
}else{ | ||
@@ -80,0 +85,0 @@ this.focusNode.setAttribute("aria-disabled", value ? "true" : "false"); |
@@ -443,3 +443,3 @@ define([ | ||
}catch(e){ | ||
console.error('Error ' + this.widgetId + ' running custom onLoad code: ' + e.message); | ||
console.error('Error ' + (this.widgetId || this.id) + ' running custom onLoad code: ' + e.message); | ||
} | ||
@@ -446,0 +446,0 @@ }, |
{ | ||
"name": "dijit", | ||
"version": "1.11.5", | ||
"version": "1.11.6", | ||
"directories": { | ||
@@ -9,3 +9,3 @@ "lib": "." | ||
"dependencies": { | ||
"dojo": "1.11.5" | ||
"dojo": "1.11.6" | ||
}, | ||
@@ -12,0 +12,0 @@ "description": "Dijit provides a complete collection of user interface controls based on Dojo, giving you the power to create web applications that are highly optimized for usability, performance, internationalization, accessibility, but above all deliver an incredible user experience.", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5542605
1420
54290
27
1
+ Addeddojo@1.11.6(transitive)
- Removeddojo@1.11.5(transitive)
Updateddojo@1.11.6