[Jifty-commit] r794 - in jifty/trunk: lib/Jifty lib/Jifty/View/Mason share/web/static/js t/Mapper/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Apr 2 06:48:24 EDT 2006


Author: autrijus
Date: Sun Apr  2 06:47:58 2006
New Revision: 794

Modified:
   jifty/trunk/doc/talks/takahashi.css
   jifty/trunk/doc/talks/takahashi.js
   jifty/trunk/doc/talks/yapc.asia.2006.xul
   jifty/trunk/lib/Jifty/Handler.pm
   jifty/trunk/lib/Jifty/I18N.pm
   jifty/trunk/lib/Jifty/Record.pm
   jifty/trunk/lib/Jifty/Request.pm
   jifty/trunk/lib/Jifty/View/Mason/Handler.pm
   jifty/trunk/share/web/static/js/rico.js
   jifty/trunk/t/Mapper/t/01-raw-api.t

Log:
* 01-raw-api.t in Mapper needs to be a bit more liberal in accepting Syck lists

Modified: jifty/trunk/doc/talks/takahashi.css
==============================================================================
--- jifty/trunk/doc/talks/takahashi.css	(original)
+++ jifty/trunk/doc/talks/takahashi.css	Sun Apr  2 06:47:58 2006
@@ -173,8 +173,9 @@
     text-align: center;
     font-size: 40px;
     background: black;
-    bottom: 10;
+    height: auto;
     padding-bottom: 10px;
     padding-top: 10px;
+    margin: 0px;
     spacing: 10px;
 }

Modified: jifty/trunk/doc/talks/takahashi.js
==============================================================================
--- jifty/trunk/doc/talks/takahashi.js	(original)
+++ jifty/trunk/doc/talks/takahashi.js	Sun Apr  2 06:47:58 2006
@@ -9,9 +9,6 @@
         this.deck     = document.getElementById('deck');
         this.scroller = document.getElementById('scroller');
 
-               this.canvas.appendChild(document.createElement('description'));
-               this.canvas.lastChild.setAttribute('id', "caption");
-               this.canvas.lastChild.setAttribute('class', 'subtitle');
         this.toolbar         = document.getElementById('canvasToolbar');
         this.toolbarHeight   = this.toolbar.boxObject.height;
         this.isToolbarHidden = true;
@@ -75,6 +72,8 @@
 
 
         var labelId = 0;
+        var subtitle = '';
+        var subtitle2 = '';
 
         for (var i = 0; i < text.length; i++)
         {
@@ -85,10 +84,14 @@
             line = text[i];
             image_width  = 0;
             image_height = 0;
-            var subtitle = '';
 
             if (line.match(/^~/)) {
-              subtitle = line.substring(1);
+              if (subtitle) {
+               subtitle2 = line.substring(1);
+              }
+              else {
+               subtitle = line.substring(1);
+              }
               line = '';
             }
 
@@ -157,6 +160,7 @@
 
         this.content.setAttribute('style', 'font-size:10px;');
           caption =  document.getElementById('caption');
+          caption2 =  document.getElementById('caption2');
         if (subtitle) {
                caption.setAttribute('value', subtitle);
         } else {
@@ -164,6 +168,13 @@
 
         }
 
+        if (subtitle2) {
+               caption2.setAttribute('value', subtitle2);
+        } else {
+               caption2.setAttribute('value', '');
+
+        }
+
         if (this.content.boxObject.width) {
             var canvas_w  = this.canvas.boxObject.width;
             var canvas_h  = this.canvas.boxObject.height-image_total_height;

Modified: jifty/trunk/doc/talks/yapc.asia.2006.xul
==============================================================================
--- jifty/trunk/doc/talks/yapc.asia.2006.xul	(original)
+++ jifty/trunk/doc/talks/yapc.asia.2006.xul	Sun Apr  2 06:47:58 2006
@@ -14,7 +14,8 @@
 ----
 Nifty Apps
 in a Jiffy
-~ あっという間にJifty
+~ 〄 Ĵïƒƫȳ 〄
+~ あっという間にMøøse
 ----
 How we're building useful applications
 in Perl 5 with a single unified framework, 
@@ -1035,6 +1036,8 @@
 </toolbar>
 </toolbox>
 <vbox flex="1" id="canvas" onclick="Presentation.onPresentationClick(event);">
+<description id="caption" class="subtitle" />
+<description id="caption2" class="subtitle" />
 <spacer flex="1"/>
 <hbox flex="1">
 <spacer flex="1"/>

Modified: jifty/trunk/lib/Jifty/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/Handler.pm	Sun Apr  2 06:47:58 2006
@@ -90,8 +90,17 @@
     my %config = (
         static_source => 1,
         use_object_files => 1,
+        preprocess => sub {
+            # Force UTF-8 semantics on all our components by
+            # prepending this block to all components as Mason
+            # components defaults to parse the text as Latin-1
+            ${$_[0]} =~ s{}{<%INIT>use utf8;</%INIT>\n};
+        },
         data_dir =>  Jifty::Util->absolute_path( Jifty->config->framework('Web')->{'DataDir'} ),
-        allow_globals => [qw[$JiftyWeb], @{Jifty->config->framework('Web')->{'Globals'} || []}],
+        allow_globals => [
+            qw[ $JiftyWeb ],
+            @{Jifty->config->framework('Web')->{'Globals'} || []},
+        ],
         comp_root     => [ 
                           [application =>  Jifty::Util->absolute_path( Jifty->config->framework('Web')->{'TemplateRoot'} )],
                           [jifty => Jifty->config->framework('Web')->{'DefaultTemplateRoot'}],

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Sun Apr  2 06:47:58 2006
@@ -39,14 +39,14 @@
                 Gettext => Jifty->config->framework('L10N')->{'PoDir'}
                     . '/*.po',
                 Gettext => Jifty->config->framework('L10N')->{'DefaultPoDir'}
-                    . '/*.po'
+                    . '/*.po',
             ],
-
             _decode => 1,
+            _auto   => 1,
+            _style  => 'gettext',
         }
     );
 
-    $Jifty::I18N::en::Lexicon{_AUTO} = 1;    # autocreate missing keys
     $self->init;
 
     my $lh         = eval { $class->get_handle };

Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm	(original)
+++ jifty/trunk/lib/Jifty/Record.pm	Sun Apr  2 06:47:58 2006
@@ -235,7 +235,7 @@
     my $value = $self->SUPER::_value( $column => @_ );
     return $value if ref $value or $self->column($column)->type eq 'blob';
 
-    utf8::decode($value) if defined $value;
+    Encode::_utf8_on($value) if defined $value;
     $value;
 }
 

Modified: jifty/trunk/lib/Jifty/Request.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Request.pm	(original)
+++ jifty/trunk/lib/Jifty/Request.pm	Sun Apr  2 06:47:58 2006
@@ -270,10 +270,10 @@
     defined(my $val = $self->arguments->{$key}) or return undef;
 
     if (ref $val eq 'ARRAY') {
-        utf8::decode($_) for @$val;
+        Encode::_utf8_on($_) for @$val;
     }
     else {
-        utf8::decode($val);
+        Encode::_utf8_on($val);
     }
 
     $val;

Modified: jifty/trunk/lib/Jifty/View/Mason/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Mason/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Mason/Handler.pm	Sun Apr  2 06:47:58 2006
@@ -83,8 +83,7 @@
     if ($r->content_type =~ /charset=([\w-]+)$/ ) {
         my $enc = $1;
 	if (lc($enc) =~ /utf-?8/) {
-            # XXX TODO: utf8 binmode breaks things right now
-            #    binmode *STDOUT, ":utf8";
+            binmode *STDOUT, ":utf8";
 	}
 	else {
             binmode *STDOUT, ":encoding($enc)";
@@ -192,7 +191,6 @@
     return %{Jifty->web->request->arguments};
 }
 
-
 ###########################################################
 package HTML::Mason::Request::Jifty;
 # Subclass for HTML::Mason::Request object $m

Modified: jifty/trunk/share/web/static/js/rico.js
==============================================================================
--- jifty/trunk/share/web/static/js/rico.js	(original)
+++ jifty/trunk/share/web/static/js/rico.js	Sun Apr  2 06:47:58 2006
@@ -2143,7 +2143,7 @@
 
    populateRow: function(htmlRow, row) {
       for (var j=0; j < row.length; j++) {
-         htmlRow.cells[j].innerHTML = row[j]
+         try { htmlRow.cells[j].innerHTML = row[j] } catch (e) {};
       }
    },
    
@@ -2489,7 +2489,9 @@
       var headerRow   = this.headerTable.rows[0];
       var headerCells = headerRow.cells;
       for ( var i = 0 ; i < headerCells.length ; i++ ) {
-         this.addSortBehaviorToColumn( i, headerCells[i] );
+         if (headerCells[i].tagName == 'TH') {
+           this.addSortBehaviorToColumn( i, headerCells[i] );
+         }
       }
    },
 
@@ -2584,7 +2586,12 @@
    },
 
    deriveColumnNameFromCell: function(cell,columnNumber) {
-      var cellContent = cell.innerText != undefined ? cell.innerText : cell.textContent;
+        var cellContent = 
+            (cell.attributes.name != undefined)
+                ? cell.attributes.name.value.toString()
+                : (cell.innerText != undefined)
+                    ? cell.innerText
+                    : cell.textContent;
       return cellContent ? cellContent.toLowerCase().split(' ').join('_') : "col_" + columnNumber;
    }
 };

Modified: jifty/trunk/t/Mapper/t/01-raw-api.t
==============================================================================
--- jifty/trunk/t/Mapper/t/01-raw-api.t	(original)
+++ jifty/trunk/t/Mapper/t/01-raw-api.t	Sun Apr  2 06:47:58 2006
@@ -48,7 +48,7 @@
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 
 $mech->get("$URL/index.html?J:M-foo=A|bar;bar=baz;bar=troz");
-$mech->content_like(qr/bar: &#38;1\n\s+- baz\n\s+- troz/, "Multiple parameters are list");
+$mech->content_like(qr/bar: &#38;1\s*\n\s+- baz\n\s+- troz/, "Multiple parameters are list");
 $mech->content_like(qr/foo: \*1/, "Multiple parameters are to same reference");
 $mech->content_lacks(qr/J:M-foo/, "Doesn't have mapping parameter");
 


More information about the Jifty-commit mailing list