[richfaces-svn-commits] JBoss Rich Faces SVN: r510 - trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Apr 24 10:42:15 EDT 2007


Author: abelevich
Date: 2007-04-24 10:42:15 -0400 (Tue, 24 Apr 2007)
New Revision: 510

Removed:
   trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/scripts/ClientUILib.js
Log:


Deleted: trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/scripts/ClientUILib.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/scripts/ClientUILib.js	2007-04-24 14:41:54 UTC (rev 509)
+++ trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/scripts/ClientUILib.js	2007-04-24 14:42:15 UTC (rev 510)
@@ -1,209 +0,0 @@
-// ClientUILib base.js v1.0.0, Fri Jan 19 19:16:36 CET 2007
-
-// TODO: Copyright (c) 2007, Denis Morozov (dmorozov at exadel.com)
-// ...
-
-var ClientUILib = {
-	Version: '1.0.0',
-	Name: 'ClientUILib',
-	LibraryPath: './',	
-	load: function(showLog) {
-	  // Check for Prototype JavaScript framework
-	  if((typeof Prototype=='undefined') || 
-	     (typeof Element == 'undefined') || 
-	     (typeof Element.Methods=='undefined') ||
-	     parseFloat(Prototype.Version.split(".")[0] + "." +
-	                Prototype.Version.split(".")[1]) < 1.5)
-	     throw("ClientUILib requires the Prototype JavaScript framework >= 1.5.0");
-	  	
-	  // Check for Extend JavaScript library
-	  if((typeof Extend=='undefined') ||
-	  	Extend.VERSION < 1.1)
-	     throw("ClientUILib requires the Extend JavaScript library >= 1.1");
-
-	  $A(document.getElementsByTagName("script")).findAll( function(s) {
-	    return (s.src && s.src.match(/ClientUILib\.js(\?.*)?$/))
-	  }).each( function(s) {
-	    LibraryPath = s.src.replace(/ClientUILib\.js(\?.*)?$/,'');
-	  });
-	  
-	  if(showLog) {
-		  ClientUILogger.create("ClientUILogger");
-		  this.startTime = (new Date()).getTime();
-	  }
-	  
-	  this.initBrowser();
-	},
- 	include: function(libraryPackageName) {
-		if(!this.packages)
-			this.packages=[];
-		if(!this.packages[libraryPackageName]) {
-			this.packages[libraryPackageName] = true;
-			var re = /\./g; // Replace all '.' in package name
-			var packagePath = LibraryPath + libraryPackageName.replace(re, "/");
-			document.write('<script type="text/javascript" src="' + packagePath + '.js"></script>');
-		}
-	},
-	include2: function(libraryPackageName) {
-		if(!this.packages)
-			this.packages=[];
-		if(!this.packages[libraryPackageName]) {
-			this.packages[libraryPackageName] = true;
-			var re = /\./g; // Replace all '.' in package name
-			var packagePath = LibraryPath + libraryPackageName.replace(re, "/");
-			//document.write('<script type="text/javascript" src="' + packagePath + '.js"></script>');
-			var e = document.createElement("script");
-		   	e.src = packagePath+".js";
-		   	e.type="text/javascript";
-		   	document.getElementsByTagName("head")[0].appendChild(e);		
-		}
-	},
-	requireClass: function(libName) {
-		// required class not included before
-		if(!this.packages[libName]) {
-			//this.include2(libName);
-			ClientUILib.log(ClientUILogger.ERROR, "Library '" + libName + "' required!!!");
-			throw("Package '" + libName + "' is required!");
-		}
-	},
-	declarePackage: function(libName) {
-		var pckg = null;
-		var packages = $A(libName.split("."));
-		packages.each( function(s) {
-			if(pckg == null)
-				pckg = eval(s);
-			else {
-				if(!pckg[s]) pckg[s] = {};
-				pckg = pckg[s];
-			}
-	  	});
-	  	
-	  	ClientUILib.log(ClientUILogger.INFO, "ClientUILib::declarePackage '" + libName + "'");
-	},
-	log: function(level, infoText) {
-		if(ClientUILogger.isCreated)
-			ClientUILogger.log(level, infoText);
-	},
-	initBrowser: function() {
-		var ua = navigator.userAgent.toLowerCase();
-		/** @type Boolean */
-		this.isOpera = (ua.indexOf('opera') > -1);
-	   	/** @type Boolean */
-		this.isSafari = (ua.indexOf('webkit') > -1);
-	   	/** @type Boolean */
-		this.isIE = (window.ActiveXObject);
-	   	/** @type Boolean */
-		this.isIE7 = (ua.indexOf('msie 7') > -1);
-	   	/** @type Boolean */
-		this.isGecko = !this.isSafari && (ua.indexOf('gecko') > -1);
-		
-		if(ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1){
-		    /** @type Boolean */
-		    this.isWindows = true;
-		}else if(ua.indexOf("macintosh") != -1){
-			/** @type Boolean */
-		    this.isMac = true;
-		}
-		if(this.isIE && !this.isIE7){
-	        try{
-	            document.execCommand("BackgroundImageCache", false, true);
-	        }catch(e){}
-	    }
-	}	
-};
-
-var ClientUILogger = {
-	// log level
-	INFO: 		1,
-	WARNING: 	2,
-	ERROR: 		3,
-	
-	// flag logger is initialized
-	isCreated: false,
-	width: 500,
-	height: 150,
-	create: function() {
-		this.logElement = $(document.createElement("div"));
-		this.logElement.setStyle({position: 'absolute'});
-		this.logElement.setStyle({overflow: 'auto'});
-		this.logElement.setStyle({whiteSpace: 'nowrap'});
-		
-		Event.observe(window, 'load', ClientUILogger.init);
-		Event.observe(window, 'resize', ClientUILogger.resizeWindow);
-		this.isCreated = true;
-	},
-	init: function() {
-		if(ClientUILogger.logElement)
-			document.body.appendChild(ClientUILogger.logElement);
-		ClientUILogger.show();
-	},
-	resizeWindow: function() {
-		ClientUILogger.show();
-	},
-	show: function() {
-		if(this.logElement) {
-			Element.show(this.logElement);
-			this.logElement.setStyle({width: this.width + 'px'});
-			this.logElement.setStyle({height: this.height + 'px'});
-			this.logElement.setStyle({top: (this.getWindowHeight() - this.height - 10) + 'px'});
-			this.logElement.setStyle({left: (this.getWindowWidth() - this.width - 10) + 'px'});
-		}
-	},
-	log: function(level, infoText) {
-		var msg = $(document.createElement("div"));
-		this.logElement.appendChild(msg);
-		msg.setStyle({width: '100%'});
-		
-		var font = "bold normal bold 10pt Arial";
-		var fontColor = "red";
-		
-		switch(level) {
-			case ClientUILogger.INFO: 
-				fontColor = "black";
-				font = "normal normal normal 10pt Arial";
-				break;
-			case ClientUILogger.WARNING: 
-				fontColor = "blue";
-				font = "italic normal normal 10pt Arial";
-				break;
-			case ClientUILogger.ERROR: 
-				fontColor = "red";
-				font = "normal normal bold 10pt Arial";
-				break;
-			default:
-				infoText = "UNRESOLVED: level=" + level + ", msg=" + infoText;
-		}
-		msg.setStyle({font: font});
-		msg.setStyle({color: fontColor});
-		msg.appendChild(document.createTextNode("> " + infoText));
-		
-		this.logElement.scrollTop = this.logElement.scrollHeight;
-	},
-	getWindowWidth: function(){
-	    var innerWidth;
-		  if (navigator.appVersion.indexOf('MSIE')>0) {
-			  innerWidth = document.body.clientWidth;
-	    } else {
-			  innerWidth = window.innerWidth;
-	    }
-	    return innerWidth;	
-	},
-	getWindowHeight: function(){
-	    var innerHeight;
-		  if (navigator.appVersion.indexOf('MSIE')>0) {
-			  innerHeight = document.body.clientHeight;
-	    } else {
-			  innerHeight = window.innerHeight;
-	    }
-	    return innerHeight;	
-	}	
-};
-
-ClientUILib.load(true);
-
-// declare predefined packages
-var ClientUI = {
-	controls: {},
-	layouts: {}
-};
-




More information about the richfaces-svn-commits mailing list