Skip to content

Instantly share code, notes, and snippets.

@jesperronn
Last active October 12, 2015 16:58
Show Gist options
  • Save jesperronn/4058857 to your computer and use it in GitHub Desktop.
Save jesperronn/4058857 to your computer and use it in GitHub Desktop.
Bookmarklets Work 2012 Put each snippet into "bookmarklet builder" (google it) and add the bookmark to your browser
javascript:
(function(){
$('input[name$=equipmentNumber]').val("12345");
$('input[name$=packageCount]').val("82");
$('input[name$=".cargo.packageKind"]').val("very kind packages");
$('textarea[name$=cargoDescription]').val("description of the cargo");
$('div.commoditySelector').select2('data',{id:"002802",text:"Paper, paperboard, packing material"});
}
)()
javascript:
/*shows internal debug info*/
(function(){
$('.internal-hidden').slideToggle()
}
)()
javascript:
(function(){
function getScript(url,success){
var script=document.createElement('script');
script.src=url;
var head=document.getElementsByTagName('head')[0],done=false;
script.onload=script.onreadystatechange=function(){
if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){
done=true;
success();
script.onload=script.onreadystatechange=null;
head.removeChild(script);
}
}
;
head.appendChild(script);
}
function doLogin(){
var name=prompt("Enter user","dev2ct_testuser53");
$('input[name=username], input[name=usi_username]').val(name+"@xleap");
$('input[name=password], input[name=usi_password]').val("xleap123");
$('form').submit();
}
function jqueryLoaded(){
if(typeof jQuery=='undefined'){
alert('Sorry, but jQuery wasn\'t able to load');
}
doLogin();
}
if(typeof jQuery=='undefined'){
getScript('http://code.jquery.com/jquery.min.js',jqueryLoaded);
}
else{
doLogin();
}
}
)()
javascript:
(function(){
$("#h-company").val("Sveboelle transport");
$("#h-street").val("Langeland Alle");
$("#h-no").val("12");
$("#h-zipCode").val("8210");
$(".time-input-field").val("900").trigger("blur");
}
)()
javascript:
(function(){
$('#b-from').select2('data',{id:"23KBBVVUYELJT",text:"Felixstowe, united Kingdom"});
$('#b-to').select2('data',{id:"2RX5LS7KU273Y",text:"Aarhus, Denmark"});
$('#b-lines-0-commodity').select2('data',{id:"002802",text:"Paper, paperboard, packing material"});
$('#b-lines-0-iso').select2('data',{id:"22G1",text:"20' Dry Standard"});
$('#b-lines-0-weight').val('15000');
$('.action_continue').trigger('click');
}
)()
javascript:
(function(){
location.href = location.href +"?carrier=SAFM"
})()
@jesperronn
Copy link
Author

Paste into the Bookmarklet builder: http://subsimple.com/bookmarklets/jsbuilder.htm

@darren-rose
Copy link

Nice work Jesper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment