From 4faf02ae66a7a0c893c141960d7ac678196b8624 Mon Sep 17 00:00:00 2001 From: Bill Keese Date: Wed, 23 Jan 2013 14:33:09 +0900 Subject: [PATCH] _TemplatedMixin: remove support for templatePath etc., refs #4 --- _AttachMixin.js | 10 ++++------ _TemplatedMixin.js | 25 +------------------------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/_AttachMixin.js b/_AttachMixin.js index d3d1c1ec8..61e43c57a 100644 --- a/_AttachMixin.js +++ b/_AttachMixin.js @@ -1,14 +1,13 @@ define([ "require", "dojo/_base/array", // array.forEach - "dojo/_base/connect", // remove for 2.0 "dojo/_base/declare", // declare "dojo/_base/lang", // lang.getObject "dojo/mouse", "dojo/on", "dojo/touch", "./_WidgetBase" -], function(require, array, connect, declare, lang, mouse, on, touch, _WidgetBase){ +], function(require, array, declare, lang, mouse, on, touch, _WidgetBase){ // module: // dijit/_AttachMixin @@ -16,8 +15,7 @@ define([ // Map from string name like "mouseenter" to synthetic event like mouse.enter var synthEvents = lang.delegate(touch, { "mouseenter": mouse.enter, - "mouseleave": mouse.leave, - "keypress": connect._keypress // remove for 2.0 + "mouseleave": mouse.leave }); // To be lightweight, _AttachMixin doesn't require() dijit/a11yclick. @@ -134,7 +132,7 @@ define([ // Process data-dojo-attach-point var _attachScope = this.attachScope || this, - attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point"); + attachPoint = getAttrFunc(baseNode, "data-dojo-attach-point"); if(attachPoint){ var point, points = attachPoint.split(/\s*,\s*/); while((point = points.shift())){ @@ -149,7 +147,7 @@ define([ } // Process data-dojo-attach-event - var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event"); + var attachEvent = getAttrFunc(baseNode, "data-dojo-attach-event"); if(attachEvent){ // NOTE: we want to support attributes that have the form // "domEvent: nativeEvent; ..." diff --git a/_TemplatedMixin.js b/_TemplatedMixin.js index 8643e7eb5..dbe07e7d1 100644 --- a/_TemplatedMixin.js +++ b/_TemplatedMixin.js @@ -1,5 +1,4 @@ define([ - "dojo/cache", // dojo.cache "dojo/_base/declare", // declare "dojo/dom-construct", // domConstruct.destroy, domConstruct.toDom "dojo/_base/lang", // lang.getObject @@ -7,7 +6,7 @@ define([ "dojo/sniff", // has("ie") "dojo/string", // string.substitute string.trim "./_AttachMixin" -], function(cache, declare, domConstruct, lang, on, has, string, _AttachMixin){ +], function(declare, domConstruct, lang, has, string, _AttachMixin){ // module: // dijit/_TemplatedMixin @@ -21,11 +20,6 @@ define([ // Use in conjunction with dojo.cache() to load from a file. templateString: null, - // templatePath: [protected deprecated] String - // Path to template (HTML file) for this widget relative to dojo.baseUrl. - // Deprecated: use templateString with require([... "dojo/text!..."], ...) instead - templatePath: null, - // skipNodeCache: [protected] Boolean // If using a cached widget template nodes poses issues for a // particular widget class, it can set this property to ensure @@ -73,10 +67,6 @@ define([ // protected if(!this._rendered){ - if(!this.templateString){ - this.templateString = cache(this.templatePath, {sanitize: true}); - } - // Lookup cached version of template, and download to cache if it // isn't there already. Returns either a DomNode or a string, depending on // whether or not the template contains ${foo} replacement parameters. @@ -172,18 +162,5 @@ define([ } }; - if(has("ie")){ - on(window, "unload", function(){ - var cache = _TemplatedMixin._templateCache; - for(var key in cache){ - var value = cache[key]; - if(typeof value == "object"){ // value is either a string or a DOM node template - domConstruct.destroy(value); - } - delete cache[key]; - } - }); - } - return _TemplatedMixin; });