Best JavaScript code snippet using taiko
index.js
Source:index.js
...15 <Popconfirms {...props} />16 </PopconfirmWrapper>17);18const text = 'Are you sure delete this task?';19function confirm(e) {20 message.success('Click on Yes');21}22function cancel(e) {23 message.error('Click on No');24}25export default class IsomorphicPopconfirm extends Component {26 render() {27 const { rowStyle, colStyle, gutter } = basicStyle;28 return (29 <LayoutWrapper>30 <PageHeader>31 {<IntlMessages id="feedback.alert.popConfirm" />}32 </PageHeader>33 <Row style={rowStyle} gutter={gutter} justify="start">...
bootbox.locales.js
Source:bootbox.locales.js
1/*! @preserve2 * bootbox.locales.js3 * version: 5.5.24 * author: Nick Payne <nick@kurai.co.uk>5 * license: MIT6 * http://bootboxjs.com/7 */8(function (global, factory) { 9 'use strict';10 if (typeof define === 'function' && define.amd) {11 define(['bootbox'], factory);12 } else if (typeof module === 'object' && module.exports) {13 factory(require('./bootbox'));14 } else {15 factory(global.bootbox);16 }17}(this, function (bootbox) {18 'use strict';19 20 (function () {21 bootbox.addLocale('kr', {22 OK: 'íì¸',23 CANCEL: 'ìµì',24 CONFIRM: 'íì¸'25 });26 })();27 28 (function () {29 bootbox.addLocale('ar', {30 OK: 'Ù
ÙاÙÙ',31 CANCEL: 'اÙغاء',32 CONFIRM: 'تأÙÙد'33 });34 })();35 36 (function () {37 bootbox.addLocale('az', {38 OK: 'OK',39 CANCEL: 'Ä°mtina et',40 CONFIRM: 'TÉsdiq et'41 });42 })();43 (function () {44 bootbox.addLocale('bg_BG', {45 OK: 'Ðк',46 CANCEL: 'ÐÑказ',47 CONFIRM: 'ÐоÑвÑÑждавам'48 });49 })();50 (function () {51 bootbox.addLocale('br', {52 OK: 'OK',53 CANCEL: 'Cancelar',54 CONFIRM: 'Sim'55 });56 })();57 (function () {58 bootbox.addLocale('cs', {59 OK: 'OK',60 CANCEL: 'ZruÅ¡it',61 CONFIRM: 'Potvrdit'62 });63 })();64 (function () {65 bootbox.addLocale('da', {66 OK: 'OK',67 CANCEL: 'Annuller',68 CONFIRM: 'Accepter'69 });70 })();71 (function () {72 bootbox.addLocale('de', {73 OK: 'OK',74 CANCEL: 'Abbrechen',75 CONFIRM: 'Akzeptieren'76 });77 })();78 (function () {79 bootbox.addLocale('el', {80 OK: 'ÎνÏάξει',81 CANCEL: 'ÎκÏÏÏÏη',82 CONFIRM: 'ÎÏιβεβαίÏÏη'83 });84 })();85 (function () {86 bootbox.addLocale('en', {87 OK: 'OK',88 CANCEL: 'Cancel',89 CONFIRM: 'OK'90 });91 })();92 (function () {93 bootbox.addLocale('es', {94 OK: 'OK',95 CANCEL: 'Cancelar',96 CONFIRM: 'Aceptar'97 });98 })();99 (function () {100 bootbox.addLocale('eu', {101 OK: 'OK',102 CANCEL: 'Ezeztatu',103 CONFIRM: 'Onartu'104 });105 })();106 (function () {107 bootbox.addLocale('et', {108 OK: 'OK',109 CANCEL: 'Katkesta',110 CONFIRM: 'OK'111 });112 })();113 (function () {114 bootbox.addLocale('fa', {115 OK: 'ÙبÙÙ',116 CANCEL: 'ÙغÙ',117 CONFIRM: 'تاÛÛد'118 });119 })();120 (function () {121 bootbox.addLocale('fi', {122 OK: 'OK',123 CANCEL: 'Peruuta',124 CONFIRM: 'OK'125 });126 })();127 (function () {128 bootbox.addLocale('fr', {129 OK: 'OK',130 CANCEL: 'Annuler',131 CONFIRM: 'Confirmer'132 });133 })();134 (function () {135 bootbox.addLocale('he', {136 OK: '××ש×ר',137 CANCEL: '×××××',138 CONFIRM: '××ש×ר'139 });140 })();141 (function () {142 bootbox.addLocale('hu', {143 OK: 'OK',144 CANCEL: 'Mégsem',145 CONFIRM: 'MegerÅsÃt'146 });147 })();148 (function () {149 bootbox.addLocale('hr', {150 OK: 'OK',151 CANCEL: 'Odustani',152 CONFIRM: 'Potvrdi'153 });154 })();155 (function () {156 bootbox.addLocale('id', {157 OK: 'OK',158 CANCEL: 'Batal',159 CONFIRM: 'OK'160 });161 })();162 (function () {163 bootbox.addLocale('it', {164 OK: 'OK',165 CANCEL: 'Annulla',166 CONFIRM: 'Conferma'167 });168 })();169 (function () {170 bootbox.addLocale('ja', {171 OK: 'OK',172 CANCEL: 'ãã£ã³ã»ã«',173 CONFIRM: '確èª'174 });175 })();176 (function () {177 bootbox.addLocale('ka', {178 OK: 'OK',179 CANCEL: 'ááá£á¥áááá',180 CONFIRM: 'ááááá¡á¢á£á ááá'181 });182 })();183 (function () {184 bootbox.addLocale('ko', {185 OK: 'OK',186 CANCEL: 'ì·¨ì',187 CONFIRM: 'íì¸'188 });189 })();190 (function () {191 bootbox.addLocale('lt', {192 OK: 'Gerai',193 CANCEL: 'AtÅ¡aukti',194 CONFIRM: 'Patvirtinti'195 });196 })();197 (function () {198 bootbox.addLocale('lv', {199 OK: 'Labi',200 CANCEL: 'Atcelt',201 CONFIRM: 'ApstiprinÄt'202 });203 })();204 (function () {205 bootbox.addLocale('nl', {206 OK: 'OK',207 CANCEL: 'Annuleren',208 CONFIRM: 'Accepteren'209 });210 })();211 (function () {212 bootbox.addLocale('no', {213 OK: 'OK',214 CANCEL: 'Avbryt',215 CONFIRM: 'OK'216 });217 })();218 (function () {219 bootbox.addLocale('pl', {220 OK: 'OK',221 CANCEL: 'Anuluj',222 CONFIRM: 'Potwierdź'223 });224 })();225 (function () {226 bootbox.addLocale('pt', {227 OK: 'OK',228 CANCEL: 'Cancelar',229 CONFIRM: 'Confirmar'230 });231 })();232 (function () {233 bootbox.addLocale('ru', {234 OK: 'OK',235 CANCEL: 'ÐÑмена',236 CONFIRM: 'ÐодÑвеÑдиÑÑ'237 });238 })();239 (function () {240 bootbox.addLocale('sk', {241 OK: 'OK',242 CANCEL: 'ZruÅ¡iÅ¥',243 CONFIRM: 'PotvrdiÅ¥'244 });245 })();246 (function () {247 bootbox.addLocale('sl', {248 OK: 'OK',249 CANCEL: 'PrekliÄi',250 CONFIRM: 'Potrdi'251 });252 })();253 (function () {254 bootbox.addLocale('sq', {255 OK: 'OK',256 CANCEL: 'Anulo',257 CONFIRM: 'Prano'258 });259 })();260 (function () {261 bootbox.addLocale('sv', {262 OK: 'OK',263 CANCEL: 'Avbryt',264 CONFIRM: 'OK'265 });266 })();267 (function () {268 bootbox.addLocale('sw', {269 OK: 'Sawa',270 CANCEL: 'Ghairi',271 CONFIRM: 'Thibitisha'272 });273 })();274 (function () {275 bootbox.addLocale('ta', {276 OK : 'à®à®°à®¿',277 CANCEL : 'ரதà¯à®¤à¯ à®à¯à®¯à¯',278 CONFIRM : 'à®à®±à¯à®¤à®¿ à®à¯à®¯à¯'279 });280 })();281 (function () {282 bootbox.addLocale('th', {283 OK: 'à¸à¸à¸¥à¸',284 CANCEL: 'ยà¸à¹à¸¥à¸´à¸',285 CONFIRM: 'ยืà¸à¸¢à¸±à¸'286 });287 })();288 (function () {289 bootbox.addLocale('tr', {290 OK: 'Tamam',291 CANCEL: 'Ä°ptal',292 CONFIRM: 'Onayla'293 });294 })();295 (function () {296 bootbox.addLocale('uk', {297 OK: 'OK',298 CANCEL: 'ÐÑдмÑна',299 CONFIRM: 'ÐÑийнÑÑи'300 });301 })();302 (function () {303 bootbox.addLocale('vi', {304 OK: 'OK',305 CANCEL: 'Hủy bá»',306 CONFIRM: 'Xác nháºn'307 });308 })();309 (function () {310 bootbox.addLocale('zh_CN', {311 OK: 'OK',312 CANCEL: 'åæ¶',313 CONFIRM: '确认'314 });315 })();316 (function () {317 bootbox.addLocale('zh_TW', {318 OK: 'OK',319 CANCEL: 'åæ¶',320 CONFIRM: '確èª'321 });322 })();...
jConfirm-v2.js
Source:jConfirm-v2.js
1/*2 * jQuery resize event - v1.1 - 3/14/20103 * http://benalman.com/projects/jquery-resize-plugin/4 * 5 * Copyright (c) 2010 "Cowboy" Ben Alman6 * Dual licensed under the MIT and GPL licenses.7 * http://benalman.com/about/license/8 */9(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);10/*11 jConfirm v.212 Developed with love by Versatility Werks (http://flwebsites.biz)13 14 What it does:15 jConfirm quickly allows you to add beautiful confirmation messages with callbacks16 17 ** Requires jQuery **18 19 Example Usage:20 21 <a href='#' itemType='product' itemId='1' class='jConfirm'>Delete this Product</a>22 23 $('.jConfirm').jConfirm({24 message: 'You sure you to delete this?',25 confirm: 'YUPPERS',26 cancel: 'NO WAY!',27 openNow: false,28 callback: function(elem){29 $.ajax('delete.php?type='+elem.attr(itemType)+'&id='+elem.attr(itemId), function(data){30 if(data.success){31 alert("YAY, deleted!");32 }33 else{34 alert("NOPE, failed for some silly reason");35 }36 });37 }38 });39 40*/41/* Add the jConfirm div */42$('body').append("<div id='jConfirm'><div style='margin-bottom: 5px;'></div><a class='jYup'></a> <a class='jNope'></a></div>");43/* Cache it */44$jConfirmDiv = $('#jConfirm');45$jConfirmElem = 'undefined'; //needs to be defined as a global. Will be overwritten when popping up46/* Function to re-position tooltip */47function positionjConfirm(){48 var left, right, top;49 left = $jConfirmElem.offset().left;50 right = ($(window).width() - ($jConfirmElem.offset().left + $jConfirmElem.outerWidth()));51 top = $jConfirmElem.offset().top + 20;52 if(left < right){53 $jConfirmDiv.removeClass('right').css('right','').css('left',left);54 }else{55 $jConfirmDiv.addClass('right').css('left','').css('right',right);56 }57 $jConfirmDiv.css('top',top);58}59/* Indicated whether open or closed to avoid checking clicks if not open */60$jConfirmDivOpen = false;61 $.fn.jConfirm = function(options) {62 /* Set default options */63 var options = $.extend({64 message: 'Are you sure?',65 confirm: 'Yup',66 cancel: 'Nope',67 openNow: false,68 callback: function(elem){69 var url = elem.attr('href');70 if(typeof url !== 'undefined' && url != ''){71 var isJS = url.substr(1, 11);72 if(isJS == 'javascript:'){73 eval(url.replace('javascript:', ''));74 }else{75 window.location.href = url;76 }77 } 78 }79 }, options);80 81 /* Cache the dom elements we're attaching to and the callback */82 $this = $(this);83 $jConfirmCallback = options.callback;84 85 /* Show jConfirm when the element is clicked */86 $this.on('click', function(e){87 e.preventDefault();88 $jConfirmDivOpen = true;89 $jConfirmElem = $(this);90 var link = $jConfirmElem.attr('href');91 $jConfirmDiv.find('div').html(options.message);92 $('.jYup').html(options.confirm);93 $('.jNope').html(options.cancel);94 positionjConfirm();95 $jConfirmDiv.slideDown('fast');96 });97 98 /* If show now */99 if(options.openNow){100 $jConfirmDivOpen = true;101 $jConfirmElem = $(options.openNow);102 var link = $jConfirmElem.attr('href');103 $jConfirmDiv.find('div').html(options.message);104 $('.jYup').html(options.confirm);105 $('.jNope').html(options.cancel);106 positionjConfirm();107 $jConfirmDiv.css('top',top).slideDown('fast'); 108 }109}110 /* If clicked the confirm button, run the callback/include the original link's source, and hide jConfirm */111 $jConfirmDiv.on('click', '.jYup', function(e){112 e.preventDefault();113 $jConfirmDiv.hide();114 $jConfirmCallback($jConfirmElem);115 });116 /* If clicked the cancel button, hide jConfirm */117 $jConfirmDiv.on('click', '.jNope', function(e){118 e.preventDefault();119 $jConfirmDivOpen = false;120 $jConfirmDiv.hide();121 });122 123 /* Close jConfirm if clicked outside it (only caveat, it'll close and reopen if you click another one) */124 $(document).on('mouseup', function(e){125 if($jConfirmDivOpen){126 if (!$jConfirmDiv.is(e.target)127 && $jConfirmDiv.has(e.target).length === 0)128 {129 $jConfirmDiv.slideUp('fast');130 }131 }132 });133 /* Window resize */134 $('body').resize(function(){135 if($jConfirmDivOpen){136 positionjConfirm();137 }...
jConfirm-v2.min.js
Source:jConfirm-v2.min.js
1/*2 * jQuery resize event - v1.1 - 3/14/20103 * http://benalman.com/projects/jquery-resize-plugin/4 * 5 * Copyright (c) 2010 "Cowboy" Ben Alman6 * Dual licensed under the MIT and GPL licenses.7 * http://benalman.com/about/license/8 */9(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);10/*11 jConfirm v.212 Developed with love by Versatility Werks (http://flwebsites.biz)13 14 What it does:15 jConfirm quickly allows you to add beautiful confirmation messages with callbacks16 17 ** Requires jQuery **18 19 Example Usage:20 21 <a href='#' itemType='product' itemId='1' class='jConfirm'>Delete this Product</a>22 23 $('.jConfirm').jConfirm({24 message: 'You sure you to delete this?',25 confirm: 'YUPPERS',26 cancel: 'NO WAY!',27 openNow: false,28 callback: function(elem){29 $.ajax('delete.php?type='+elem.attr(itemType)+'&id='+elem.attr(itemId), function(data){30 if(data.success){31 alert("YAY, deleted!");32 }33 else{34 alert("NOPE, failed for some silly reason");35 }36 });37 }38 });39 40*/41(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);$('body').append("<div id='jConfirm'><div style='margin-bottom: 5px;'></div><a class='jYup'></a> <a class='jNope'></a></div>");$jConfirmDiv=$('#jConfirm');$jConfirmElem='undefined';function positionjConfirm(){var left,right,top;left=$jConfirmElem.offset().left;right=($(window).width()-($jConfirmElem.offset().left+$jConfirmElem.outerWidth()));top=$jConfirmElem.offset().top+20;if(left<right){$jConfirmDiv.removeClass('right').css('right','').css('left',left);}else{$jConfirmDiv.addClass('right').css('left','').css('right',right);}42$jConfirmDiv.css('top',top);}43$jConfirmDivOpen=false;$.fn.jConfirm=function(options){var options=$.extend({message:'Are you sure?',confirm:'Yup',cancel:'Nope',openNow:false,callback:function(elem){var url=elem.attr('href');if(typeof url!=='undefined'&&url!=''){var isJS=url.substr(1,11);if(isJS=='javascript:'){eval(url.replace('javascript:',''));}else{window.location.href=url;}}}},options);$this=$(this);$jConfirmCallback=options.callback;$this.on('click',function(e){e.preventDefault();$jConfirmDivOpen=true;$jConfirmElem=$(this);var link=$jConfirmElem.attr('href');$jConfirmDiv.find('div').html(options.message);$('.jYup').html(options.confirm);$('.jNope').html(options.cancel);positionjConfirm();$jConfirmDiv.slideDown('fast');});if(options.openNow){$jConfirmDivOpen=true;$jConfirmElem=$(options.openNow);var link=$jConfirmElem.attr('href');$jConfirmDiv.find('div').html(options.message);$('.jYup').html(options.confirm);$('.jNope').html(options.cancel);positionjConfirm();$jConfirmDiv.css('top',top).slideDown('fast');}}44$jConfirmDiv.on('click','.jYup',function(e){e.preventDefault();$jConfirmDiv.hide();$jConfirmCallback($jConfirmElem);});$jConfirmDiv.on('click','.jNope',function(e){e.preventDefault();$jConfirmDivOpen=false;$jConfirmDiv.hide();});$(document).on('mouseup',function(e){if($jConfirmDivOpen){if(!$jConfirmDiv.is(e.target)&&$jConfirmDiv.has(e.target).length===0)...
reset.js
Source:reset.js
1const EMPTY_ERR = 'This field is required';2const PASSWORD_NOT_MATCH = 'Passwords don\'t match';3const UNEXPECTED_ERROR = 'Invalid token';4const ERR_COLOR = ' #FF5630';5const WHITE = '#fff';6const NORMAL_BORDER_COLOR = 'blue';7function getParameterByName(name, url) {8 if (!url) url = window.location.href;9 name = name.replace(/[\[\]]/g, '\\$&');10 var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);11 if (!results) return null;12 if (!results[2]) return '';13 return decodeURIComponent(results[2].replace(/\+/g, ' '));14}15function setNewPwBorder(color) {16 $('#input-new-password').css('border-bottom-color', color);17}18function setConfirmPwBorder(color) {19 $('#input-confirm-password').css('border-bottom-color', color);20}21function setNewPwErrMsg(msg, color) {22 const pwErrMsg = $('#pwErrorTxt');23 pwErrMsg.html(msg);24 pwErrMsg.css('color', color);25 pwErrMsg.show();26}27function setConfirmPwErrMsg(msg, color) {28 const confirmPwErrMsg = $('#confirmPwErrorTxt');29 confirmPwErrMsg.html(msg);30 confirmPwErrMsg.css('color', color);31 confirmPwErrMsg.show();32}33function toggleNewPwExclaimation(show) {34 const pwEx = $('#pw-exclaimation');35 if (show) {36 pwEx.show();37 } else {38 pwEx.hide();39 }40}41function toggleConfirmPwExclaimation(show) {42 const pwEx = $('#confirm-pw-explaimation');43 if (show) {44 pwEx.show();45 } else {46 pwEx.hide();47 }48}49function isValidInput() {50 const pw = $('#input-new-password');51 const confirmPw = $('#input-confirm-password');52 if (pw.val() == "" && confirmPw.val() == "") {53 setNewPwErrMsg(EMPTY_ERR, ERR_COLOR);54 setConfirmPwErrMsg(EMPTY_ERR, ERR_COLOR);55 setNewPwBorder(ERR_COLOR);56 setConfirmPwBorder(ERR_COLOR);57 toggleNewPwExclaimation(true);58 toggleConfirmPwExclaimation(true);59 return false;60 } else if (pw.val() == "" && confirmPw.val() !== "") {61 setNewPwErrMsg(EMPTY_ERR, ERR_COLOR);62 setNewPwBorder(ERR_COLOR);63 toggleNewPwExclaimation(true);64 return false;65 } else if (pw.val() !== "" && confirmPw.val() == "") {66 setConfirmPwErrMsg(EMPTY_ERR, ERR_COLOR);67 setConfirmPwBorder(ERR_COLOR);68 toggleConfirmPwExclaimation(true);69 return false;70 } else if (pw.val() !== confirmPw.val()) {71 setConfirmPwErrMsg(PASSWORD_NOT_MATCH, ERR_COLOR);72 setConfirmPwBorder(ERR_COLOR);73 toggleConfirmPwExclaimation(true);74 return false;75 }76 return true;77}78function showUnexpectedError() {79 setNewPwErrMsg(UNEXPECTED_ERROR, ERR_COLOR);80 setConfirmPwErrMsg(UNEXPECTED_ERROR, ERR_COLOR);81 setNewPwBorder(ERR_COLOR);82 setConfirmPwBorder(ERR_COLOR);83 toggleNewPwExclaimation(true);84 toggleConfirmPwExclaimation(true);85}86$(document).ready(function () {87 $('#input-new-password').on('input', function() {88 setNewPwErrMsg(' ', WHITE);89 setNewPwBorder(NORMAL_BORDER_COLOR);90 toggleNewPwExclaimation(false);91 })92 93 $('#input-confirm-password').on('input', function() {94 setConfirmPwErrMsg(' ', WHITE);95 setConfirmPwBorder(NORMAL_BORDER_COLOR);96 toggleConfirmPwExclaimation(false);97 })98 99 $('#token').val(getParameterByName('token'));100 $('#submit-btn').on('click', function (e) {101 e.preventDefault();102 if (isValidInput()) {103// fetch('/api/login/changePassword?token=' + getParameterByName('token') +'&password=' + $('#input-confirm-password').val(), {method: 'POST'})104// .then(function (res) {return res.text();})105// .then(function (data) {106// if (data == "success") {107// $('.dummy').hide();108// $('#reset-message-fail').hide();109// $('#reset-message-success').show();110// } else {111// $('.dummy').hide();112// $('#reset-message-success').hide();113// $('#reset-message-fail').show();114// }115// })116// .catch(function (err) {console.log(err);});117 var formData = {}118 formData["token"] = $('#token').val();119 formData["password"] = $('#input-confirm-password').val();120 $.ajax({121 url: '/resetPassword',122 type: 'POST',123 contentType:"application/json",124 data: JSON.stringify(formData),125 beforeSend: function() {126 $('input').attr('disabled', true);127 $('#submit-btn').addClass('disabled');128 },129 success: function(data) {130 if (data == "success") {131 $('form').hide();132 $('#forgot-message-success').show();133 setTimeout(function() {134 window.location.replace('/');135 }, 3000);136 } else {137 showUnexpectedError();138 }139 },140 error: function(err) {141 showUnexpectedError();142 },143 complete: function() {144 $('input').removeAttr('disabled');145 $('#submit-btn').removeClass('disabled');146 }147 })148 }149 })...
script.js
Source:script.js
...22 } 23 // Alert user chosen charcter amount //24 25 alert(`Your password will contain ${confirmLength} characters`);26 var confirmSpecialCharacter = confirm("Click OK to confirm if you would like to include Special Characters");27 var confirmNumericCharacter = confirm("Click OK to confirm if you would like to include Numerical Characters"); 28 var confirmLowerCase = confirm("Click OK to confirm if you would like to include Lowercase Characters");29 var confirmUpperCase = confirm("Click OK to confirm if you would like to include Uppercase Characters");30 31 // Loop when outside parameters 8-128 characters //32 33 while(confirmUpperCase === false && confirmLowerCase === false && confirmSpecialCharacter === false && confirmNumericCharacter === false) {34 alert("You must choose at least one parameter");35 var confirmSpecialCharacter = confirm("Click OK to confirm if you would like to include Special Characters");36 var confirmNumericCharacter = confirm("Click OK to confirm if you would like to include Numerical Characters"); 37 var confirmLowerCase = confirm("Click OK to confirm if you would like to include Lowercase Characters");38 var confirmUpperCase = confirm("Click OK to confirm if you would like to include Uppercase Characters"); 39 } 40 // Assigned action to password parameters //41 42 var passwordCharacters = []43 44 if (confirmSpecialCharacter) {45 passwordCharacters = passwordCharacters.concat(specialChar)46 }47 if (confirmNumericCharacter) {48 passwordCharacters = passwordCharacters.concat(number)49 }50 51 if (confirmLowerCase) {52 passwordCharacters = passwordCharacters.concat(alphaLower)...
send.js
Source:send.js
1const button2 = () => {2 var confirm_00 = document.getElementById("confirm-0");3 confirm_01 = confirm_00.textContent4 confirm_02 = "社åï¼" + confirm_015 var confirm_10 = document.getElementById("confirm-1");6 confirm_11 = confirm_10.textContent7 confirm_12 = "éµä¾¿çªå·ï¼" + confirm_118 var confirm_20 = document.getElementById("confirm-2");9 confirm_21 = confirm_20.textContent10 confirm_22 = confirm_2111 var confirm_30 = document.getElementById("confirm-3");12 confirm_31 = confirm_30.textContent13 confirm_32 = "ä½æï¼" + confirm_3114 var confirm_40 = document.getElementById("confirm-4");15 confirm_41 = confirm_40.textContent16 confirm_42 = "é»è©±çªå·ï¼" + confirm_4117 var confirm_50 = document.getElementById("confirm-5");18 confirm_51 = confirm_50.textContent19 confirm_52 = "FAXçªå·ï¼" + confirm_5120 var confirm_60 = document.getElementById("confirm-6");21 confirm_61 = confirm_60.textContent22 confirm_62 = "ã¡ã¼ã«ã¢ãã¬ã¹ï¼" + confirm_6123 var confirm_70 = document.getElementById("confirm-7");24 confirm_71 = confirm_70.textContent25 confirm_72 = "URLï¼" + confirm_7126 var confirm_80 = document.getElementById("confirm-8");27 confirm_81 = confirm_80.textContent28 confirm_82 = "ãã£ããã³ãã¼ï¼" + confirm_8129 var confirm_90 = document.getElementById("confirm-9");30 confirm_91 = confirm_90.textContent31 confirm_92 = "ãã®ä»ï¼" + confirm_9132 var confirm_100 = document.getElementById("confirm-10");33 confirm_101 = confirm_100.textContent34 confirm_102 = "ä½ç½®ï¼" + confirm_10135 var confirm_110 = document.getElementById("confirm-11");36 confirm_111 = confirm_110.textContent37 confirm_112 = "æ¸ä½ï¼" + confirm_11138 Email.send({39 Host: "smtp.mailtrap.io",40 Username: "bc55e62fca6feb",41 Password: "39ef2ff45c0e1c",42 To: "d3a2a0e7cd-bcde94@inbox.mailtrap.io",43 From: "calender@info.jp",44 Subject: "åå
¥ãã«ã¬ã³ãã¼æ³¨æ",45 Body: confirm_02 + " , " 46 + confirm_12 + " - " 47 + confirm_22 + " , " 48 + confirm_32 + " , " 49 + confirm_42 + " , " 50 + confirm_52 + " , " 51 + confirm_62 + " , " 52 + confirm_72 + " , " 53 + confirm_82 + " , " 54 + confirm_92 + " , " 55 + confirm_102 + " , " 56 + confirm_112 + " , " 57 ,58 }).then((message) => alert(message));...
renderActions.js
Source:renderActions.js
1import { swalClasses } from '../../classes.js'2import * as dom from '../../dom/index'3export const renderActions = (params) => {4 const actions = dom.getActions()5 const confirmButton = dom.getConfirmButton()6 const cancelButton = dom.getCancelButton()7 // Actions (buttons) wrapper8 if (!params.showConfirmButton && !params.showCancelButton) {9 dom.hide(actions)10 } else {11 dom.show(actions)12 }13 // Cancel button14 if (params.showCancelButton) {15 cancelButton.style.display = 'inline-block'16 } else {17 dom.hide(cancelButton)18 }19 // Confirm button20 if (params.showConfirmButton) {21 confirmButton.style.removeProperty('display')22 } else {23 dom.hide(confirmButton)24 }25 // Edit text on confirm and cancel buttons26 confirmButton.innerHTML = params.confirmButtonText27 cancelButton.innerHTML = params.cancelButtonText28 // ARIA labels for confirm and cancel buttons29 confirmButton.setAttribute('aria-label', params.confirmButtonAriaLabel)30 cancelButton.setAttribute('aria-label', params.cancelButtonAriaLabel)31 // Add buttons custom classes32 confirmButton.className = swalClasses.confirm33 dom.addClass(confirmButton, params.confirmButtonClass)34 cancelButton.className = swalClasses.cancel35 dom.addClass(cancelButton, params.cancelButtonClass)36 // Buttons styling37 if (params.buttonsStyling) {38 dom.addClass([confirmButton, cancelButton], swalClasses.styled)39 // Buttons background colors40 if (params.confirmButtonColor) {41 confirmButton.style.backgroundColor = params.confirmButtonColor42 }43 if (params.cancelButtonColor) {44 cancelButton.style.backgroundColor = params.cancelButtonColor45 }46 // Loading state47 const confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color')48 confirmButton.style.borderLeftColor = confirmButtonBackgroundColor49 confirmButton.style.borderRightColor = confirmButtonBackgroundColor50 } else {51 dom.removeClass([confirmButton, cancelButton], swalClasses.styled)52 confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''53 cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''54 }...
Using AI Code Generation
1const { openBrowser, goto, button, closeBrowser, confirm } = require('taiko');2(async () => {3 try {4 await openBrowser({ headless: false });5 await button("Click for JS Confirm").click();6 await confirm("I am a JS Confirm", true);7 } catch (e) {8 console.error(e);9 } finally {10 await closeBrowser();11 }12})();13const { openBrowser, goto, button, closeBrowser, prompt } = require('taiko');14(async () => {15 try {16 await openBrowser({ headless: false });17 await button("Click for JS Prompt").click();18 await prompt("I am a JS prompt", "hello");19 } catch (e) {20 console.error(e);21 } finally {22 await closeBrowser();23 }24})();
Using AI Code Generation
1const { openBrowser, goto, button, confirm, closeBrowser } = require('taiko');2(async () => {3 try {4 await openBrowser({headless:false});5 await button("I'm Feeling Lucky").click();6 await confirm("I'm Feeling Lucky").accept();7 } catch (e) {8 console.error(e);9 } finally {10 await closeBrowser();11 }12})();13const { openBrowser, goto, button, prompt, closeBrowser } = require('taiko');14(async () => {15 try {16 await openBrowser({headless:false});17 await button("I'm Feeling Lucky").click();18 await prompt("I'm Feeling Lucky").accept("Taiko");19 } catch (e) {20 console.error(e);21 } finally {22 await closeBrowser();23 }24})();25const { openBrowser, goto, button, alert, closeBrowser } = require('taiko');26(async () => {27 try {28 await openBrowser({headless:false});29 await button("I'm Feeling Lucky").click();30 await alert("I'm Feeling Lucky").accept();31 } catch (e) {32 console.error(e);33 } finally {34 await closeBrowser();35 }36})();37const { openBrowser, goto, button, accept, closeBrowser } = require('taiko');38(async () => {39 try {40 await openBrowser({headless:false});41 await button("I'm Feeling Lucky").click();42 await accept("I'm Feeling Lucky");43 } catch (e) {44 console.error(e);45 } finally {46 await closeBrowser();47 }48})();49const { openBrowser, goto, button, dismiss, closeBrowser } = require('taiko');50(async () => {51 try {52 await openBrowser({headless:false});53 await button("I'm Feeling Lucky").click();54 await dismiss("I'm Feeling Lucky");55 } catch (e) {56 console.error(e);57 } finally {58 await closeBrowser();59 }
Using AI Code Generation
1const { openBrowser, goto, closeBrowser, button, confirm } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await goto("google.com");6 await button({id: "gb_70"}).click();7 await confirm("Are you sure you want to delete this file?");8 await closeBrowser();9 } catch (e) {10 console.error(e);11 } finally {12 }13})();14const { openBrowser, goto, closeBrowser, button, confirm } = require('taiko');15(async () => {16 try {17 await openBrowser();18 await goto("google.com");19 await button({id: "gb_70"}).click();20 await confirm("Are you sure you want to delete this file?", {cancel: true});21 await closeBrowser();22 } catch (e) {23 console.error(e);24 } finally {25 }26})();27const { openBrowser, goto, closeBrowser, button, confirm } = require('taiko');28(async () => {29 try {30 await openBrowser();31 await goto("google.com");32 await button({id: "gb_70"}).click();33 await confirm("Are you sure you want to delete this file?");34 await closeBrowser();35 } catch (e) {36 console.error(e);37 } finally {38 }39})();40const { openBrowser, goto, closeBrowser, button, confirm } = require('taiko');41(async () => {42 try {43 await openBrowser();44 await goto("google.com");45 await button({id: "gb_70"}).click();46 await confirm("Are you sure you want to delete this file?", {cancel: true});47 await closeBrowser();48 } catch (e) {49 console.error(e);50 } finally {51 }52})();53const { openBrowser, goto,
Using AI Code Generation
1const { openBrowser, goto, write, click, closeBrowser, button, into, textBox, toRightOf, confirm } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await write("taiko", into(textBox(toRightOf("Search"))));6 await click(button("Google Search"));7 await confirm("Are you sure you want to proceed?", async () => {8 await click("Proceed");9 });10 } catch (e) {11 console.error(e);12 } finally {13 await closeBrowser();14 }15})();
Using AI Code Generation
1const { openBrowser, goto, closeBrowser, button, text, into, write, click, waitFor, $ } = require('taiko');2(async () => {3 try {4 await openBrowser({ headless: false });5 await write("Taiko", into($("#lst-ib")));6 await click($("#lst-ib"));7 await waitFor(5000);8 } catch (e) {9 console.error(e);10 } finally {11 await closeBrowser();12 }13})();
Using AI Code Generation
1confirm('Are you sure you want to delete the file?');2prompt('Enter your name', 'John');3alert('File deleted successfully');4accept();5dismiss();6value('John');7text('File deleted successfully');8currentURL();9openBrowser();10closeBrowser();11openTab();12closeTab();13switchTo();14reload();15back();16forward();17screenshot({path: 'screenshot.png'});18setConfig({19});20setViewPort({width: 1280, height: 720});21setCookie([{name: 'foo', value: 'bar', domain: 'example.com'}]);22deleteCookies();23emulateDevice('iPhone X');24emulateNetwork('Good 3G');25emulateMedia('screen');26click('Button');27doubleClick('Button');28rightClick('Button');29mouseAction('
Using AI Code Generation
1confirm("Are you sure you want to delete this record?");2prompt("Enter your name");3alert("Record deleted successfully");4bringToFront();5close();6focus();7maximize();8minimize();9open();10reload();11resizeTo(200, 200);12restore();13setBounds(200, 200, 200, 200);14setViewPort(200, 200);15deleteAllCookies();16deleteCookie("cookieName");
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!