You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/04/14 09:50:00 UTC
svn commit: r1587155 - in
/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script:
tobago-sheet.js tobago.js
Author: lofwyr
Date: Mon Apr 14 07:49:59 2014
New Revision: 1587155
URL: http://svn.apache.org/r1587155
Log:
- logging
- event handling
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1587155&r1=1587154&r2=1587155&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Mon Apr 14 07:49:59 2014
@@ -29,7 +29,8 @@ Tobago.Sheets = {
Tobago.Sheet = function(sheetId, unused1, unused2, unused3, unused4,
clickActionId, clickReloadComponentId, dblClickActionId, dblClickReloadComponentId, renderedPartially) {
- this.startTime = new Date(); // @DEV_ONLY
+ console.debug("New Sheet with id " + sheetId); // @DEV_ONLY
+ console.time("[tobago-sheet] constructor"); // @DEV_ONLY
this.id = sheetId;
Tobago.Sheets.put(this);
this.clickActionId = clickActionId;
@@ -52,13 +53,11 @@ Tobago.Sheet = function(sheetId, unused1
this.setup();
- console.debug("New Sheet with id " + this.id); // @DEV_ONLY
- this.endTime = new Date(); // @DEV_ONLY
- console.debug("Sheet-setup time = " + (this.setupEnd.getTime() - this.setupStart.getTime())); // @DEV_ONLY
- console.debug("Sheet-total time = " + (this.endTime.getTime() - this.startTime.getTime())); // @DEV_ONLY
+ console.timeEnd("[tobago-sheet] constructor"); // @DEV_ONLY
};
Tobago.Sheet.init = function(elements) {
+ console.time("[tobago-sheet] init"); // @DEV_ONLY
var sheets = Tobago.Utils.selectWidthJQuery(elements, ".tobago-sheet");
sheets.each(function initSheets() {
var sheet = jQuery(this);
@@ -94,6 +93,7 @@ Tobago.Sheet.init = function(elements) {
Tobago.Sheet.toggleAll(sheet);
});
+ console.timeEnd("[tobago-sheet] init"); // @DEV_ONLY
};
Tobago.registerListener(Tobago.Sheet.init, Tobago.Phase.DOCUMENT_READY);
@@ -261,7 +261,6 @@ Tobago.Sheet.prototype.doKeyEvent = func
if (keyCode == 13) {
if (input.value != input.nextSibling.innerHTML) {
Tobago.stopEventPropagation(event);
- event.returnValue = false;
this.reloadWithAction(event.srcElement, input.actionId);
} else {
this.textInput = input;
@@ -460,7 +459,7 @@ Tobago.Sheet.hidden = function(sheet, id
};
Tobago.Sheet.prototype.setup = function() {
- this.setupStart = new Date(); // @DEV_ONLY
+ console.time("[tobago-sheet] setup"); // @DEV_ONLY
// IE 6+7
if (Tobago.browser.isMsie67) {
@@ -480,7 +479,7 @@ Tobago.Sheet.prototype.setup = function(
this.setupRowPaging();
this.initReload();
- this.setupEnd = new Date(); // @DEV_ONLY
+ console.timeEnd("[tobago-sheet] setup"); // @DEV_ONLY
};
Tobago.Sheet.prototype.initReload = function() {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1587155&r1=1587154&r2=1587155&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Apr 14 07:49:59 2014
@@ -285,7 +285,9 @@ var Tobago = {
for (var order = 0; order < Tobago.listeners.documentReady.length; order++) {
var list = Tobago.listeners.documentReady[order];
for (var i = 0; i < list.length; i++) {
+ console.time("[tobago] init " + order + " " + i); // @DEV_ONLY
list[i]();
+ console.timeEnd("[tobago] init " + order + " " + i); // @DEV_ONLY
}
}
@@ -994,6 +996,7 @@ var Tobago = {
initCss: function(elements) {
// element styles
+ console.time("[tobago] initCss"); // @DEV_ONLY
Tobago.Utils.selectWidthJQuery(elements, "[data-tobago-style]").each(function () {
var element = jQuery(this);
if (Tobago.browser.isMsie678) { // IE before 9 doesn't support multiple backgrounds, so we use only the first.
@@ -1001,6 +1004,7 @@ var Tobago = {
}
element.css(element.data("tobago-style"));
});
+ console.timeEnd("[tobago] initCss"); // @DEV_ONLY
},
/* supports only two background images in the moment */
@@ -1412,7 +1416,11 @@ var Tobago = {
event.cancelBubble = true; // this is IE, no matter if not supported by actual browser
if (event.stopPropagation) {
event.stopPropagation(); // this is DOM2
+ }
+ if (event.preventDefault) {
event.preventDefault();
+ } else {
+ event.returnValue = false;
}
},