Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits

[4216] CTK/trunk: New tabs style

 

 

Cherokee commits RSS feed   Index | Next | Previous | View Threaded


cherokee at cherokee-project

Feb 8, 2010, 8:59 AM

Post #1 of 1 (96 views)
Permalink
[4216] CTK/trunk: New tabs style

Revision: 4216
http://svn.cherokee-project.com/changeset/4216
Author: ion
Date: 2010-02-08 17:59:55 +0100 (Mon, 08 Feb 2010)

Log Message:
-----------
New tabs style

Modified Paths:
--------------
CTK/trunk/CTK/Tab.py

Added Paths:
-----------
CTK/trunk/static/images/tabbg.png

Modified: CTK/trunk/CTK/Tab.py
===================================================================
--- CTK/trunk/CTK/Tab.py 2010-02-08 16:59:22 UTC (rev 4215)
+++ CTK/trunk/CTK/Tab.py 2010-02-08 16:59:55 UTC (rev 4216)
@@ -23,7 +23,7 @@
from Widget import Widget, RenderResponse

HEADERS = [.
- '<link type="text/css" href="/CTK/css/jquery-ui-1.7.2.custom.css" rel="stylesheet" />',
+ '<link type="text/css" href="/CTK/css/CTK.css" rel="stylesheet" />',
'<script type="text/javascript" src="/CTK/js/jquery-ui-1.7.2.custom.min.js"></script>'
]

@@ -44,13 +44,37 @@

JS_INIT = """
$("#tab_%(id)s").tabs().bind('tabsselect', function(event, ui) {
+ tabslen = $("#tab_%(id)s").tabs('length');
+
+ nprevtab = parseInt(get_cookie('open_tab')) + 2;
+ if (nprevtab < tabslen) {
+ $("#tab_%(id)s li:nth-child("+ nprevtab +")").removeClass("ui-tabs-selected-next");
+ } else {
+ $("#tab_%(id)s li:nth-child("+ nprevtab +")").removeClass("ui-tabs-selected-next-last");
+ }
+
+ nnexttab = ui.index + 2;
+ if (nnexttab < tabslen) {
+ $("#tab_%(id)s li:nth-child("+ nnexttab +")").addClass("ui-tabs-selected-next");
+ } else {
+ $("#tab_%(id)s li:nth-child("+ nnexttab +")").addClass("ui-tabs-selected-next-last");
+ }
document.cookie = "open_tab=" + ui.index;
});

+$("#tab_%(id)s ul li:first").addClass("ui-tabs-first");
+$("#tab_%(id)s ul li:last").addClass("ui-tabs-last");
+
var open_tab = get_cookie('open_tab');
if (open_tab) {
- $("#tab_%(id)s").tabs("select", open_tab);
+ $("#tab_%(id)s").tabs("select", parseInt(open_tab));
+} else {
+ document.cookie = "open_tab=0";
}
+
+if ($("#tab_%(id)s").tabs('option', 'selected') == 0) {
+ $("#tab_%(id)s li:nth-child(2)").addClass("ui-tabs-selected-next");
+}
"""

class Tab (Widget):

Added: CTK/trunk/static/images/tabbg.png
===================================================================
(Binary files differ)


Property changes on: CTK/trunk/static/images/tabbg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Cherokee commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.