1 |
85ad3d82
|
Assos Assos
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
(function ($) {
|
6 |
|
|
|
7 |
|
|
Drupal.Views = {};
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
Drupal.behaviors.viewsTabs = {
|
13 |
|
|
attach: function (context) {
|
14 |
|
|
if ($.viewsUi && $.viewsUi.tabs) {
|
15 |
|
|
$('#views-tabset').once('views-processed').viewsTabs({
|
16 |
|
|
selectedClass: 'active'
|
17 |
|
|
});
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
$('a.views-remove-link').once('views-processed').click(function(event) {
|
21 |
|
|
var id = $(this).attr('id').replace('views-remove-link-', '');
|
22 |
|
|
$('#views-row-' + id).hide();
|
23 |
|
|
$('#views-removed-' + id).attr('checked', true);
|
24 |
|
|
event.preventDefault();
|
25 |
|
|
});
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
$('a.display-remove-link')
|
31 |
|
|
.addClass('display-processed')
|
32 |
|
|
.click(function() {
|
33 |
|
|
var id = $(this).attr('id').replace('display-remove-link-', '');
|
34 |
|
|
$('#display-row-' + id).hide();
|
35 |
|
|
$('#display-removed-' + id).attr('checked', true);
|
36 |
|
|
return false;
|
37 |
|
|
});
|
38 |
|
|
}
|
39 |
|
|
};
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
Drupal.Views.parseQueryString = function (query) {
|
45 |
|
|
var args = {};
|
46 |
|
|
var pos = query.indexOf('?');
|
47 |
|
|
if (pos != -1) {
|
48 |
|
|
query = query.substring(pos + 1);
|
49 |
|
|
}
|
50 |
|
|
var pairs = query.split('&');
|
51 |
|
|
for(var i in pairs) {
|
52 |
|
|
if (typeof(pairs[i]) == 'string') {
|
53 |
|
|
var pair = pairs[i].split('=');
|
54 |
|
|
|
55 |
|
|
if (pair[0] != 'q' && pair[1]) {
|
56 |
|
|
args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
|
57 |
|
|
}
|
58 |
|
|
}
|
59 |
|
|
}
|
60 |
|
|
return args;
|
61 |
|
|
};
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
Drupal.Views.parseViewArgs = function (href, viewPath) {
|
67 |
|
|
var returnObj = {};
|
68 |
|
|
var path = Drupal.Views.getPath(href);
|
69 |
|
|
|
70 |
|
|
if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') {
|
71 |
|
|
var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length));
|
72 |
|
|
returnObj.view_args = args;
|
73 |
|
|
returnObj.view_path = path;
|
74 |
|
|
}
|
75 |
|
|
return returnObj;
|
76 |
|
|
};
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
Drupal.Views.pathPortion = function (href) {
|
82 |
|
|
|
83 |
|
|
var protocol = window.location.protocol;
|
84 |
|
|
if (href.substring(0, protocol.length) == protocol) {
|
85 |
|
|
|
86 |
|
|
href = href.substring(href.indexOf('/', protocol.length + 2));
|
87 |
|
|
}
|
88 |
|
|
return href;
|
89 |
|
|
};
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
Drupal.Views.getPath = function (href) {
|
95 |
|
|
href = Drupal.Views.pathPortion(href);
|
96 |
|
|
href = href.substring(Drupal.settings.basePath.length, href.length);
|
97 |
|
|
|
98 |
|
|
if (href.substring(0, 3) == '?q=') {
|
99 |
|
|
href = href.substring(3, href.length);
|
100 |
|
|
}
|
101 |
|
|
var chars = ['#', '?', '&'];
|
102 |
|
|
for (i in chars) {
|
103 |
|
|
if (href.indexOf(chars[i]) > -1) {
|
104 |
|
|
href = href.substr(0, href.indexOf(chars[i]));
|
105 |
|
|
}
|
106 |
|
|
}
|
107 |
|
|
return href;
|
108 |
|
|
};
|
109 |
|
|
|
110 |
|
|
})(jQuery); |