aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-08-08 09:18:45 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-08-08 09:18:45 +0000
commit2358a5c1e3a2ac8c0220e2384f5f88747fdba929 (patch)
tree73be02cf620dbfacc8ace37124f5b391eac4b3c9
parentca65a9cb9d38b2e691db34a2439a0e1d79e87440 (diff)
improved language tabs
-rw-r--r--h-source/Application/Include/languages.php1
-rw-r--r--h-source/Application/Include/myFunctions.php9
-rw-r--r--h-source/Application/Views/header.php4
-rw-r--r--h-source/Public/Css/main.css20
-rw-r--r--h-source/Public/Js/functions.js43
5 files changed, 67 insertions, 10 deletions
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index b9ed55a..a57121b 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -259,6 +259,7 @@ class Lang
/*0211*/"You are not a registered user or you have not logged in. Your contribution won't be published until an administrator approves it. If you want your contributions to be automatically published please log in or create an account." => "Noi sei un utente registrato oppure non hai eseguito il login. Il tuo contributo non verrà pubblicato finché un amministratore non l'avrà approvato. Se desideri che il tuo contributo sia automaticamente pubblicato per favore esegui il login oppure crea un account.",
/*0212*/"has been inserted by an anonymous user, it has to be approved by an administrator in order to be published" => "è stato inserito da un utente anonimo, deve essere approvato da un amministratore per essere pubblicato",
/*0213*/"you can also subscribe to the feed in order to receive the new modifications that need a moderation" => "puoi anche iscriverti al feed per ricevere le nuove modifiche che richiedono una moderazione",
+ /*0214*/"you need javascript enabled in order to correctly use the language's tabs (see below)" => "deve abilitare Javascript per usare correttamente le schede della lingua (vedi sotto)",
),
'es' => array
(
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index 385923a..c299942 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -278,8 +278,8 @@ function decodeWikiText($string)
function createTabs($match)
{
$label = Lang::getLabel($match[3]);
- Tabs::$tabList[] = "<li class='desc_tabs'><a href='#".$label."'>".$label."</a></li>\n";
- Tabs::$htmlList[] = "<div class='description_tabs_page' id='".$label."'>".$match[5]."</div>\n";
+ Tabs::$tabList[] = "<li class='desc_tabs ".$match[3]."'><a href='#".$match[3]."'>".$label."</a></li>\n";
+ Tabs::$htmlList[] = "<div class='separation_line'>$label</div>\n<div class='description_tabs_page' id='".$match[3]."'>".$match[5]."</div>\n";
return null;
}
@@ -294,7 +294,8 @@ class Tabs
$html = null;
if (count(self::$tabList) > 0)
{
- $html .= "<div id='description_tabs'>\n";
+ $html .= "<div class='description_tabs'>\n";
+ $html .= "<noscript><div class='noscript_notice'>".gtext("you need javascript enabled in order to correctly use the language's tabs (see below)")."</div></noscript>\n";
$html .= "<ul class='desc_menu'>\n";
foreach (self::$tabList as $label)
{
@@ -307,6 +308,8 @@ class Tabs
}
$html .= "</div>\n</div>\n";
}
+ self::$tabList = array();
+ self::$htmlList = array();
return $html;
}
diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php
index af2db37..96f1a8c 100644
--- a/h-source/Application/Views/header.php
+++ b/h-source/Application/Views/header.php
@@ -64,9 +64,7 @@ $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index';
$(document).ready(function() {
-// $(function() {
-// $( "#description_tabs" ).tabs();
-// });
+ animateTabs(curr_lang);
});
diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css
index 2c2512c..49ff8b8 100644
--- a/h-source/Public/Css/main.css
+++ b/h-source/Public/Css/main.css
@@ -1870,7 +1870,7 @@ span.entry_label_small
}
/*tabs*/
-#description_tabs
+.description_tabs
{
margin-top:10px;
}
@@ -1887,7 +1887,7 @@ div#description_tabs_content
{
margin:10px;
}
-#description_tabs ul.desc_menu
+.description_tabs ul.desc_menu
{
width:700px;
/* border-bottom:1px solid #DCDCDC; */
@@ -1901,7 +1901,7 @@ div#description_tabs_content
top:1px;
/* padding-left:10px; */
}
-#description_tabs li.desc_tabs
+.description_tabs li.desc_tabs
{
display:block;
float:left;
@@ -1912,14 +1912,26 @@ div#description_tabs_content
background-color:#E6E6FA;
position:relative;
margin-right:8px;
+ margin-left:0px;
z-index:5;
}
-#description_tabs li.desc_tabs a
+.description_tabs li.current_tab
+{
+ background-color:#FFF;
+ border-bottom:1px solid #FFF;
+}
+.description_tabs li.desc_tabs a
{
/* text-decoration:none; */
color:#000;
/* font-weight:bold; */
}
+.separation_line
+{
+ background-color:#DCDCDC;
+ padding:6px 8px;
+ margin:20px 0;
+}
/*
Start - temporarily added due to transformation of help pages
2011-05-29 joeko
diff --git a/h-source/Public/Js/functions.js b/h-source/Public/Js/functions.js
index c3661cd..9111ba4 100644
--- a/h-source/Public/Js/functions.js
+++ b/h-source/Public/Js/functions.js
@@ -137,4 +137,47 @@ function moderator_dialog(md_action,md_type)
});
}
+function animateTabs(defaultTag)
+{
+ $(".description_tabs").each(function(){
+
+ var that = $(this);
+ showTab(that,defaultTag);
+ $(this).find("li.desc_tabs a").click(function(){
+
+ var t_ref = $(this).attr("href").replace(/\#/, "");
+ showTab(that,t_ref);
+ return false;
+ });
+ });
+
+}
+
+//show a single tab
+function showTab(descObject,tagLabel)
+{
+ $(".separation_line").css("display","none");
+ descObject.find(".description_tabs_page").css("display","none");
+ descObject.find(".desc_tabs").removeClass("current_tab");
+ if (descObject.find("#description_tabs_content").find("#"+tagLabel).length > 0)
+ {
+ descObject.find("#description_tabs_content").find("#"+tagLabel).css("display","block");
+ descObject.find(".desc_menu").find("."+tagLabel).addClass("current_tab");
+ }
+ else
+ {
+ if (descObject.find("#description_tabs_content").find("#en").length > 0)
+ {
+ descObject.find("#description_tabs_content").find("#en").css("display","block");
+ descObject.find(".desc_menu").find(".en").addClass("current_tab");
+ }
+ else
+ {
+ descObject.find("#description_tabs_content").find(".description_tabs_page").first().css("display","block");
+ descObject.find(".desc_menu li").first().addClass("current_tab");
+ }
+ }
+// $("#description_tabs_content").find("#"+tagLabel).css("display","block");
+}
+
//--> \ No newline at end of file