1window.UcozApp = {} 2 3/** 4 * Replace all defined symbol in inner HTML of element 5 * 6 *@param {string} el .ClassName or #id of element (use identificator) 7 *@param {object} symbols where key - the symbol that you want to replace 8 * value - the symbol which should be replaced 9 */ 10 window.UcozApp.replaceSymbol = function(el, symbols) { 11 12 var arr = document.querySelectorAll(el); 13 if(arr.length){ 14 for(var i = 0; i < arr.length; i++ ){ 15 for (var param in symbols){ 16 arr[i].innerHTML = arr[i].innerHTML.replace(param, symbols[param]); 17 } 18 } 19 } 20 } 21 22window.UcozApp.comments = function() { 23 var i; 24 var comment = document.querySelectorAll('.e-comments'); 25 for(i = 0; i < comment.length; i++){ 26 var numberOfComments = comment[i].innerText.match(/\d+/g); 27 comment[i].innerText = numberOfComments; 28 } 29} 30 31/** 32 * Add after all defined input[type="checkbox | radio"] <span> with class 'customCheckbox | customRadio' 33 * Hide all defined input[type="checkbox | radio"] 34 * Copy all event to original input 35 */ 36window.UcozApp.CustomRadio = (function() { 37 38 "use strict"; 39 40 var customRadio = {}; 41 42 function insertAfter(newNode, referenceNode) { 43 referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 44 } 45 46 customRadio.init = function(){ 47 48 49 var inputCollection = document.querySelectorAll('input[type="checkbox"], input[type="radio"]'); 50 51 for(var i = 0; i < inputCollection.length; i++){ 52 if(inputCollection[i].offsetParent !== null && !inputCollection[i].getAttribute('data-parent')){ 53 var customInput = document.createElement('span'); 54 if (inputCollection[i].nextSibling && (inputCollection[i].nextSibling.className == "customRadio" || inputCollection[i].nextSibling.className == "customCheckbox")) { 55 inputCollection[i].parentNode.removeChild(inputCollection[i].nextSibling) 56 } 57 customInput.className = inputCollection[i].type == 'radio' ? 'customRadio' : 'customCheckbox'; 58 59 insertAfter(customInput,inputCollection[i]); 60 61 customInput.addEventListener('click', function (event) { 62 event.preventDefault(); 63 this.previousSibling.click(); 64 }); 65 66 inputCollection[i].style.display = 'none'; 67 } 68 } 69 } 70 return customRadio; 71})(); 72 73UcozApp.CustomRadio.init(); 74UcozApp.comments(); 75 76UcozApp.replaceSymbol('.pollLnk',{'[':'',']':'','·':'/'}); 77UcozApp.replaceSymbol('.catsTd',{'[':'(',']':')'}); 78UcozApp.replaceSymbol('.cDate',{'(':'', ')':''}); 79UcozApp.replaceSymbol('.uc-opacity',{'â¢':''}); 80 81(function ($) { 82 $.fn.uNavMenu = function () { 83 function init() { 84 if(!$('.navItemMore',this).length){ 85 $('.uMenuRoot',this).append('<li class="navItemMore"><div class="nav_menu_toggler"><span></span><span></span><span></span></div><ul id="overflow"></ul></li>'); 86 } 87 $('.uMenuRoot li.navItemMore',this).before($('#overflow > li',this)); 88 89 var $navItemMore = $('.navItemMore',this), 90 $navItems = $('.uMenuRoot > li:not(.navItemMore)',this), 91 navItemWidth = $navItemMore.width(), 92 windowWidth = $('[id^="uNMenuDiv"]',this).width(); 93 94 $navItems.each(function () { 95 navItemWidth += $(this).width(); 96 }); 97 98 navItemWidth > windowWidth ? $navItemMore.show() : $navItemMore.hide(); 99 100 while (navItemWidth > windowWidth && window.innerWidth > 960) { 101 navItemWidth -= $navItems.last().width(); 102 $navItems.last().prependTo('#overflow',this); 103 $navItems.splice(-1, 1); 104 } 105 106 $('.uMenuRoot',this).css({overflow: 'visible'}); 107 } 108 109 return init.apply(this); 110 }; 111})(jQuery); 112 113var umenu = function(){$('#catmenu').uNavMenu()}; 114 115$(function() { 116 window.onresize = umenu; 117 window.onload = umenu; 118 119 var parentLi = $('#catmenu li.uWithSubmenu'); 120 $('> a', parentLi).after('<i class="material-icons menu_tog">keyboard_arrow_down</i>'); 121 122 123 124 function changeMenuIcon() { 125 if (window.innerWidth < 961) { 126 $('#catmenu li.uWithSubmenu i').each(function() { 127 $(this).html() == 'keyboard_arrow_down' && $(this).html('add'); 128 }); 129 } else { 130 $('#catmenu li.uWithSubmenu i').html('keyboard_arrow_down'); 131 } 132 }; 133 134 changeMenuIcon(); 135 $(window).resize(function() { 136 changeMenuIcon(); 137 }); 138 139 $('> i', parentLi).click(function() { 140 if (window.innerWidth < 961) { 141 if ($(this).text() == 'add') { 142 $(this).parent().addClass('over'); 143 $(this).text('remove'); 144 } else { 145 $(this).parent().removeClass('over'); 146 $(this).text('add'); 147 } 148 } 149 }); 150 151 $('.nav-head .i_menu').on('click', function() { 152 $("#uNMenuDiv1").toggleClass('openMenu'); 153 }); 154 155 $( window ).on( "orientationchange", function( ) { 156 $("#uNMenuDiv1").removeClass('openMenu'); 157 }); 158 159 160 $(document).on('click', function (e) { 161 if ($(".uMenuRoot").has(e.target).length === 0 && $(e.target).attr('class') != 'material-icons i_menu') { 162 $("#uNMenuDiv1").removeClass('openMenu'); 163 } 164 165 if ($(".i_person").has(e.target).length === 0 && $("#user-box").has(e.target).length === 0 && $(e.target).attr('class') != 'material-icons i_person open') { 166 $('.i_person').removeClass('open'); 167 } 168 169 if ($(".i_search").has(e.target).length === 0 && $(".search-box").has(e.target).length === 0 && $(e.target).attr('class') != 'material-icons i_search open'){ 170 $('.i_search').removeClass('open'); 171 } 172 }); 173 174 175 176 $('.i_search,.i_person').click(function() { 177 $(this).toggleClass('open'); 178 }); 179 180 181 if ($('#cont-shop-invoices h1').length) { 182 183 $('#cont-shop-invoices h1 + table') 184 .addClass('status_table') 185 .after('<div class="fil_togg_wrapper"><div class="fil_togg_holder"><span class="material-icons">storage</span><span class="material-icons arrow">keyboard_arrow_down</span></div></div>') 186 .siblings('table, hr') 187 .addClass('filter_table'); 188 var buttonToIcon = { 189 '#invoice-form-export': 'file_download', 190 '#invoice-form-print': 'print', 191 '#invoice-form-send-el-goods': 'forward' 192 193 } 194 convertToIcon(buttonToIcon); 195 $(document).ajaxComplete(function() { 196 convertToIcon(buttonToIcon); 197 }); 198 199 $('.fil_togg_holder').on('click', function() { 200 var arrow = $(this).children('.arrow'); 201 $('.filter_table').fadeToggle(); 202 arrow.text(arrow.text() == 'keyboard_arrow_up' ? 'keyboard_arrow_down' : 'keyboard_arrow_up'); 203 }); 204 205 function convertToIcon(obj) { 206 for (var prop in obj) { 207 $(prop) 208 .attr('title', $(prop).val()) 209 .addClass('material-icons') 210 .val(obj[prop]); 211 } 212 } 213 } 214 215 $('.shop-spec-filter-wrapper').on('click','.spec-filter-title, .spec-subfilter-title',function(){ 216 UcozApp.CustomRadio.init(); 217 }); 218 $('#TstSbm, .pollreSultsBut').one('click', function() { 219 $(document).ajaxComplete(function() { 220 UcozApp.CustomRadio.init(); 221 }) 222 }); 223 224 $('[id^="gbut"],.sidebox a.noun,.ui-add-link,.opt_items, #pmGrLnk').on('click',UcozApp.CustomRadio.init); 225 226 227 if (typeof shopPageMore === "function") { 228 $(document).ajaxComplete(function() { 229 UcozApp.CustomRadio.init(); 230 }) 231 } 232 $('.sidebox ul.cat-tree').removeAttr('style').removeClass('cat-tree'); 233 var sdLi = $('.sidebox li:has(ul)').addClass('parent-li'); 234 $(sdLi).each(function() { 235 $(this).prepend('<em>+</em>'); 236 }); 237 $('> em', sdLi).click(function() { 238 if ($(this).text() == '+') { 239 $(this).parent().addClass('over'); 240 $(this).text('-'); 241 } else { 242 $(this).parent().removeClass('over'); 243 $(this).text('+'); 244 } 245 }); 246 $('.uTable').wrap('<div class="x-scroll"></div>'); 247 248}); 249 250WebFontConfig = { 251 google: { 252 families: ['Roboto:300,400,500,600,700&subset=cyrillic,cyrillic-ext'] 253 }, 254 active: umenu 255}; 256
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.