Changeset 1553 for branches/3.0
- Timestamp:
- 12/03/2006 05:29:46 PM (2 years ago)
- Location:
- branches/3.0
- Files:
-
- 6 modified
-
HISTORY (modified) (2 diffs)
-
UPGRADE (modified) (1 diff)
-
framework/Web/Javascripts/extra/logger.js (modified) (3 diffs)
-
framework/Web/Javascripts/js/compressed/logger.js (modified) (3 diffs)
-
framework/Web/Javascripts/js/debug/logger.js (modified) (3 diffs)
-
framework/Web/UI/WebControls/TJavascriptLogger.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/HISTORY
r1552 r1553 1 1 Version 3.0.6 December 4, 2006 2 2 ============================== 3 BUG: Ticket#400 - TJavascriptLogger incompatible with Firefox 2.0 RC1 (Wei) 3 4 BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) 4 5 BUG: Ticket#443 - Template comment tag messed up with HTML comment tag (Qiang) … … 8 9 BUG: global state was not saved when redirect() is invoked (Qiang) 9 10 BUG: TPager would not display if it was invisible previously (Qiang) 11 BUG: Ticket#476 - Problem when adding a new text (translate) with MessageSource_XLIFF (Wei) 10 12 ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 11 13 ENH: Ticket#451 - Modified TUrlMapping to extend from TUrlManager (Qiang) 12 14 ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) 13 15 ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) 16 ENH: Add ToggleKey for TJavascriptLogger (Wei) 14 17 CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) 15 18 CHG: Ticket#454 - Redundant PHP Version Check (Qiang) -
branches/3.0/UPGRADE
r1542 r1553 23 23 - If TUrlMapping is used, you need to set the UrlManager property of 24 24 THttpRequest to the module ID of TUrlMapping. 25 - TJavascriptLogger toggle key is changed from ALT-D to ALT-J. 26 Use the ToggleKey property chanage to a different key. 25 27 26 28 Upgrading from v3.0.4 -
branches/3.0/framework/Web/Javascripts/extra/logger.js
r1457 r1553 201 201 // ------- 202 202 203 initialize : function( ) {203 initialize : function(toggleKey) { 204 204 this.outputCount = 0 205 205 this.tagPattern = Cookie.get('tagPattern') || ".*" … … 284 284 this.logElement.style.bottom="0px"; 285 285 } 286 var self=this; 287 Event.observe(document, 'keydown', function(e) 288 { 289 if((e.altKey==true) && Event.keyCode(e) == toggleKey ) //Alt+J | Ctrl+J 290 self.toggle(); 291 }); 286 292 287 293 // Listen to the logger.... … … 452 458 } 453 459 } 454 455 // Load the Console when the window loads456 var logConsole;457 Event.OnLoad(function() { logConsole = new LogConsole()});458 459 460 460 461 461 -
branches/3.0/framework/Web/Javascripts/js/compressed/logger.js
r1457 r1553 41 41 this.tag=tag}} 42 42 LogConsole=Class.create() 43 LogConsole.prototype={commandHistory:[],commandIndex:0,hidden:true,initialize:function( ){this.outputCount=043 LogConsole.prototype={commandHistory:[],commandIndex:0,hidden:true,initialize:function(toggleKey){this.outputCount=0 44 44 this.tagPattern=Cookie.get('tagPattern')||".*" 45 45 this.logElement=document.createElement('div') … … 98 98 else 99 99 {this.logElement.style.position="fixed";this.logElement.style.bottom="0px";} 100 Logger.onupdate.addListener(this.logUpdate.bind(this)) 100 var self=this;Event.observe(document,'keydown',function(e) 101 {if((e.altKey==true)&&Event.keyCode(e)==toggleKey) 102 self.toggle();});Logger.onupdate.addListener(this.logUpdate.bind(this)) 101 103 Logger.onclear.addListener(this.clear.bind(this)) 102 104 for(var i=0;i<Logger.logEntries.length;i++){this.logUpdate(Logger.logEntries[i])} … … 153 155 this.inputElement.value=this.commandHistory[this.commandIndex]} 154 156 else{this.commandIndex=0}}} 155 var logConsole;Event.OnLoad(function(){logConsole=new LogConsole()});function inspect(o)157 function inspect(o) 156 158 {var objtype=typeof(o);if(objtype=="undefined"){return"undefined";}else if(objtype=="number"||objtype=="boolean"){return o+"";}else if(o===null){return"null";} 157 159 try{var ostring=(o+"");}catch(e){return"["+typeof(o)+"]";} -
branches/3.0/framework/Web/Javascripts/js/debug/logger.js
r1457 r1553 201 201 // ------- 202 202 203 initialize : function( ) {203 initialize : function(toggleKey) { 204 204 this.outputCount = 0 205 205 this.tagPattern = Cookie.get('tagPattern') || ".*" … … 284 284 this.logElement.style.bottom="0px"; 285 285 } 286 var self=this; 287 Event.observe(document, 'keydown', function(e) 288 { 289 if((e.altKey==true) && Event.keyCode(e) == toggleKey ) //Alt+J | Ctrl+J 290 self.toggle(); 291 }); 286 292 287 293 // Listen to the logger.... … … 452 458 } 453 459 } 454 455 // Load the Console when the window loads456 var logConsole;457 Event.OnLoad(function() { logConsole = new LogConsole()});458 459 460 460 461 461 -
branches/3.0/framework/Web/UI/WebControls/TJavascriptLogger.php
r1457 r1553 33 33 class TJavascriptLogger extends TWebControl 34 34 { 35 private static $_keyCodes = array( 36 '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57, 37 'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72, 38 'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80, 39 'q'=>81, 'r'=>82, 's'=>83, 't'=>84, 'u'=>85, 'v'=>86, 'w'=>87, 'x'=>88, 'y'=>89, 'z'=>90); 40 35 41 /** 36 42 * @return string tag name of the panel … … 42 48 43 49 /** 50 * @param string keyboard key for toggling the console, default is J. 51 */ 52 public function setToggleKey($value) 53 { 54 $this->setViewState('ToggleKey', $value, 'j'); 55 } 56 57 /** 58 * @return string keyboard key for toggling the console. 59 */ 60 public function getToggleKey() 61 { 62 return $this->getViewState('ToggleKey', 'j'); 63 } 64 65 /** 44 66 * Registers the required logger javascript. 45 67 * @param TEventParameter event parameter … … 47 69 public function onPreRender($param) 48 70 { 49 $this->getPage()->getClientScript()->registerPradoScript('logger'); 71 $key = strtolower($this->getToggleKey()); 72 $code = isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74; 73 $js = "var logConsole; Event.OnLoad(function() { logConsole = new LogConsole($code)}); "; 74 $cs = $this->getPage()->getClientScript(); 75 $cs->registerBeginScript($this->getClientID(),$js); 76 $cs->registerPradoScript('logger'); 50 77 } 51 78 … … 57 84 public function renderContents($writer) 58 85 { 86 $code = strtoupper($this->getToggleKey()); 59 87 $info = '(<a href="http://gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; 60 88 $link = '<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; 61 $usage = 'Press ALT- D (Or CTRL-Don OS X) to';89 $usage = 'Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; 62 90 $writer->write("{$usage} {$link} {$info}"); 63 91 }
