1/* 2//////////////////////////////////////////////////////////////// 3// 4// JavaScript Funktionen für Listen 5// 6// Weblication CMS BASE 7// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 8// erstellt mit Weblication Content Management Server, www.weblication.de 9// 10//////////////////////////////////////////////////////////////// 11*/ 12 13wAllowMinimize = true; 14wLoadingStack = {}; 15 16//////////////////////////////////////////////////////////////// 17// 18// @method void appendEntriesToList(id, options) 19// 20// @desc Fügt neue Listenelemente zur Liste hinzu 21// 22// @return void 23// 24//////////////////////////////////////////////////////////////// 25 26appendEntriesToList = function(listId, options){ 27 28 if(wUiTmp['doNotAppendList'] == true){ 29 return false; 30 } 31 32 if(typeof(wEditor) != 'undefined'){ 33 return; 34 } 35 36 if(typeof(options) == 'undefined' || !options['querystring']){ 37 options['querystring'] = (location.search.substr(1) != '' ? '&' : '') + location.search.substr(1); 38 } 39 40 var url = '/weblication/grid5/scripts/wList.php?action=createListAjaxOfData&listId=' + listId + '&project=' + options['project'] + '&data=' + options['ajaxId'] + options['querystring']; 41 url = wSetParameter(url, 'pageId', options['pageId']); 42 43 if(typeof(wLoadingStack[url]) != 'undefined'){ 44 return; 45 } 46 wLoadingStack[url] = null; 47 48 var prefixId = '#list_'; 49 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 50 if(jQuery(prefixId + listId).length == 0){ 51 prefixId = prefixId.replace('#', '#embed_'); 52 } 53 } 54 55 var hasQuickfilter = false; 56 57 if(jQuery(prefixId + listId).length){ 58 if(jQuery('html').hasClass('appendLoading')){ 59 //return false; 60 } 61 jQuery('html').addClass('appendLoading'); 62 jQuery(prefixId + listId).addClass('appendLoading'); 63 jQuery(prefixId + listId).find('> ul').addClass('appendLoading'); 64 hasQuickfilter = jQuery(prefixId + listId).find('> ul').data('quickfilter') == '1'; 65 66 lastAdaptedQuickfilterBy = jQuery(prefixId + listId).find('> ul').data('lastadaptedquickfilterby'); 67 } 68 69 jQuery.ajax({type: "GET", url: url, dataType: 'html', success: function(resultHTML){ 70 71 if(jQuery(prefixId + listId).length){ 72 jQuery('html').removeClass('appendLoading'); 73 jQuery(prefixId + listId).removeClass('appendLoading').addClass('appendLoaded'); 74 jQuery(prefixId + listId).find('> ul').removeClass('appendLoading').addClass('appendLoaded'); 75 } 76 77 var parsedHTML = jQuery(resultHTML); 78 var listElement = jQuery(prefixId + listId); 79 80 var listEntriesContainerO = listElement.find('> ul'); 81 82 if(listEntriesContainerO.length == 0){ 83 listEntriesContainerO = listElement.find(".listEntries .listEntriesInner > div"); 84 } 85 86 var listEntriesO = parsedHTML.find("li"); 87 88 if(listEntriesO.length == 0){ 89 listEntriesO = parsedHTML.find(".listEntries .listEntry"); 90 } 91 92 listEntriesO.each(function(index){ 93 94 var entryToAppend = jQuery(this); 95 96 listEntriesContainerO.append(entryToAppend); 97 entryToAppend.addClass('append').addClass('appendInit').addClass('appendInitDelay'); 98 window.setTimeout(function(){ 99 entryToAppend.removeClass('appendInit'); 100 }, 10); 101 window.setTimeout(function(){ 102 entryToAppend.removeClass('appendInitDelay'); 103 }, 10 + 100 * index); 104 105 }); 106 107 var newListLoaderMore = parsedHTML.filter(".listLoaderMore"); 108 109 if(listElement.find(".listLoaderMore").length > 0 && !listElement.attr('data-listLoaderMoreInit')){ 110 listElement.attr('data-listLoaderMoreInit', listElement.find(".listLoaderMore").get(0).outerHTML); 111 } 112 113 if(newListLoaderMore.length > 0){ 114 listElement.find(".listLoaderMore").replaceWith(newListLoaderMore); 115 } 116 else{ 117 listElement.find(".listLoaderMore").remove(); 118 } 119 120 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 121 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 122 jQuery(lastAdaptedQuickfilterBy).removeClass("selected") 123 jQuery(lastAdaptedQuickfilterBy).trigger('click'); 124 } 125 } 126 127 wPrepareHTML(jQuery(prefixId + listId)); 128 window.setTimeout(function(){ 129 jQuery(window).trigger('resize'); 130 }, 100); 131 window.setTimeout(function(){ 132 jQuery(window).trigger('resize'); 133 }, 500); 134 window.setTimeout(function(){ 135 jQuery(window).trigger('resize'); 136 }, 1000); 137 138 var pageIdExtension = typeof(options['pageIdExtension']) !== 'undefined' ? options['pageIdExtension'] : listId; 139 var regExpCurrentLoadId = new RegExp('&?moreId' + pageIdExtension + '=\\d+'); 140 var newLocationSearch = location.search.replace(regExpCurrentLoadId, ''); 141 142 newLocationSearch += (newLocationSearch.indexOf('?') == -1 ? '?' : '&') + 'moreId' + pageIdExtension + '=' + options['pageId']; 143 newLocationSearch = newLocationSearch.replace('?&', '?'); 144 history.pushState({page: location.pathname + newLocationSearch + location.hash}, '', location.pathname + newLocationSearch + location.hash); 145 146 jQuery(prefixId + listId).find('.wglAccordion').wAccordion(); 147 148 if(typeof(wOnAfterAppendEntriesToList) == 'function'){ 149 wOnAfterAppendEntriesToList(listId, options); 150 } 151 }}); 152}; 153 154//////////////////////////////////////////////////////////////// 155// 156// @method void removeAppendEntriesFromList(listId) 157// 158// @desc Löscht hinzugefügte Listenelemente 159// 160// @return void 161// 162//////////////////////////////////////////////////////////////// 163 164removeAppendEntriesFromList = function(listId){ 165 166 if(jQuery('#list_' + listId).length){ 167 168 var listElement = jQuery('#list_' + listId); 169 170 jQuery('#list_' + listId + ' li.append').each(function(index){ 171 172 var entryToRemove = jQuery(this); 173 174 entryToRemove.addClass('remove').addClass('removeInit'); 175 window.setTimeout(function(){ 176 entryToRemove.removeClass('removeInit'); 177 }, 10); 178 window.setTimeout(function(){ 179 entryToRemove.remove(); 180 }, 10 + 100 * index); 181 }); 182 183 window.setTimeout(function(){ 184 jQuery(window).trigger('resize'); 185 }, 100); 186 187 listElement.append(listElement.attr('data-listLoaderMoreInit')); 188 189 jQuery('#list_' + listId).find('.listLoaderMoreReset').remove(); 190 191 var regExpCurrentLoadId = new RegExp('&?moreId' + listId + '=\\d+'); 192 var newLocationSearch = location.search.replace(regExpCurrentLoadId, ''); 193 newLocationSearch = newLocationSearch.replace('?&', '?').replace(/\?$/, ''); 194 history.pushState({page: location.pathname + newLocationSearch + location.hash}, '', location.pathname + newLocationSearch + location.hash); 195 } 196}; 197 198//////////////////////////////////////////////////////////////// 199//
200// @method void filterCategory(category, categoryName) 201// 202// @desc Ruft die Seite mit einem Kategorienfilter auf 203// 204// @return void 205// 206//////////////////////////////////////////////////////////////// 207 208filterCategory = function(category, categoryName){ 209 210 var regExpReplace = new RegExp(categoryName + '(\\[\\])?=\\w+'); 211 location.href = location.pathname + (location.search.replace(regExpReplace, '') + (location.search.indexOf('?') == -1 ? '?' : '&') + categoryName + '[]=' + category).replace(/\&+/, '&').replace(/\?\&/, '?') + location.hash; 212}; 213 214//////////////////////////////////////////////////////////////// 215// 216// @method void reloadListAjax(listId, options) 217// 218// @desc Aktualisiert eine AJAX-Liste 219// 220// @return void 221// 222//////////////////////////////////////////////////////////////// 223 224reloadListAjax = function(listId){ 225 226 listId = listId.replace('list_', ''); 227 var ajaxIdP = jQuery('*[data-listid=' + listId + ']').data('ajaxid'); 228 if(ajaxIdP && ajaxIdP != ''){ 229 loadListAjax(listId, {ajaxId : ajaxIdP, project : wProjectPath}); 230 } 231}; 232 233//////////////////////////////////////////////////////////////// 234// 235// @method void loadListAjax(listId, options) 236// 237// @desc Lädt eine AJAX-Liste 238// 239// @return void 240// 241//////////////////////////////////////////////////////////////// 242 243loadListAjax = function(listId, options){ 244 245 if(typeof(wEditor) != 'undefined'){ 246 return; 247 } 248 249 if(typeof(options) == 'undefined' || !options['querystring']){ 250 options['querystring'] = '&' + location.search.substr(1); 251 } 252 253 if(typeof options['pageId'] == 'undefined'){ 254 options['pageId'] = '1'; 255 } 256 257 var url = '/weblication/grid5/scripts/wList.php?action=createListAjaxOfData&listId=' + listId + '&project=' + options['project'] + '&data=' + options['ajaxId'] + (typeof options['pageId'] != 'undefined' ? '&pageId=' + options['pageId'] : '') + options['querystring']; 258 259 var prefixId = '#list_'; 260 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 261 if(jQuery(prefixId + listId).length == 0){ 262 prefixId = prefixId.replace('#', '#embed_'); 263 } 264 } 265 266 var hasQuickfilter = false; 267 268 if(jQuery(prefixId + listId).length){ 269 jQuery('html').addClass('adaptLoading'); 270 jQuery(prefixId + listId).addClass('adaptLoading'); 271 jQuery(prefixId + listId).find('> ul').addClass('adaptLoading'); 272 hasQuickfilter = jQuery(prefixId + listId).find('> ul').data('quickfilter') == '1'; 273 274 lastAdaptedQuickfilterBy = jQuery(prefixId + listId).find('> ul').data('lastadaptedquickfilterby'); 275 } 276 277 jQuery.ajax({type: "GET", url: url, dataType: 'html', success: function(resultHTML){ 278 279 if(jQuery(prefixId + listId).length){ 280 jQuery('html').removeClass('adaptLoading'); 281 jQuery(prefixId + listId).removeClass('adaptLoading').addClass('adaptLoaded'); 282 jQuery(prefixId + listId).find('> ul').removeClass('adaptLoading').addClass('adaptLoaded'); 283 } 284 285 var parsedHTML = jQuery(resultHTML); 286 var listOuter = jQuery('#list_' + listId); 287 var listElement = jQuery(prefixId + listId); 288 289 if(parsedHTML.attr('data-listresulttype') == 'jsonly'){ 290 291 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 292 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 293 jQuery(lastAdaptedQuickfilterBy).removeClass("selected") 294 jQuery(lastAdaptedQuickfilterBy).trigger('click'); 295 } 296 } 297 298 if(typeof(wOnAfterLoadListAjax) == 'function'){ 299 wOnAfterLoadListAjax(listId, options); 300 } 301 listElement.html(resultHTML); 302 } 303 else{ 304 305 var listEntriesContainerO = listElement.find('> ul'); 306 if(listEntriesContainerO.length == 0){ 307 listEntriesContainerO = listElement.find(".listEntries .listEntriesInner > div"); 308 } 309 310 var listEntriesO = parsedHTML.find("li"); 311 if(listEntriesO.length == 0){ 312 listEntriesO = parsedHTML.find(".listEntries .listEntry"); 313 } 314 315 listElement.find('*[data-removeonreloadlistbyajax="1"]').remove(); 316 317 if(listEntriesO.length == 0){ 318 listEntriesO = parsedHTML; 319 listEntriesContainerO.html(''); 320 listEntriesContainerO = listElement; 321 } 322 else{ 323 listEntriesContainerO.html(''); 324 } 325 326 listEntriesContainerO.attr('data-numbervisible', parsedHTML.attr('data-numbervisible') ? parsedHTML.attr('data-numbervisible') : 0); 327 328 listEntriesO.each(function(index){ 329 jQuery(this).attr('data-removeonreloadlistbyajax', '1'); 330 listEntriesContainerO.append(jQuery(this)); 331 wLoadingStack = {}; 332 }); 333
334 if(listOuter.find(".pageNaviList").length > 0){ 335 var pageNaviListHTML = ''; 336 parsedHTML.each(function(){ 337 if(jQuery(this).hasClass('pageNaviList')){ 338 pageNaviListHTML = jQuery(this).html(); 339 } 340 }); 341 listOuter.find(".pageNaviList").each(function(){ 342 jQuery(this).get(0).innerHTML = pageNaviListHTML; 343 }); 344 } 345 346 var newListLoaderMore = parsedHTML.filter(".listLoaderMore"); 347 348 if(listElement.find(".listLoaderMore").length > 0 && !listElement.attr('data-listLoaderMoreInit')){ 349 listElement.attr('data-listLoaderMoreInit', listElement.find(".listLoaderMore").get(0).outerHTML); 350 } 351 352 if(newListLoaderMore.length > 0){ 353 if(listElement.find(".listLoaderMore").length > 0){ 354 listElement.find(".listLoaderMore").replaceWith(newListLoaderMore); 355 } 356 else{ 357 listElement.append(newListLoaderMore); 358 } 359 } 360 else{ 361 listElement.find(".listLoaderMore").remove(); 362 } 363 364 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 365 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 366 jQuery(lastAdaptedQuickfilterBy).removeClass("selected") 367 jQuery(lastAdaptedQuickfilterBy).trigger('click'); 368 } 369 } 370 371 if(typeof(wOnAfterLoadListAjax) == 'function'){ 372 options['parsedHTML'] = parsedHTML; 373 wOnAfterLoadListAjax(listId, options); 374 } 375 376 jQuery(prefixId + listId).find('.wglAccordion').wAccordion(); 377 } 378 379 wPrepareHTML(jQuery(prefixId + listId)); 380 window.setTimeout(function(){ 381 jQuery(window).trigger('resize'); 382 }, 100); 383 window.setTimeout(function(){ 384 jQuery(window).trigger('resize'); 385 }, 500); 386 window.setTimeout(function(){ 387 jQuery(window).trigger('resize'); 388 }, 1000); 389 }}); 390};
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.