[Bps-public-commit] App-Changeloggr branch, master, updated. 2503e872a35d379cef864880459891c0faa76257

sartak at bestpractical.com sartak at bestpractical.com
Wed May 20 15:32:50 EDT 2009


The branch, master has been updated
       via  2503e872a35d379cef864880459891c0faa76257 (commit)
      from  893c30d4608e296679f3152980a7ebeb7fb5756b (commit)

Summary of changes:
 lib/App/Changeloggr/View.pm |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 2503e872a35d379cef864880459891c0faa76257
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed May 20 15:32:38 2009 -0400

    Display full diff in an iframe, needs polish

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index fc4971d..54c5019 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -119,11 +119,21 @@ sub show_change {
         my $id = $change->id;
         if (my $url = $change->external_source) {
             hyperlink(
-                label  => "Full diff",
-                url    => $url,
-                target => "diff",
-                class  => "external_source",
-            );
+                label => 'Full diff',
+                onclick => [{
+                    region       => Jifty->web->qualified_region("change_${id}_source"),
+                    replace_with => '/change/external_source',
+                    toggle       => 1,
+                    effect       => 'slideDown',
+                    arguments    => {
+                        url => $url,
+                    },
+                },
+                "this.innerHTML = this.innerHTML == 'Full diff' ? 'Hide diff' : 'Full diff';",
+            ]);
+            div {
+                render_region("change_${id}_source");
+            };
         }
         if (Jifty->web->current_user->user_object->show_details) {
             div {
@@ -164,6 +174,14 @@ sub show_change {
     };
 }
 
+template '/change/external_source' => sub {
+    my $url = get('url');
+
+    iframe {
+        src is $url;
+    };
+};
+
 template '/change/more' => sub {
     my $change = M('Change', id => get('change'));
 

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



More information about the Bps-public-commit mailing list