1//EP - Shared controls, used in admin and front-end. 2 3//EP - Limit Text Box 4(function (LimitTextBoxModule, $, undefined) { 5 LimitTextBoxModule.init = function () { 6 function generateGuid() { 7 var ret = []; 8 var chars = "0123456789abcdef"; 9 for (var i = 0; i < 32; i++) { 10 var beginPos = parseInt(Math.random() * chars.length); 11 ret.push(chars.substring(beginPos, beginPos + 1)); 12 } 13 return ret.join(""); 14 } 15 16 if (jQuery().limit !== "undefined") { 17 $("textarea[maxlength], input[type='text'][maxlength][data-limit-box]").each(function () { 18 //EP - something with unobtrusive validation, html encoding, and rendering updates, causes there to be 19 //a leftover newline character which looks bad and messes up the count. 20 var $this = $(this); 21 if ($this.val() == "\n") 22 $this.val(""); 23 24 $this.limit(); 25 }); 26 27 $(".limitTextBoxSpellWrpr").each(function (i) { 28 elem = $(this); 29 var textId = elem.data("text-id"); 30 var spellId = textId + "_UltimateSpell"; 31 32 if (elem.data("spell-bound")) { 33 34 // We deleted the reference to the init'd ultimatespell so we have to unwind the operations and re-do them 35 elem.parent().find("span").remove(); 36 elem.off("click"); 37 //if (window.UltimateSpells != undefined) delete window.UltimateSpells[spellId]; 38 } 39 var textName = elem.data("text-name"); 40 var spellName = textName + "$UltimateSpell"; 41 42 var generatedGuid = generateGuid(); 43 var outerSpan = $("<span/>", { "id": spellId + "Click" });
44 outerSpan.append($("<span />", { "onclick": "UltimateSpellCheck('/UltimateSpellInclude/UltimateSpell.dialog.htm?cid=" + spellId + "','u" + generatedGuid + "');return false;" })); 45 46 elem.on("click", function () { 47 UltimateSpellClick(spellId + "Click"); 48 }).parent().append(outerSpan); 49 50 InitiateUltimateSpell(spellId, "", function () { 51 new UltimateSpell(spellId, spellName, true, '/UltimateSpellInclude/', 52 'en-US', '', 1, 10, textId, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 'Ignore', 'Ignore All', 'Delete', 53 'Add to Dictionary', '(no spelling suggestions)', 'Delete Repeated Word', false, 54 300, false, 'http://dictionary.reference.com/browse/[WORD]', 'Look up meaning', 55 false, textId, 'font-weight:bold;color:#FF0000;', 0, 0, 'Not in dictionary:', 56 'Mixed case:', 'Repeated word:', 'Spell check complete.', 57 'Click OK to apply changes.', 'Loading...', 'Change to:', 'Suggestions:', 'Change', 58 'Change All', 'Delete All', 'Show Options...', 'Hide Options...', 'OK', 'Cancel', 59 'Ignore Words In Uppercase', 'Ignore Words In Mixed Case', 60 'Ignore Words With Numbers', 'Ignore Repeated Words', 'Ignore Internet Addresses', 61 'Ignore Email Addresses', 'Ignore Filenames', 'Ignore HTML Tags'); 62 }); 63 64 elem.data("spell-bound", true); 65 }); 66 } else { 67 logger.log("Limit Text Box plugin not found, could not bind Limit Text Box."); 68 } 69 } 70}(window.LimitTextBoxModule = window.LimitTextBoxModule || {}, jQuery)); 71 72//EP - One Click Button - currently only works with a single OneClickButton per page. 73(function (OneClickButtonModule, $, undefined) { 74 var ctrl_to_disable; 75 76 OneClickButtonModule.init = function () { 77 //$('input').off('invalid').on('invalid', function () { 78 //triggers when browser HTML5 validation fires, from like e-mail/date field types. 79 //use if needed. by default, browser validation is disabled at the submit button level (formnovalidate attr). 80 //}); 81 } 82 83 OneClickButtonModule.PleaseWait = function (ctrl, msg) { 84 var $ctrl = $(ctrl); 85 $ctrl.data('oneclick-prevmsg', $ctrl.val()); 86 87 var msg_to_display = msg ? msg_to_display = msg : msg_to_display = idevStorage.getStorageValue('Please wait...'); 88 89 $ctrl.data('oneclick-msg', msg_to_display); 90 91 ctrl_to_disable = ctrl; 92 93 window.setTimeout(function () { PleaseWaitTimeout($ctrl) }, 10); 94 } 95 96 OneClickButtonModule.PleaseWaitImageButton = function (ctrl) { 97 ctrl_to_disable = ctrl 98 window.setTimeout(function () { PleaseWaitTimeout($ctrl) }, 10); 99 } 100 101 function PleaseWaitTimeout(ctrl) { 102 if (ctrl.attr('type') == 'image') { 103 ctrl.attr('src', '/images/spacer.gif'); 104 ctrl.attr('onclick', 'return false'); 105 } else { 106 ctrl.val(ctrl.data('oneclick-msg')); 107 ctrl.prop("disabled", true); 108 } 109 } 110 111 function PleaseWaitReset(ctrl) { 112 var $ctrl = $(ctrl); 113 $ctrl.prop("disabled", false); 114 $ctrl.val($ctrl.data('oneclick-prevmsg')); 115 } 116}(window.OneClickButtonModule = window.OneClickButtonModule || {}, jQuery)); 117 118//END ONE CLICK BUTTON 119 120//EP - Rate It Ajax/UpdatePanel Rebinding 121(function (StarRatingModule, $, undefined) { 122 StarRatingModule.init = function () { 123 $('div.rateit').rateit(); 124 } 125}(window.StarRatingModule = window.StarRatingModule || {}, jQuery)); 126 127//END ONE CLICK BUTTON 128 129jQuery(function () { 130 LimitTextBoxModule.init(); 131 BaseModule.addModuleRebindFunction("LimitTextBoxModule", LimitTextBoxModule.init); 132 133 //Rate It automatically binds, so we only need to rebind if needed. 134 BaseModule.addModuleRebindFunction("StarRatingModule", StarRatingModule.init); 135
136 //OneClickButtonModule.init(); 137 //BaseModule.addModuleRebindFunction("OneClickButtonModule", OneClickButtonModule.init); 138});
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.