Linux multi-monitor fullscreen support
[ryzomcore.git] / web / public_php / webtt / app / webroot / js / jquery-fluid16.js
blob4da1f0d01c5cb24df5d37302224e13b7de421f39
1 var fluid = {
2 Ajax : function(){
3 $("#loading").hide();
4 var content = $("#ajax-content").hide();
5 $("#toggle-ajax").bind("click", function(e) {
6 if ( $(this).is(".hidden") ) {
7 $("#ajax-content").empty();
9 $("#loading").show();
10 $("#ajax-content").load("/fluid960gs/data/ajax-response.html", function() {
11 $("#loading").hide();
12 content.slideDown();
13 });
15 else {
16 content.slideUp();
18 if ($(this).hasClass('hidden')){
19 $(this).removeClass('hidden').addClass('visible');
21 else {
22 $(this).removeClass('visible').addClass('hidden');
24 e.preventDefault();
25 });
27 Toggle : function(){
28 var default_hide = {"grid": true, "filter": true };
29 $.each(
30 ["neighbour-actions", "admin-left-menu", "admin-actions", "help", "filter", "related-records", "grid", "paragraphs", "blockquote", "list-items", "section-menu", "tables", "forms", "login-forms", "search", "articles", "accordion"],
31 function() {
32 var el = $("#" + (this == 'accordon' ? 'accordion-block' : this) );
33 if (default_hide[this]) {
34 el.hide();
35 $("[id='toggle-"+this+"']").addClass("hidden")
37 $("[id='toggle-"+this+"']")
38 .bind("click", function(e) {
39 if ($(this).hasClass('hidden')){
40 $(this).removeClass('hidden').addClass('visible');
41 el.slideDown();
42 } else {
43 $(this).removeClass('visible').addClass('hidden');
44 el.slideUp();
46 e.preventDefault();
47 });
51 Kwicks : function(){
52 var animating = false;
53 $("#kwick .kwick")
54 .bind("mouseenter", function(e) {
55 if (animating) return false;
56 animating == true;
57 $("#kwick .kwick").not(this).animate({ "width": 125 }, 200);
58 $(this).animate({ "width": 485 }, 200, function() {
59 animating = false;
60 });
61 });
62 $("#kwick").bind("mouseleave", function(e) {
63 $(".kwick", this).animate({ "width": 215 }, 200);
64 });
66 SectionMenu : function(){
67 $("#section-menu")
68 .accordion({
69 "header": "a.menuitem"
71 .bind("accordionchangestart", function(e, data) {
72 data.newHeader.next().andSelf().addClass("current");
73 data.oldHeader.next().andSelf().removeClass("current");
75 .find("a.menuitem:first").addClass("current")
76 .next().addClass("current");
78 Accordion: function(){
79 $("#accordion").accordion({
80 'header': "h3.atStart"
81 }).bind("accordionchangestart", function(e, data) {
82 data.newHeader.css({
83 "font-weight": "bold",
84 "background": "#fff"
85 });
87 data.oldHeader.css({
88 "font-weight": "normal",
89 "background": "#eee"
90 });
91 }).find("h3.atStart:first").css({
92 "font-weight": "bold",
93 "background": "#fff"
94 });
97 jQuery(function ($) {
98 if($("#accordion").length){fluid.Accordion();}
99 if($("[id$='ajax']").length){fluid.Ajax();}
100 if($("[id^='toggle']").length){fluid.Toggle();}
101 if($("#kwick .kwick").length){fluid.Kwicks();}
102 if($("#section-menu").length){fluid.SectionMenu();}