Permalink
Browse files

fixed cc.ControlEditBox

  • Loading branch information...
1 parent 81a29bd commit 4f8e2309263549b0c6503bc37235ffec9216f958 @dingpinglv dingpinglv committed Dec 17, 2012
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -52,7 +52,7 @@ cc.DOM.methods = /** @lends cc.DOM# */{
* @param {Number} y
*/
setPosition:function (x, y) {
- if (arguments.length==2) {
+ if (arguments.length == 2) {
this._position.x = x;
this._position.y = y;
//this._position = cc.p(newPosOrxValue,yValue);
@@ -118,7 +118,7 @@ cc.DOM.methods = /** @lends cc.DOM# */{
* replace set anchorpoint of ccNode
* @param {object} point
*/
- setAnchorpoint:function (point) {
+ setAnchorPoint:function (point) {
this._anchorPoint = point;
this._anchorPointInPoints = cc.p(this._contentSize.width * this._anchorPoint.x,
this._contentSize.height * this._anchorPoint.y);
@@ -251,21 +251,19 @@ cc.DOM.methods = /** @lends cc.DOM# */{
cleanup:function () {
// actions
this.stopAllActions();
- this.unscheduleAllSelectors();
+ this.unscheduleAllCallbacks();
// timers
this._arrayMakeObjectsPerformSelector(this._children, cc.Node.StateCallbackType.cleanup);
if (this.dom) {
this.dom.remove();
- //this.dom=null;
}
},
/**
* replace remove from parent and clean up of ccNode
*/
removeFromParentAndCleanup:function () {
this.dom.remove();
- //this.dom=null;
},
setOpacity:function (o) {
this._opacity = o;
@@ -313,12 +311,7 @@ cc.DOM.parentDOM = function (x) {
p.dom.appendTo(cc.container);
}
}
- //x.dom.appendTo(cc.container);
- /* var pp;
- if(pp = p.getParent())
- {
- p.parentDiv = p.parentDiv || this.parentDiv;
- }*/
+ return true;
};
/**
@@ -582,7 +575,11 @@ cc.DOM.convert = function () {
//add hover event to popup inspector
if (!cc.DOM.tooltip) {
var style = cc.$new('style');
- style.textContent = ".CCDOMEdit:hover{border: rgba(255,0,0,0.5) 2px dashed;left: -2px;} .CCDOMEdit #CCCloseButton{width:80px;height:15px;background: rgba(0,0,0,0.4);border:1px solid #aaaaaa;font-size: 9px;line-height:9px;color:#bbbbbb;} .CCTipWindow .CCTipMove{cursor:move;} .CCTipWindow .CCTipRotate{cursor:w-resize;} .CCTipWindow .CCTipScale{cursor:ne-resize;} .CCTipWindow .CCTipSkew{cursor:se-resize;} .CCTipWindow input{width:40px;background: rgba(0,0,0,0.5);color:white;border:none;border-bottom: 1px solid #fff;} div.CCTipWindow:hover{color:rgb(50,50,255);}";
+ style.textContent = ".CCDOMEdit:hover{border: rgba(255,0,0,0.5) 2px dashed;left: -2px;} .CCDOMEdit "
+ + " #CCCloseButton{width:80px;height:15px;background: rgba(0,0,0,0.4);border:1px solid #aaaaaa;font-size: 9px;line-height:9px;color:#bbbbbb;} "
+ + " .CCTipWindow .CCTipMove{cursor:move;} .CCTipWindow .CCTipRotate{cursor:w-resize;} .CCTipWindow .CCTipScale{cursor:ne-resize;} "
+ + ".CCTipWindow .CCTipSkew{cursor:se-resize;} .CCTipWindow input{width:40px;background: rgba(0,0,0,0.5);color:white;border:none;border-bottom: 1px solid #fff;} "
+ + "div.CCTipWindow:hover{color:rgb(50,50,255);}";
document.body.appendChild(style);
cc.container.style.overflow = "visible";
var tip = cc.DOM.tooltip = cc.$new('div');
@@ -728,6 +725,11 @@ cc.DOM.convert = function () {
args[i].dom.ccnode = args[i];
var that = args[i];
args[i].dom.addEventListener('mouseover', function () {
+ this.style.zIndex = 999999;
+
+ if(this.showTooltipDiv !== undefined && this.showTooltipDiv === false)
+ return;
+
if (!cc.DOM.tooltip.mouseDown) {
var pos = cc.$.findpos(this);
cc.DOM.tooltip.style.display = 'block';
@@ -742,6 +744,4 @@ cc.DOM.convert = function () {
});
}
}
-
-
};
@@ -425,14 +425,12 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
},
_updateTTF:function () {
- cc.renderContext.save();
-
+ var oldFontStr = cc.renderContext.font;
this._fontStyleStr = this._fontSize + "px '" + this._fontName + "'";
cc.renderContext.font = this._fontStyleStr;
var dim = cc.renderContext.measureText(this._string);
this.setContentSize(cc.size(dim.width, this._fontSize));
-
- cc.renderContext.restore();
+ cc.renderContext.font = oldFontStr;
this.setNodeDirty();
}
});
@@ -336,7 +336,7 @@ cc.Menu = cc.Layer.extend(/** @lends cc.Menu# */{
for (var i = 0; i < this._children.length; i++) {
var child = this._children[i];
// check if too many menu items for the amount of rows/columns
- cc.Assert(column < columns.size(), "");
+ cc.Assert(column < columns.length, "");
columnRows = columns[column];
// can't have zero rows on a column
View
@@ -80,3 +80,38 @@ cc.Codec.Base64.decodeAsArray = function Jacob__Codec__Base64___decodeAsArray(in
return ar;
};
+
+cc.Codec.Base64.encode = function Jacob__Codec__Base64__encode(input) {
+ input = encodeURIComponent(input);
+ var output = "";
+ var chr1, chr2, chr3 = "";
+ var enc1, enc2, enc3, enc4 = "";
+ var i = 0;
+
+ do {
+ chr1 = input.charCodeAt(i++);
+ chr2 = input.charCodeAt(i++);
+ chr3 = input.charCodeAt(i++);
+
+ enc1 = chr1 >> 2;
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+ enc4 = chr3 & 63;
+
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
+
+ output = output +
+ this._keyStr.charAt(enc1) +
+ this._keyStr.charAt(enc2) +
+ this._keyStr.charAt(enc3) +
+ this._keyStr.charAt(enc4);
+ chr1 = chr2 = chr3 = "";
+ enc1 = enc2 = enc3 = enc4 = "";
+ } while (i < input.length);
+
+ return output;
+};
Oops, something went wrong.

0 comments on commit 4f8e230

Please sign in to comment.