madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20305: LJSUP-10119: using is_enbaled

Committer: sbelyaev
LJSUP-10119: using is_enbaled
U   trunk/cgi-bin/LJ/S2/DayPage.pm
U   trunk/cgi-bin/LJ/S2/MonthPage.pm
U   trunk/cgi-bin/LJ/S2/RecentPage.pm
U   trunk/cgi-bin/LJ/User.pm
U   trunk/cgi-bin/LJ/Widget/EntryForm.pm
U   trunk/cgi-bin/ljprotocol.pl
U   trunk/htdocs/editjournal.bml
Modified: trunk/cgi-bin/LJ/S2/DayPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/DayPage.pm	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/LJ/S2/DayPage.pm	2011-10-13 10:59:16 UTC (rev 20305)
@@ -109,7 +109,7 @@
     my $tags = LJ::Tags::get_logtags($u, \@itemids);
     
     my @ditems = ();
-    if ( !$LJ::DELAYED_ENTRIES_DISABLED ) {
+    if (LJ::is_enabled("delayed_entries")) {
         @ditems = LJ::DelayedEntry->get_entries_for_day($u, $year, $month, $day, $dateformat, $secwhere);
 
         foreach my $ditem (@ditems) {

Modified: trunk/cgi-bin/LJ/S2/MonthPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/MonthPage.pm	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/LJ/S2/MonthPage.pm	2011-10-13 10:59:16 UTC (rev 20305)
@@ -79,7 +79,7 @@
     push @items, $_ while $_ = $sth->fetchrow_hashref;
     
     my @ditems = ();
-    if ( !$LJ::DELAYED_ENTRIES_DISABLED ) {
+    if (LJ::is_enabled("delayed_entries")) {
         @ditems = LJ::DelayedEntry->get_entries_for_month($u, $year, $month, $dateformat, $secwhere);
 
         foreach my $ditem (@ditems) {

Modified: trunk/cgi-bin/LJ/S2/RecentPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/RecentPage.pm	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/LJ/S2/RecentPage.pm	2011-10-13 10:59:16 UTC (rev 20305)
@@ -79,7 +79,7 @@
     my $usual_skip =  $delayed_entries_count - $skip > $itemshow ? 
                                             $skip - $delayed_entries_count + $has_sticky :
                                             $skip ? $skip : 0;
-    if (!$LJ::DELAYED_ENTRIES_DISABLED) {
+    if (LJ::is_enabled("delayed_entries")) {
         if (!$skip) {
             $delayed_entries = LJ::DelayedEntry->get_entries_by_journal($u, $skip, $itemshow - $has_sticky);
         } elsif ( $skip) {

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/LJ/User.pm	2011-10-13 10:59:16 UTC (rev 20305)
@@ -7843,7 +7843,7 @@
     my $list = LJ::MemCache::get($memkey);
     if ($list) {
         my $list_create_time = shift @$list;
-        if (!$LJ::DELAYED_ENTRIES_DISABLED) {
+        if (LJ::is_enabled("delayed_entries")) {
             LJ::DelayedEntry->get_daycount_query($u, $list, $secwhere);
         }
         return $list if $list_create_time >= $u->timeupdate;
@@ -7880,7 +7880,7 @@
     LJ::MemCache::set($memkey, [time, @days]);
 
     # not cached part
-    if (!$LJ::DELAYED_ENTRIES_DISABLED) {
+    if (LJ::is_enabled("delayed_entries")) {
         LJ::DelayedEntry->get_daycount_query($u, \@days, $secwhere);
     }
     $release_lock->();

Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-10-13 10:59:16 UTC (rev 20305)
@@ -1160,38 +1160,6 @@
         'spellcheck' => sub {
             my $out = '';
 
-            # extra submit button so make sure it posts the form when
-            # person presses enter key
-            my %action_map = (
-                'edit' => 'save',
-                'update' => 'update',
-            );
-            if (my $action = $action_map{$opts->{'mode'}}) {
-                $out .= qq{
-                    <input type='submit' name='action:$action'
-                        class='hidden_submit' />
-                    <span id="preview_button_holder"></span>
-                };
-            }
-            my $preview_tabindex = $self->tabindex;
-            my $preview = qq{
-                <input
-                    type='button'
-                    value='$BML::ML{'entryform.preview'}'
-                    onclick='entryPreview(this.form)'
-                    tabindex='$preview_tabindex'
-                />
-            };
-            $preview =~ s/\s+/ /sg; # JS doesn't like newlines in string
-                                    # literals
-
-            unless ($opts->{'disabled_save'}) {
-                $out .= $self->wrap_js(qq{
-                    if (document.getElementById) {
-                        \$('preview_button_holder').innerHTML = "$preview ";
-                    }
-                });
-            }
             if ($LJ::SPELLER && !$opts->{'disabled_save'}) {
                 $out .= LJ::html_submit(
                     'action:spellcheck',

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/cgi-bin/ljprotocol.pl	2011-10-13 10:59:16 UTC (rev 20305)
@@ -2144,7 +2144,7 @@
         LJ::run_hook('spam_community_detector', $uowner, $req, \$need_moderated);
     }
 
-    if ( $req->{ver} > 1  && !$LJ::DELAYED_ENTRIES_DISABLED ) {
+    if ( $req->{ver} > 1  && LJ::is_enabled("delayed_entries") ) {
         my $use_delayed = $req->{'custom_time'} ||
                     !(exists $flags->{'use_custom_time'});
         if ( $use_delayed && LJ::DelayedEntry::is_future_date($req) ) {
@@ -3142,7 +3142,7 @@
 
     $skip = 500 if $skip > 500;
 
-    if ( $req->{ver} > 1 && !$LJ::DELAYED_ENTRIES_DISABLED ) {
+    if ( $req->{ver} > 1 && LJ::is_enabled("delayed_entries") ) {
         my $res = {};
 
         if ( $req->{delayedid} ) {

Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2011-10-13 08:13:47 UTC (rev 20304)
+++ trunk/htdocs/editjournal.bml	2011-10-13 10:59:16 UTC (rev 20305)
@@ -868,7 +868,7 @@
         my $next_page = 0;
 
         my $delayed_entries = [];
-        if (!$LJ::DELAYED_ENTRIES_DISABLED) {
+        if (LJ::is_enabled("delayed_entries")) {
             if ( $show eq 'recent' || !($year && $month && $day)) {
                 $delayed_entries = LJ::DelayedEntry->get_entries_by_journal($usejournal_u) || [];
             } else {

Tags: bml, livejournal, madeon, pl, pm, sbelyaev
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