can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21570: LJSUP-11591: Remove unnecessary resource...

Committer: dpetrov
LJSUP-11591: Remove unnecessary resources from the editjournal.bml and manage/scheduled_posts.bml
U   trunk/htdocs/editjournal.bml
U   trunk/htdocs/manage/scheduled_posts.bml
Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2012-03-28 09:21:32 UTC (rev 21569)
+++ trunk/htdocs/editjournal.bml	2012-03-28 09:28:36 UTC (rev 21570)
@@ -40,24 +40,31 @@
 
     my $editprivacy_link = "<p class='i-bubble b-bubble-lite b-bubble-editprivacy b-bubble-noarrow'>" . BML::ml('.editprivacy', { aopts => "href='editprivacy.bml'" }) . "</p>";
 
-    LJ::need_res(qw(
-                    stc/entry.css
-                    stc/editjournal.css
-                    stc/widgets/selecttags.css
-                    js/inputcomplete.js
-                    js/jquery/jquery.ui.position.min.js
-                    js/jquery/jquery.ui.autocomplete.min.js
-                    js/jquery/jquery.bgiframe.js
-                    js/gears_init.js
-                    js/scanner.js
-                    js/photobucket_jw.js
-                    ));
+    if ($mode eq "edit") {
+        LJ::need_res(qw(
+                        stc/entry.css
+                        stc/editjournal.css
+                        stc/widgets/selecttags.css
+                        js/inputcomplete.js
+                        js/jquery/jquery.ui.position.min.js
+                        js/jquery/jquery.ui.autocomplete.min.js
+                        js/jquery/jquery.bgiframe.js
+                        js/gears_init.js
+                        js/scanner.js
+                        js/photobucket_jw.js
+                        ));
 
-    if (LJ::is_enabled("delayed_entries")) {
-        LJ::need_string(qw/
-                            entryform.sticky_replace.edit
-                            entryform.sticky.edit
-                            entryform.choose_date/);
+        if (LJ::is_enabled("delayed_entries")) {
+            LJ::need_string(qw/
+                                entryform.sticky_replace.edit
+                                entryform.sticky.edit
+                                entryform.choose_date/);
+        }
+
+    } else {
+        LJ::need_res(qw(
+                        stc/editjournal.css
+                        ));
     }
 
     # append months names tranlation to Site.ml_text['month.names.long']  
@@ -804,32 +811,33 @@
 
 <?entryformcss?>
 <?_code return $_[0]->{'head'}; _code?>
-<?_code return $LJ::COMMON_CODE{'autoradio_check'}; _code?>
 
 <?_code
 {
     my $ret;
 
-    LJ::need_res(qw(
-                    js/core.js
-                    js/dom.js
-                    js/httpreq.js
-                    js/livejournal.js
-                    js/widget_ippu/selecttags.js
-                    js/entry.js
-                    js/poll.js
-                    js/jquery/jquery.lj.editentriesfilter.js
-                    ));
+    my $ditemid = $GET{'itemid'} || $POST{'itemid'} || 0;
+    my $delayedid = $GET{'delayedid'} || $POST{'delayedid'};    
 
-    # JS vars for the RTE
-    $ret .= LJ::rte_js_vars($remote);
+    if ( $ditemid || $delayedid ) {
+        LJ::need_res(qw(
+                        js/widget_ippu/selecttags.js
+                        js/entry.js
+                        js/poll.js
+                        ));
 
+        # JS vars for the RTE
+        $ret .= LJ::rte_js_vars($remote);
+        $ret .= '<script type="text/javascript">LiveJournal.register_hook("page_load", setCopyrightEdit);</script>';
+    } else {
+        LJ::need_res(qw(
+                        js/jquery/jquery.lj.editentriesfilter.js
+                        ));
+    }
+
     return $ret;
 }
 _code?>
-<script type='text/javascript'>
-    LiveJournal.register_hook("page_load", setCopyrightEdit);
-</script>
 
 <=head
 page?><?_c <LJDEP>

Modified: trunk/htdocs/manage/scheduled_posts.bml
===================================================================
--- trunk/htdocs/manage/scheduled_posts.bml	2012-03-28 09:21:32 UTC (rev 21569)
+++ trunk/htdocs/manage/scheduled_posts.bml	2012-03-28 09:28:36 UTC (rev 21570)
@@ -9,16 +9,7 @@
 #line 7
 
     LJ::need_res(qw(
-                    stc/entry.css
                     stc/editjournal.css
-                    stc/widgets/selecttags.css
-                    js/inputcomplete.js
-                    js/jquery/jquery.ui.position.min.js
-                    js/jquery/jquery.ui.autocomplete.min.js
-                    js/jquery/jquery.bgiframe.js
-                    js/gears_init.js
-                    js/scanner.js
-                    js/photobucket_jw.js
                     ));
     if (!LJ::is_enabled("delayed_entries")) {
           return LJ::error_list("This feature is disabled.");
@@ -176,22 +167,22 @@
     if ( !$usejournal_u || $usejournal_u->is_community ) {
         $ret .= "<p><a href='$LJ::SITEROOT/manage/$page_name'>" . BML::ml('.lnk.journal') . "</a></p>";
     }
-	
+
     my $timezone = $remote->prop("timezone");
     if ($timezone) {
-		$ret .="<div class='b-editentries-timezone show-timezone'>";
+        $ret .="<div class='b-editentries-timezone show-timezone'>";
         $ret .= BML::ml('.date.your_time_zone');
         $ret .= "<a href=\"$LJ::SITEROOT/manage/settings/?cat=display\">(";
         $ret .= $timezone;
         $ret .= ')</a>';
-		$ret .="</div>";
+        $ret .="</div>";
     } else {
-		$ret .="<div class='b-editentries-timezone'>";
+        $ret .="<div class='b-editentries-timezone'>";
         $ret .= BML::ml('.date.gmt');
         $ret .= "<a href=\"$LJ::SITEROOT/manage/settings/?cat=display\">";
         $ret .= BML::ml('.date.set_time_zone');
         $ret .= '</a>';
-		$ret .="</div>";
+        $ret .="</div>";
     }
     $ret .= $entry_chooser->( \@recent_entries,
                                 first_page   => $skip ? 0 : 1,

Tags: bml, can3p, dpetrov, livejournal
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