function changeName(newName){
var ProjectName = document.getElementById('project-name');
ProjectName.innerHTML = newName + " <input type=\"image\" class=\"edit-icon click-to-edit\" src=\"http://www.nickpoole.me/spectacle/edit-icon.png\" height=\"10px\">";
}
var el = document.getElementById("project-name-block");
el.addEventListener("click", function(){
var NewProjectName = prompt("What would you like to call your project?");
while(NewProjectName == ""){
if(NewProjectName == ""){alert("You have to pick a name");}
NewProjectName = prompt("What would you like to call your project?");
}
changeName(NewProjectName);
}, false);
// Scuddle away all of the hidden elements at app start
$("exit-foot").hide();
$(".module-list").hide();
$(".cross").hide();
$(".menu").hide();
// Handler for opening the hamburger menu
$(".hamburger").click(function() {
$(".menu").slideToggle("slow", function() {
$(".hamburger").hide();
$(".cross").show();
});
});
// Handler for closing the hamburger menu
$(".cross").click(function() {
$(".menu").slideToggle("slow", function() {
$(".cross").hide();
$(".hamburger").show();
});
});
// Handler for "Add Module" navigation action
$(".add-module").click(function() {
$(".module-list").slideToggle("slow", function() {
$("footer").hide();
$("exit-foot").show();
});
});
// Module list exit handler
$(".mod-list-exit").click(function() {
$(".module-list").slideToggle("slow", function() {
$("footer").show();
$("exit-foot").hide();
});
});
function showImage(src,target) {
var fr=new FileReader();
// when image is loaded, set the src of the image where you want to display it
fr.onload = function(e) { target.src = this.result; };
src.addEventListener("change",function() {
// fill fr with image data
fr.readAsDataURL(src.files[0]);
});
}
var src = document.getElementById("photo-input");
var target =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.