Skip to content

Commit f9b3322

Browse files
author
Firedrake969
authored
Merge pull request #241 from Airhogs777/quicktext2
Quicktext Button - round 2
2 parents 8f486a5 + 063ec66 commit f9b3322

6 files changed

Lines changed: 77 additions & 24 deletions

File tree

resources/css/blocks.css

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/css/blocks.scss

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ body {
9393
}
9494
.c-header,
9595
.c-footer {
96-
display:table;
9796
background:#E44D4D;
9897
padding:5px 10px;
9998
position:relative;
@@ -103,10 +102,15 @@ body {
103102
}
104103
.c-header {
105104
border-bottom-left-radius:0px;
105+
box-shadow: -1px -1px 0px #A9A9A9;
106+
display:table;
106107
}
107108
.c-footer {
108109
border-top-left-radius:0px;
109110
margin-bottom:1px;
111+
max-height: 18px;
112+
display:block;
113+
box-shadow: -1px 1px 0px #A9A9A9;
110114
}
111115
.c-content {
112116
background:#E44D4D;
@@ -118,11 +122,23 @@ body {
118122
position:relative; /* For z-index (appear on top of .c-header, which in turn puts it on top of the extra border-bottom when attaching a block) */
119123
box-shadow: -1px 0px 0px #A9A9A9;
120124
}
121-
.c-header {
122-
box-shadow: -1px -1px 0px #A9A9A9;
123-
}
124-
.c-footer {
125-
box-shadow: -1px 1px 0px #A9A9A9;
125+
.c-quicktext {
126+
background: #914DE4;
127+
padding: 7px;
128+
font-size: 10pt;
129+
border-radius: 100%;
130+
cursor: pointer;
131+
opacity: .7;
132+
position: relative;
133+
top: -20px;
134+
right: -25px;
135+
display: none;
136+
&:hover {
137+
opacity: .9;
138+
}
139+
}
140+
.scriptingArea .c-content:empty + .c-footer .c-quicktext {
141+
display: inline-block;
126142
}
127143
.drop-area {
128144
border-bottom: 5px solid white;

resources/css/style.css

Lines changed: 22 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/blockFilter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var filter = {
4242
'<li class="c-header">' + block.name + ' <span class="attr-controls"><span class="remove-attr"></span><span class="add-attr"></span></span></li>',
4343
'<ul class="c-content">',
4444
'</ul>',
45-
'<li class="c-footer">&nbsp;</li>',
45+
'<ul class="c-footer"><li class="c-quicktext">Aa</li></ul>',
4646
'</ul>'
4747
].join('');
4848
} else {
@@ -51,7 +51,7 @@ var filter = {
5151
'<li class="c-header">' + block.name + ' <span class="script-input" contenteditable="true">&nbsp;</span></li>',
5252
'<ul class="c-content">',
5353
'</ul>',
54-
'<li class="c-footer">&nbsp;</li>',
54+
'<ul class="c-footer"></ul>',
5555
'</ul>'
5656
].join('');
5757
}

resources/js/blocks.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@ SCRIPTING_AREA.addEventListener('input', function(ev) {
357357
}
358358
});
359359

360+
SCRIPTING_AREA.addEventListener('click', function(ev) {
361+
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+
setFrameContent();
364+
}
365+
});
366+
360367
var SCRIPT_MENU = document.querySelector('.context-menu.scripts');
361368
var RIGHT_CLICKED_SCRIPT = undefined;
362369

resources/js/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function generateWrapperBlocks(jsonData) {
160160
}
161161

162162
wrapperHtml.push(
163-
'</ul><li class="c-footer">&nbsp;</li></ul>'
163+
'</ul><ul class="c-footer"><li class="c-quicktext">Aa</li></ul></ul>'
164164
);
165165

166166
return wrapperHtml.join('');

0 commit comments

Comments
 (0)