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:49 UTC

svn commit: r1587156 - in /myfaces/tobago/branches/tobago-3.0.x/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:50:49 2014
New Revision: 1587156

URL: http://svn.apache.org/r1587156
Log:
- logging
- event handling

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-3.0.x/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/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1587156&r1=1587155&r2=1587156&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Mon Apr 14 07:50:49 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);
@@ -230,7 +230,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;
@@ -487,7 +486,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) {
@@ -506,7 +505,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/branches/tobago-3.0.x/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/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1587156&r1=1587155&r2=1587156&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Apr 14 07:50:49 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,13 +996,15 @@ 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 doen't support multiple backgrounds, so we use only the first.
+      if (Tobago.browser.isMsie678) { // IE before 9 doesn't support multiple backgrounds, so we use only the first.
         Tobago.fixMultiBackgroundIE8(element);
       }
       element.css(element.data("tobago-style"));
     });
+    console.timeEnd("[tobago] initCss"); // @DEV_ONLY
 */
   },
 
@@ -1396,7 +1400,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;
     }
   },