Revision 1933
Added by darkviper almost 11 years ago
jquery-plugins.js | ||
---|---|---|
44 | 44 |
}).addClass("internal"); |
45 | 45 |
|
46 | 46 |
$('form').attr('autocomplete', 'off'); |
47 |
function include_file(filename, filetype) { |
|
47 | 48 |
|
49 |
if(!filetype) |
|
50 |
var filetype = 'js'; //js default filetype |
|
51 |
|
|
52 |
var th = document.getElementsByTagName('head')[0]; |
|
53 |
var s = document.createElement((filetype == "js") ? 'script' : 'link'); |
|
54 |
|
|
55 |
s.setAttribute('type',(filetype == "js") ? 'text/javascript' : 'text/css'); |
|
56 |
|
|
57 |
if (filetype == "css") |
|
58 |
s.setAttribute('rel','stylesheet'); |
|
59 |
|
|
60 |
s.setAttribute((filetype == "js") ? 'src' : 'href', filename); |
|
61 |
th.appendChild(s); |
|
62 |
|
|
63 |
} |
|
64 |
|
|
65 |
function redirect_to_page (url, timer) { |
|
66 |
setTimeout('self.location.href="'+url+'"', timer); |
|
67 |
} |
|
68 |
|
|
69 |
$(document).ready(function() |
|
70 |
{ |
|
71 |
|
|
72 |
if($(".jcalendar").length) { |
|
73 |
$.insert(WB_URL+"/include/jscalendar/calendar-system.css"); |
|
74 |
} |
|
75 |
|
|
76 |
if($(".jsadmin").length) { |
|
77 |
$.insert(WB_URL+"/modules/jsadmin/backend.css"); |
|
78 |
} |
|
79 |
|
|
80 |
//Add external link class to external links - |
|
81 |
$('a[href^="http://"]').filter(function() { |
|
82 |
//Compare the anchor tag's host name with location's host name |
|
83 |
return this.hostname && this.hostname !== location.hostname; |
|
84 |
}).addClass("external").attr("target", "_blank"); |
|
85 |
|
|
86 |
/* Add internal link class to external links - */ |
|
87 |
$('a[href^="http://"]').filter(function() { |
|
88 |
//Compare the anchor tag's host name with location's host name |
|
89 |
return this.hostname && this.hostname == location.hostname; |
|
90 |
}).addClass("internal"); |
|
91 |
|
|
92 |
$('form').attr('autocomplete', 'off'); |
|
93 |
|
|
94 |
/* toggler for group permissions */ |
|
95 |
if($('form[name="group"]').length) { |
|
96 |
|
|
97 |
function toggleBox(checkbox, toggleID){ |
|
98 |
var $checkbox = checkbox; |
|
99 |
if( $checkbox.attr('checked')){ |
|
100 |
$(toggleID).removeClass("hide"); |
|
101 |
} else { |
|
102 |
$(toggleID).addClass("hide"); |
|
103 |
} |
|
104 |
} |
|
105 |
|
|
106 |
|
|
107 |
var $ischecked = false; |
|
108 |
/* check toggler on pageload */ |
|
109 |
if($ischecked == false) { |
|
110 |
if(!$('#pages_view').attr('checked')){ |
|
111 |
toggleBox($(this), "#JQPageView"); |
|
112 |
} |
|
113 |
if(!$('#media_view').attr('checked')){ |
|
114 |
toggleBox($(this), "#JQMediaView"); |
|
115 |
} |
|
116 |
if(!$('#modules_view').attr('checked')){ |
|
117 |
toggleBox($(this), "#JQModulesView"); |
|
118 |
} |
|
119 |
if(!$('#templates_view').attr('checked')){ |
|
120 |
toggleBox($(this), "#JQTemplateView"); |
|
121 |
} |
|
122 |
if(!$('#languages_view').attr('checked')){ |
|
123 |
toggleBox($(this), "#JQLanguagesView"); |
|
124 |
} |
|
125 |
if(!$('#settings_view').attr('checked')){ |
|
126 |
toggleBox($(this), "#JQSettingsView"); |
|
127 |
} |
|
128 |
if(!$('#admintools_view').attr('checked')){ |
|
129 |
toggleBox($(this), "#JQAToolsView"); |
|
130 |
} |
|
131 |
if(!$('#users_view').attr('checked')){ |
|
132 |
toggleBox($(this), "#JQUsersView"); |
|
133 |
} |
|
134 |
if(!$('#groups_view').attr('checked')){ |
|
135 |
toggleBox($(this), "#JQGroupsView"); |
|
136 |
} |
|
137 |
var $ischecked = true; |
|
138 |
} |
|
139 |
|
|
140 |
|
|
141 |
$('#pages_view').click(function(){ |
|
142 |
toggleBox($(this), "#JQPageView"); |
|
143 |
}); |
|
144 |
$('#media_view').click(function(){ |
|
145 |
toggleBox($(this), "#JQMediaView"); |
|
146 |
}); |
|
147 |
$('#modules_view').click(function(){ |
|
148 |
toggleBox($(this), "#JQModulesView"); |
|
149 |
}); |
|
150 |
$('#templates_view').click(function(){ |
|
151 |
toggleBox($(this), "#JQTemplateView"); |
|
152 |
}); |
|
153 |
$('#languages_view').click(function(){ |
|
154 |
toggleBox($(this), "#JQLanguagesView"); |
|
155 |
}); |
|
156 |
$('#settings_view').click(function(){ |
|
157 |
toggleBox($(this), "#JQSettingsView"); |
|
158 |
}); |
|
159 |
$('#admintools_view').click(function(){ |
|
160 |
toggleBox($(this), "#JQAToolsView"); |
|
161 |
}); |
|
162 |
$('#users_view').click(function(){ |
|
163 |
toggleBox($(this), "#JQUsersView"); |
|
164 |
}); |
|
165 |
$('#groups_view').click(function(){ |
|
166 |
toggleBox($(this), "#JQGroupsView"); |
|
167 |
}); |
|
168 |
$('#preferences_view').click(function(){ |
|
169 |
toggleBox($(this), "#JQUSettingsView"); |
|
170 |
}); |
|
171 |
} |
|
172 |
|
|
173 |
|
|
174 |
}); |
|
48 | 175 |
}); |
Also available in: Unified diff
modified layout of admin/groups for better usability