Permalink
Browse files

Added rules for setSelectable, deprecated, store/Memory, warning for …

…getObject, etc.
  • Loading branch information...
1 parent 3fd9531 commit 2bad4ecb4f62f11c8a23808a9a4641e680abb2af @danconn danconn committed Mar 26, 2013
Showing with 51 additions and 3 deletions.
  1. +31 −3 converter.js
  2. +12 −0 tests/basic/expected.js
  3. +8 −0 tests/basic/input.js
View
@@ -76,6 +76,7 @@ this.CONVERTER = (function () {
'dojo/_base/array': 'dojoArray',
'dojo/io/iframe': 'dojoIframe',
'dojo/_base/lang': 'dojoLang',
+ 'dojo/_base/kernel': 'kernel',
'dojo/keys': 'keys',
'dojo/_base/event': 'dojoEvent',
'dojo/dom-style': 'domStyle',
@@ -85,6 +86,7 @@ this.CONVERTER = (function () {
'dojo/ready': 'ready',
'dojo/has': 'has',
'dojo/Stateful': 'Stateful',
+ 'dojo/store/Memory': 'Memory',
'dijit/registry': 'dijitRegistry',
'dijit/popup': 'dijitPopup',
'dijit/focus': 'dijitFocus',
@@ -129,13 +131,27 @@ this.CONVERTER = (function () {
depend: 'dojo/_base/lang'
},
{
+ pattern: /dojo\.(getObject)/g,
+ depend: 'dojo/_base/lang',
+ repFn: function (all) {
+ warn('dojo.getObject relies on globals - refactor to make dojo.getObject unnecessary');
+ }
+ },
+ {
pattern: /dojo\.isIE/g,
depend: 'dojo/has',
repFn: function (all) {
warn('dojo.IsIE detected - replaced with has("ie"). Please double check the replacement for cases where a specific version of IE needed to be detected');
addDependency(this.depend, dependNameMap[this.depend]);
return "has('ie')";
}
+ },{
+ pattern: /dojo\.isWebKit/g,
+ depend: 'dojo/has',
+ repFn: function (all) {
+ addDependency(this.depend, dependNameMap[this.depend]);
+ return "has('webkit')";
+ }
},
{
pattern: /dojo\.(attr)/g,
@@ -149,10 +165,18 @@ this.CONVERTER = (function () {
depend: 'dojo/dom'
},
{
+ pattern: /dojo\.(setSelectable)/g,
+ depend: 'dojo/dom'
+ },
+ {
pattern: /dojo\.Stateful()/g,
depend: 'dojo/Stateful'
},
{
+ pattern: /dojo\.store\.Memory()/g,
+ depend: 'dojo/store/Memory'
+ },
+ {
pattern: /dojo\.html\.(set)/g,
depend: 'dojo/html'
},
@@ -174,7 +198,7 @@ this.CONVERTER = (function () {
depend: 'dojo/_base/declare',
alias: 'declare',
repFn: function (all) {
- //hacky work around specifically for declare, since we don't won't to replace it till the end
+ //hacky work around specifically for declare, since we don't want to replace it until the end
addDependency(this.depend, this.alias);
return all;
}
@@ -213,6 +237,10 @@ this.CONVERTER = (function () {
depend: 'dojo/_base/lang'
},
{
+ pattern: /dojo\.(deprecated)/g,
+ depend: 'dojo/_base/kernel'
+ },
+ {
pattern: /dojo\.keys[\.]?([\w\.]*)/g,
depend: 'dojo/keys'
},
@@ -425,7 +453,7 @@ this.CONVERTER = (function () {
pattern: /PTO\.log([\w\.]*)/g,
repFn: function (all, rest) {
this.alias = 'log' + rest;
- this.depend = 'plugin/ioc!' + toRelativePath('PTO.logging.Logger', currentPath);
+ this.depend = 'plugins/ioc!' + toRelativePath('PTO.logging.Logger', currentPath);
}
},
{
@@ -717,4 +745,4 @@ this.CONVERTER = (function () {
return fileString.replace(/dojo\.declare/g, "declare");
}
};
-}());
+}());
@@ -31,6 +31,7 @@ define([
"dojo/Stateful",
"dojo/_base/array",
"dojo/_base/event",
+ "dojo/_base/kernel",
"dojo/_base/lang",
"dojo/_base/window",
"dojo/cookie",
@@ -46,6 +47,7 @@ define([
"dojo/keys",
"dojo/query",
"dojo/ready",
+ "dojo/store/Memory",
"dojo/string",
"plugin/ioc!../../logging/Logger"
], function (
@@ -78,6 +80,7 @@ define([
Stateful,
dojoArray,
dojoEvent,
+ kernel,
dojoLang,
dojoWindow,
cookie,
@@ -93,6 +96,7 @@ define([
keys,
dojoQuery,
ready,
+ Memory,
dojoString,
log
) {
@@ -119,6 +123,7 @@ define([
domClass.add('class');
domAttr.attr('aria');
dojoDom.byId('someId');
+ dojoDom.setSelectable({}, true);
domConstruct.place('' + title + '', html);
domConstruct.place('<span id="printCaseTitle" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%;">' +
title + '</span>', html);
@@ -190,6 +195,7 @@ define([
dojoLang.isString('sdfsdf');
has('ie');
+ has('webkit');
domGeom.getBorderExtents();
ready();
dojoWindow.body();
@@ -211,6 +217,12 @@ define([
});
new Stateful();
+
+ dojoLang.getObject();
+
+ new Memory({data: {"id": "fake"}, idProperty: "id"});
+
+ kernel.deprecated("Don't use this!", "Use that!", "2.0");
},
templateString: 'something data-dojo-attach-point="pinnedDataNodeCenter">/something' +
@@ -53,6 +53,7 @@ dojo.declare('PTO.widget.document.DocumentViewerLoader', [PTO.something.Thing, P
var x = new PTO.widget.ConstructorProperty();
dijit.registry.someMethod();
dijit.byId('id');
+ dojo.setSelectable({}, true);
dijit.byNode('node');
dojo.clone(new Sheep());
dojo.contentBox('box');
@@ -109,6 +110,7 @@ dojo.declare('PTO.widget.document.DocumentViewerLoader', [PTO.something.Thing, P
dojo.isString('sdfsdf');
dojo.isIE;
+ dojo.isWebKit;
dojo._getBorderExtents();
dojo.ready();
dojo.body();
@@ -130,6 +132,12 @@ dojo.declare('PTO.widget.document.DocumentViewerLoader', [PTO.something.Thing, P
});
new dojo.Stateful();
+
+ dojo.getObject();
+
+ new dojo.store.Memory({data: {"id": "fake"}, idProperty: "id"});
+
+ dojo.deprecated("Don't use this!", "Use that!", "2.0");
},
templateString: 'something dojoAttachPoint="pinnedDataNodeCenter">/something' +

0 comments on commit 2bad4ec

Please sign in to comment.