Савинцев Егор 🚶 (savintsev_egor) wrote in changelog,
Савинцев Егор 🚶
savintsev_egor
changelog

[ljcom] r10654: LJSUP-8917: iPad Minimalism

Committer: esavintcev
LJSUP-8917: iPad Minimalism
U   trunk/bin/upgrading/s2layers/sup/themes.s2
U   trunk/cgi-bin/LJ/S2Theme/sup.pm
Modified: trunk/bin/upgrading/s2layers/sup/themes.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-16 04:26:48 UTC (rev 10653)
+++ trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-16 07:00:26 UTC (rev 10654)
@@ -505,3 +505,191 @@
         "</li>";
     }
 }
+
+
+#NEWLAYER: sup/ipad
+layerinfo "type" = "theme";
+layerinfo "name" = "iPad";
+layerinfo "redist_uniq" = "sup/ipad";
+set theme_css = "ipad.css";
+set active_theme = "";
+set recent_show_date = true;
+set friends_show_date = true;
+set recent_show_upic = false;
+set friends_show_upic = false;
+set theme_designer = "andrey_agrafenin";
+
+function Page::print() {
+    if ($.view == "recent") {$*_RecentPage = $this as RecentPage;} elseif ($.view == "friends") {$*_FriendsPage = $this as FriendsPage;} elseif ($.view == "day") {$*_DayPage = $this as DayPage;} elseif ($.view == "month") {$*_MonthPage = $this as MonthPage;} elseif ($.view == "archive") {$*_YearPage = $this as YearPage;}
+    _global_init_();
+    var string _upic = $.journal.default_pic?"""<div class="userpic"><div class="userpic-in"><img alt="${.journal.default_pic.alttext}" width="${.journal.default_pic.width}" height="${.journal.default_pic.height}" """+ ($*active_theme == "x2" or $*active_theme == "x4"?"style=\"margin-top:"+ (100-${.journal.default_pic.height})/2 +"px;\"":"") +"""src="${.journal.default_pic.url}" /></div></div>""":"";
+    var string _h1 = "<h1>" + _user_print($.journal, "microformatted") + "</h1>";
+    var string _nav = """ <li class="item item-recent""" + (($.view == "recent")?" item-selected":"") + """"><a""" + (($*exact_view != "recent_first")?" rel=\"home\" href=\"$*base_url\"":"") + """>$*text_view_recent</a></li> <li class="item item-friends""" + (($.view == "friends")?" item-selected":"") + """"><a""" + (($*exact_view != "friends_first")?" href=\"$*base_url/friends\"":"") + """>$*text_view_friends</a></li> <li class="item item-archive""" + (($.view == "archive" or $.view == "month" or $.view == "day")?" item-selected":"") + """"><a""" + (($*exact_view != "archive_first")?" href=\"$*base_url/calendar\"":"") + """>$*text_view_archive</a></li> <li class="item item-profile"><a href="$*base_url/profile">$*text_view_userinfo</a></li> """;
+    var string rsslink = ($.data_link{"rss"})?($.data_link{"rss"}.url):"$*base_url/data/rss";
+	var Link addlink = $.journal -> get_link("add_friend");
+    var string _games;
+    if ($.view_my_games) {
+        $_games = """<li class="item item-games"><a href="$.journal.website_url/profile#apps">$*text_view_games</a></li>""";
+    }
+	var string addfriend = (not viewer_is_owner() and $addlink.url != "") ? $addlink.url : "";
+    var string _nav_sub = ($addfriend ? """ <li class="item item-addfriend"><a class="btn btn-add" href="$addfriend"><span><span><span>$*text_friend_add</span></span></span></a></li> """ : "") + """ <li class="item item-rss"><a class="btn btn-rss" href="$rsslink"><span><span><span>RSS</span></span></span></a></li>$_games""";
+    if ($*active_theme == "x3") { $_nav_sub = ($addfriend ? """ <li class="item item-addfriend"><a href="$addfriend">$*text_friend_add</a></li> """ : "") + """ <li class="item item-rss"><a href="$rsslink">RSS</a></li> $_games """; }
+    var string _h2 = """<h2><span>$.global_title</span></h2>""";
+    var string _h3 = "";
+	if ($.view == "friends" and $*_FriendsPage.friends_title != "") {
+		$_h3 = "<h3><span>$*_FriendsPage.friends_title</span></h3>";
+	} elseif ($.global_subtitle != "") {
+		$_h3 = "<h3><span>$.global_subtitle</span></h3>";
+	}
+    var string _hfeed = ($.view=="recent" or $.view=="friends" or $.view=="day")?" hfeed":"";
+    _Header();
+"""
+<div id="page">
+    <div class="layout">
+    <div class="layout-inner">
+            <div class="content$_hfeed">
+                <div class="content-inner">
+                    <div class="header">
+                        <div class="nav-wrapper""" + ($addfriend ? " nav-addfriend" : "") + """\">
+                        <ul class="nav">
+                            $_nav
+                            $_nav_sub
+                        </ul>
+                        </div>
+                        $_upic
+                        $_h1
+                        $_h2
+                        $_h3
+                    </div>
+                    <div class="hr hr-afterhead"><hr /></div>
+                    """;$this->print_body();"""
+                </div>
+            </div>
+""";
+            _Sidebar();
+"""
+        </div>
+        </div>
+    </div>
+""";
+    _Footer();
+}
+
+function _Sidebar {
+    var Page p=get_page();
+"""
+                <div class="sidebar">
+                    <div class="sidebar-inner">
+""";
+    if ($*layout_show_calendar) {
+"""
+                    <dl class="sidebar-block sidebar-cal">
+                        <dt>$*text_view_archive</dt>
+                        <dd class="calendar-wrap">"""; _calendar($p->get_latest_month(), "sidebar"); """</dd>
+                    </dl>
+""";
+    }
+
+    if (size($p->visible_tag_list()) > 0 and $*layout_show_tags and $p.view!="tags") {
+        if ($*layout_show_calendar or (size($p.linklist) > 0 and $*layout_show_links)) {"""<div class="hr"><hr /></div>""";}
+"""
+                    <dl class="sidebar-block sidebar-tags">
+                        <dt>$*text_tags_section_header</dt>
+                        <dd class="tags">""";
+if ($*tag_limit) {
+    _taglist($*tag_cloud_max,108);
+} else {
+    _taglist(108);
+} """</dd>
+                    </dl>
+""";
+    }
+    """
+                        </div>
+                    </div>
+    """;
+
+
+}
+
+function RecentPage::print_body {
+    var Page p = get_page();
+    if ($*sticky_post!="" and $*exact_view == "recent_first") {
+"""
+                        <div class="entry-wrap disabledcomments">
+                        <dl class="entry" id="post-sticky">
+                            <dt class="entry-title">""" + ($*sticky_subject!="" ? $*sticky_subject : "Sticky post") +"""</dt>
+                            <dd class="entry-text">
+                                <div class="entry-content">$*sticky_post</div>
+                            </dd>
+                        </dl>
+                        </div>
+                        <div class="hr"><hr /></div>
+""";
+    }
+    foreach var Entry e ($.entries) {
+        _print_entry($e);
+        """
+        <!-- $e.itemid -->
+        """;
+    }
+    if (size $.entries > 0 and ($.nav.backward_url != "" or $.nav.forward_url != "" or ($p.view == "recent" and $*page_recent_items != 1) or ($p.view == "friends" and $*page_friends_items != 1))) {
+"""
+                <ul class="page-nav">
+""";
+        if ($.nav.backward_url != "") {
+"""
+                    <li class="prev"><a href="$.nav.backward_url" class="item">"""+get_plural_phrase($.nav.backward_count, "text_skiplinks_back")+"""</a></li>
+""";
+        }
+        if (($p.view == "recent" and $*page_recent_items != 1) or ($p.view == "friends" and $*page_friends_items != 1)) {
+"""
+                    <li class="ontop"><a href="#" onclick="jQuery('body,html').animate({scrollTop:0},500);return false;" class="item">$*text_totop</a></li>
+""";
+        }
+        if ($.nav.forward_url != "") {
+"""
+                    <li class="next"><a href="$.nav.forward_url" class="item">"""+get_plural_phrase($.nav.forward_count, "text_skiplinks_forward")+"""</a></li>
+""";
+        }
+"""
+                </ul>
+""";
+    }
+}
+
+function DayPage::print_body() {
+    var string corners1 = "";
+    var string corners1_2 = "";
+    var string corners2 = "";
+    if ($*active_theme == "x4") {
+        $corners1 = """<i class="cornerz cornerz-top"><b></b></i>""";
+        $corners2 = """<i class="cornerz cornerz-bot"><b></b></i>""";
+    } elseif ($*active_theme == "x5") {
+        $corners1_2 = """<i class="cornerz cornerz-top"><b></b></i>""";
+        $corners2 = """<i class="cornerz cornerz-bot"><b></b></i>""";
+    }
+    if ($.has_entries) {
+        foreach var Entry e ($.entries) {
+            _print_entry($e);
+        }
+    } else {
+"""
+                <div class="entry-wrap">$corners1$corners1_2<div class="entry"><div class="entry-text"><p>$*text_noentries_day</p></div></div>$corners2</div>
+""";
+    }
+"""
+                <ul class="page-nav">
+                    <li class="prev"><a class="item" href="$.prev_url">$*text_day_prev</a></li>
+""";
+    if (size $.entries > 1) {
+"""
+                    <li class="ontop"><a href="#" onclick="jQuery('body,html').animate({scrollTop:0},500);return false;" class="item">$*text_totop</a></li>
+""";
+    }
+"""
+                    <li class="next"><a class="item" href="$.next_url">$*text_day_next</a></li>
+                </ul>
+""";
+}
+

Modified: trunk/cgi-bin/LJ/S2Theme/sup.pm
===================================================================
--- trunk/cgi-bin/LJ/S2Theme/sup.pm	2011-06-16 04:26:48 UTC (rev 10653)
+++ trunk/cgi-bin/LJ/S2Theme/sup.pm	2011-06-16 07:00:26 UTC (rev 10654)
@@ -135,4 +135,9 @@
 sub cats { qw( sup anniversary ) }
 sub designer { "matt_uza" }
 
+package LJ::S2Theme::sup::ipad;
+use base qw(LJ::S2Theme::sup);
+sub cats { qw( sup ipad ) }
+sub designer { "andrey_agrafenin" }
+
 1;

Tags: ljcom, pm, s2, savintsev_egor
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