[Jifty-commit] r5064 - in jifty/branches/jquery: share/plugins/Jifty/Plugin/I18N/web/static/js share/web/static/js t/TestApp-JiftyJS/t

Jifty commits jifty-commit at lists.jifty.org
Thu Feb 7 08:11:09 EST 2008


Author: gugod
Date: Thu Feb  7 08:11:08 2008
New Revision: 5064

Modified:
   jifty/branches/jquery/share/plugins/Jifty/Plugin/I18N/web/static/js/loc.js
   jifty/branches/jquery/share/web/static/js/halo.js
   jifty/branches/jquery/t/TestApp-JiftyJS/etc/config.yml
   jifty/branches/jquery/t/TestApp-JiftyJS/t/00-action-Play2.t

Log:
Prototypeism removal in loc.js and the updated halo.js Add I18N
into the plugin list in config.yml TestApp-JiftyJS so loc.js is
included.


Modified: jifty/branches/jquery/share/plugins/Jifty/Plugin/I18N/web/static/js/loc.js
==============================================================================
--- jifty/branches/jquery/share/plugins/Jifty/Plugin/I18N/web/static/js/loc.js	(original)
+++ jifty/branches/jquery/share/plugins/Jifty/Plugin/I18N/web/static/js/loc.js	Thu Feb  7 08:11:08 2008
@@ -1,4 +1,4 @@
-Localization = Object.extend(new Object(), {
+Localization = jQuery.extend(new Object(), {
     init: function(params) {
         this.lang = params.lang || 'en';
         if (params["dict_path"]) {
@@ -62,4 +62,7 @@
 });
 
 Localization.dict = {};
-_ = Localization.loc.bind(Localization);
+_ = function() {
+    Localization.loc.apply(Localization, arguments);
+}
+

Modified: jifty/branches/jquery/share/web/static/js/halo.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/halo.js	(original)
+++ jifty/branches/jquery/share/web/static/js/halo.js	Thu Feb  7 08:11:08 2008
@@ -77,21 +77,20 @@
         halo_padding        = '3px';
     }
 
-    $("render_info-draw_halos").innerHTML = halos_drawn ? "Hide halos" : "Draw halos";
-
-    YAHOO.util.Dom.getElementsByClassName("halo-header", null, null,
-        function (e) {
-            e.style.display = halo_header_display;
-        }
+    jQuery("#render_info-draw_halos").html(
+        halos_drawn ? "Hide halos" : "Draw halos"
     );
 
-    YAHOO.util.Dom.getElementsByClassName("halo", null, null,
-        function (e) {
-            e.style.borderWidth = halo_border_width;
-            e.style.margin = halo_margin;
-            e.style.padding = halo_padding;
-        }
-    );
+    jQuery(".halo-header").css({
+        display: halo_header_display
+    });
+
+    jQuery(".halo").css({
+        'border-width': halo_border_width,
+        'margin': halo_margin,
+        'padding': halo_padding
+    })
+
 }
 
 function render_info_tree() {
@@ -100,9 +99,10 @@
 
 function halo_render(id, name) {
     halo_reset(id);
-    $('halo-button-'+name+'-'+id).style.fontWeight = 'bold';
 
-    var e = $('halo-rendered-'+id);
+    jQuery('#halo-button-'+name+'-'+id).css("font-weight", "bold");
+
+    var e = jQuery('halo-rendered-'+id).get(0);
 
     if (name == 'source') {
         e.halo_rendered = e.innerHTML;
@@ -113,8 +113,8 @@
     }
     else {
         e.style.display = 'none';
-        $('halo-info-'+id).style.display = 'block';
-        $('halo-info-'+name+'-'+id).style.display = 'block';
+        jQuery("#halo-info-"+id).show();
+        jQuery('#halo-info-'+name+'-'+id).show();
     }
 }
 
@@ -129,7 +129,8 @@
     }
 
     /* hide all the info divs */
-    $('halo-info-'+id).style.display = 'none';
+    jQuery('#halo-info-'+id).hide();
+
     for (var child = $('halo-info-'+id).firstChild;
          child != null;
          child = child.nextSibling) {
@@ -139,7 +140,7 @@
     }
 
     /* restore the rendered div */
-    var e = $('halo-rendered-'+id);
+    var e = jQuery('#halo-rendered-'+id).get(0);
     e.style.display = 'block';
     if (e.halo_rendered) {
         e.innerHTML = e.halo_rendered;
@@ -148,7 +149,7 @@
 }
 
 function remove_link(id, name) {
-    var link = $('halo-button-'+name+'-'+id);
+    var link = jQuery('#halo-button-'+name+'-'+id).get(0);
     var newlink = document.createElement("span");
     newlink.appendChild(link.childNodes[0]);
     link.parentNode.replaceChild(newlink, link);

Modified: jifty/branches/jquery/t/TestApp-JiftyJS/etc/config.yml
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/etc/config.yml	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/etc/config.yml	Thu Feb  7 08:11:08 2008
@@ -17,11 +17,16 @@
   DevelMode: 1
   L10N: 
     PoDir: share/po
+    AllowedLang:
+      - en
+      - zh_tw
   LogLevel: INFO
   Mailer: Sendmail
   MailerArgs: []
 
   Plugins: 
+    - I18N: { js: 1 }
+
     - 
       LetMe: {}
 

Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/00-action-Play2.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/t/00-action-Play2.t	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/00-action-Play2.t	Thu Feb  7 08:11:08 2008
@@ -8,6 +8,8 @@
 
 =cut
 
+use lib 't/lib';
+use Jifty::SubTest;
 use Jifty::Test tests => 1;
 
 # Make sure we can load the action


More information about the Jifty-commit mailing list