Best JavaScript code snippet using devicefarmer-stf
admin.js
Source:admin.js
1var downloadData = '';2var deleteusergroup = [];3var selectedusergroup = [];4var navpage = '';5$(document).ready(function() {6 $('.usr-accounts').change(function(){7 8 var usrid = selectedusergroup.indexOf($(this).val());9 10 if( usrid == -1 ){11 selectedusergroup.push($(this).val());12 }13 else{14 selectedusergroup.splice(usrid, 1);15 }16 });17});18$(document).on('pagehide', function(event, ui) {19 var page = jQuery(event.target);20});21$(document).bind("mobileinit", function() {22 $.mobile.defaultDialogTransition = 'none';23});24function marketDataEvent(eventtype, marketid) {25 var active = $("#market-active").val();26 var goApp = $("#market-go").val();27 var iseeker = $("#market-iseeker").val();28 var name = $("#market-name").val(); 29 var rounded = $("#roundedResults").val();30 var scximporter = $("#market-scximporter").val();31 var snapshot = $("#market-snapshot").val();32 var d = {};33 d.eventtype = eventtype;34 d.marketid = marketid35 d.name = name;36 d.active = active;37 d.rounded = rounded;38 d.goApp = goApp;39 d.snapshot = snapshot;40 var url = "services/markets.php";41 $.post(url, d).done(function(data) {42 window.location = "/markets.php?marketid=" + data;43 });44}45function getUrlVars(name) {46 47 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");48 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),49 results = regex.exec(location.search);50 return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); 51}52function s4() {53 return Math.floor((1 + Math.random()) * 0x10000)54 .toString(16)55 .substring(1);56};57function guid() {58 return s4() + s4() + '-' + s4() + '-' + s4() + '-' +59 s4() + '-' + s4() + s4() + s4();60}61//////////////// USER //////////////////////62function userUpdate(id, corporationid) {63 if (id == 0) {64 userCreate(corporationid);65 return;66 }67 var firstname = $("#firstname").val();68 var lastname = $("#lastname").val();69 var title = $("#title").val();70 var email = $("#email").val();71 var password = $("#password").val();72 var phone = $("#phone").val();73 var cell = $("#cell").val();74 var fax = $("#fax").val();75 var active = $("#active").val();76 var address = $("#address").val();77 var address2 = $("#address2").val();78 var city = $("#city").val();79 var state = $("#state").val();80 var zip = $("#zip").val();81 var defaultoffice = $("#defaultoffice").val();82 var useroffices = [];83 $('input[name="useroffices"]:checkbox:checked').each(function(i) {84 useroffices[i] = $(this).val();85 });86 var usergroups = [];87 $('input[name="usergroups"]:checkbox:checked').each(function(i) {88 usergroups[i] = $(this).val();89 });90 var ezbreakgroups = [];91 $('input[name="ezbreakgroups"]:checkbox:checked').each(function(i) {92 ezbreakgroups[i] = $(this).val();93 });94 if (firstname == '' || lastname == '' || title == '' || email == '' || password == '' || phone == '') {95 alert("Please Fill Required Fields");96 return;97 } 98 $.post("/services/users.php", {99 id: id,100 eventtype: "update",101 firstname: firstname,102 lastname: lastname,103 title: title,104 email: email,105 password: password,106 phone: phone,107 cell: cell,108 fax: fax,109 active: active,110 address: address,111 address2: address2,112 city: city,113 state: state,114 zip: zip,115 defaultoffice: defaultoffice,116 useroffices: useroffices,117 usergroups: usergroups,118 ezbreakgroups: ezbreakgroups119 }).done(function(data) {120 //window.alert('User Updated');121 $.mobile.back();122 //window.location = "/markets.php?marketid="+data;123 });124}125function userCreate(corporationid) {126 var firstname = $("#firstname").val();127 var lastname = $("#lastname").val();128 var title = $("#title").val();129 var email = $("#email").val();130 var password = $("#password").val();131 var phone = $("#phone").val();132 var cell = $("#cell").val();133 var fax = $("#fax").val();134 var active = $("#active").val();135 var address = $("#address").val();136 var address2 = $("#address2").val();137 var city = $("#city").val();138 var state = $("#state").val();139 var zip = $("#zip").val();140 var defaultoffice = $("#defaultoffice").val();141 var useroffices = [];142 $('input[name="useroffices"]:checkbox:checked').each(function(i) {143 useroffices[i] = $(this).val();144 });145 var usergroups = [];146 $('input[name="usergroups"]:checkbox:checked').each(function(i) {147 usergroups[i] = $(this).val();148 });149 $.post("/services/users.php", {150 corporationid: corporationid,151 eventtype: "create",152 firstname: firstname,153 lastname: lastname,154 title: title,155 email: email,156 password: password,157 phone: phone,158 cell: cell,159 fax: fax,160 active: active,161 address: address,162 address2: address2,163 city: city,164 state: state,165 zip: zip,166 defaultoffice: defaultoffice,167 useroffices: useroffices,168 usergroups: usergroups169 }).done(function(data) {170 if (data == '0') {171 window.alert('Email in use');172 } else {173 $.mobile.back();174 }175 });176}177function userDelete(userid, corporationid) {178 var confirm = $("#user-delete-confirm").val();179 var confirmTrimmed = $.trim(confirm);180 if (confirmTrimmed == "delete") {181 182 183 setTimeout(function(){184 $.post("services/users.php", {185 eventtype: 'delete',186 userid: userid,187 corporationid: corporationid188 }).done(function(data) {189 $.mobile.back();190 });191 }, 100); 192 193 194 $.post("services/users.php", {195 eventtype: 'delete',196 userid: userid,197 corporationid: corporationid198 }).done(function(data) {199 $.mobile.back();200 });201 202 } else {203 window.alert('If you wish to delete this user type delete in the box and click this button again');204 }205}206function usersDelete() {207 var currentusers = parseInt($('#users-count').text());208 209 //clear the array of users to be deleted210 while(deleteusergroup.length > 0) {211 deleteusergroup.pop();212 }213 214 // adds new selected users215 for(var i=0; i < selectedusergroup.length; i++) {216 deleteusergroup.push(selectedusergroup[i]);217 }218 219 $.post("services/users.php", {220 221 eventtype: 'deletegroup',222 userids: deleteusergroup.join(",")223 }).done(function(data) {224 currentusers = currentusers - deleteusergroup.length;225 226 //clear array of deleted users227 while(selectedusergroup.length > 0) {228 selectedusergroup.pop();229 }230 231 //confirmation message is updated and displayed232 $('#confirmation-msg-area').text(deleteusergroup.length +" deleted account(s)").toggle();233 234 //number of users in corporation, market or office is updated too235 $('#users-count').text(currentusers);236 //UNDO button is shown237 $('#user-delete-undo:hidden').toggle();238 239 //Hidding removed users from the view240 for(var j=0; j < deleteusergroup.length; j++) {241 $('#usr_'+deleteusergroup[j]).css({'display':'none'});242 }243 244 245 //setting time out to remove the confirmation message246 setTimeout(function(){247 $('#confirmation-msg-area').text("");248 $('#confirmation-msg-area').toggle();249 }250 ,5000);251 252 });253}254function undousersDelete() {255 256 //getting number of users displayed at the header of the widget257 var currentusers = parseInt($('#users-count').text()); 258 259 $.post("services/users.php", {260 eventtype: 'undodelete',261 userids: deleteusergroup.join(",")262 })263 .done(function(data) {264 currentusers = currentusers + deleteusergroup.length;265 $('#user-delete-undo').toggle();266 267 $('#confirmation-msg-area').toggle();268 $('#confirmation-msg-area').text(deleteusergroup.length +" account(s) recovered");269 270 $('#users-count').text(currentusers); 271 272 273 for(var j=0; j < deleteusergroup.length; j++) {274 $('#usr_'+deleteusergroup[j]).toggle();275 $('#'+deleteusergroup[j]).prop('checked',false);276 $('#usr_'+deleteusergroup[j]+' label').toggleClass('ui-checkbox-on');277 $('#usr_'+deleteusergroup[j]+' label').toggleClass('ui-checkbox-off');278 279 $('#usr_'+deleteusergroup[j]+' span').toggleClass('ui-icon-checkbox-on');280 $('#usr_'+deleteusergroup[j]+' span').toggleClass('ui-icon-checkbox-off');281 282 } 283 284 //empty users array285 while(deleteusergroup.length > 0) {286 deleteusergroup.pop();287 }288 setTimeout(function(){289 $('#confirmation-msg-area').text("");290 $('#confirmation-msg-area').toggle();291 }292 ,5000);293 }); 294}295function preDeleteUser(){296 //gets the number of selected users to be deleted297 var cn = selectedusergroup.length;298 299 if(cn > 0){300 $('#number-users-deleted').text(cn); 301 }302 else{303 $('#number-users-deleted').text(''); 304 }...
index.js
Source:index.js
1 var users = {};2 var users2 = [];3 var onhold = 0;4 var userEmail = '';5 var deleteusergroup = [];6 var selectedusergroup = [];7 var apiUrl = "https://plusapi.showseeker.com/";8 $(document).ready(function(){9 $.ajax({10 type:'get', 11 url: apiUrl + 'user/info',12 headers:{"User":localStorage.getItem("userId"), "Api-Key":localStorage.getItem("apiKey")},13 success:function(resp){14 if(!resp.roles.UsersAdmin){15 window.location.href = '../login.php?logout=true&app=admin';16 }17 }18 });19 });20 document.domain = "showseeker.com";21 $('.usr-accounts').change(function(){22 var usrid = selectedusergroup.indexOf($(this).val());23 if( usrid == -1 ){24 selectedusergroup.push($(this).val());25 }26 else{27 selectedusergroup.splice(usrid, 1);28 }29 });30 $('li.allUsersList i').on('click', function(e) {31 32 $(this).toggleClass('fa-square-o').toggleClass('fa-check-square-o');33 34 deleteusergroup = [];35 36 $('li.allUsersList').each(function(i,val){37 if($(this).find('i').hasClass('fa-check-square-o')){38 deleteusergroup.push(parseInt($(this).prop('id')));39 }40 }); 41 42 });43 $('li.officeName').bind('click', function(e) {44 45 $('li.officeName').find('i').removeClass('fa-check-circle-o').addClass('fa-circle-o');46 $(this).find('i').removeClass('fa-circle-o').addClass('fa-check-circle-o');47 48 });49 50 $('#defaultOfficeSelector').on('click',function(){51 $('li.officeName').each(function(i,val){52 if($(this).find('i').hasClass('fa-check-circle-o')){53 var officeId = String($(this).prop('id')).replace('officeId-','');54 var officeName = String($(this).text()).trim(); 55 selectOffice(officeId,officeName);56 } 57 }); 58 });59 var getUrlParameter = function getUrlParameter(sParam) {60 var sPageURL = window.location.search.substring(1),61 sURLVariables = sPageURL.split('&'),62 sParameterName,63 i;64 65 for (i = 0; i < sURLVariables.length; i++) {66 sParameterName = sURLVariables[i].split('=');67 68 if (sParameterName[0] === sParam) {69 return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);70 }71 }72 };73function selectOffice(officeId,officeName){74 $('#defaultoffice').val(officeId);75 $('#officeNameInfo').find('span.ui-btn-text').html(officeName);76 $.ajax({77 type:'get', 78 url: 'services/office.php?id='+officeId,79 success:function(data){80 $("#defaultoffice").val(officeId);81 $("#officeAddressInfo").html(data.address+', '+data.city+'<br />'+data.state+', '+data.zipcode);82 $("#both").popup("close");83 }84 });85}86function clearPopup(){87 $('#emailFormBody').show();88 $('#emailFormConfirmation').hide();89}90function sendNotification(isNew) {91 var first = $("#first").val();92 var email = $("#email").val();93 var id = $("#id").val();94 var corpId = $("#corporationId").val();95 $("#popupLogin").hide();96 var url = 'services/email.php';97 var postData = {};98 99 if(!validateEmail(email)){100 $('#popupEmailAddress,#popupNotification').toggle();101 return; 102 } 103 104 postData.first = first;105 postData.email = email;106 postData.id = id;107 108 109 $.ajax({110 type:'post',111 url: url,112 dataType:"json",113 headers:{"Api-Key":apiKey,"User":userid},114 data: {"first": first, "email": email, "id": id},115 success:function(resp){116 //resp.sentEmail117 if(!isNew){118 $('#emailFormBody').hide();119 $('#emailFormConfirmation').show();120 }121 try{mixTrack("Admin - NewUserEmail",postData);}122 catch(e){} 123 }124 });125} 126function usersDelete() {127 var currentusers = parseInt($('#users-count').text());128 currentusers = currentusers - deleteusergroup.length;129 130 $.post("services/users.php", {131 132 eventtype: 'deletegroup',133 userids: deleteusergroup.join(","),134 adminid: userid135 }).done(function(data) {136 137 //confirmation message is updated and displayed138 $('#confirmation-msg-area').text(deleteusergroup.length +" deleted account(s)").toggle();139 140 //number of users in corporation, market or office is updated too141 $('#users-count').text(currentusers);142 //UNDO button is shown143 $('#user-delete-undo:hidden').toggle();144 145 //Hidding removed users from the view146 for(var j=0; j < deleteusergroup.length; j++) {147 $('#'+deleteusergroup[j]).css({'display':'none'});148 }149 //setting time out to remove the confirmation message150 setTimeout(function(){151 $('#confirmation-msg-area').text("");152 $('#confirmation-msg-area').toggle();153 }154 ,5000);155 try{mixTrack("Admin - UserDelete",{'ids':deleteusergroup.join(",")});}156 catch(e){}157 158 });159}160 function undousersDelete() {161 162 //getting number of users displayed at the header of the widget163 var currentusers = parseInt($('#users-count').text()); 164 165 $.post("services/users.php", {166 eventtype: 'undodelete',167 userids: deleteusergroup.join(",")168 })169 .done(function(data) {170 currentusers = currentusers + deleteusergroup.length;171 $('#user-delete-undo').toggle();172 $('#confirmation-msg-area').toggle();173 $('#confirmation-msg-area').text(deleteusergroup.length +" account(s) recovered");174 $('#users-count').text(currentusers); 175 176 for(var j=0; j < deleteusergroup.length; j++) {177 $('#'+deleteusergroup[j]).toggle();178 $('#'+deleteusergroup[j]).find('i').toggleClass('fa-check-square-o').toggleClass('fa-square-o');179 }180 //empty users array181 while(deleteusergroup.length > 0) {182 deleteusergroup.pop();183 }184 setTimeout(function(){185 $('#confirmation-msg-area').text("");186 $('#confirmation-msg-area').toggle();187 },5000);188 try{mixTrack("Admin - UserUndoDelete",{'ids':deleteusergroup.join(",")});}189 catch(e){}190 }); 191 }192function preDeleteUser(){193 //gets the number of selected users to be deleted194 var cn = deleteusergroup.length;195 if(cn > 0){196 $('#deletedUsersNum').text(cn); 197 $('#popupDelete').popup('open');198 }199 else{200 console.log(0)201 $('#nonSelectedUsers').popup('open');202 $('#deletedUsersNum').text(''); 203 }204}205 function userDelete(userid, corporationid,adminid) {206 deleteusergroup.push(userid);207 setTimeout(function(){208 209 $.post("services/users.php", {210 eventtype: 'delete',211 userid: userid,212 corporationid: corporationid,213 adminid: adminid214 }).done(function(data) { 215 try{mixTrack("Admin - UserDelete",{'userId':userid});}216 catch(e){} 217 //$.mobile.back();218 //window.location = '/admin';219 $('#popupUndo').popup('open');220 });221 }, 100); 222 }223 function undoSingleUserDelete() {224 225 $.post("services/users.php", {226 eventtype: 'undodelete',227 userids: deleteusergroup.join(",")228 })229 .done(function(data) {230 //empty users array231 while(deleteusergroup.length > 0) {232 deleteusergroup.pop();233 }234 try{mixTrack("Admin - SingleUserUndoDelete",{'ids':deleteusergroup.join(",")});}235 catch(e){}236 $('#popupUndo').popup('close');237 }); 238 }239function validateEmail(email) {240 var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;241 return re.test(email);242}243function openTutorial(url,appendUserId){244 var w = 1024;245 var h = 880;246 if(appendUserId){247 url += '&userid='+userid;248 }249 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;250 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;251 window.open(url, "tutorialwindow", "location=no,status=yes,resizable=yes,scrollbars=yes,width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition);...
indexOK.js
Source:indexOK.js
1 var users = {};2 var users2 = [];3 var onhold = 0;4 var userEmail = '';5 var deleteusergroup = [];6 var selectedusergroup = [];7 $(document).ready(function(){8 $.ajax({9 type:'get', 10 url: 'https://apistg2.showseeker.com/user/info',11 headers:{"User":localStorage.getItem("userId"), "Api-Key":localStorage.getItem("apiKey")},12 success:function(resp){13 if(!resp.roles.UsersAdmin && !resp.roles.superAdmin){14 window.location.href = '../login.php?logout=true&app=admin';15 }16 }17 });18 });19 document.domain = "showseeker.com";20 $('.usr-accounts').change(function(){21 var usrid = selectedusergroup.indexOf($(this).val());22 if( usrid == -1 ){23 selectedusergroup.push($(this).val());24 }25 else{26 selectedusergroup.splice(usrid, 1);27 }28 });29 $('li.allUsersList i').on('click', function(e) {30 31 $(this).toggleClass('fa-square-o').toggleClass('fa-check-square-o');32 33 deleteusergroup = [];34 35 $('li.allUsersList').each(function(i,val){36 if($(this).find('i').hasClass('fa-check-square-o')){37 deleteusergroup.push(parseInt($(this).prop('id')));38 }39 }); 40 41 });42 $('li.officeName').bind('click', function(e) {43 44 $('li.officeName').find('i').removeClass('fa-check-circle-o').addClass('fa-circle-o');45 $(this).find('i').removeClass('fa-circle-o').addClass('fa-check-circle-o');46 47 });48 49 $('#defaultOfficeSelector').on('click',function(){50 $('li.officeName').each(function(i,val){51 if($(this).find('i').hasClass('fa-check-circle-o')){52 var officeId = String($(this).prop('id')).replace('officeId-','');53 var officeName = String($(this).text()).trim(); 54 selectOffice(officeId,officeName);55 } 56 }); 57 });58 var getUrlParameter = function getUrlParameter(sParam) {59 var sPageURL = window.location.search.substring(1),60 sURLVariables = sPageURL.split('&'),61 sParameterName,62 i;63 64 for (i = 0; i < sURLVariables.length; i++) {65 sParameterName = sURLVariables[i].split('=');66 67 if (sParameterName[0] === sParam) {68 return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);69 }70 }71 };72function selectOffice(officeId,officeName){73 $('#defaultoffice').val(officeId);74 $('#officeNameInfo').find('span.ui-btn-text').html(officeName);75 $.ajax({76 type:'get', 77 url: 'services/office.php?id='+officeId,78 success:function(data){79 $("#defaultoffice").val(officeId);80 $("#officeAddressInfo").html(data.address+', '+data.city+'<br />'+data.state+', '+data.zipcode);81 $("#both").popup("close");82 }83 });84}85function sendNotification(isNew) {86 var first = $("#first").val();87 var email = $("#email").val();88 var id = $("#id").val();89 var corpId = $("#corporationId").val();90 $("#popupLogin").hide();91 var url = 'services/email.php';92 var postData = {};93 94 if(!validateEmail(email)){95 $('#popupEmailAddress,#popupNotification').toggle();96 return; 97 } 98 99 postData.first = first;100 postData.email = email;101 postData.id = id;102 103 104 $.ajax({105 type:'post',106 url: url,107 dataType:"json",108 headers:{"Api-Key":apiKey,"User":userid},109 data: {"first": first, "email": email, "id": id},110 success:function(resp){111 //resp.sentEmail112 if(!isNew){113 $('#emailFormBody').hide();114 $('#emailFormConfirmation').show();115 }116 try{mixTrack("Admin - NewUserEmail",postData);}117 catch(e){} 118 }119 });120} 121function usersDelete() {122 var currentusers = parseInt($('#users-count').text());123 currentusers = currentusers - deleteusergroup.length;124 125 $.post("services/users.php", {126 127 eventtype: 'deletegroup',128 userids: deleteusergroup.join(","),129 adminid: userid130 }).done(function(data) {131 132 //confirmation message is updated and displayed133 $('#confirmation-msg-area').text(deleteusergroup.length +" deleted account(s)").toggle();134 135 //number of users in corporation, market or office is updated too136 $('#users-count').text(currentusers);137 //UNDO button is shown138 $('#user-delete-undo:hidden').toggle();139 140 //Hidding removed users from the view141 for(var j=0; j < deleteusergroup.length; j++) {142 $('#'+deleteusergroup[j]).css({'display':'none'});143 }144 //setting time out to remove the confirmation message145 setTimeout(function(){146 $('#confirmation-msg-area').text("");147 $('#confirmation-msg-area').toggle();148 }149 ,5000);150 try{mixTrack("Admin - UserDelete",{'ids':deleteusergroup.join(",")});}151 catch(e){}152 153 });154}155 function undousersDelete() {156 157 //getting number of users displayed at the header of the widget158 var currentusers = parseInt($('#users-count').text()); 159 160 $.post("services/users.php", {161 eventtype: 'undodelete',162 userids: deleteusergroup.join(",")163 })164 .done(function(data) {165 currentusers = currentusers + deleteusergroup.length;166 $('#user-delete-undo').toggle();167 $('#confirmation-msg-area').toggle();168 $('#confirmation-msg-area').text(deleteusergroup.length +" account(s) recovered");169 $('#users-count').text(currentusers); 170 171 for(var j=0; j < deleteusergroup.length; j++) {172 $('#'+deleteusergroup[j]).toggle();173 $('#'+deleteusergroup[j]).find('i').toggleClass('fa-check-square-o').toggleClass('fa-square-o');174 }175 //empty users array176 while(deleteusergroup.length > 0) {177 deleteusergroup.pop();178 }179 setTimeout(function(){180 $('#confirmation-msg-area').text("");181 $('#confirmation-msg-area').toggle();182 },5000);183 try{mixTrack("Admin - UserUndoDelete",{'ids':deleteusergroup.join(",")});}184 catch(e){}185 }); 186 }187function preDeleteUser(){188 //gets the number of selected users to be deleted189 var cn = deleteusergroup.length;190 if(cn > 0){191 $('#deletedUsersNum').text(cn); 192 $('#popupDelete').popup('open');193 }194 else{195 console.log(0)196 $('#nonSelectedUsers').popup('open');197 $('#deletedUsersNum').text(''); 198 }199}200 function userDelete(userid, corporationid,adminid) {201 deleteusergroup.push(userid);202 setTimeout(function(){203 204 $.post("services/users.php", {205 eventtype: 'delete',206 userid: userid,207 corporationid: corporationid,208 adminid: adminid209 }).done(function(data) { 210 try{mixTrack("Admin - UserDelete",{'userId':userid});}211 catch(e){} 212 //$.mobile.back();213 //window.location = '/admin';214 $('#popupUndo').popup('open');215 });216 }, 100); 217 }218 function undoSingleUserDelete() {219 220 $.post("services/users.php", {221 eventtype: 'undodelete',222 userids: deleteusergroup.join(",")223 })224 .done(function(data) {225 //empty users array226 while(deleteusergroup.length > 0) {227 deleteusergroup.pop();228 }229 try{mixTrack("Admin - SingleUserUndoDelete",{'ids':deleteusergroup.join(",")});}230 catch(e){}231 $('#popupUndo').popup('close');232 }); 233 }234function validateEmail(email) {235 var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;236 return re.test(email);237}238function openTutorial(url,appendUserId){239 var w = 1024;240 var h = 880;241 if(appendUserId){242 url += '&userid='+userid;243 }244 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;245 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;246 window.open(url, "tutorialwindow", "location=no,status=yes,resizable=yes,scrollbars=yes,width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition);...
Using AI Code Generation
1var stf = require('devicefarmer-stf-client');2client.deleteUserGroup(1, function(err, res) {3 if (err) {4 console.log(err);5 } else {6 console.log(res);7 }8});9var stf = require('devicefarmer-stf-client');10client.deleteUserGroup(1, function(err, res) {11 if (err) {12 console.log(err);13 } else {14 console.log(res);15 }16});17var stf = require('devicefarmer-stf-client');18client.deleteUserGroup(1, function(err, res) {19 if (err) {20 console.log(err);21 } else {22 console.log(res);23 }24});25var stf = require('devicefarmer-stf-client');26client.deleteUserGroup(1, function(err, res) {27 if (err) {28 console.log(err);29 } else {30 console.log(res);31 }32});33var stf = require('devicefarmer-stf-client');34client.deleteUserGroup(1, function(err, res) {35 if (err) {36 console.log(err);37 } else {38 console.log(res);39 }40});41var stf = require('devicefarmer-stf-client');42client.deleteUserGroup(1, function(err, res) {43 if (err) {44 console.log(err);45 } else {46 console.log(res);47 }48});
Using AI Code Generation
1var stf = require('devicefarmer-stf-client');2var user = new stf.User();3user.deleteUserGroup("group1", function(err, result) {4 if (err) {5 console.log(err);6 } else {7 console.log(result);8 }9});
Using AI Code Generation
1var stf = require('devicefarmer-stf');2client.deleteUserGroup('mygroup1', function(err, data) {3 if (err) {4 console.log(err);5 } else {6 console.log(data);7 }8});9getDevices()10var stf = require('devicefarmer-stf');11client.getDevices(function(err, data) {12 if (err) {13 console.log(err);14 } else {15 console.log(data);16 }17});18getDeviceGroup()19var stf = require('devicefarmer-stf');20client.getDeviceGroup('mygroup1', function(err, data) {21 if (err) {22 console.log(err);23 } else {24 console.log(data);25 }26});
Using AI Code Generation
1var stf = require('devicefarmer-stf')2var group = client.deleteUserGroup('groupname')3var stf = require('devicefarmer-stf')4var group = client.deleteUserGroup('groupname')5var stf = require('devicefarmer-stf')6var group = client.deleteUserGroup('groupname')7var stf = require('devicefarmer-stf')8var group = client.deleteUserGroup('groupname')9var stf = require('devicefarmer-stf')10var group = client.deleteUserGroup('groupname')11var stf = require('devicefarmer-stf')12var group = client.deleteUserGroup('groupname')13var stf = require('devicefarmer-stf')14var group = client.deleteUserGroup('groupname')15var stf = require('devicefarmer-stf')16var group = client.deleteUserGroup('groupname')17var stf = require('devicefarmer-stf')18var group = client.deleteUserGroup('groupname')19var stf = require('devicefarmer-stf')
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!!