Skip to content

Commit babf4b6

Browse files
authored
Merge pull request #3 from julsemaan/feature/cleanup-events
Feature/cleanup events
2 parents 1d324fa + a3bfdc5 commit babf4b6

File tree

21 files changed

+462
-256
lines changed

21 files changed

+462
-256
lines changed

afn-app.sh

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,30 @@ function emptyfile() {
1212
truncate -s 0 $1
1313
}
1414

15-
function add_asset() {
15+
function add_template() {
16+
add_to_file "$1" "$2" ""
17+
}
18+
19+
function add_js_asset() {
20+
add_to_file "$1" "$2" ";"
21+
}
22+
23+
function add_css_asset() {
24+
add_to_file "$1" "$2" ""
25+
}
26+
27+
function add_to_file() {
1628
to_add="$1"
1729
add_to="$2"
18-
echo "" >> $add_to
30+
separator="$3"
31+
echo "$separator" >> $add_to
1932
cat $to_add >> $add_to
20-
echo "" >> $add_to
33+
echo "$separator" >> $add_to
2134
}
22-
export -f add_asset
35+
export -f add_js_asset
36+
export -f add_css_asset
37+
export -f add_template
38+
export -f add_to_file
2339

2440
function add_min_prefix() {
2541
file=$1
@@ -120,8 +136,8 @@ function application_css() {
120136
rm -f $COMPILED_APP/assets/application-*.css
121137
fi
122138

123-
add_asset bower_components/bootstrap/dist/css/bootstrap.min.css $APPLICATION_CSS
124-
add_asset bower_components/tether-shepherd/dist/css/shepherd-theme-default.css $APPLICATION_CSS
139+
add_css_asset bower_components/bootstrap/dist/css/bootstrap.min.css $APPLICATION_CSS
140+
add_css_asset bower_components/tether-shepherd/dist/css/shepherd-theme-default.css $APPLICATION_CSS
125141
./node_modules/.bin/node-sass --include-path client/assets/css/ client/assets/css/editor.css.scss >> $APPLICATION_CSS
126142

127143
./node_modules/.bin/minify $APPLICATION_CSS > `add_min_prefix $APPLICATION_CSS`
@@ -136,22 +152,23 @@ function application_js() {
136152
rm -f $COMPILED_APP/assets/application-*.js
137153
fi
138154

139-
add_asset bower_components/jquery/dist/jquery.min.js $APPLICATION_JS
140-
add_asset bower_components/jquery-ui/jquery-ui.min.js $APPLICATION_JS
141-
add_asset bower_components/bootstrap/dist/js/bootstrap.min.js $APPLICATION_JS
142-
add_asset bower_components/tether-shepherd/dist/js/tether.js $APPLICATION_JS
143-
add_asset bower_components/tether-shepherd/dist/js/shepherd.min.js $APPLICATION_JS
144-
145-
add_asset client/assets/js/libs/rsvp.min.js $APPLICATION_JS
146-
add_asset client/assets/js/libs/route-recognizer.js $APPLICATION_JS
147-
add_asset client/assets/js/DataBinder.js $APPLICATION_JS
148-
add_asset client/assets/js/Model.js $APPLICATION_JS
149-
add_asset client/assets/js/Model/Preference.js $APPLICATION_JS
150-
add_asset client/assets/js/Model/CloudFile.js $APPLICATION_JS
151-
add_asset client/assets/js/helpers.js $APPLICATION_JS
155+
add_js_asset bower_components/jquery/dist/jquery.min.js $APPLICATION_JS
156+
add_js_asset bower_components/jquery-ui/jquery-ui.min.js $APPLICATION_JS
157+
add_js_asset bower_components/bootstrap/dist/js/bootstrap.min.js $APPLICATION_JS
158+
add_js_asset bower_components/tether-shepherd/dist/js/tether.js $APPLICATION_JS
159+
add_js_asset bower_components/tether-shepherd/dist/js/shepherd.min.js $APPLICATION_JS
160+
161+
add_js_asset client/assets/js/libs/rsvp.min.js $APPLICATION_JS
162+
add_js_asset client/assets/js/libs/route-recognizer.js $APPLICATION_JS
163+
add_js_asset client/assets/js/DataBinder.js $APPLICATION_JS
164+
add_js_asset client/assets/js/Model.js $APPLICATION_JS
165+
add_js_asset client/assets/js/Model/Preference.js $APPLICATION_JS
166+
add_js_asset client/assets/js/Model/CloudFile.js $APPLICATION_JS
167+
add_js_asset client/assets/js/Widget/Preference.js $APPLICATION_JS
168+
add_js_asset client/assets/js/helpers.js $APPLICATION_JS
152169

153170
# todo - exclude the files above
154-
find client/assets/js/ -name '*.js' | while read file; do add_asset "$file" $APPLICATION_JS ; done
171+
find client/assets/js/ -name '*.js' | while read file; do add_js_asset "$file" $APPLICATION_JS ; done
155172

156173
./node_modules/.bin/minify $APPLICATION_JS > `add_min_prefix $APPLICATION_JS`
157174
}
@@ -165,7 +182,7 @@ function editor_part() {
165182
rm -f $COMPILED_APP/app.partials
166183
fi
167184

168-
find client/ -name '_*.html' | while read file ; do add_asset "$file" $COMPILED_APP/app.partials ; done
185+
find client/ -name '_*.html' | while read file ; do add_template "$file" $COMPILED_APP/app.partials ; done
169186
}
170187

171188
function app() {

client/app.tt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@
167167
user_preferences = new Preferences(
168168
function(){
169169
editor_controller = new EditorController("editor_app", {
170-
'word_wrap_pref':BooleanPreference.find('word_wrap'),
171-
'font_size_pref': StringPreference.find('ace_js_font_size'),
172-
'tab_size_pref' : StringPreference.find('ace_js_tab_size'),
173170
'major_notice_pref' : IntPreference.find('major_notice'),
174-
'theme_pref': StringPreference.find('theme'),
175171
'menu_width_pref' : StringPreference.find('menu_width'),
176-
'keybinding_pref' : StringPreference.find('keybinding'),
177172
'flash' : new FlashController('editor_flash'),
178173
'file_explorer': new FileExplorerController("file_explorer_container", {
179174
'height_pref' : StringPreference.find('file_explorer_height'),

client/assets/css/editor.css.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ h5.menu_header {
268268
}
269269

270270
.themes {
271-
.btn_theme {
271+
.btn-theme {
272272
padding:8px 10px;
273273
min-width:250px;
274274
}
@@ -293,6 +293,13 @@ h5.menu_header {
293293
min-width:250px;
294294
min-height:250px;
295295
}
296+
.syntax_button.btn-primary {
297+
background-color:#3f51b5 !important;
298+
color:white !important;
299+
}
300+
.syntax_button.disabled {
301+
color:rgba(#000000, (26/100)) !important;
302+
}
296303
}
297304

298305
}
@@ -445,3 +452,7 @@ div#current_user{
445452
margin-left:8px;
446453
}
447454
}
455+
456+
li a.btn-primary {
457+
@extend .btn-primary;
458+
}

0 commit comments

Comments
 (0)