Skip to content

Commit df986f2

Browse files
committed
replace “breadfish.gif” with a constant
1 parent f9b3322 commit df986f2

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

resources/js/blockFilter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var filter = {
7373
].join('');
7474
}
7575
} else {
76-
blockString = '<li class="stack e-text"><span contenteditable="true" class="script-input text">breadfish.gif</span></li>';
76+
blockString = '<li class="stack e-text"><span contenteditable="true" class="script-input text">' + DEFAULT_TEXT + '</span></li>';
7777
}
7878
}
7979
blockArea.innerHTML += blockString;

resources/js/blocks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var selected = null, // Object of the element to be moved
22
x_pos = 0, y_pos = 0, // Stores x & y coordinates of the mouse pointer
3-
x_elem = 0, y_elem = 0; // Stores top, left values (edge) of the element
3+
x_elem = 0, y_elem = 0, // Stores top, left values (edge) of the element
4+
DEFAULT_TEXT = 'breadfish';
45

56
function isDescendant(parent, child) {
67
var node = child.parentNode;
@@ -359,7 +360,7 @@ SCRIPTING_AREA.addEventListener('input', function(ev) {
359360

360361
SCRIPTING_AREA.addEventListener('click', function(ev) {
361362
if (ev.target.matches('.c-quicktext')) {
362-
ev.target.parentNode.parentNode.querySelector('.c-content').innerHTML = '<li class="stack e-text"><span contenteditable="true" class="script-input text">breadfish.gif</span></li>';
363+
ev.target.parentNode.parentNode.querySelector('.c-content').innerHTML = '<li class="stack e-text"><span contenteditable="true" class="script-input text">' + DEFAULT_TEXT + '</span></li>';
363364
setFrameContent();
364365
}
365366
});

resources/js/tutorials/2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//hijack the file open script so I don't have to walk user through the basics again
2-
fileData = {"index.html":{"tag":"body","child":[{"tag":"h1","attr":{},"child":[{"tag":"","attr":{},"text":"My Awesome Website"}]},{"tag":"","attr":{},"text":"breadfish.gif"}]}};
2+
fileData = {"index.html":{"tag":"body","child":[{"tag":"h1","attr":{},"child":[{"tag":"","attr":{},"text":"My Awesome Website"}]},{"tag":"","attr":{},"text":DEFAULT_TEXT}]}};
33
$('.filePane')[0].innerHTML = '<div class="file selected"><div class="file-name" data-file="index.html">index.html</div></div><div class="add-file"><div class="file-name">+</div></div>';
44
loadFile("index.html");
55

0 commit comments

Comments
 (0)