Skip to content

Commit

Permalink
catching up with javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
WardCunningham committed Nov 27, 2012
1 parent a0e9cc8 commit 3880135
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,9 @@ require.define("/lib/refresh.coffee",function(require,module,exports,__dirname,_

initAddButton = function(pageElement) {
return pageElement.find(".add-factory").live("click", function(evt) {
if (pageElement.hasClass('ghost')) {
return;
}
evt.preventDefault();
return createFactory(pageElement);
});
Expand Down
12 changes: 6 additions & 6 deletions client/plugins/efficiency/efficiency.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions client/test/testclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,9 @@ require.define("/lib/refresh.coffee",function(require,module,exports,__dirname,_

initAddButton = function(pageElement) {
return pageElement.find(".add-factory").live("click", function(evt) {
if (pageElement.hasClass('ghost')) {
return;
}
evt.preventDefault();
return createFactory(pageElement);
});
Expand Down Expand Up @@ -2512,16 +2515,16 @@ require.define("/plugins/efficiency/efficiency.js",function(require,module,expor
return div.find('p:first').text("" + (value.toFixed(1)) + "%");
};
getImageData = function(div) {
var can, ctx, h, imageData, img, w;
var c, d, h, imageData, img, w;
img = new Image;
img.src = $(div).data('item').url;
w = img.width;
h = img.height;
can = $('<canvas id="myCanvas" width="#{w}" height="#{h}">');
ctx = can.get(0).getContext("2d");
ctx.drawImage(img, 0, 0);
wiki.log('efficiency img w, h', w, h, 'c w, h ', can.width(), can.height());
imageData = ctx.getImageData(0, 0, w, h);
c = $('<canvas id="myCanvas" width="#{w}" height="#{h}">');
d = c.get(0).getContext("2d");
d.drawImage(img, 0, 0);
wiki.log('efficiency img w, h', w, h, 'c w, h ', c.width(), c.height());
imageData = d.getImageData(0, 0, w, h);
return imageData.data;
};
calculatePercentage = function(data) {
Expand Down

0 comments on commit 3880135

Please sign in to comment.