Skip to content

Commit

Permalink
Fix style errors (spacing) in top level widgets plus some miscellaneo…
Browse files Browse the repository at this point in the history
…us files, refs #10048 !strict.

git-svn-id: http://svn.dojotoolkit.org/src/dijit/trunk@20569 560b804f-0ae3-0310-86f3-f6aa0a117693
  • Loading branch information
wkeese committed Oct 13, 2009
1 parent b121219 commit f5f7d81
Show file tree
Hide file tree
Showing 21 changed files with 256 additions and 249 deletions.
6 changes: 3 additions & 3 deletions Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dojo.declare(
// example:
// | var calendar = new dijit.Calendar({}, dojo.byId("calendarNode"));
//
// example:
// example:
// | <div dojoType="dijit.Calendar"></div>

templateString: dojo.cache("dijit", "templates/Calendar.html"),
Expand Down Expand Up @@ -165,7 +165,7 @@ dojo.declare(
clazz = clazz2 + " " + clazz;
}

template.className = clazz + "Month dijitCalendarDateTemplate";
template.className = clazz + "Month dijitCalendarDateTemplate";
template.dijitDateValue = date.valueOf();
var label = dojo.query(".dijitCalendarDateLabel", template)[0],
text = date.getDateLocalized ? date.getDateLocalized(this.lang) : date.getDate();
Expand Down Expand Up @@ -211,7 +211,7 @@ dojo.declare(
var dateClass = (args.datePackage && (args.datePackage != "dojo.date"))? args.datePackage + ".Date" : "Date";
this.dateClassObj = dojo.getObject(dateClass, false);
this.datePackage = args.datePackage || this.datePackage;
this.dateFuncObj = dojo.getObject(this.datePackage, false);
this.dateFuncObj = dojo.getObject(this.datePackage, false);
this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false);
},

Expand Down
50 changes: 25 additions & 25 deletions ColorPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dojo.declare("dijit.ColorPalette",

"3x4": [["white", "lime", "green", "blue"],
["silver", "yellow", "fuchsia", "navy"],
["gray", "red", "purple", "black"]]
["gray", "red", "purple", "black"]]

},

Expand All @@ -85,7 +85,7 @@ dojo.declare("dijit.ColorPalette",
_paletteCoords: {
"leftOffset": 3, "topOffset": 3,
"cWidth": 20, "cHeight": 20

},

// templateString: String
Expand All @@ -107,25 +107,25 @@ dojo.declare("dijit.ColorPalette",
// A name has to be given to the colorMap, this needs to be unique per Palette.
dojo.mixin(this.divNode.style, this._paletteDims[this.palette]);
this.imageNode.setAttribute("src", this._imagePaths[this.palette].toString());
var choices = this._palettes[this.palette];
var choices = this._palettes[this.palette];
this.domNode.style.position = "relative";
this._cellNodes = [];
this._cellNodes = [];
this.colorNames = dojo.i18n.getLocalization("dojo", "colors", this.lang);
var url = this._blankGif,
colorObject = new dojo.Color(),
coords = this._paletteCoords;
colorObject = new dojo.Color(),
coords = this._paletteCoords;
for(var row=0; row < choices.length; row++){
var rowNode = dojo.create("div", {
role: "row"
});
dojo.place(rowNode, this.divNode);
for(var col=0; col < choices[row].length; col++) {
for(var col=0; col < choices[row].length; col++){

var color = choices[row][col],
colorValue = colorObject.setColor(dojo.Color.named[color])
var color = choices[row][col],
colorValue = colorObject.setColor(dojo.Color.named[color])
;

var cellNode = dojo.create("span", {
var cellNode = dojo.create("span", {
"class":"dijitPaletteCell",
tabIndex:"-1",
title: this.colorNames[color],
Expand All @@ -134,28 +134,28 @@ dojo.declare("dijit.ColorPalette",
left: coords.leftOffset + (col * coords.cWidth) + "px"
}
});

var imgNode = dojo.create("img",{
src: url,
src: url,
"class":"dijitPaletteImg",
alt: this.colorNames[color]
}, cellNode);

// FIXME: color is an attribute of img?
imgNode.color = colorValue.toHex();
var imgStyle = imgNode.style;
imgStyle.color = imgStyle.backgroundColor = imgNode.color;

dojo.forEach(["Dijitclick", "MouseEnter", "Focus"], function(handler) {
this.connect(cellNode, "on" + handler.toLowerCase(), "_onCell" + handler);
}, this);
dojo.forEach(["Dijitclick", "MouseEnter", "Focus"], function(handler){
this.connect(cellNode, "on" + handler.toLowerCase(), "_onCell" + handler);
}, this);

dojo.place(cellNode, rowNode);

dijit.setWaiRole(cellNode, "gridcell");
cellNode.index = this._cellNodes.length;
this._cellNodes.push(cellNode);
}
dijit.setWaiRole(cellNode, "gridcell");
cellNode.index = this._cellNodes.length;
this._cellNodes.push(cellNode);
}
}
this._xDim = choices[0].length;
this._yDim = choices.length;
Expand All @@ -165,11 +165,11 @@ dojo.declare("dijit.ColorPalette",
// The palette itself is navigated to with the tab key on the keyboard
// Keyboard navigation within the Palette is with the arrow keys
// Spacebar selects the color.
// For the up key the index is changed by negative the x dimension.
// For the up key the index is changed by negative the x dimension.

var keyIncrementMap = {
UP_ARROW: -this._xDim,
// The down key the index is increase by the x dimension.
// The down key the index is increase by the x dimension.
DOWN_ARROW: this._xDim,
// Right and left move the index by 1.
RIGHT_ARROW: 1,
Expand Down Expand Up @@ -256,7 +256,7 @@ dojo.declare("dijit.ColorPalette",
// private

var target = evt.currentTarget;
if (this._currentFocus != target.index){
if(this._currentFocus != target.index){
this._currentFocus = target.index;
window.setTimeout(function(){dijit.focus(target)}, 0);
}
Expand Down Expand Up @@ -300,7 +300,7 @@ dojo.declare("dijit.ColorPalette",
// protected
this._removeCellHighlight(this._currentFocus);
this._currentFocus = node.index;
dojo.addClass(node, "dijitPaletteCellHighlight");
dojo.addClass(node, "dijitPaletteCellHighlight");
},

_removeCellHighlight: function(index){
Expand All @@ -311,7 +311,7 @@ dojo.declare("dijit.ColorPalette",
dojo.removeClass(this._cellNodes[index], "dijitPaletteCellHighlight");
},

_selectColor: function(selectNode){
_selectColor: function(selectNode){
// summary:
// This selects a color. It triggers the onChange event
// area:
Expand Down
6 changes: 3 additions & 3 deletions Declaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dojo.declare(
regularConnects = dojo.query("> script[type^='dojo/connect']", src).orphan(),
srcType = src.nodeName;

var propList = this.defaults||{};
var propList = this.defaults || {};

// For all methods defined like <script type="dojo/method" event="foo">,
// add that method to prototype
Expand All @@ -54,7 +54,7 @@ dojo.declare(

propList.widgetsInTemplate = true;
propList._skipNodeCache = true;
propList.templateString = "<"+srcType+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint")||'')+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent")||'')+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+srcType+">";
propList.templateString = "<"+srcType+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint") || '')+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent") || '')+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+srcType+">";

// strip things so we don't create stuff under us in the initial setup phase
dojo.query("[dojoType]", src).forEach(function(node){
Expand All @@ -77,7 +77,7 @@ dojo.declare(
// in the _prototype_.
var connects = regularConnects.concat(postscriptConnects);
dojo.forEach(connects, function(s){
var evt = s.getAttribute("event")||"postscript",
var evt = s.getAttribute("event") || "postscript",
func = dojo.parser._functionFromScript(s);
dojo.connect(wc.prototype, evt, func);
});
Expand Down
Loading

0 comments on commit f5f7d81

Please sign in to comment.