Socket
Socket
Sign inDemoInstall

dojo

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dojo - npm Package Compare versions

Comparing version 1.9.3 to 1.9.4

tests/text.html

3

_base/config.js

@@ -177,2 +177,3 @@ define(["../has", "require"], function(has, require){

};
var global = (function () { return this; })();
result = has("dojo-loader") ?

@@ -182,3 +183,3 @@ // must be a built version of the dojo loader; all config stuffed in require.rawConfig

// a foreign loader
this.dojoConfig || this.djConfig || {};
global.dojoConfig || global.djConfig || {};
adviseHas(result, "config", 1);

@@ -185,0 +186,0 @@ adviseHas(result.has, "", 1);

@@ -13,2 +13,3 @@ define(["../has", "./config", "require", "module"], function(has, config, require, module){

// FIXME: in 2.0 remove dijit, dojox being created by dojo
global = (function () { return this; })(),
dijit = {},

@@ -22,3 +23,3 @@ dojox = {},

config:config,
global:this,
global:global,
dijit:dijit,

@@ -72,3 +73,3 @@ dojox:dojox

if(!config.noGlobals){
this[item[0]] = item[1];
global[item[0]] = item[1];
}

@@ -85,3 +86,3 @@ }

var rev = "$Rev: fd52c96 $".match(/[0-9a-f]{7,}/);
var rev = "$Rev: 2fc0590 $".match(/[0-9a-f]{7,}/);
dojo.version = {

@@ -99,3 +100,3 @@ // summary:

major: 1, minor: 9, patch: 3, flag: "",
major: 1, minor: 9, patch: 4, flag: "",
revision: rev ? rev[0] : NaN,

@@ -172,3 +173,3 @@ toString: function(){

console[tcn] = ('log' in console) ? function(){
var a = Array.apply({}, arguments);
var a = Array.prototype.slice.call(arguments);
a.unshift(tcn + ":");

@@ -175,0 +176,0 @@ console["log"](a.join(" "));

@@ -21,3 +21,3 @@ define(["./kernel", "./lang", "../sniff"], function(dojo, lang, has){

doc: this["document"] || null,
doc: dojo.global["document"] || null,
/*=====

@@ -24,0 +24,0 @@ doc: {

@@ -202,3 +202,3 @@ define(["./sniff", "./dom"], function(has, dom){

type = type.toLowerCase();
if(has("ie")){
if(has("ie") || has("trident")){
if(value == "auto"){

@@ -205,0 +205,0 @@ if(type == "height"){ return node.offsetHeight; }

@@ -127,2 +127,7 @@ define(["./sniff", "./_base/window"],

// (currently known to work in all but IE < 10 and Opera)
// TODO: The user-select CSS property as of May 2014 is no longer part of
// any CSS specification. In IE, -ms-user-select does not do the same thing
// as the unselectable attribute on elements; namely, dijit Editor buttons
// do not properly prevent the content of the editable content frame from
// unblurring. As a result, the -ms- prefixed version is omitted here.
has.add("css-user-select", function(global, doc, element){

@@ -133,3 +138,3 @@ // Avoid exception when dom.js is loaded in non-browser environments

var style = element.style;
var prefixes = ["Khtml", "O", "ms", "Moz", "Webkit"],
var prefixes = ["Khtml", "O", "Moz", "Webkit"],
i = prefixes.length,

@@ -136,0 +141,0 @@ name = "userSelect",

define(['./has'], function(has){
var global = this,
var global = (function () { return this; })(),
doc = document,

@@ -42,3 +42,3 @@ readyStates = { 'loaded': 1, 'complete': 1 },

}catch(err){
console.log("Error on domReady callback: " + err);
console.error(err, "in domReady callback", err.stack);
}

@@ -45,0 +45,0 @@ }

@@ -29,3 +29,3 @@ define(["require", "module"], function(require, module){

// has API variables
global = this,
global = (function () { return this; })(),
doc = isBrowser && document,

@@ -32,0 +32,0 @@ element = doc && doc.createElement("DiV"),

@@ -1,17 +0,16 @@

define(["./has"], function(has){
if(!has("host-node")){
throw new Error("node plugin failed to load because environment is not Node.js");
}
define(["./_base/kernel", "./has", "require"], function(kernel, has, require){
var nodeRequire = kernel.global.require && kernel.global.require.nodeRequire;
var pathUtil;
if(require.nodeRequire){
pathUtil = require.nodeRequire("path");
}else{
throw new Error("node plugin failed to load because it cannot find the original Node.js require");
if (!nodeRequire) {
throw new Error("Cannot find the Node.js require");
}
var module = nodeRequire("module");
return {
// summary:
// This AMD plugin module allows native Node.js modules to be loaded by AMD modules using the Dojo
// loader. Note that this plugin will not work with AMD loaders other than the Dojo loader.
// loader. This plugin will not work with AMD loaders that do not expose the Node.js require function
// at `require.nodeRequire`.
//
// example:

@@ -22,27 +21,40 @@ // | require(["dojo/node!fs"], function(fs){

load: function(/*string*/ id, /*Function*/ require, /*Function*/ load){
// summary:
// Standard AMD plugin interface. See https://github.com/amdjs/amdjs-api/wiki/Loader-Plugins
// for information.
load: function(/*string*/ id, /*Function*/ contextRequire, /*Function*/ load){
/*global define:true */
if(!require.nodeRequire){
throw new Error("Cannot find native require function");
// The `nodeRequire` function comes from the Node.js module of the AMD loader, so module ID resolution is
// relative to the loader's path, not the calling AMD module's path. This means that loading Node.js
// modules that exist in a higher level or sibling path to the loader will cause those modules to fail to
// resolve.
//
// Node.js does not expose a public API for performing module filename resolution relative to an arbitrary
// directory root, so we are forced to dig into the internal functions of the Node.js `module` module to
// use Node.js's own path resolution code instead of having to duplicate its rules ourselves.
//
// Sooner or later, probably around the time that Node.js internal code is reworked to use ES6, these
// methods will no longer be exposed and we will have to find another workaround if they have not exposed
// an API for doing this by then.
if(module._findPath && module._nodeModulePaths){
var localModulePath = module._findPath(id, module._nodeModulePaths(contextRequire.toUrl(".")));
if (localModulePath !== false) {
id = localModulePath;
}
}
load((function(id, require){
var oldDefine = define,
result;
var oldDefine = define,
result;
// Some modules may attempt to detect an AMD loader via define and define.amd. This can cause issues
// when other CommonJS modules attempt to load them via the standard node require(). If define is
// temporarily moved into another variable, it will prevent modules from detecting AMD in this fashion.
define = undefined;
// Some modules attempt to detect an AMD loader by looking for global AMD `define`. This causes issues
// when other CommonJS modules attempt to load them via the standard Node.js `require`, so hide it
// during the load
define = undefined;
try{
result = require(id);
}finally{
define = oldDefine;
}
return result;
})(id, require.nodeRequire));
try {
result = nodeRequire(id);
}
finally {
define = oldDefine;
}
load(result);
},

@@ -52,13 +64,11 @@

// summary:
// Produces a normalized id to be used by node. Relative ids are resolved relative to the requesting
// module's location in the file system and will return an id with path separators appropriate for the
// local file system.
// Produces a normalized CommonJS module ID to be used by Node.js `require`. Relative IDs
// are resolved relative to the requesting module's location in the filesystem and will
// return an ID with path separators appropriate for the local filesystem
if(id.charAt(0) === "."){
// dirname of the reference module - normalized to match the local file system
var referenceModuleDirname = require.toUrl(normalize(".")).replace("/", pathUtil.sep),
segments = id.split("/");
segments.unshift(referenceModuleDirname);
// this will produce an absolute path normalized to the semantics of the underlying file system.
id = pathUtil.join.apply(pathUtil, segments);
if (id.charAt(0) === ".") {
// absolute module IDs need to be generated based on the AMD loader's knowledge of the parent module,
// since Node.js will try to use the directory containing `dojo.js` as the relative root if a
// relative module ID is provided
id = require.toUrl(normalize("./" + id));
}

@@ -65,0 +75,0 @@

@@ -12,2 +12,26 @@ define(["./has!dom-addeventlistener?:./aspect", "./_base/kernel", "./sniff"], function(aspect, dojo, has){

});
if(has("touch")){
has.add("touch-can-modify-event-delegate", function(){
// This feature test checks whether deleting a property of an event delegate works
// for a touch-enabled device. If it works, event delegation can be used as fallback
// for browsers such as Safari in older iOS where deleting properties of the original
// event does not work.
var EventDelegate = function(){};
EventDelegate.prototype =
document.createEvent("MouseEvents"); // original event
// Attempt to modify a property of an event delegate and check if
// it succeeds. Depending on browsers and on whether dojo/on's
// strict mode is stripped in a Dojo build, there are 3 known behaviors:
// it may either succeed, or raise an error, or fail to set the property
// without raising an error.
try{
var eventDelegate = new EventDelegate;
eventDelegate.target = null;
return eventDelegate.target === null;
}catch(e){
return false; // cannot use event delegation
}
});
}
}

@@ -204,3 +228,5 @@ var on = function(target, type, listener, dontFix){

// if it matches we call the listener
return eventTarget && listener.call(eventTarget, event);
if (eventTarget) {
return listener.call(eventTarget, event);
}
});

@@ -468,3 +494,3 @@ };

if(has("touch")){
var Event = function(){};
var EventDelegate = function(){};
var windowOrientation = window.orientation;

@@ -483,16 +509,18 @@ var fixTouchListener = function(listener){

try{
delete originalEvent.type; // on some JS engines (android), deleting properties make them mutable
delete originalEvent.type; // on some JS engines (android), deleting properties makes them mutable
}catch(e){}
if(originalEvent.type){
// deleting properties doesn't work (older iOS), have to use delegation
if(has('mozilla')){
// Firefox doesn't like delegated properties, so we have to copy
var event = {};
// Deleting the property of the original event did not work (this is the case of
// browsers such as older Safari iOS), hence fallback:
if(has("touch-can-modify-event-delegate")){
// If deleting properties of delegated event works, use event delegation:
EventDelegate.prototype = originalEvent;
event = new EventDelegate;
}else{
// Otherwise last fallback: other browsers, such as mobile Firefox, do not like
// delegated properties, so we have to copy
event = {};
for(var name in originalEvent){
event[name] = originalEvent[name];
}
}else{
// old iOS branch
Event.prototype = originalEvent;
var event = new Event;
}

@@ -499,0 +527,0 @@ // have to delegate methods to make them work

{
"name": "dojo",
"version":"1.9.3",
"version":"1.9.4",
"directories": {

@@ -5,0 +5,0 @@ "lib": "."

@@ -7,2 +7,4 @@ define([

], function(tracer, has, lang, arrayUtil){
has.add("config-useDeferredInstrumentation", "report-unhandled-rejections");
function logError(error, rejection, deferred){

@@ -9,0 +11,0 @@ var stack = "";

@@ -182,3 +182,3 @@ define([

parentNode = parentNode.parentNode;
}while(parentNode !== win.doc.documentElement);
}while(parentNode && parentNode !== win.doc.documentElement);

@@ -185,0 +185,0 @@ // Append the form node or some browsers won't work

@@ -5,2 +5,3 @@ define([

'./util',
'../_base/kernel',
'../_base/array',

@@ -15,3 +16,3 @@ '../_base/lang',

'../_base/declare' =====*/
], function(module, watch, util, array, lang, on, dom, domConstruct, has, win/*=====, request, declare =====*/){
], function(module, watch, util, kernel, array, lang, on, dom, domConstruct, has, win/*=====, request, declare =====*/){
has.add('script-readystatechange', function(global, document){

@@ -27,3 +28,3 @@ var script = document.createElement('script');

readyRegExp = /complete|loaded/,
callbacks = this[mid + '_callbacks'] = {},
callbacks = kernel.global[mid + '_callbacks'] = {},
deadScripts = [];

@@ -30,0 +31,0 @@

@@ -27,3 +27,3 @@ define([

// if true, the environment has a native FormData implementation
return typeof FormData === 'function';
return typeof FormData !== 'undefined';
});

@@ -30,0 +30,0 @@

@@ -152,3 +152,3 @@ define(["../_base/declare", "./util/QueryResults", "./util/SimpleQueryEngine" /*=====, "./api/Store" =====*/],

// just for convenience with the data format IFRS expects
this.idProperty = data.identifier;
this.idProperty = data.identifier || this.idProperty;
data = this.data = data.items;

@@ -155,0 +155,0 @@ }else{

@@ -27,2 +27,3 @@ define([

"dojo/tests/errors",
"dojo/tests/text",
"dojo/has!host-node?dojo/tests/node",

@@ -29,0 +30,0 @@ "dojo/has!host-browser?dojo/tests/router",

@@ -299,2 +299,11 @@ define([

t.is(testValue, 3);
},
function delegatePreventDefault(t){
var div = document.createElement("div");
div.innerHTML = '<input type="checkbox">';
var cb = div.childNodes[0];
document.body.appendChild(div);
on(div, '.matchesNothing:click', function () {});
cb.click();
t.t(cb.checked);
}

@@ -301,0 +310,0 @@ ]);

@@ -104,36 +104,2 @@ define(["doh/main", "require", "../rpc/RpcService", "../rpc/JsonService", "../rpc/JsonpService"],

}
},
{
name: "JsonP_test",
timeout: 10000,
setUp: function(){
this.svc = new JsonpService(require.toUrl("dojo/tests/resources/yahoo_smd_v1.smd"), {appid: "foo"});
},
runTest: function(){
var d = new doh.Deferred();
if (window.location.protocol=="file:"){
var err= new Error("This Test requires a webserver and will fail intentionally if loaded from file://");
d.errback(err);
return d;
}
var td = this.svc.webSearch({query:"dojotoolkit"});
td.addCallbacks(function(result){
return true;
if (result["ResultSet"]["Result"][0]["DisplayUrl"]=="dojotoolkit.org/"){
return true;
}else{
return new Error("JsonRpc_SMD_Loading_Test failed, resultant content didn't match");
}
}, function(result){
return new Error(result);
});
td.addBoth(d, "callback");
return d;
}
}

@@ -140,0 +106,0 @@ ]);

@@ -8,3 +8,3 @@ define(["./_base/kernel", "require", "./has", "./has!host-browser?./request"], function(dojo, require, has, request){

getText= function(url, sync, load){
request(url, {sync:!!sync}).then(load);
request(url, {sync:!!sync, headers: { 'X-Requested-With': null } }).then(load);
};

@@ -11,0 +11,0 @@ }else{

@@ -39,3 +39,10 @@ define(["./_base/kernel", "./aspect", "./dom", "./dom-class", "./_base/lang", "./on", "./has", "./mouse", "./domReady", "./_base/window"],

return function(node, listener){
var handle1 = on(node, touchType, listener),
var handle1 = on(node, touchType, function(evt){
listener.call(this, evt);
// On slow mobile browsers (see https://bugs.dojotoolkit.org/ticket/17634),
// a handler for a touch event may take >1s to run. That time shouldn't
// be included in the calculation for lastTouch.
lastTouch = (new Date()).getTime();
}),
handle2 = on(node, mouseType, function(evt){

@@ -80,4 +87,4 @@ if(!lastTouch || (new Date()).getTime() > lastTouch + 1000){

clickTarget = e.target;
clickX = e.touches ? e.touches[0].pageX : e.clientX;
clickY = e.touches ? e.touches[0].pageY : e.clientY;
clickX = e.changedTouches ? e.changedTouches[0].pageX : e.clientX;
clickY = e.changedTouches ? e.changedTouches[0].pageY : e.clientY;
clickDx = (typeof clickTracker == "object" ? clickTracker.x : (typeof clickTracker == "number" ? clickTracker : 0)) || 4;

@@ -93,5 +100,5 @@ clickDy = (typeof clickTracker == "object" ? clickTracker.y : (typeof clickTracker == "number" ? clickTracker : 0)) || 4;

clickTracker = clickTracker &&
e.target == clickTarget &&
Math.abs((e.touches ? e.touches[0].pageX : e.clientX) - clickX) <= clickDx &&
Math.abs((e.touches ? e.touches[0].pageY : e.clientY) - clickY) <= clickDy;
(e.changedTouches ? e.changedTouches[0].target : e.target) == clickTarget &&
Math.abs((e.changedTouches ? e.changedTouches[0].pageX : e.clientX) - clickX) <= clickDx &&
Math.abs((e.changedTouches ? e.changedTouches[0].pageY : e.clientY) - clickY) <= clickDy;
}, true);

@@ -107,9 +114,28 @@

}
//some attributes can be on the Touch object, not on the Event:
//http://www.w3.org/TR/touch-events/#touch-interface
var src = (e.changedTouches) ? e.changedTouches[0] : e;
//create the synthetic event.
//http://www.w3.org/TR/DOM-Level-3-Events/#widl-MouseEvent-initMouseEvent
var clickEvt = document.createEvent("MouseEvents");
clickEvt._dojo_click = true;
clickEvt.initMouseEvent("click",
true, //bubbles
true, //cancelable
e.view,
e.detail,
src.screenX,
src.screenY,
src.clientX,
src.clientY,
e.ctrlKey,
e.altKey,
e.shiftKey,
e.metaKey,
0, //button
null //related target
);
setTimeout(function(){
on.emit(target, "click", {
bubbles : true,
cancelable : true,
_dojo_click : true
});
});
on.emit(target, "click", clickEvt);
}, 0);
}

@@ -116,0 +142,0 @@ }, true);

@@ -151,2 +151,11 @@ define(["./_base/lang", "./sniff", "./_base/window", "./dom", "./dom-geometry", "./dom-style", "./dom-construct"],

: (has("position-fixed-support") && (style.get(el, 'position').toLowerCase() == "fixed"));
},
self = this,
scrollElementBy = function(el, x, y){
if(el.tagName == "BODY" || el.tagName == "HTML"){
self.get(el.ownerDocument).scrollBy(x, y);
}else{
x && (el.scrollLeft += x);
y && (el.scrollTop += y);
}
};

@@ -162,5 +171,5 @@ if(isFixed(node)){ return; } // nothing to do

elPos.w = rootWidth; elPos.h = rootHeight;
if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
if(elPos.x < 0 || !isIE || isIE >= 9){ elPos.x = 0; } // older IE can have values > 0
if(elPos.y < 0 || !isIE || isIE >= 9){ elPos.y = 0; }
if(scrollRoot == html && (isIE || has("trident")) && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
if(elPos.x < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.x = 0; } // older IE can have values > 0
if(elPos.y < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.y = 0; }
}else{

@@ -206,5 +215,5 @@ var pb = geom.getPadBorderExtents(el);

s = Math[l < 0? "max" : "min"](l, r);
if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9)){ s = -s; }
if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9 || has("trident"))){ s = -s; }
old = el.scrollLeft;
el.scrollLeft += s;
scrollElementBy(el, s, 0);
s = el.scrollLeft - old;

@@ -216,3 +225,3 @@ nodePos.x -= s;

old = el.scrollTop;
el.scrollTop += s;
scrollElementBy(el, 0, s);
s = el.scrollTop - old;

@@ -219,0 +228,0 @@ nodePos.y -= s;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc