This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createLauncherPanel() { | |
var div = document.createElement("div"); | |
div.setAttribute("class", "launcher-panel"); | |
div.classList.add("hidden"); | |
div.appendChild(createLauncherLink(div)); | |
document.getElementsByTagName("body")[0].appendChild(div); | |
return div; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no"> | |
<meta name="theme-color" content="#ffffff"> | |
<title>Enonic XP Admin</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, user-scalable=no" name="viewport"> | |
<style type="text/css"> | |
.. | |
</style> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor() { | |
this.userIdInput = new api.ui.text.TextInput('input-view'); | |
this.userIdInput.setPlaceholder(_i18n('userid or e-mail')); | |
this.passwordInput = new api.ui.text.PasswordInput('input-view'); | |
this.passwordInput.setPlaceholder(_i18n('password')); | |
this.loginButton = new api.ui.button.Button(); | |
this.loginButton.addClass("login-button"); | |
this.loginButton.hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor() { | |
this.appendChild(this.createLoginContainer()); | |
this.addEventHandlers(); | |
} | |
private api.ui.button.Button createLoginButton() { | |
var button = new api.ui.button.Button(); | |
button.addClass("login-button"); | |
button.hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveChanges() { | |
if (this.hasChanges()) { | |
var user = this.getCurrentUser(); | |
if (user.isAuthenticated() && user.hasWriteAccess()) { | |
// Saving code goes here… | |
} | |
else { | |
this.showMessage(“Not authorised for saving changes”); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveChanges() { | |
if (!this.hasChanges()) { | |
return; | |
} | |
var user = this.getCurrentUser(); | |
if (!user.isAuthenticated() || !user.hasWriteAccess()) | |
this.showMessage(“Not authorised for saving changes”); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLaserSwordOrigin() { | |
var s = ""; | |
if (getLaserSwordColor() == “blue”) { | |
s = “I\’m owned by Luke Skywalker.”; | |
} | |
else if (getLaserSwordColor() == “green”) { | |
s = “I\’m owned by Yoda.”; | |
} | |
else if (getLaserSwordColor() == “red”) { | |
s = “I\’m owned by Luke\’s pa.”; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLaserSwordOrigin() { | |
var laserSwordColor = getLaserSwordColor(); | |
if (laserSwordColor == “blue”) { | |
return “I\’m owned by Luke Skywalker.”; | |
} | |
if (laserSwordColor == “green”) { | |
return “I\’m owned by Yoda.”; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function guessAvenger(avenger) { | |
if (avenger.sex == “M” && avenger.age < 80 && avenger.canFly && avenger.skinColor.includes(“white”)) { | |
console.log(“Iron Man”); | |
} | |
else if (avenger.sex == “M” && avenger.age > 1000 && avenger.canFly && avenger.skinColor.includes(“white”)) { | |
console.log(“Thor”); | |
} | |
else if (avenger.sex == “M” && avenger.age < 80 && !avenger.canFly && (avenger.skinColor.includes(“white”) || avenger.skinColor.includes(“green”))) { | |
console.log(“Hulk”); | |
} |
OlderNewer