Skip to content

Instantly share code, notes, and snippets.

@jhorsman
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhorsman/f19159df4ff054c58bcb to your computer and use it in GitHub Desktop.
Save jhorsman/f19159df4ff054c58bcb to your computer and use it in GitHub Desktop.
LiveContent login bookmarklet
javascript:(function(){if(window.location.href.indexOf("docs.sdl.com") != -1 && document.getElementById("username")) {if($("#loginForm").length == 0) {$(".fields").css("position", "relative");$("<p style='color: orange; position: absolute; right: 40px; top: -8px;'>Enhanced by LiveContent bookmarklet</p>").prependTo(".fields");$(".splash .fields").wrap("<form id='loginForm' onsubmit='javascript: $(\"div.login_button.xref\").children(\"img\").click(); return false;'/>");$("<input id='formSubmitButton' type='submit' value='Submit' style='display: none;'/>").appendTo(".login_button");imageButton = $("div.login_button.xref").children("img");imageButton.hide();$("<img onClick='$(\"#formSubmitButton\").click()'/>").attr("src", imageButton.attr("src")).insertAfter(imageButton);}} else {window.location.href="http://docs.sdl.com/LiveContent/"}}());
if(window.location.href.indexOf("docs.sdl.com") != -1 && document.getElementById("username")) {
if($("#loginForm").length == 0) {
$(".fields").css("position", "relative");
$("<p style='color: orange; position: absolute; right: 40px; top: -8px;'>Enhanced by LiveContent bookmarklet</p>").prependTo(".fields");
$(".splash .fields").wrap("<form id='loginForm' onsubmit='javascript: $(\"div.login_button.xref\").children(\"img\").click(); return false;'/>");
$("<input id='formSubmitButton' type='submit' value='Submit' style='display: none;'/>").appendTo(".login_button");
imageButton = $("div.login_button.xref").children("img");
imageButton.hide();
$("<img onClick='$(\"#formSubmitButton\").click()'/>").attr("src", imageButton.attr("src")).insertAfter(imageButton);
}
} else {
window.location.href="http://docs.sdl.com/LiveContent/"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment