1var toolsetForms = toolsetForms || {}; 2 3 4var wptCallbacks = {}; 5wptCallbacks.validationInit = jQuery.Callbacks('unique'); 6wptCallbacks.addRepetitive = jQuery.Callbacks('unique'); 7wptCallbacks.removeRepetitive = jQuery.Callbacks('unique'); 8wptCallbacks.conditionalCheck = jQuery.Callbacks('unique'); 9wptCallbacks.reset = jQuery.Callbacks('unique'); 10 11jQuery(document).ready(function () { 12 if (typeof wptValidation !== 'undefined') { 13 wptCallbacks.validationInit.add(function () { 14 wptValidation.init(); 15 }); 16 } 17 if (typeof wptCond !== 'undefined') { 18 wptCond.init(); 19 } else { 20 wptCallbacks.validationInit.fire(); 21 } 22 /** 23 * check taxonmies on submitted forms 24 */ 25 jQuery('.cred-taxonomy', jQuery('form.is_submitted')).each(function () { 26 parent = jQuery(this); 27 setTimeout(function () { 28 jQuery('input.wpt-taxonomy-add-new', parent).click(); 29 }, 50); 30 }); 31 32 setTimeout(function(){ 33 34 if(jQuery(".wpt-hierarchical-taxonomy-add-new-show-hide").is(":hidden")){ 35 jQuery(".wpt-hierarchical-taxonomy-add-new:hidden").remove(); 36 jQuery(".wpt-hierarchical-taxonomy-add-new-show-hide:hidden").remove(); 37 } 38 39 }, 1000); 40}); 41 42 43var wptFilters = {}; 44function add_filter(name, callback, priority, args_num) { 45 var args = _.defaults(arguments, ['', '', 10, 2]); 46 if (typeof wptFilters[name] === 'undefined') 47 wptFilters[name] = {}; 48 if (typeof wptFilters[name][args[2]] === 'undefined') 49 wptFilters[name][args[2]] = []; 50 wptFilters[name][args[2]].push([callback, args[3]]); 51} 52function apply_filters(name, val) { 53 if (typeof wptFilters[name] === 'undefined') 54 return val; 55 var args = _.rest(_.toArray(arguments)); 56 _.each(wptFilters[name], function (funcs, priority) { 57 _.each(funcs, function ($callback) { 58 var _args = args.slice(0, $callback[1]); 59 args[0] = $callback[0].apply(null, _args); 60 }); 61 }); 62 return args[0]; 63} 64function add_action(name, callback, priority, args_num) { 65 add_filter.apply(null, arguments); 66} 67function do_action(name) { 68 if (typeof wptFilters[name] === 'undefined') 69 return false; 70 var args = _.rest(_.toArray(arguments)); 71 _.each(wptFilters[name], function (funcs, priority) { 72 _.each(funcs, function ($callback) { 73 var _args = args.slice(0, $callback[1]); 74 $callback[0].apply(null, _args); 75 }); 76 }); 77 return true; 78} 79 80/** 81 * flat taxonomies functions 82 */ 83function showHideMostPopularButton(taxonomy, form) 84{ 85 var $button = jQuery('[name="sh_' + taxonomy + '"]', form); 86 var $taxonomy_box = jQuery('.shmpt-' + taxonomy, form); 87 var $tag_list = $taxonomy_box.find('.js-wpt-taxonomy-popular-add'); 88 89 if (!$button.hasClass('js-wpt-taxonomy-popular-show-hide')) 90 return true; 91 92 if ($tag_list.length > 0) 93 { 94 $button.show(); 95 return true; 96 } else { 97 $button.hide(); 98 return false; 99 } 100} 101 102jQuery(document).off('click', '.js-wpt-taxonomy-popular-show-hide', null); 103jQuery(document).off('click', '.js-wpt-taxonomy-popular-add', null); 104jQuery(document).off('click', '.js-wpt-taxonomy-add-new', null); 105jQuery(document).off('keypress', '.js-wpt-new-taxonomy-title', null); 106 107jQuery(document).on('click', '.js-wpt-taxonomy-popular-show-hide', function () { 108 showHideMostPopularTaxonomy(this); 109}); 110 111function showHideMostPopularTaxonomy(el) 112{ 113 var taxonomy = jQuery(el).data('taxonomy'); 114 var form = jQuery(el).closest('form'); 115 jQuery('.shmpt-' + taxonomy, form).toggle(); 116 var curr = jQuery(el).val(); 117 if (curr == jQuery(el).data('show-popular-text')) { 118 jQuery(el).val(jQuery(el).data('hide-popular-text'), form).addClass('btn-cancel'); 119 } else { 120 jQuery(el).val(jQuery(el).data('show-popular-text'), form).removeClass('btn-cancel'); 121 } 122} 123 124jQuery(document).on('click', '.js-wpt-taxonomy-popular-add', function () { 125 var thiz = jQuery(this); 126 var taxonomy = thiz.data('taxonomy'); 127 var slug = thiz.data('slug'); 128 var _name = thiz.data('name'); 129 setTaxonomyFromPopular(_name, taxonomy, this); 130 return false;
131}); 132 133function setTaxonomyFromPopular(slug, taxonomy, el) 134{ 135 var form = jQuery(el).closest('form'); 136 var tmp_tax = String(slug); 137 if (typeof tmp_tax === "undefined" || tmp_tax.trim() == '') 138 return; 139 var tax = jQuery('input[name=' + taxonomy + ']', form).val(); 140 var arr = String(tax).split(','); 141 if (jQuery.inArray(tmp_tax, arr) !== -1) 142 return; 143 var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax; 144 jQuery('input[name=' + taxonomy + ']', form).val(toadd); 145 updateTaxonomies(taxonomy, form); 146} 147 148function addTaxonomy(slug, taxonomy, el) 149{ 150 var form = jQuery(el).closest('form'); 151 var curr = jQuery('input[name=tmp_' + taxonomy + ']', form).val().trim(); 152 if ('' == curr) { 153 jQuery('input[name=tmp_' + taxonomy + ']', form).val(slug); 154 setTaxonomy(taxonomy, el); 155 } else { 156 if (curr.indexOf(slug) == -1) { 157 jQuery('input[name=tmp_' + taxonomy + ']', form).val(curr + ',' + slug); 158 setTaxonomy(taxonomy, el); 159 } 160 } 161 jQuery('input[name=tmp_' + taxonomy + ']', form).val(''); 162} 163 164jQuery(document).on('click', '.js-wpt-taxonomy-add-new', function () { 165 var thiz = jQuery(this), 166 taxonomy = thiz.data('taxonomy'); 167 setTaxonomy(taxonomy, this); 168}); 169 170jQuery(document).on('keypress', '.js-wpt-new-taxonomy-title', function (e) { 171 if (13 === e.keyCode) { 172 e.preventDefault(); 173 var thiz = jQuery(this), 174 taxonomy = thiz.data('taxonomy'), 175 taxtype = thiz.data('taxtype'); 176 if (taxtype == 'hierarchical') { 177 toolsetForms.cred_tax.add_taxonomy(taxonomy, this); 178 } else { 179 setTaxonomy(taxonomy, this); 180 } 181 } 182}); 183 184function setTaxonomy(taxonomy, el) 185{ 186 var form = jQuery(el).closest('form'); 187 var tmp_tax = jQuery('input[name=tmp_' + taxonomy + ']', form).val(); 188 var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig; 189 tmp_tax = _.escape(tmp_tax.replace(rex, "")).trim(); 190 if (tmp_tax.trim() == '') 191 return; 192 var tax = jQuery('input[name=' + taxonomy + ']', form).val(); 193 var arr = tax.split(','); 194 if (jQuery.inArray(tmp_tax, arr) !== -1) 195 return; 196 var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax; 197 jQuery('input[name=' + taxonomy + ']', form).val(toadd); 198 jQuery('input[name=tmp_' + taxonomy + ']', form).val(''); 199 updateTaxonomies(taxonomy, form); 200} 201 202function updateTaxonomies(taxonomy, form) 203{ 204 var taxonomies = jQuery('input[name=' + taxonomy + ']', form).val(); 205 jQuery('div.tagchecklist-' + taxonomy, form).html(''); 206 if (!taxonomies || (taxonomies && taxonomies.trim() == '')) 207 return; 208 var toshow = taxonomies.split(','); 209 var str = ''; 210 for (var i = 0; i < toshow.length; i++) { 211 var sh = toshow[i].trim(); 212 str += '<span><a href="#" class=\'ntdelbutton\' data-wpcf-i=\'' + i + '\' id=\'post_tag-check-num-' + i + '\'>X</a> ' + sh + '</span>'; 213 } 214 jQuery('div.tagchecklist-' + taxonomy, form).html(str); 215 jQuery('div.tagchecklist-' + taxonomy + ' a', form).bind('click', function () { 216 jQuery('input[name=' + taxonomy + ']', form).val(''); 217 del = jQuery(this).data('wpcf-i'); 218 var values = ''; 219 for (i = 0; i < toshow.length; i++) { 220 if (del == i) { 221 continue; 222 } 223 if (values) { 224 values += ','; 225 } 226 values += toshow[i]; 227 } 228 jQuery('input[name=' + taxonomy + ']', form).val(values); 229 updateTaxonomies(taxonomy, form); 230 231 return false;
232 }); 233 234} 235 236function initTaxonomies(values, taxonomy, url, fieldId) 237{ 238 form = jQuery('#' + fieldId.replace(/_field_\d+$/, '')).closest('form'); 239 jQuery('div.tagchecklist-' + taxonomy).html(values); 240 241 jQuery('input[name=' + taxonomy + ']').val(values); 242 updateTaxonomies(taxonomy, form); 243 244 jQuery('input[name=tmp_' + taxonomy + ']').suggest( 245 wptoolset_taxonomy_settings.ajaxurl + '?action=wpt_suggest_taxonomy_term&taxonomy=' + taxonomy, 246 { 247 resultsClass: 'wpt-suggest-taxonomy-term', 248 selectClass: 'wpt-suggest-taxonomy-term-select' 249 } 250 ); 251 //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195723133/comments#308689055 252 if (jQuery('input[name=tmp_' + taxonomy + ']').val() != "") 253 jQuery("input[name='new_tax_button_" + taxonomy + "']").trigger("click"); 254} 255 256toolsetForms.CRED_taxonomy = function () { 257 258 var self = this; 259 260 self.init = function () { 261 self._new_taxonomy = new Array(); 262 jQuery(document).ready(self._document_ready); 263 } 264 265 self._document_ready = function () { 266 self._initialize_taxonomy_buttons(); 267 self._initialize_hierachical(); 268 } 269 270 self._initialize_hierachical = function () { 271 self._fill_parent_drop_down() 272 } 273 274 self._fill_parent_drop_down = function () { 275 jQuery('select.js-taxonomy-parent').each(function () { 276 var select = jQuery(this); 277 278 // remove all the options 279 jQuery(this).find('option').each(function () { 280 if (jQuery(this).val() != '-1') { 281 jQuery(this).remove(); 282 } 283 }) 284 285 var taxonomy = jQuery(this).data('taxonomy'); 286 287 // Copy all the checkbox values if it's checkbox mode 288 jQuery('input[name="' + taxonomy + '\[\]"]').each(function () { 289 var id = jQuery(this).attr('id'); 290 var label = jQuery(this).next('label'); 291 var level = jQuery(this).closest('ul').data('level'); 292 var prefix = ''; 293 if (level) { 294 prefix = "\xA0\xA0" + Array(level).join("\xA0\xA0"); 295 } 296 select.append('<option value="' + jQuery(this).val() + '">' + prefix + label.text() + '</option>'); 297 }) 298 299 // Copy all the select option values if it's select mode 300 jQuery('select[name="' + taxonomy + '\[\]"]').find('option').each(function () { 301 var id = jQuery(this).val(); 302 var text = jQuery(this).text(); 303 select.append('<option value="' + id + '">
303' + text + '</option>'); 304 }) 305 306 307 }); 308 309 } 310 311 self._initialize_taxonomy_buttons = function () { 312 // replace the taxonomy button placeholders with the actual buttons. 313 jQuery('.js-taxonomy-button-placeholder').each(function () { 314 var placeholder = jQuery(this); 315 //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195150507/comments 316 var label = jQuery(this).attr('data-label'); 317 //########################################################################################### 318 var taxonomy = jQuery(this).data('taxonomy'); 319 var form = jQuery(this).closest('form'); 320 var buttons = jQuery('[name="sh_' + taxonomy + '"],[name="btn_' + taxonomy + '"]', form); 321 var selectors = []; 322 323 if (buttons.length) { 324 325 buttons.each(function () { 326 var button = jQuery(this, form); 327 328 //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195150507/comments 329 if (label) 330 button.val(label); 331 //########################################################################################## 332 333 placeholder.replaceWith(button); 334 335 if (button.hasClass('js-wpt-taxonomy-popular-show-hide')) { 336 if (showHideMostPopularButton(taxonomy, form)) { 337 button.show(); 338 } 339 } else { 340 button.show(); 341 } 342 343 // move anything else that should be moved with the button 344 //Responsible of the issue https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188673095/comments 345 //changed selector 346 //var selector = button.data('after-selector'); 347 selectors.push(button.data('after-selector')) 348 if (typeof selector !== 'undefined' && selector.length) { 349 var position = button; 350 jQuery('.' + selectors[0]).detach(); 351 jQuery('.' + selectors[0]).insertAfter(button); 352 position = jQuery('.' + selectors[0]); 353 selectors.pop(); 354 } 355 }) 356 } 357 }); 358 } 359 360//cred-286 361// self.add_new_show_hide = function (taxonomy, button) { 362// var form = jQuery(button).closest('form'); 363// jQuery('.js-wpt-hierarchical-taxonomy-add-new-' + taxonomy, form).toggle(); 364// self.hide_parent_button_if_no_terms(taxonomy, button); 365// } 366 self.add_new_show_hide = function (taxonomy, button) { 367 var form = jQuery(button).closest('form'); 368 var add_wrap = jQuery(".js-wpt-hierarchical-taxonomy-add-new-" + taxonomy); 369 if (add_wrap.is(":visible")) { 370 add_wrap.hide(); 371 } else { 372 add_wrap.show(); 373 } 374 self.hide_parent_button_if_no_terms(taxonomy, button); 375 } 376 377 jQuery('.js-wpt-hierarchical-taxonomy-add-new').on('click', function () { 378 var thiz = jQuery(this), 379 taxonomy = thiz.data('taxonomy'); 380 self.add_taxonomy(taxonomy, this); 381 }); 382 383 jQuery('.js-wpt-hierarchical-taxonomy-add-new-show-hide').on('click', function () { 384 if (jQuery(this).val() == jQuery(this).data('close')) { 385 jQuery(this).val(jQuery(this).data('open')).removeClass('btn-cancel'); 386 } else { 387 jQuery(this).val(jQuery(this).data('close')).addClass('btn-cancel'); 388 } 389 var thiz = jQuery(this), taxonomy = thiz.data('taxonomy'); 390 self.add_new_show_hide(taxonomy, this); 391 }); 392 393 /* 394 jQuery(document).on('keypress', '.js-wpt-new-taxonomy-title', function(e) { 395 if( 13 === e.keyCode ) { 396 e.preventDefault(); 397 var thiz = jQuery(this), 398 taxonomy = thiz.data( 'taxonomy' ); 399 self.add_taxonomy( taxonomy, this ); 400 } 401 }); 402 */ 403 404 self.terms_exist = function (taxonomy, button) 405 { 406 var form = jQuery(button).closest('form'); 407 var build_what = jQuery(button).data('build_what'), parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val(); 408 if (build_what === 'checkboxes') { 409 var first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', form); 410 return first_checkbox.length > 0; 411 } else { 412 var first_option = jQuery('select[name="' + taxonomy + '\[\]"]', form).find('option[data-parent="' + parent + '"]:first'); 413 return first_option.length > 0; 414 } 415 416 return false;
417 }; 418 419 self._add_new_flag = []; 420 self.hide_parent_button_if_no_terms = function (taxonomy, button) 421 { 422 var form = jQuery(button).closest('form'); 423 var form_id = form.attr('id'); 424 if ('undefined' == typeof self._add_new_flag[form_id]) { 425 self._add_new_flag[form_id] = ''; 426 } 427 self._add_new_flag[form_id] = !self._add_new_flag[form_id]; 428 if (self._add_new_flag[form_id] === false) { 429 jQuery('[name="new_tax_select_' + taxonomy + '"]', form).hide(); 430 } else { 431 jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show(); 432 } 433 }; 434 435 self.add_taxonomy = function (taxonomy, button) 436 { 437 var form = jQuery(button).closest('form'); 438 var new_taxonomy = jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val(); 439 var build_what = jQuery(button).data('build_what'); 440 new_taxonomy = new_taxonomy.trim(); 441 442 if (new_taxonomy == '') { 443 return; 444 } 445 446 // make sure we don't already have a taxonomy with the same name. 447 var exists = false; 448 jQuery('input[name="' + taxonomy + '\[\]"]').each(function () { 449 var id = jQuery(this).attr('id'); 450 var label = jQuery('label[for="' + id + '"]', form); 451 452 if (new_taxonomy == label.text()) { 453 exists = true 454 self._flash_it(label); 455 } 456 }); 457 458 jQuery('select[name="' + taxonomy + '\[\]"]', form).find('option').each(function () { 459 if (new_taxonomy == jQuery(this).text()) { 460 exists = true; 461 self._flash_it(jQuery(this)); 462 } 463 }); 464 465 if (exists) { 466 jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val(''); 467 return; 468 } 469 470 var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val(), 471 add_position = null, 472 add_before = true, 473 div_fields_wrap = jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"]', form), 474 level = 0; 475 476 if (build_what === 'checkboxes') { 477 //Fix add new leaf 478 //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188589136/comments 479 jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"] li input[type=checkbox]', form).each(function () { 480 if (this.value == parent || this.value == new_taxonomy) { 481 div_fields_wrap = jQuery(this).parent(); 482 } 483 }); 484 //######################################################################################### 485 486 var new_checkbox = '<li><input data-parent="' + parent + '" class="wpt-form-checkbox form-checkbox checkbox" type="checkbox" name="' + taxonomy + '[]" checked="checked" value="' + new_taxonomy + '"></input><label>' + new_taxonomy + '</label></li>'; 487 // find the first checkbox sharing parent 488 var first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', form); 489 if (first_checkbox.length == 0) { 490 // there are no existing brothers 491 // so we need to compose the ul wrapper and append to the parent li 492 //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li'); 493 level = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]', form).closest('ul').data('level'); 494 level++; 495 new_checkbox = '<ul class="wpt-form-set-children" data-level="' + level + '">' + new_checkbox + '</ul>'; 496 //first_checkbox = ; 497 //add_before = false; 498 //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li'); 499 jQuery(new_checkbox).appendTo(div_fields_wrap); 500 } else { 501 // there are brothers 502 // so we need to insert before all of them 503 add_position = first_checkbox.closest('li'); 504 jQuery(new_checkbox).insertBefore(add_position); 505 } 506 jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show(); 507 } else if (build_what === 'select') { 508 // Select control 509 510 jQuery('select[name="' + taxonomy + '\[\]"]').show(); 511 512 var indent = ''; 513 var first_option = jQuery('select[name="' + taxonomy + '\[\]"]').find('option[data-parent="' + parent + '"]:first', form); 514 if (first_option.length == 0) { 515 // there a no children of this parent 516 first_option = jQuery('select[name="' + taxonomy + '\[\]"]').find('option[value="' + parent + '"]:first', form); 517 add_before = false;
518 var label = first_option.text(); 519 for (var i = 0; i < label.length; i++) { 520 if (label[i] == '\xA0') { 521 indent += '\xA0'; 522 } else { 523 break; 524 } 525 } 526 indent += '\xA0'; 527 indent += '\xA0'; 528 add_position = jQuery('select[name="' + taxonomy + '\[\]"]', form); 529 } else { 530 add_position = first_option; 531 var label = first_option.text(); 532 for (var i = 0; i < label.length; i++) { 533 if (label[i] == '\xA0') { 534 indent += '\xA0'; 535 } else { 536 break; 537 } 538 } 539 } 540 541 if (add_position) { 542 var new_option = '<option value="' + new_taxonomy + '" selected>' + indent + new_taxonomy + '</option>'; 543 if (add_before) { 544 jQuery(new_option).insertBefore(add_position); 545 } else { 546 jQuery(new_option).appendTo(add_position); 547 } 548 } 549 jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show() 550 } 551 552 self._update_hierachy(taxonomy, new_taxonomy, form); 553 554 jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val(''); 555 556 self._fill_parent_drop_down(); 557 558 } 559 560 self._update_hierachy = function (taxonomy, new_taxonomy, form) { 561 var new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', form); 562 if (!new_taxonomy_input.length) { 563 // add a hidden field for the hierarchy 564 jQuery('<input name="' + taxonomy + '_hierarchy" style="display:none" type="hidden">').insertAfter(jQuery('[name="new_tax_text_' + taxonomy + '"]', form)); 565 new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', form); 566 } 567 568 if (typeof self._new_taxonomy[taxonomy] == 'undefined') 569 self._new_taxonomy[taxonomy] = new Array(); 570 571 var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val(); 572 self._new_taxonomy[taxonomy].push(parent + ',' + new_taxonomy); 573 574 var value = ''; 575 for (var i = 0; i < self._new_taxonomy[taxonomy].length; i++) { 576 value += '{' + self._new_taxonomy[taxonomy][i] + '}'; 577 } 578 new_taxonomy_input.val(value); 579 } 580 581 self._flash_it = function (element) { 582 element.fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300); 583 } 584 585 self.init(); 586 587} 588 589toolsetForms.cred_tax = new toolsetForms.CRED_taxonomy(); 590 591//Fix https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188725294/comments 592//removed return key press 593jQuery(function () { 594 var keyStop = { 595 8: ":not(input:text, textarea, input:file, input:password)", // stop backspace = back 596 13: "input:text, input:password", // stop enter = submit 597 598 end: null 599 }; 600 jQuery(document).bind("keydown", function (event) { 601 var thiz_selector = keyStop[event.which], 602 thiz_target = jQuery(event.target); 603 604 if ( 605 thiz_target.closest("form.cred-form").length 606 && thiz_selector !== undefined 607 && thiz_target.is(thiz_selector) 608 ) { 609 event.preventDefault(); //stop event 610 } 611 612 return true; 613 }); 614}); 615
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.