dijit
Advanced tools
Comparing version 1.17.0-pre to 1.17.0
define([ | ||
"require", | ||
"dojo/_base/array", | ||
"dojo/_base/declare", // declare | ||
@@ -14,3 +15,3 @@ "dojo/dom-attr", // domAttr.get | ||
"../range" | ||
], function(require, declare, domAttr, keys, lang, on, has, query, string, | ||
], function(require, array, declare, domAttr, keys, lang, on, has, query, string, | ||
_Plugin, DropDownButton, rangeapi){ | ||
@@ -30,2 +31,17 @@ | ||
// allowUnsafeHtml: boolean | ||
// If false (default), the link description will be filtered to prevent HTML content. | ||
// If true no filtering is done, allowing for HTML content within the link element. | ||
// The filter can be specified with the 'linkFilter' option. | ||
allowUnsafeHtml: false, | ||
// linkFilter: function or array of replacement pairs | ||
// If 'allowUnsafeHtml' is false then this filter will be applied to the link Description value. | ||
// function: the function will be invoked with the string value of the Description field and its | ||
// return value will be used | ||
// array: each array item should be an array of two values to pass to String#replace | ||
linkFilter: [ | ||
[/</g, "<"] | ||
], | ||
// Override _Plugin.buttonClass. This plugin is controlled by a DropDownButton | ||
@@ -257,2 +273,12 @@ // (which triggers a TooltipDialog). | ||
} | ||
if(!this.allowUnsafeHtml && args && args.textInput){ | ||
if(typeof this.linkFilter === 'function'){ | ||
args.textInput = this.linkFilter(args.textInput); | ||
} | ||
else{ | ||
array.forEach(this.linkFilter, function (currentFilter) { | ||
args.textInput = args.textInput.replace(currentFilter[0], currentFilter[1]); | ||
}); | ||
} | ||
} | ||
return args; | ||
@@ -635,4 +661,11 @@ }, | ||
// Register these plugins | ||
_Plugin.registry["createLink"] = function(){ | ||
return new LinkDialog({command: "createLink"}); | ||
_Plugin.registry["createLink"] = function(args){ | ||
var pluginOptions = { | ||
command: "createLink", | ||
allowUnsafeHtml: ("allowUnsafeHtml" in args) ? args.allowUnsafeHtml : false | ||
}; | ||
if("linkFilter" in args){ | ||
pluginOptions.linkFilter = args.linkFilter; | ||
} | ||
return new LinkDialog(pluginOptions); | ||
}; | ||
@@ -639,0 +672,0 @@ _Plugin.registry["insertImage"] = function(){ |
@@ -18,3 +18,3 @@ { | ||
"dependencies": { | ||
"dojo": "1.17.0-pre" | ||
"dojo": "1.17.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -186,2 +186,39 @@ define([ | ||
_isDefinitelyOutOfRange: function(){ | ||
var returnValue = this.inherited(arguments); | ||
var isOutOfRange = false; | ||
var inputDate; | ||
var inputYear; | ||
var inputYearMax; | ||
var inputYearMin; | ||
var maxDate; | ||
var minDate; | ||
if(returnValue && (this.constraints.min || this.constraints.max)){ | ||
dateRegExp = new RegExp(this._lastRegExp); | ||
inputDate = dateRegExp.exec(this._lastInputEventValue); | ||
inputYear = inputDate[3]; | ||
if(this.constraints.min){ | ||
minDate = this.constraints.min instanceof Date ? | ||
this.constraints.min : new Date(String(this.constraints.min)); | ||
minYear = minDate.getFullYear(); | ||
inputYearMax = parseInt((inputYear + '9999').substr(0, 4), 10); | ||
isOutOfRange = inputYearMax < minYear; | ||
} | ||
if(!isOutOfRange && this.constraints.max){ | ||
maxDate = this.constraints.max instanceof Date ? | ||
this.constraints.max : new Date(String(this.constraints.max)); | ||
maxYear = maxDate.getFullYear(); | ||
inputYearMin = parseInt((inputYear + '0000').substr(0, 4), 10); | ||
isOutOfRange = inputYearMin > maxYear; | ||
} | ||
returnValue = isOutOfRange; | ||
} | ||
return returnValue; | ||
}, | ||
_isInvalidDate: function(/*Date*/ value){ | ||
@@ -188,0 +225,0 @@ // summary: |
@@ -147,3 +147,5 @@ define([ | ||
if(lang.isArrayLike(valueOrIdx)){ | ||
return array.map(valueOrIdx, "return this.getOptions(item);", this); // __SelectOption[] | ||
return array.map(valueOrIdx, function(item){ | ||
return this.getOptions(item); | ||
}, this); // __SelectOption[] | ||
} | ||
@@ -150,0 +152,0 @@ if(lang.isString(valueOrIdx)){ |
@@ -136,3 +136,3 @@ define([ | ||
if (key == keys.DELETE || key == keys.BACKSPACE) { | ||
if (key === keys.DELETE || key === keys.BACKSPACE) { | ||
this._prev_key_backspace = true; | ||
@@ -139,0 +139,0 @@ this._maskValidSubsetError = true; |
{ | ||
"name": "dijit", | ||
"version": "1.17.0-pre", | ||
"version": "1.17.0", | ||
"directories": { | ||
@@ -9,3 +9,3 @@ "lib": "." | ||
"dependencies": { | ||
"dojo": "1.17.0-pre" | ||
"dojo": "1.17.0" | ||
}, | ||
@@ -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.", |
@@ -5,6 +5,6 @@ { | ||
"items": [ | ||
{ "id": "0", "name":"Foods", "numberOfItems":1, "children":[ {"_reference": "1"}, {"_reference": "2"}, {"_reference": "3"} ] }, | ||
{ "id": "1", "name":"Fruits", "numberOfItems":1, "children":[ {"_reference": "4"} ] }, | ||
{ "id": "4","name":"Citrus", "numberOfItems":1, "items":[ {"_reference": "5"} ] }, | ||
{ "id": "5", "name":"Orange"}, | ||
{ "id": "0", "name":"Foods", "numberOfItems":3, "children":[ {"_reference": "1"}, {"_reference": "2"}, {"_reference": "3"} ] }, | ||
{ "id": "1", "name":"Fruits", "numberOfItems":1, "children":[ {"_reference": "4"} ] }, | ||
{ "id": "4", "name":"Citrus", "numberOfItems":1, "items":[ {"_reference": "5"} ] }, | ||
{ "id": "5", "name":"Orange"}, | ||
{ "id": "2", "name":"Vegetables", "numberOfItems":0}, | ||
@@ -11,0 +11,0 @@ { "id": "3", "name":"Cereals", "numberOfItems":0} |
@@ -387,3 +387,3 @@ define([ | ||
// Deregister mapping from item id --> this node and its descendants | ||
function remove(node){ | ||
var remove = function remove(node){ | ||
var id = model.getIdentity(node.item), | ||
@@ -400,3 +400,3 @@ ary = tree._itemNodesMap[id]; | ||
array.forEach(node.getChildren(), remove); | ||
} | ||
}; | ||
@@ -1577,3 +1577,3 @@ remove(node); | ||
var tmp = []; | ||
for(var domNode = this.domNode; | ||
for(var domNode = this.domNode; | ||
domNode && domNode.tagName && domNode.tagName.toUpperCase() !== 'IFRAME'; | ||
@@ -1580,0 +1580,0 @@ domNode = domNode.parentNode) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5556714
54525
0
+ Addeddojo@1.17.0(transitive)
- Removeddojo@1.17.0-pre(transitive)
Updateddojo@1.17.0