|
@@ -185,15 +185,15 @@ function explode (delimiter, string, limit) {
|
185
|
185
|
// * returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}
|
186
|
186
|
// * example 2: explode('=', 'a=bc=d', 2);
|
187
|
187
|
// * returns 2: ['a', 'bc=d']
|
188
|
|
- var emptyArray = { 0: ''
|
|
188
|
+ var emptyArray = {0: ''
|
189
|
189
|
};
|
190
|
190
|
|
191
|
191
|
// third argument is not required
|
192
|
|
- if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') { return null;
|
|
192
|
+ if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') {return null;
|
193
|
193
|
}
|
194
|
194
|
|
195
|
195
|
if (delimiter === '' || delimiter === false || delimiter === null) {
|
196
|
|
- return false; }
|
|
196
|
+ return false;}
|
197
|
197
|
|
198
|
198
|
if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') {
|
199
|
199
|
return emptyArray;
|
|
@@ -205,7 +205,7 @@ function explode (delimiter, string, limit) {
|
205
|
205
|
return string.toString().split(delimiter.toString());
|
206
|
206
|
}
|
207
|
207
|
// support for limit argument
|
208
|
|
- var splitted = string.toString().split(delimiter.toString()); var partA = splitted.splice(0, limit - 1);
|
|
208
|
+ var splitted = string.toString().split(delimiter.toString());var partA = splitted.splice(0, limit - 1);
|
209
|
209
|
var partB = splitted.join(delimiter.toString());
|
210
|
210
|
partA.push(partB);
|
211
|
211
|
return partA;
|
|
@@ -242,12 +242,43 @@ $(document).ready(function(){
|
242
|
242
|
}
|
243
|
243
|
|
244
|
244
|
// Bouton de personalisation du filtre
|
245
|
|
- // pour le moment ce ne sotn que des redirection vers des actions
|
246
|
245
|
$('.tags_prompt input.clear, a.filter_clear_url').live("click", function(){
|
247
|
|
- $(location).attr('href', $('input.filter_clear_url').val());
|
|
246
|
+ $('img.elements_more_loader').show();
|
|
247
|
+ $('ul.elements').html('');
|
|
248
|
+ form = $(this).parent('div').parent('form');
|
|
249
|
+ remove_tags(form.attr('name'));
|
|
250
|
+ form.submit();
|
248
|
251
|
});
|
249
|
252
|
$('.tags_prompt input.mytags').live("click", function(){
|
250
|
|
- $(location).attr('href', $('input.filter_mytags_url').val());
|
|
253
|
+
|
|
254
|
+ $('img.elements_more_loader').show();
|
|
255
|
+ $('ul.elements').html('');
|
|
256
|
+
|
|
257
|
+ form = $(this).parent('div').parent('form');
|
|
258
|
+
|
|
259
|
+ $.getJSON(url_get_favorites_tags, function(response) {
|
|
260
|
+ if (response.status == 'mustbeconnected')
|
|
261
|
+ {
|
|
262
|
+ $(location).attr('href', url_index);
|
|
263
|
+ }
|
|
264
|
+
|
|
265
|
+ remove_tags(form.attr('name'));
|
|
266
|
+// if (tags.length)
|
|
267
|
+// {
|
|
268
|
+ inputTag = $("div#tags_prompt_"+form.attr('name')+" input.form-default-value-processed");
|
|
269
|
+ for (i in response.tags)
|
|
270
|
+ {
|
|
271
|
+ $('input#tags_selected_tag_'+form.attr('name')).val(i);
|
|
272
|
+ inputTag.val(response.tags[i]);
|
|
273
|
+
|
|
274
|
+ // Et on execute l'évènement selectTag de l'input
|
|
275
|
+ inputTag.trigger("selectTag");
|
|
276
|
+ }
|
|
277
|
+
|
|
278
|
+ form.submit();
|
|
279
|
+ //}
|
|
280
|
+
|
|
281
|
+ });
|
251
|
282
|
});
|
252
|
283
|
|
253
|
284
|
// Affichage un/des embed
|
|
@@ -659,7 +690,7 @@ $(document).ready(function(){
|
659
|
690
|
id = $(this).attr('href').substr(1,$(this).attr('href').length);
|
660
|
691
|
id = str_replace(name, '', id);
|
661
|
692
|
id = str_replace('#', '', id);
|
662
|
|
-
|
|
693
|
+
|
663
|
694
|
$('input#tags_selected_tag_'+form_name).val(id);
|
664
|
695
|
inputTag.val(name);
|
665
|
696
|
// Et on execute l'évènement selectTag de l'input
|