juks (juks) wrote in changelog,
juks
juks
changelog

[livejournal] r18201: LJSV-1382 Inbox

Committer: iaskarov
LJSV-1382 Inbox
U   trunk/cgi-bin/ljlib.pl
U   trunk/cgi-bin/weblib.pl
U   trunk/htdocs/inbox/compose.bml
U   trunk/htdocs/inbox/compose.bml.text
U   trunk/htdocs/inbox/index.bml.text
Modified: trunk/cgi-bin/ljlib.pl
===================================================================
--- trunk/cgi-bin/ljlib.pl	2011-02-03 10:13:27 UTC (rev 18200)
+++ trunk/cgi-bin/ljlib.pl	2011-02-03 10:36:20 UTC (rev 18201)
@@ -2159,6 +2159,7 @@
     %LJ::NEEDED_RES = ();             # needed resources (css/js/etc):
     @LJ::NEEDED_RES = ();             # needed resources, in order requested (implicit dependencies)
                                       #  keys are relative from htdocs, values 1 or 2 (1=external, 2=inline)
+    %LJ::JSML = ();                   # Javascript language variables sent to the page header for further javascript use
     @LJ::INCLUDE_RAW = ();            # raw js/css added after needed resources.
     %LJ::REQ_GLOBAL = ();             # per-request globals
     %LJ::_ML_USED_STRINGS = ();       # strings looked up in this web request

Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2011-02-03 10:13:27 UTC (rev 18200)
+++ trunk/cgi-bin/weblib.pl	2011-02-03 10:36:20 UTC (rev 18201)
@@ -1378,8 +1378,9 @@
     $ret .= qq {
         <script type="text/javascript">
             Site = window.Site || {};
-
-            (function(){
+    };
+    $ret .= '        Site.ml_text = ' .  LJ::JSON->to_json(\%LJ::JSML) . ";\n" if(%LJ::JSML);
+    $ret .= qq {            (function(){
                 var p = $site_params, i;
                 for (i in p) Site[i] = p[i];
             })();
@@ -2473,4 +2474,13 @@
     return join(" ", @classes);
 }
 
+# Add some javascript language strings
+sub add_js_ml {
+    my %data = @_;
+    
+    for (keys %data) {
+        $LJ::JSML{$_} = $data{$_};
+    }
+}
+
 1;

Modified: trunk/htdocs/inbox/compose.bml
===================================================================
--- trunk/htdocs/inbox/compose.bml	2011-02-03 10:13:27 UTC (rev 18200)
+++ trunk/htdocs/inbox/compose.bml	2011-02-03 10:36:20 UTC (rev 18201)
@@ -130,7 +130,7 @@
                 }
 
                 unless (@errors) {
-                    $body .= $ML{'.sent.title'}; #"Your message has been sent successfully.";
+                    $body .= $ML{'.sent.title'};
                     $body .= "<?p " . $ML{'.sent.nowyoucan'} . " <ul>";
                     $body .= "<li><a href='$LJ::SITEROOT/inbox/compose.bml'>" . $ML{'.sent.new'} . "</a></li>";
                     $body .= "<li><a href='$LJ::SITEROOT/inbox/'>" . $ML{'.sent.return'} . "</a></li>";
@@ -141,6 +141,8 @@
             }
         }
     }
+    
+    LJ::add_js_ml( userpic_title => $ML{'.userpic.title'} );
 
     # Display errors
     $body .= LJ::error_list(@errors) if (@errors);

Modified: trunk/htdocs/inbox/compose.bml.text
===================================================================
--- trunk/htdocs/inbox/compose.bml.text	2011-02-03 10:13:27 UTC (rev 18200)
+++ trunk/htdocs/inbox/compose.bml.text	2011-02-03 10:36:20 UTC (rev 18201)
@@ -11,4 +11,6 @@
 .sent.nowyoucan=From here you can
 .sent.new=Send a new message
 .sent.return=Return to Inbox
-.sent.returnhome=Return Home
\ No newline at end of file
+.sent.returnhome=Return Home
+
+.userpic.title=View Thumbnails

Modified: trunk/htdocs/inbox/index.bml.text
===================================================================
--- trunk/htdocs/inbox/index.bml.text	2011-02-03 10:13:27 UTC (rev 18200)
+++ trunk/htdocs/inbox/index.bml.text	2011-02-03 10:36:20 UTC (rev 18201)
@@ -54,4 +54,4 @@
 .btn.unread=unread
 .btn.delete=delete
 .btn.prev=Previous
-.btn.next=Next
+.btn.next=Next
\ No newline at end of file

Tags: bml, juks, livejournal, pl, text
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments