@@ -22,21 +22,21 @@ var background = (function(){
2222bind . feedback = {
2323animation : {
2424set : function ( animationClass , action ) {
25- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
26- helper . addClass ( controlBackgroundImageLocalFeedback , animationClass ) ;
25+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
26+ helper . addClass ( controlBackgroundImageFileFeedback , animationClass ) ;
2727var animationEndAction = function ( ) {
2828if ( action ) {
2929action ( ) ;
3030} ;
3131bind . feedback . animation . reset ( ) ;
3232} ;
33- controlBackgroundImageLocalFeedback . addEventListener ( "animationend" , animationEndAction , false ) ;
33+ controlBackgroundImageFileFeedback . addEventListener ( "animationend" , animationEndAction , false ) ;
3434} ,
3535reset : function ( ) {
36- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
37- helper . removeClass ( controlBackgroundImageLocalFeedback , "is-shake" ) ;
38- helper . removeClass ( controlBackgroundImageLocalFeedback , "is-pop" ) ;
39- controlBackgroundImageLocalFeedback . removeEventListener ( "animationend" , bind . feedback . animation . reset , false ) ;
36+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
37+ helper . removeClass ( controlBackgroundImageFileFeedback , "is-shake" ) ;
38+ helper . removeClass ( controlBackgroundImageFileFeedback , "is-pop" ) ;
39+ controlBackgroundImageFileFeedback . removeEventListener ( "animationend" , bind . feedback . animation . reset , false ) ;
4040}
4141}
4242} ;
@@ -46,7 +46,7 @@ var background = (function(){
4646render . image = function ( ) {
4747var html = helper . e ( "html" ) ;
4848if ( state . get ( ) . background . image . show ) {
49- if ( state . get ( ) . background . image . from == "local " ) {
49+ if ( state . get ( ) . background . image . from == "file " ) {
5050html . style . setProperty ( "--background-image" , "url(" + state . get ( ) . background . image . file . data + ")" ) ;
5151} else if ( state . get ( ) . background . image . from == "url" ) {
5252html . style . setProperty ( "--background-image" , "url(" + state . get ( ) . background . image . url + ")" ) ;
@@ -83,7 +83,7 @@ var background = (function(){
8383
8484render . input = {
8585clear : function ( ) {
86- var input = helper . e ( ".control-background-image-local " ) ;
86+ var input = helper . e ( ".control-background-image-file " ) ;
8787input . value = "" ;
8888}
8989} ;
@@ -97,54 +97,54 @@ var background = (function(){
9797} ;
9898} ,
9999empty : function ( ) {
100- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
100+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
101101var para1 = helper . node ( "p:No image selected.|class:muted small" ) ;
102- controlBackgroundImageLocalFeedback . appendChild ( para1 ) ;
102+ controlBackgroundImageFileFeedback . appendChild ( para1 ) ;
103103} ,
104104current : function ( ) {
105- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
105+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
106106var para1 = helper . node ( "p:Image loaded.|class:muted small" ) ;
107107var para2 = helper . node ( "p:" + state . get ( ) . background . image . file . name ) ;
108- controlBackgroundImageLocalFeedback . appendChild ( para1 ) ;
109- controlBackgroundImageLocalFeedback . appendChild ( para2 ) ;
108+ controlBackgroundImageFileFeedback . appendChild ( para1 ) ;
109+ controlBackgroundImageFileFeedback . appendChild ( para2 ) ;
110110} ,
111111success : function ( action ) {
112- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
112+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
113113var para1 = helper . node ( "p:Success! Setting Background image.|class:muted small" ) ;
114114var para2 = helper . node ( "p:" + state . get ( ) . background . image . file . name ) ;
115- controlBackgroundImageLocalFeedback . appendChild ( para1 ) ;
116- controlBackgroundImageLocalFeedback . appendChild ( para2 ) ;
115+ controlBackgroundImageFileFeedback . appendChild ( para1 ) ;
116+ controlBackgroundImageFileFeedback . appendChild ( para2 ) ;
117117bind . feedback . animation . set ( "is-pop" , action ) ;
118118} ,
119119clear : function ( ) {
120- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
121- while ( controlBackgroundImageLocalFeedback . lastChild ) {
122- controlBackgroundImageLocalFeedback . removeChild ( controlBackgroundImageLocalFeedback . lastChild ) ;
120+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
121+ while ( controlBackgroundImageFileFeedback . lastChild ) {
122+ controlBackgroundImageFileFeedback . removeChild ( controlBackgroundImageFileFeedback . lastChild ) ;
123123} ;
124124} ,
125125fail : {
126126filetype : function ( name ) {
127- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
127+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
128128var para1 = helper . node ( "p:Not the right kind of file. Make sure the selected file is an image.|class:small muted" ) ;
129129var para2 = helper . node ( "p:" + name ) ;
130- controlBackgroundImageLocalFeedback . appendChild ( para1 ) ;
131- controlBackgroundImageLocalFeedback . appendChild ( para2 ) ;
130+ controlBackgroundImageFileFeedback . appendChild ( para1 ) ;
131+ controlBackgroundImageFileFeedback . appendChild ( para2 ) ;
132132bind . feedback . animation . set ( "is-shake" ) ;
133133} ,
134134size : function ( name ) {
135- var controlBackgroundImageLocalFeedback = helper . e ( ".control-background-image-local -feedback" ) ;
135+ var controlBackgroundImageFileFeedback = helper . e ( ".control-background-image-file -feedback" ) ;
136136var para1 = helper . node ( "p:File size is too big. Max file size of 5MB.|class:small muted" ) ;
137137var para2 = helper . node ( "p:" + name ) ;
138- controlBackgroundImageLocalFeedback . appendChild ( para1 ) ;
139- controlBackgroundImageLocalFeedback . appendChild ( para2 ) ;
138+ controlBackgroundImageFileFeedback . appendChild ( para1 ) ;
139+ controlBackgroundImageFileFeedback . appendChild ( para2 ) ;
140140bind . feedback . animation . set ( "is-shake" ) ;
141141}
142142}
143143} ;
144144
145145var importData = function ( ) {
146146// get files from input
147- var fileList = helper . e ( ".control-background-image-local " ) . files ;
147+ var fileList = helper . e ( ".control-background-image-file " ) . files ;
148148// if file was added
149149if ( fileList . length > 0 ) {
150150// validate the file
0 commit comments