[Jifty-commit] jifty-plugin-codepress branch, master, updated. b63f4c558a389973d31e5be4fa9c65db1237c6da

Jifty commits jifty-commit at lists.jifty.org
Fri Jan 15 14:34:27 EST 2010


The branch, master has been updated
       via  b63f4c558a389973d31e5be4fa9c65db1237c6da (commit)
      from  7dfc60d5be6b96b7ce085db1b32d6460bfe157a8 (commit)

Summary of changes:
 share/web/static/js/codepress.js |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit b63f4c558a389973d31e5be4fa9c65db1237c6da
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jan 15 14:34:23 2010 -0500

    Move to jQuery event handling from JSAN

diff --git a/share/web/static/js/codepress.js b/share/web/static/js/codepress.js
index c714b33..eed23ad 100644
--- a/share/web/static/js/codepress.js
+++ b/share/web/static/js/codepress.js
@@ -48,12 +48,12 @@ CodePress = function(obj) {
 			alert("can't find frame");
 		}
 
-		DOM.Events.addListener( iframe, 'blur', function () {
+		jQuery( iframe ).blur(function () {
 			self.textarea.value = self.getCode();
 			self.textarea.disabled = false;
 			return self;
 		});
-		DOM.Events.addListener( iframe, 'focus', function () {
+		jQuery( iframe ).focus(function () {
 			self.textarea.disabled = true;
 			return self;
 		});
@@ -67,7 +67,7 @@ CodePress = function(obj) {
 		self.src = '/static/codepress/codepress.html?language='+self.language+'&ts='+(new Date).getTime();
 		//if(self.attachEvent) self.attachEvent('onload',self.initialize);
 		//else self.addEventListener('load',self.initialize,false);
-		DOM.Events.addListener(self, 'load', self.initialize);
+		jQuery(self).load(self.initialize);
 	}
 
 	self.getLanguage = function() {
@@ -164,8 +164,4 @@ CodePress.beforeSubmit = function() {
 	}
 }
 
-//if(window.attachEvent) window.attachEvent('onload',CodePress.run);
-//else window.addEventListener('DOMContentLoaded',CodePress.run,false);
-//DOM.Events.addListener(window, "load", CodePress.run);
-// Jifty-specific onLoad hook
-onLoadHook( 'CodePress.run();' );
+jQuery(document).ready(function(){ CodePress.run() });

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list