1(function($) { 2 'use strict'; 3 var sprintf = function(str) { 4 var args = arguments, 5 flag = !0, 6 i = 1; 7 str = str.replace(/%s/g, function() { 8 var arg = args[i++]; 9 if (typeof arg === 'undefined') { 10 flag = !1; 11 return '' 12 } 13 return arg 14 }); 15 return flag ? str : '' 16 }; 17 var ini=1; 18 var selects_curr, arr; 19 var removeDiacritics = function(str) { 20 var defaultDiacriticsRemovalMap = [{ 21 'base': 'A', 22 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g 23 }, { 24 'base': 'AA', 25 'letters': /[\uA732]/g 26 }, { 27 'base': 'AE', 28 'letters': /[\u00C6\u01FC\u01E2]/g 29 }, { 30 'base': 'AO', 31 'letters': /[\uA734]/g 32 }, { 33 'base': 'AU', 34 'letters': /[\uA736]/g 35 }, { 36 'base': 'AV', 37 'letters': /[\uA738\uA73A]/g 38 }, { 39 'base': 'AY', 40 'letters': /[\uA73C]/g 41 }, { 42 'base': 'B', 43 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g 44 }, { 45 'base': 'C', 46 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g 47 }, { 48 'base': 'D', 49 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g 50 }, { 51 'base': 'DZ', 52 'letters': /[\u01F1\u01C4]/g 53 }, { 54 'base': 'Dz', 55 'letters': /[\u01F2\u01C5]/g 56 }, { 57 'base': 'E', 58 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g 59 }, { 60 'base': 'F', 61 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g 62 }, { 63 'base': 'G', 64 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g 65 }, { 66 'base': 'H', 67 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g 68 }, { 69 'base': 'I', 70 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g 71 }, { 72 'base': 'J', 73 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g 74 }, { 75 'base': 'K', 76 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g 77 }, { 78 'base': 'L', 79 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g 80 }, { 81 'base': 'LJ', 82 'letters': /[\u01C7]/g 83 }, { 84 'base': 'Lj', 85 'letters': /[\u01C8]/g 86 }, { 87 'base': 'M', 88 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g 89 }, { 90 'base': 'N', 91 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g 92 }, { 93 'base': 'NJ', 94 'letters': /[\u01CA]/g 95 }, { 96 'base': 'Nj', 97 'letters': /[\u01CB]/g 98 }, { 99 'base': 'O', 100 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g 101 }, { 102 'base': 'OI', 103 'letters': /[\u01A2]/g 104 }, { 105 'base': 'OO', 106 'letters': /[\uA74E]/g 107 }, { 108 'base': 'OU', 109 'letters': /[\u0222]/g 110 }, { 111 'base': 'P', 112 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g 113 }, { 114 'base': 'Q', 115 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g 116 }, { 117 'base': 'R', 118 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g 119 }, { 120 'base': 'S',
121 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g 122 }, { 123 'base': 'T', 124 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g 125 }, { 126 'base': 'TZ', 127 'letters': /[\uA728]/g 128 }, { 129 'base': 'U', 130 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g 131 }, { 132 'base': 'V', 133 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g 134 }, { 135 'base': 'VY', 136 'letters': /[\uA760]/g 137 }, { 138 'base': 'W', 139 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g 140 }, { 141 'base': 'X', 142 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g 143 }, { 144 'base': 'Y', 145 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g 146 }, { 147 'base': 'Z', 148 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g 149 }, { 150 'base': 'a', 151 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g 152 }, { 153 'base': 'aa', 154 'letters': /[\uA733]/g 155 }, { 156 'base': 'ae', 157 'letters': /[\u00E6\u01FD\u01E3]/g 158 }, { 159 'base': 'ao', 160 'letters': /[\uA735]/g 161 }, { 162 'base': 'au', 163 'letters': /[\uA737]/g 164 }, { 165 'base': 'av', 166 'letters': /[\uA739\uA73B]/g 167 }, { 168 'base': 'ay', 169 'letters': /[\uA73D]/g 170 }, { 171 'base': 'b', 172 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g 173 }, { 174 'base': 'c', 175 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g 176 }, { 177 'base': 'd', 178 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g 179 }, { 180 'base': 'dz', 181 'letters': /[\u01F3\u01C6]/g 182 }, { 183 'base': 'e', 184 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g 185 }, { 186 'base': 'f', 187 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g 188 }, { 189 'base': 'g', 190 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g 191 }, { 192 'base': 'h', 193 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g 194 }, { 195 'base': 'hv', 196 'letters': /[\u0195]/g 197 }, { 198 'base': 'i', 199 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g 200 }, { 201 'base': 'j', 202 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g 203 }, { 204 'base': 'k', 205 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g 206 }, { 207 'base': 'l', 208 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g 209 }, { 210 'base': 'lj', 211 'letters': /[\u01C9]/g 212 }, { 213 'base': 'm', 214 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g 215 }, { 216 'base': 'n', 217 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g 218 }, { 219 'base': 'nj', 220 'letters': /[\u01CC]/g 221 }, { 222 'base': 'o',
223 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g 224 }, { 225 'base': 'oi', 226 'letters': /[\u01A3]/g 227 }, { 228 'base': 'ou', 229 'letters': /[\u0223]/g 230 }, { 231 'base': 'oo', 232 'letters': /[\uA74F]/g 233 }, { 234 'base': 'p', 235 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g 236 }, { 237 'base': 'q', 238 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g 239 }, { 240 'base': 'r', 241 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g 242 }, { 243 'base': 's', 244 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g 245 }, { 246 'base': 't', 247 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g 248 }, { 249 'base': 'tz', 250 'letters': /[\uA729]/g 251 }, { 252 'base': 'u', 253 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g 254 }, { 255 'base': 'v', 256 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g 257 }, { 258 'base': 'vy', 259 'letters': /[\uA761]/g 260 }, { 261 'base': 'w', 262 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g 263 }, { 264 'base': 'x', 265 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g 266 }, { 267 'base': 'y', 268 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g 269 }, { 270 'base': 'z', 271 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g 272 }]; 273 for (var i = 0; i < defaultDiacriticsRemovalMap.length; i++) { 274 str = str.replace(defaultDiacriticsRemovalMap[i].letters, defaultDiacriticsRemovalMap[i].base) 275 } 276 return str 277 }; 278 279 function MultipleSelect($el, options) { 280 var that = this, 281 name = $el.attr('name') || options.name || ''; 282 this.options = options; 283 this.$el = $el.hide(); 284 $('.pre_select_categories').hide(); 285 this.$label = this.$el.closest('label'); 286 if (this.$label.length === 0 && this.$el.attr('id')) { 287 this.$label = $(sprintf('label[for="%s"]', this.$el.attr('id').replace(/:/g, '\\:'))) 288 } 289 this.$parent = $(sprintf('<div class="ms-parent %s" %s/>', $el.attr('class') || '', sprintf('title="%s"', $el.attr('title')))); 290 this.$choice = $(sprintf(['<button type="button" class="ms-choice">', '<span class="placeholder">%s</span><b class="close_inp3" style="display:none;"></b>', '<div></div>', '</button>'].join(''), this.options.placeholder)); 291 this.$drop = $(sprintf('<div class="ms-drop %s"%s></div>', this.options.position, sprintf(' style="width: %s"', this.options.dropWidth))); 292 this.$el.after(this.$parent); 293 this.$parent.append(this.$choice); 294 this.$parent.append(this.$drop); 295 if (this.$el.prop('disabled')) { 296 this.$choice.addClass('disabled') 297 } 298 this.$parent.css('width', this.options.width || this.$el.css('width') || this.$el.outerWidth() + 20); 299 this.selectAllName = 'data-name="selectAll' + name + '"'; 300 this.selectGroupName = 'data-name="selectGroup' + name + '"'; 301 this.selectItemName = 'data-name="selectItem' + name + '"'; 302 if (!this.options.keepOpen) { 303 $(document).click(function(e) { 304 if ($(e.target)[0] === that.$choice[0] || $(e.target).parents('.ms-choice')[0] === that.$choice[0]) { 305 return 306 } 307 if (($(e.target)[0] === that.$drop[0] || $(e.target).parents('.ms-drop')[0] !== that.$drop[0] && e.target !== $el[0]) && that.options.isOpen) { 308 that.close() 309 } 310 }) 311 } 312 } 313 MultipleSelect.prototype = { 314 constructor: MultipleSelect, 315 init: function() { 316 var that = this, 317 $ul = $('<ul></ul>'); 318 this.$drop.html(''); 319 if (this.options.filter) { 320 this.$drop.append(['<div class="ms-search">', '<input type="text" autocomplete="off" autocorrect="off" autocapitilize="off" spellcheck="false">', '</div>'].join('')) 321 } 322 if (this.options.selectAll && !this.options.single) { 323 $ul.append(['<li class="ms-select-all">', '<label>', sprintf('<input type="checkbox" %s /> ', this.selectAllName), this.options.selectAllDelimiter[0], this.options.selectAllText, this.options.selectAllDelimiter[1], '</label>', '</li>'].join('')) 324 } 325 $.each(this.$el.children(), function(i, elm) { 326 $ul.append(that.optionToHtml(i, elm)) 327 }); 328 $ul.append(sprintf('<li class="ms-no-results">%s</li>', this.options.noMatchesFound)); 329 this.$drop.append($ul); 330 this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px'); 331 this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px'); 332 this.$searchInput = this.$drop.find('.ms-search input'); 333 this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']'); 334 this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']'); 335 this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled'); 336 this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled'); 337 this.$noResults = this.$drop.find('.ms-no-results'); 338 this.events(); 339 this.updateSelectAll(!0); 340 this.update(!0); 341 if (this.options.isOpen) { 342 this.open() 343 } 344 if (this.getSelects().length) jQuery('.close_inp3').css('display','block'); 345 jQuery('.home .search_jobs div.search_categories').addClass('show'); 346 }, 347 optionToHtml: function(i, elm, group, groupDisabled) { 348 var that = this, 349 $elm = $(elm), 350 classes = $elm.attr('class') || '', 351 title = sprintf('title="%s"', $elm.attr('title')), 352 multiple = this.options.multiple ? 'multiple' : '', 353 disabled, type = this.options.single ? 'radio' : 'checkbox'; 354 if ($elm.is('option')) { 355 var value = $elm.val(), 356 text = that.options.textTemplate($elm), 357 selected = $elm.prop('selected'), 358 style = sprintf('style="%s"', this.options.styler(value)), 359 $el; 360 disabled = groupDisabled || $elm.prop('disabled'); 361 $el = $([sprintf('<li class="%s %s" %s %s>', multiple, classes, title, style), sprintf('<label class="%s">', disabled ? 'disabled' : ''), sprintf('<input type="%s" %s%s%s%s>', type, this.selectItemName, selected ? ' checked="checked"' : '', disabled ? ' disabled="disabled"' : '', sprintf(' data-group="%s"', group)), sprintf('<span><div class="before"></div><div class="name_cat">%s</div></span>', text), '</label>', '</li>'].join('')); 362 $el.find('input').val(value); 363 return $el 364 } 365 if ($elm.is('optgroup')) { 366 var label = that.options.labelTemplate($elm), 367 $group = $('<div/>'); 368 group = 'group_' + i; 369 disabled = $elm.prop('disabled'); 370 $group.append(['<li class="group">', sprintf('<label class="optgroup %s" data-group="%s">', disabled ? 'disabled' : '', group), this.options.hideOptgroupCheckboxes || this.options.single ? '' : sprintf('<input type="checkbox" %s %s>', this.selectGroupName, disabled ? 'disabled="disabled"' : ''), label, '</label>', '</li>'].join('')); 371 $.each($elm.children(), function(i, elm) { 372 $group.append(that.optionToHtml(i, elm, group, disabled)) 373 }); 374 return $group.html() 375 } 376 }, 377 events: function() { 378 var that = this, 379 toggleOpen = function(e) { 380 381if ( (jQuery('.ms-drop').css('display')=='none') && ($(window).width() < 500) ){ 382 //jQuery('ul.job_listings').css('margin-top','53px'); 383 jQuery('.job_filters').css('margin-bottom','140px'); 384} else //jQuery('ul.job_listings').css('margin-top','13px'); 385jQuery('.job_filters').css('margin-bottom','0px'); 386 387 if(navigator.userAgent.indexOf("Firefox") != -1 ){ 388 if (jQuery('.close_inp3').css('display')=='none'){ 389 jQuery('.close_inp3').css('display','block');
390 var marg_left = parseInt(jQuery('.close_inp3').css('margin-left')); 391 jQuery('.close_inp3').css('display','none'); 392 } else var marg_left = parseInt(jQuery('.close_inp3').css('margin-left')); 393 marg_left = +marg_left+13; 394 //console.log('marg_left='+marg_left); 395 if ((e['type']=='click')&&(e['offsetX']>marg_left)&&(jQuery('.close_inp3').css('display')=='block')&&(jQuery('.ms-drop').css('display')=='none')){ 396 jQuery( 'select[name^="search_category_multi"]' ).multipleSelect('uncheckAll'); 397 jQuery('.close_inp3').css('display','none'); 398 return !1 399 } 400 } else { 401 if (e['type']=='click'){ //console.log('e[type]='+e['type']); 402 403 if (ini==1){ 404 ini=2; 405 jQuery('body').on('click','.close_inp3', function(){ 406 if (jQuery('.ms-drop').css('display')=='block'){ 407 jQuery( 'select[name^="search_category_multi"]' ).multipleSelect('uncheckAll'); 408 jQuery('.close_inp3').css('display','none'); 409 jQuery('.ms-drop').css('display','none'); 410 return !1 411 } 412 }); 413 } else 414 jQuery('.close_inp3').on('click', function(){ 415 // console.log('.ms-drop='+jQuery('.ms-drop').css('display')); 416 if (jQuery('.ms-drop').css('display')=='none'){ 417 jQuery( 'select[name^="search_category_multi"]' ).multipleSelect('uncheckAll'); 418 jQuery('.close_inp3').css('display','none'); 419 return !1 420 } 421 422 }); 423 } 424 } 425 // console.log('offsetX='+e['offsetX']); 426 for (var key in e ) 427 { //console.log('e['+key+']='+e[key]); 428 } 429 // console.log(jQuery('.ms-drop').css('display')); 430 e.preventDefault(); 431 that[that.options.isOpen ? 'close' : 'open']() 432 }; 433 if (this.$label) { 434 this.$label.off('click').on('click', function(e) { 435 if (e.target.nodeName.toLowerCase() !== 'label' || e.target !== this) { 436 return 437 } 438 toggleOpen(e); 439 if (!that.options.filter || !that.options.isOpen) { 440 that.focus() 441 } 442 e.stopPropagation() 443 }) 444 } 445 this.$choice.off('click').on('click', toggleOpen).off('focus').on('focus', this.options.onFocus).off('blur').on('blur', this.options.onBlur); 446 this.$parent.off('keydown').on('keydown', function(e) { 447 switch (e.which) { 448 case 27: 449 that.close(); 450 that.$choice.focus(); 451 break 452 } 453 }); 454 this.$searchInput.off('keydown').on('keydown', function(e) { 455 if (e.keyCode === 9 && e.shiftKey) { 456 that.close() 457 } 458 }).off('keyup').on('keyup', function(e) { 459 if (that.options.filterAcceptOnEnter && (e.which === 13 || e.which == 32) && that.$searchInput.val()) { 460 that.$selectAll.click(); 461 that.close(); 462 that.focus(); 463 return 464 } 465 that.filter() 466 }); 467 this.$selectAll.off('click').on('click', function() { 468 var checked = $(this).prop('checked'), 469 $items = that.$selectItems.filter(':visible'); 470 if ($items.length === that.$selectItems.length) { 471 that[checked ? 'checkAll' : 'uncheckAll']() 472 } else { 473 that.$selectGroups.prop('checked', checked); 474 $items.prop('checked', checked); 475 that.options[checked ? 'onCheckAll' : 'onUncheckAll'](); 476 that.update() 477 } 478 }); 479 this.$selectGroups.off('click').on('click', function() { 480 var group = $(this).parent().attr('data-group'), 481 $items = that.$selectItems.filter(':visible'), 482 $children = $items.filter(sprintf('[data-group="%s"]', group)), 483 checked = $children.length !== $children.filter(':checked').length; 484 $children.prop('checked', checked); 485 that.updateSelectAll();
486 that.update(); 487 that.options.onOptgroupClick({ 488 label: $(this).parent().text(), 489 checked: checked, 490 children: $children.get(), 491 instance: that 492 }) 493 }); 494 this.$selectItems.off('click').on('click', function() { 495 that.updateSelectAll(); 496 that.update(); 497 that.updateOptGroupSelect(); 498 that.options.onClick({ 499 label: $(this).parent().text(), 500 value: $(this).val(), 501 checked: $(this).prop('checked'), 502 instance: that 503 }); 504 if (that.options.single && that.options.isOpen && !that.options.keepOpen) { 505 that.close() 506 } 507 if (that.options.single) { 508 var clickedVal = $(this).val(); 509 that.$selectItems.filter(function() { 510 return $(this).val() !== clickedVal 511 }).each(function() { 512 $(this).prop('checked', !1) 513 }); 514 that.update() 515 } 516 }) 517 }, 518 open: function() { 519 if (this.$choice.hasClass('disabled')) { 520 return 521 } 522 this.options.isOpen = !0; 523 this.$choice.find('>div').addClass('open'); 524 this.$choice.find('.close_inp3').css('display', 'block'); 525 this.$drop[this.animateMethod('show')](); 526 this.$selectAll.parent().show(); 527 this.$noResults.hide(); 528 if (!this.$el.children().length) { 529 this.$selectAll.parent().hide(); 530 this.$noResults.show() 531 } 532 if (this.options.container) { 533 var offset = this.$drop.offset(); 534 this.$drop.appendTo($(this.options.container)); 535 this.$drop.offset({ 536 top: offset.top, 537 left: offset.left 538 }) 539 } 540 if (this.options.filter) { 541 this.$searchInput.val(''); 542 this.$searchInput.focus(); 543 this.filter() 544 } 545 this.options.onOpen() 546 }, 547 close: function() { 548 this.options.isOpen = !1; 549 this.$choice.find('>div').removeClass('open'); 550 551 if (!this.getSelects().length) $('.close_inp3').css('display', 'none'); 552 jQuery('.job_filters').css('margin-bottom','0px'); 553 554 this.$drop[this.animateMethod('hide')](); 555 if (this.options.container) { 556 this.$parent.append(this.$drop); 557 this.$drop.css({ 558 'top': 'auto', 559 'left': 'auto' 560 }) 561 } 562 this.options.onClose() 563 }, 564 animateMethod: function(method) { 565 var methods = { 566 show: { 567 fade: 'fadeIn', 568 slide: 'slideDown' 569 }, 570 hide: { 571 fade: 'fadeOut', 572 slide: 'slideUp' 573 } 574 }; 575 return methods[method][this.options.animate] || method 576 }, 577 update: function(isInit) { 578 if ((this.options.maxCountSelect != 0) && (this.getSelects().length > this.options.maxCountSelect)) { 579 this.setSelects(arr) 580 } 581 var selects = this.options.displayValues ? this.getSelects() : this.getSelects('text'), 582 $span = this.$choice.find('>span'), 583 sl = selects.length; 584 if (sl === 0) { 585 $span.addClass('placeholder').html(this.options.placeholder) 586 } else if (this.options.allSelected && sl === this.$selectItems.length + this.$disableItems.length) { 587 $span.removeClass('placeholder').html(this.options.allSelected) 588 } else if (this.options.ellipsis && sl > this.options.minimumCountSelected) { 589 $span.removeClass('placeholder').text(selects.slice(0, this.options.minimumCountSelected).join(this.options.delimiter) + '...') 590 } else if (this.options.countSelected && sl > this.options.minimumCountSelected) { 591 $span.removeClass('placeholder').html(this.options.countSelected.replace('#', selects.length).replace('%', this.$selectItems.length + this.$disableItems.length)) 592 } else { 593 $span.removeClass('placeholder').text(selects.join(this.options.delimiter)) 594 } 595 if (this.options.addTitle) {
596 $span.prop('title', this.getSelects('text')) 597 } 598 this.$el.val(this.getSelects()).trigger('change'); 599 this.$drop.find('li').removeClass('selected'); 600 this.$drop.find('input:checked').each(function() { 601 $(this).parents('li').first().addClass('selected') 602 }); 603 if ((this.options.maxCountSelect != 0) && (this.getSelects().length = this.options.maxCountSelect)) { 604 selects_curr = this.getSelects() + ''; 605 arr = selects_curr.split(',') 606 } 607 if (!isInit) { 608 this.$el.trigger('change') 609 } 610 this.close() 611 }, 612 updateSelectAll: function(isInit) { 613 var $items = this.$selectItems; 614 if (!isInit) { 615 $items = $items.filter(':visible') 616 } 617 this.$selectAll.prop('checked', $items.length && $items.length === $items.filter(':checked').length); 618 if (!isInit && this.$selectAll.prop('checked')) { 619 this.options.onCheckAll(); 620 } 621 }, 622 updateOptGroupSelect: function() { 623 var $items = this.$selectItems.filter(':visible'); 624 $.each(this.$selectGroups, function(i, val) { 625 var group = $(val).parent().attr('data-group'), 626 $children = $items.filter(sprintf('[data-group="%s"]', group)); 627 $(val).prop('checked', $children.length && $children.length === $children.filter(':checked').length) 628 }) 629 }, 630 getSelects: function(type) { 631 var that = this, 632 texts = [], 633 values = []; 634 this.$drop.find(sprintf('input[%s]:checked', this.selectItemName)).each(function() { 635 texts.push($(this).parents('li').first().text()); 636 values.push($(this).val()) 637 }); 638 if (type === 'text' && this.$selectGroups.length) { 639 texts = []; 640 this.$selectGroups.each(function() { 641 var html = [], 642 text = $.trim($(this).parent().text()), 643 group = $(this).parent().data('group'), 644 $children = that.$drop.find(sprintf('[%s][data-group="%s"]', that.selectItemName, group)), 645 $selected = $children.filter(':checked'); 646 if (!$selected.length) { 647 return 648 } 649 html.push('['); 650 html.push(text); 651 if ($children.length > $selected.length) { 652 var list = []; 653 $selected.each(function() { 654 list.push($(this).parent().text()) 655 }); 656 html.push(': ' + list.join(', ')) 657 } 658 html.push(']'); 659 texts.push(html.join('')) 660 }) 661 } 662 return type === 'text' ? texts : values 663 }, 664 setSelects: function(values) { 665 var that = this; 666 this.$selectItems.prop('checked', !1); 667 this.$disableItems.prop('checked', !1); 668 $.each(values, function(i, value) { 669 that.$selectItems.filter(sprintf('[value="%s"]', value)).prop('checked', !0); 670 that.$disableItems.filter(sprintf('[value="%s"]', value)).prop('checked', !0) 671 }); 672 this.$selectAll.prop('checked', this.$selectItems.length === this.$selectItems.filter(':checked').length + this.$disableItems.filter(':checked').length); 673 $.each(that.$selectGroups, function(i, val) { 674 var group = $(val).parent().attr('data-group'), 675 $children = that.$selectItems.filter('[data-group="' + group + '"]'); 676 $(val).prop('checked', $children.length && $children.length === $children.filter(':checked').length) 677 }); 678 this.update() 679 }, 680 enable: function() { 681 this.$choice.removeClass('disabled') 682 }, 683 disable: function() { 684 this.$choice.addClass('disabled') 685 }, 686 checkAll: function() { 687 this.$selectItems.prop('checked', !0); 688 this.$selectGroups.prop('checked', !0); 689 this.$selectAll.prop('checked', !0); 690 this.update(); 691 this.options.onCheckAll() 692 }, 693 uncheckAll: function() { 694 this.$selectItems.prop('checked', !1); 695 this.$selectGroups.prop('checked', !1); 696 this.$selectAll.prop('checked', !1); 697 this.update(); 698 this.options.onUncheckAll() 699 }, 700 focus: function() { 701 this.$choice.focus(); 702 this.options.onFocus() 703 }, 704 blur: function() { 705 this.$choice.blur(); 706 this.options.onBlur() 707 }, 708 refresh: function() { 709 this.init() 710 }, 711 destroy: function() { 712 this.$el.show(); 713 this.$parent.remove(); 714 this.$el.data('multipleSelect', null) 715 }, 716 filter: function() { 717 var that = this, 718 text = $.trim(this.$searchInput.val()).toLowerCase(); 719 if (text.length === 0) { 720 this.$selectAll.parent().show(); 721 this.$selectItems.parent().show(); 722 this.$disableItems.parent().show(); 723 this.$selectGroups.parent().show(); 724 this.$noResults.hide() 725 } else { 726 this.$selectItems.each(function() { 727 var $parent = $(this).parent(); 728 $parent[removeDiacritics($parent.text().toLowerCase()).indexOf(removeDiacritics(text)) < 0 ? 'hide' : 'show']() 729 }); 730 this.$disableItems.parent().hide(); 731 this.$selectGroups.each(function() { 732 var $parent = $(this).parent(); 733 var group = $parent.attr('data-group'), 734 $items = that.$selectItems.filter(':visible'); 735 $parent[$items.filter(sprintf('[data-group="%s"]', group)).length ? 'show' : 'hide']() 736 }); 737 if (this.$selectItems.parent().filter(':visible').length) { 738 this.$selectAll.parent().show(); 739 this.$noResults.hide() 740 } else { 741 this.$selectAll.parent().hide(); 742 this.$noResults.show() 743 } 744 } 745 this.updateOptGroupSelect(); 746 this.updateSelectAll(); 747 this.options.onFilter(text) 748 } 749 }; 750 $.fn.multipleSelect = function() { 751 var option = arguments[0], 752 args = arguments, 753 value, allowedMethods = ['getSelects', 'setSelects', 'enable', 'disable', 'open', 'close', 'checkAll', 'uncheckAll', 'focus', 'blur', 'refresh', 'destroy']; 754 this.each(function() { 755 var $this = $(this), 756 data = $this.data('multipleSelect'), 757 options = $.extend({}, $.fn.multipleSelect.defaults, $this.data(), typeof option === 'object' && option); 758 if (!data) { 759 data = new MultipleSelect($this, options); 760 $this.data('multipleSelect', data) 761 } 762 if (typeof option === 'string') { 763 if ($.inArray(option, allowedMethods) < 0) { 764 throw 'Unknown method: ' + option 765 } 766 value = data[option](args[1]) 767 } else { 768 data.init(); 769 if (args[1]) { 770 value = data[args[1]].apply(data, [].slice.call(args, 2)) 771 } 772 } 773 }); 774 return typeof value !== 'undefined' ? value : this 775 }; 776 $.fn.multipleSelect.defaults = { 777 name: '', 778 isOpen: !1, 779 placeholder: '', 780 selectAll: !0, 781 selectAllDelimiter: ['[', ']'], 782 minimumCountSelected: 3, 783 maxCountSelect: 0, 784 ellipsis: !1, 785 multiple: !1, 786 multipleWidth: 80, 787 single: !1, 788 filter: !1, 789 width: undefined, 790 dropWidth: undefined, 791 maxHeight: 250, 792 container: null, 793 position: 'bottom', 794 keepOpen: !1, 795 animate: 'none', 796 displayValues: !1, 797 delimiter: ', ', 798 addTitle: !1,
799 filterAcceptOnEnter: !1, 800 hideOptgroupCheckboxes: !1, 801 selectAllText: 'Select all', 802 allSelected: 'All selected', 803 countSelected: '# of % selected', 804 noMatchesFound: 'No matches found', 805 styler: function() { 806 return !1 807 }, 808 textTemplate: function($elm) { 809 return $elm.html() 810 }, 811 labelTemplate: function($elm) { 812 return $elm.attr('label') 813 }, 814 onOpen: function() { 815 return !1 816 }, 817 onClose: function() { 818 return !1 819 }, 820 onCheckAll: function() { 821 return !1 822 }, 823 onUncheckAll: function() { 824 return !1 825 }, 826 onFocus: function() { 827 return !1 828 }, 829 onBlur: function() { 830 return !1 831 }, 832 onOptgroupClick: function() { 833 return !1 834 }, 835 onClick: function() { 836 return !1 837 }, 838 onFilter: function() { 839 return !1 840 } 841 } 842})(jQuery)
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.