1 |
1 |
function include_file(filename, filetype) {
|
2 |
|
|
3 |
|
if(!filetype)
|
4 |
|
var filetype = 'js'; //js default filetype
|
5 |
|
|
6 |
|
var th = document.getElementsByTagName('head')[0];
|
7 |
|
var s = document.createElement((filetype == "js") ? 'script' : 'link');
|
8 |
|
|
9 |
|
s.setAttribute('type',(filetype == "js") ? 'text/javascript' : 'text/css');
|
10 |
|
|
11 |
|
if (filetype == "css")
|
12 |
|
s.setAttribute('rel','stylesheet');
|
13 |
|
|
14 |
|
s.setAttribute((filetype == "js") ? 'src' : 'href', filename);
|
15 |
|
th.appendChild(s);
|
16 |
|
|
|
2 |
if(!filetype){var filetype="js"}var th=document.getElementsByTagName("head")[0];var s=document.createElement((filetype=="js")?"script":"link");s.setAttribute("type",(filetype=="js")?"text/javascript":"text/css");if(filetype=="css"){s.setAttribute("rel","stylesheet")}s.setAttribute((filetype=="js")?"src":"href",filename);th.appendChild(s);
|
17 |
3 |
}
|
18 |
4 |
|
19 |
5 |
function redirect_to_page (url, timer) {
|
... | ... | |
22 |
8 |
|
23 |
9 |
$(document).ready(function()
|
24 |
10 |
{
|
|
11 |
if($(".jcalendar").length){$.insert(WB_URL+"/include/jscalendar/calendar-system.css")};
|
|
12 |
if($(".jsadmin").length){$.insert(WB_URL+"/modules/jsadmin/backend.css")};
|
25 |
13 |
|
26 |
|
if($(".jcalendar").length) {
|
27 |
|
$.insert(WB_URL+"/include/jscalendar/calendar-system.css");
|
28 |
|
}
|
|
14 |
//Add external link class to external links
|
|
15 |
$('a[href^="http://"]').filter(function(){return this.hostname&&this.hostname!==location.hostname}).addClass("external").attr("target","_blank");
|
|
16 |
// Add internal link class to external links
|
|
17 |
$('a[href^="http://"]').filter(function(){return this.hostname&&this.hostname==location.hostname}).addClass("internal");
|
29 |
18 |
|
30 |
|
if($(".jsadmin").length) {
|
31 |
|
$.insert(WB_URL+"/modules/jsadmin/backend.css");
|
32 |
|
}
|
33 |
|
|
34 |
|
//Add external link class to external links -
|
35 |
|
$('a[href^="http://"]').filter(function() {
|
36 |
|
//Compare the anchor tag's host name with location's host name
|
37 |
|
return this.hostname && this.hostname !== location.hostname;
|
38 |
|
}).addClass("external").attr("target", "_blank");
|
39 |
|
|
40 |
|
/* Add internal link class to external links - */
|
41 |
|
$('a[href^="http://"]').filter(function() {
|
42 |
|
//Compare the anchor tag's host name with location's host name
|
43 |
|
return this.hostname && this.hostname == location.hostname;
|
44 |
|
}).addClass("internal");
|
45 |
|
|
46 |
19 |
$('form').attr('autocomplete', 'off');
|
47 |
|
function include_file(filename, filetype) {
|
48 |
20 |
|
49 |
|
if(!filetype)
|
50 |
|
var filetype = 'js'; //js default filetype
|
|
21 |
function include_file(filename, filetype)
|
|
22 |
{
|
|
23 |
if(!filetype){var filetype="js"}var th=document.getElementsByTagName("head")[0];var s=document.createElement((filetype=="js")?"script":"link");s.setAttribute("type",(filetype=="js")?"text/javascript":"text/css");if(filetype=="css"){s.setAttribute("rel","stylesheet")}s.setAttribute((filetype=="js")?"src":"href",filename);th.appendChild(s);
|
|
24 |
}
|
51 |
25 |
|
52 |
|
var th = document.getElementsByTagName('head')[0];
|
53 |
|
var s = document.createElement((filetype == "js") ? 'script' : 'link');
|
|
26 |
function redirect_to_page (url, timer) {
|
|
27 |
setTimeout('self.location.href="'+url+'"', timer);
|
|
28 |
}
|
54 |
29 |
|
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 */
|
|
30 |
/* toggler for group permissions */
|
95 |
31 |
if($('form[name="group"]').length) {
|
96 |
32 |
|
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 |
|
}
|
|
33 |
function toggleBox(checkbox, toggleID)
|
|
34 |
{
|
|
35 |
var $checkbox = checkbox;
|
|
36 |
if( $checkbox.attr('checked'))
|
|
37 |
{
|
|
38 |
$(toggleID).removeClass("hide");
|
|
39 |
return true;
|
|
40 |
} else {
|
|
41 |
$(toggleID).addClass("hide");
|
|
42 |
return false;
|
|
43 |
}
|
|
44 |
}
|
105 |
45 |
|
|
46 |
function proveCheckbox(checkbox)
|
|
47 |
{
|
|
48 |
if($(checkbox).attr('checked'))
|
|
49 |
{
|
|
50 |
$(checkbox).prop('checked', false);
|
|
51 |
} else {
|
|
52 |
$(checkbox).prop('checked', true);
|
|
53 |
}
|
|
54 |
}
|
106 |
55 |
|
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 |
|
}
|
|
56 |
var $ischecked = false;
|
|
57 |
/* check toggler on pageload */
|
|
58 |
if($ischecked == false) {
|
|
59 |
if(!$('#pages_view').attr('checked')){
|
|
60 |
toggleBox($(this), "#JQPageView");
|
|
61 |
}s
|
|
62 |
if(!$('#media_view').attr('checked')){
|
|
63 |
toggleBox($(this), "#JQMediaView");
|
|
64 |
}
|
|
65 |
if(!$('#modules_view').attr('checked')){
|
|
66 |
toggleBox($(this), "#JQModulesView");
|
|
67 |
}
|
|
68 |
if(!$('#templates_view').attr('checked')){
|
|
69 |
toggleBox($(this), "#JQTemplateView");
|
|
70 |
}
|
|
71 |
if(!$('#languages_view').attr('checked')){
|
|
72 |
toggleBox($(this), "#JQLanguagesView");
|
|
73 |
}
|
|
74 |
if(!$('#settings_view').attr('checked')){
|
|
75 |
toggleBox($(this), "#JQSettingsView");
|
|
76 |
}
|
|
77 |
if(!$('#admintools_view').attr('checked')){
|
|
78 |
toggleBox($(this), "#JQAToolsView");
|
|
79 |
}
|
|
80 |
if(!$('#users_view').attr('checked')){
|
|
81 |
toggleBox($(this), "#JQUsersView");
|
|
82 |
}
|
|
83 |
if(!$('#groups_view').attr('checked')){
|
|
84 |
toggleBox($(this), "#JQGroupsView");
|
|
85 |
}
|
|
86 |
var $ischecked = true;
|
|
87 |
}
|
139 |
88 |
|
140 |
89 |
|
141 |
90 |
$('#pages_view').click(function(){
|
142 |
|
toggleBox($(this), "#JQPageView");
|
|
91 |
if(toggleBox($(this),"#JQPageView")){proveCheckbox("#pages_view_detail")}else{proveCheckbox("#pages_view_detail");proveCheckbox("#pages_add_l0");proveCheckbox("#pages_add");proveCheckbox("#pages_settings");proveCheckbox("#pages_modify");proveCheckbox("#pages_intro");proveCheckbox("#pages_delete")};
|
143 |
92 |
});
|
144 |
93 |
$('#media_view').click(function(){
|
145 |
|
toggleBox($(this), "#JQMediaView");
|
|
94 |
if(toggleBox($(this),"#JQMediaView")){proveCheckbox("#media_view_detail")}else{proveCheckbox("#media_view_detail");proveCheckbox("#media_upload");proveCheckbox("#media_rename");proveCheckbox("#media_delete");proveCheckbox("#media_create")};
|
146 |
95 |
});
|
147 |
96 |
$('#modules_view').click(function(){
|
148 |
|
toggleBox($(this), "#JQModulesView");
|
|
97 |
if(toggleBox($(this),"#JQModulesView")){proveCheckbox("#modules_view_detail")}else{proveCheckbox("#modules_view_detail");proveCheckbox("#modules_install");proveCheckbox("#modules_uninstall");proveCheckbox("#modules_advanced")};
|
149 |
98 |
});
|
150 |
99 |
$('#templates_view').click(function(){
|
151 |
|
toggleBox($(this), "#JQTemplateView");
|
|
100 |
if(toggleBox($(this),"#JQTemplateView")){proveCheckbox("#templates_view_detail")}else{proveCheckbox("#templates_view_detail");proveCheckbox("#templates_install");proveCheckbox("#templates_uninstall")};
|
152 |
101 |
});
|
153 |
102 |
$('#languages_view').click(function(){
|
154 |
|
toggleBox($(this), "#JQLanguagesView");
|
|
103 |
if(toggleBox($(this),"#JQLanguagesView")){proveCheckbox("#languages_view_detail")}else{proveCheckbox("#languages_view_detail");proveCheckbox("#languages_install");proveCheckbox("#languages_uninstall")};
|
155 |
104 |
});
|
156 |
105 |
$('#settings_view').click(function(){
|
157 |
|
toggleBox($(this), "#JQSettingsView");
|
|
106 |
if(toggleBox($(this),"#JQSettingsView")){proveCheckbox("#settings_view_detail")}else{proveCheckbox("#settings_view_detail");proveCheckbox("#settings_advanced")};
|
158 |
107 |
});
|
159 |
108 |
$('#admintools_view').click(function(){
|
160 |
|
toggleBox($(this), "#JQAToolsView");
|
|
109 |
if(toggleBox($(this),"#JQAToolsView")){proveCheckbox("#admintools_view_detail")}else{proveCheckbox("#admintools_view_detail")};
|
161 |
110 |
});
|
162 |
111 |
$('#users_view').click(function(){
|
163 |
|
toggleBox($(this), "#JQUsersView");
|
|
112 |
if(toggleBox($(this),"#JQUsersView")){proveCheckbox("#users_view_detail")}else{proveCheckbox("#users_view_detail");proveCheckbox("#users_add");proveCheckbox("#users_modify");proveCheckbox("#users_delete")};
|
164 |
113 |
});
|
165 |
114 |
$('#groups_view').click(function(){
|
166 |
|
toggleBox($(this), "#JQGroupsView");
|
|
115 |
if(toggleBox($(this),"#JQGroupsView")){proveCheckbox("#groups_view_detail")}else{proveCheckbox("#groups_view_detail");proveCheckbox("#groups_add");proveCheckbox("#groups_modify");proveCheckbox("#groups_delete")};
|
167 |
116 |
});
|
168 |
117 |
$('#preferences_view').click(function(){
|
169 |
|
toggleBox($(this), "#JQUSettingsView");
|
|
118 |
if(toggleBox($(this),"#JQUSettingsView")){proveCheckbox("#preferences_view_detail")}else{proveCheckbox("#preferences_view_detail")};
|
170 |
119 |
});
|
171 |
|
}
|
172 |
|
|
173 |
|
|
174 |
|
});
|
|
120 |
}
|
175 |
121 |
});
|
/wb_theme/jquery/jquery-plugins.js fixed uncheck function