1 function tableOrdering( order, dir, task ) 2 { 3 var form = document.getElementById("adminForm"); 4 5 form.filter_order.value = order; 6 form.filter_order_Dir.value = dir; 7 8 var form = document.getElementById("adminForm"); 9 10 adminFormPrepare(form, 2, task); 11 } 12 13 function getSEFurl(loader_el, loader_html, form, url_to_load, autosubmit_msg, autosubmit) { 14 15 var dooptions = { 16 method: 'get', 17 evalScripts: false, 18 onSuccess: function(responseText) { 19 form.action=responseText; 20 var fcform = jQuery(form); 21 fcform.attr('data-fcform_action', responseText); 22 if (autosubmit) { 23 $(loader_el).innerHTML += autosubmit_msg; 24 adminFormPrepare(form, 2); 25 } else { 26 $(loader_el).innerHTML = ''; 27 } 28 } 29 }; 30 if(typeof options!="undefined") { 31 dooptions = options; 32 } 33 34 if (MooTools.version>='1.2.4') { 35 $(loader_el).set('html', loader_html); 36 new Request({ 37 url: url_to_load, 38 method: 'get', 39 evalScripts: false, 40 onSuccess: function(responseText) { 41 form.action=responseText; 42 var fcform = jQuery(form); 43 fcform.attr('data-fcform_action', responseText); 44 if (autosubmit) { 45 $(loader_el).innerHTML += autosubmit_msg; 46 adminFormPrepare(form, 2); 47 } else { 48 $(loader_el).innerHTML = ''; 49 } 50 } 51 }).send(); 52 } else { 53 $(loader_el).setHTML(loader_html); 54 var ajax = new Ajax(url_to_load, dooptions); 55 ajax.request.delay(300, ajax); 56 } 57 } 58 59 60 function adminFormPrepare(form, postprep, task) { 61 var extra_action = ''; 62 var fcform = jQuery(form); 63 64 var fcform_action = fcform.attr('data-fcform_action'); 65 if ( typeof fcform_action === "undefined" || fcform_action === null ) { 66 fcform_action = fcform.attr('action'); 67 fcform.attr('data-fcform_action', fcform_action); 68 } 69 70 var var_sep = fcform_action.match(/\?/) ? '&' : '?'; 71 72 for(i=0; i<form.elements.length; i++) { 73 74 var element = form.elements[i]; 75 if (typeof element.name === "undefined" || element.name === null || !element.name) continue; 76 77 // No need to add the default values for ordering, to the URL 78 if (element.name=='filter_order' && element.value=='i.title') continue; 79 if (element.name=='filter_order_Dir' && element.value=='ASC') continue; 80 81 var matches = element.name.match(/(filter[.]*|cids|letter|clayout|limit|orderby|searchword|searchphrase|areas|contenttypes|txtflds|ordering)/); 82 if (!matches || element.value == '') continue; 83 if ((element.type=='radio' || element.type=='checkbox') && !element.checked) continue; 84 85 if ( element.type=='select-multiple' ) { 86 for (var p=0; p < element.length; p++) { 87 if ( ! element.options[p].selected ) continue; 88 extra_action += var_sep + element.name.replace("[]","") + '[' + p + ']=' + element.options[p].value; 89 var_sep = '&'; 90 } 91 } else { 92 element_value = element.value; 93 if ( jQuery(element).hasClass('fc_iscalendar') ) { 94 var frmt = '%Y-%m-%d'; 95 var date = Date.parseDate(element.value || element.innerHTML, frmt); 96 if (postprep==2) element.value = date.print(frmt, true); 97 element_value = date.print(frmt, true); 98 } 99 extra_action += var_sep + element.name + '=' + element_value; 100 var_sep = '&'; 101 } 102 } 103 form.action = fcform_action + extra_action; //alert(form.action); 104 105 if (typeof postprep !== "undefined" && postprep !== null && postprep!=0) { 106 if (postprep==2) { 107 var fc_filter_form_blocker = jQuery("#fc_filter_form_blocker"); 108 form.submit( task ); 109 if (fc_filter_form_blocker) { 110 fc_filter_form_blocker.css("display", "block"); 111 fc_progress(95, jQuery('#fc_filter_form_blocker .fc_blocker_bar')); 112 } 113 } else if (postprep==1) { 114 var form_id = jQuery(form).attr('id'); 115 jQuery('#'+form_id+'_submitWarn').css("display", "inline-block"); 116 } 117 } 118 } 119 120 function adminFormClearFilters (form) { 121 for(i=0; i<form.elements.length; i++) { 122 var element = form.elements[i]; 123 124 if (element.name=='filter_order') { element.value=='i.title'; continue; } 125 if (element.name=='filter_order_Dir') { element.value=='ASC'; continue; } 126 127 var matches = element.name.match(/(filter[.]*|letter)/); 128 if (matches) { 129 element.value = ''; 130 } 131 } 132 } 133 134 function fc_toggleClass(ele, cls, fc_all) { 135 var inputs = ele.parentNode.parentNode.getElementsByTagName('input'); 136 var input_0 = jQuery(inputs[0]); 137 if (typeof fc_all === "undefined" || fc_all === null || !fc_all) 138 { 139 if ( jQuery(ele).attr('checked') ) { 140 jQuery(ele).next().addClass(cls); 141 jQuery(ele).parent().addClass('fc_checkradio_checked'); 142 } else { 143 jQuery(ele).next().removeClass(cls); 144 jQuery(ele).parent().removeClass('fc_checkradio_checked'); 145 } 146 // Handle disabling 'select all' checkbox (if it exists), not needed but to make sure ... 147 if (input_0.val()=='') { 148 input_0.prop('checked', false); 149 input_0.next().removeClass(cls); 150 input_0.parent().removeClass('fc_checkradio_checked'); 151 } 152 } 153 else 154 { 155 for (var i = 0; i < inputs.length; ++i) { 156 var input_i = jQuery(inputs[i]); 157 input_i.prop('checked', false); 158 input_i.next().removeClass(cls); 159 input_i.parent().removeClass('fc_checkradio_checked'); 160 } 161 // Handle highlighting (but not enabling) 'select all' checkbox 162 jQuery(ele).prop('checked', true); 163 jQuery(ele).next().addClass(cls); 164 jQuery(ele).parent().addClass('fc_checkradio_checked'); 165 } 166 //alert('done fc_toggleClass()'); 167 } 168 169 function fc_toggleClassGrp(ele, cls, fc_all) { 170 var inputs = ele.parentNode.parentNode.getElementsByTagName('input'); 171 var input_0 = jQuery(inputs[0]); 172 if (typeof fc_all === "undefined" || fc_all === null || !fc_all) 173 { 174 for (var i = 0; i < inputs.length; ++i) { 175 var input_i = jQuery(inputs[i]); 176 if ( input_i.attr('checked') ) { 177 input_i.next().addClass(cls); 178 input_i.parent().addClass('fc_checkradio_checked'); 179 } else { 180 input_i.next().removeClass(cls); 181 input_i.parent().removeClass('fc_checkradio_checked'); 182 } 183 } 184 } 185 else 186 { 187 for (var i = 0; i < inputs.length; ++i) { 188 var input_i = jQuery(inputs[i]); 189 input_i.next().removeClass(cls); 190 input_i.parent().removeClass('fc_checkradio_checked'); 191 } 192 // Handle highlighting (but not enabling) 'select all' radio button 193 jQuery(ele).next().addClass(cls); 194 jQuery(ele).parent().addClass('fc_checkradio_checked'); 195 } 196 //alert('done fc_toggleClassGrp()'); 197 } 198 199 200 function fc_progress(percent, element) { 201 var progressBarWidth = percent * element.width() / 100; 202 element.find('div').animate({ width: progressBarWidth }, 5000).html(""); 203 } 204 205 206 207jQuery(document).ready(function() { 208 209 // case-insensitive contains() 210 jQuery.expr[':'].contains_ci_fc = function(el,i,txt){ 211 return (el.textContent || el.innerText || "").toUpperCase().indexOf(txt[3].toUpperCase()) >= 0; 212 }; 213 214 // Add instant text type filter to lists 215 jQuery('span.fc_list_filter_wrapper').each(function() { 216 var list = jQuery(this).find('ul:first'); 217 // prepend text filter input to the list 218 var form = jQuery("<form>").attr({"class":"fc_instant_filter", "action":"#"}), 219 input = jQuery("<input>").attr({"class":"fc_field_filter fc_label_internal fc_instant_filter fc_autosubmit_exclude", "type":"text", "data-fc_label_text":Joomla.JText._('FLEXI_TYPE_TO_FILTER')}); 220 jQuery(form).append(input).insertBefore(this); 221 222 jQuery(input) 223 .change( function () { 224 var filter = jQuery(this).val(); 225 if(filter) { 226 jQuery(list).find("li:not(.fc_checkradio_checked):not(.fc_checkradio_special) label:not(:contains_ci_fc(" + filter + "))").parent().slideUp(); 227 jQuery(list).find("li:not(.fc_checkradio_checked):not(.fc_checkradio_special) label:contains_ci_fc(" + filter + ")").parent().slideDown(); 228 } else { 229 jQuery(list).find("li").slideDown(); 230 } 231 return false;
232 }) 233 .keyup( function () { 234 jQuery(this).change(); 235 }); 236 }); 237 238 239 // Initialize internal labels 240 jQuery('input.fc_label_internal').each(function() { 241 var el = jQuery(this); 242 var fc_label_text = el.attr('data-fc_label_text'); 243 if (!fc_label_text) fc_label_text = el.attr('fc_label_text'); 244 if (!fc_label_text) return; 245 var _label = (fc_label_text.length >= 27) ? fc_label_text.substring(0, 25) + '...' : fc_label_text; 246 247 el.before(jQuery('<span/>', { 248 'class': 'fc_has_inner_label fc_has_inner_label_input', 249 'text': _label 250 })); 251 if (el.val().length > 0) el.prev().hide(); 252 }); 253 254 255 jQuery('input.fc_label_internal').bind('focus', function() { 256 var el = jQuery(this); 257 var fc_label_text = el.attr('data-fc_label_text'); 258 if (!fc_label_text) fc_label_text = el.attr('fc_label_text'); 259 if (!fc_label_text) return; 260 el.prev().hide(); 261 el.css("opacity", "1"); 262 }).bind('change blur', function(event) { 263 var el = jQuery(this); 264 var fc_label_text = el.attr('data-fc_label_text'); 265 if (!fc_label_text) fc_label_text = el.attr('fc_label_text'); 266 if (!fc_label_text) return; 267 268 if (event.type=='blur') { 269 var previous_value = el.attr('data-previous_value'); 270 if ( typeof previous_value !== "undefined" && previous_value != el.val()) el.trigger('change'); 271 } 272 273 if ( el.val().length ) { 274 el.prev().hide(); 275 el.css("opacity", "1"); 276 } else { 277 el.prev().show(); 278 el.css("opacity", "0.5"); 279 } 280 }); 281 282 /* handle calender fields being changed by popup calendar, focus/blur is cross-browser compatible ... to detect input field being changed */ 283 /* up to J2.5 */ 284 jQuery('img.calendar').bind('click', function() { 285 var el = jQuery(this).prev(); 286 el.prev().hide(); 287 el.attr('data-previous_value', el.val()); 288 el.css("opacity", "1"); 289 el.focus(); 290 }); 291 /* up to J3.0+ */ 292 jQuery('button i.icon-calendar').parent().bind('click', function() { 293 var el = jQuery(this).prev(); 294 el.prev().hide(); 295 el.attr('data-previous_value', el.val()); 296 el.css("opacity", "1"); 297 el.focus(); 298 }); 299 if (typeof Calendar !== "undefined" && typeof Calendar.prototype.callCloseHandler === 'function') { 300 var oldFunc = Calendar.prototype.callCloseHandler; 301 Calendar.prototype.callCloseHandler = function() { 302 var oldFuncResult = oldFunc.apply(this, arguments); 303 document.activeElement.blur(); 304 return oldFuncResult; 305 } 306 } 307 308 var fc_select_pageSize = 10; 309 310 // add Simple text search autocomplete 311 if (typeof jQuery.fn.autocomplete==='function') { 312 jQuery( "input.fc_index_complete_simple" ).autocomplete({ 313 source: function( request, response ) { 314 el = jQuery(this.element); 315 jQuery.ajax({ 316 url: "index.php?option=com_flexicontent&tmpl=component", 317 dataType: "json", 318 data: { 319 type: (el.hasClass('fc_adv_complete') ? "adv_index" : "basic_index"), 320 task: "txtautocomplete", 321 pageSize: fc_select_pageSize, 322 text: request.term, 323 cid: parseInt(_FC_GET['cid']), 324 cids: _FC_GET['cids'], 325 filter_13: _FC_GET['filter_13'] 326 }, 327 success: function( data ) { 328 //console.log( '... done' ); 329 response( jQuery.map( data.Matches, function( item ) { 330 return { 331 /*label: item.item_id +': '+ item.text,*/ 332 label: item.text, 333 value: item.text 334 } 335 })); 336 } 337 }); 338 }, 339 delay: 200, 340 minLength: 1, 341 select: function( event, ui ) { 342 //console.log( ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value); 343 var ele = event.target; 344 jQuery(ele).trigger('change'); 345 }, 346 open: function() { 347 jQuery( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); 348 jQuery(this).removeClass('working'); 349 }, 350 close: function() { 351 jQuery( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); 352 }, 353 search: function() { 354 //console.log( 'quering ... ' ); 355 jQuery(this).addClass('working'); 356 } 357 }); 358 } 359 360 361 362 // add Tag-Like text search autocomplete 363 if(typeof jQuery('input.fc_index_complete_tlike').select2!=='undefined') { 364 jQuery('input.fc_index_complete_tlike').select2( 365 { 366 placeholder: Joomla.JText._('FLEXI_TYPE_TO_LIST'), 367 multiple: true, 368 minimumInputLength: 1, 369 separator: " ", 370 allowClear: true, 371
372 initSelection : function (element, callback) { 373 var data = []; 374 jQuery(element.val().split(" ")).each(function () { 375 data.push({id: this, text: this}); 376 }); 377 callback(data); 378 }, 379 380 ajax: { 381 quietMillis: 200, 382 url: "index.php?option=com_flexicontent&tmpl=component", 383 dataType: 'json', 384 //Our search term and what page we are on 385 data: function (term, page) { 386 return { 387 type: (jQuery(this).hasClass('fc_adv_complete') ? "adv_index" : "basic_index"), 388 task: "txtautocomplete", 389 text: term, 390 pageSize: fc_select_pageSize, 391 pageNum: page, 392 cid: parseInt(_FC_GET['cid']), 393 cids: _FC_GET['cids'], 394 filter_13: _FC_GET['filter_13'] 395 }; 396 }, 397 results: function (data, page) { 398 //Used to determine whether or not there are more results available, 399 //and if requests for more data should be sent in the infinite scrolling 400 var more = (page * fc_select_pageSize) < data.Total; 401 return { results: data.Matches, more: more }; 402 } 403 } 404 }); 405 } 406 407 jQuery('body').prepend( 408 "<span id='fc_filter_form_blocker'>" + 409 "<span class='fc_blocker_opacity'></span>" + 410 "<span class='fc_blocker_content'>" + 411 Joomla.JText._('FLEXI_APPLYING_FILTERING') + 412 "<div class='fc_blocker_bar'><div></div></div>" + 413 "</span>" + 414 "</span>"); 415 416 fc_recalculateWindow(); 417}); 418 419 420/* recalculate window width/height and widow scrollbars */ 421function fc_recalculateWindow() 422{ 423 // Set these to hidden to force scrollbar recalculation when we set to auto 424 document.documentElement.style.overflow = "hidden"; 425 document.body.style.overflow = "hidden"; 426 427 // make sure widht & height is automatic 428 document.documentElement.style.height = "auto"; 429 document.documentElement.style.width = "auto"; 430 document.body.style.height = "auto"; 431 document.body.style.width = "auto"; 432 433 //document.body.scroll = "no"; // old ie versions ?? 434 setTimeout(function() { 435 document.documentElement.style.overflow = "auto"; // firefox, chrome, ie11+ 436 //document.body.style.overflow = "auto"; 437 //document.body.scroll = "yes"; // old ie versions ?? 438 }, 100); 439 440 /* reset popup overlay containers ... TODO add more ? */ 441 jQuery('#OverlayContainer').css("height", jQuery('body').css('height')); 442}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.