@@ -46,48 +46,48 @@ class GlobalCard {
4646 <div class="card-action">
4747 <div class="flexcontainer">
4848 <a class="project-icon tooltipped" data-position="bottom" data-delay="50" data-tooltip="${ _ (
49- "More Details"
50- ) } " id="global-project-more-details-{ID}"><i class="material-icons">info</i></a>
49+ "More Details"
50+ ) } " id="global-project-more-details-{ID}"><i class="material-icons">info</i></a>
5151 <a class="project-icon tooltipped" data-position="bottom" data-delay="50" data-tooltip="${ _ (
52- "Open in Music Blocks"
53- ) } " id="global-project-open-{ID}"><i class="material-icons">launch</i></a>
52+ "Open in Music Blocks"
53+ ) } " id="global-project-open-{ID}"><i class="material-icons">launch</i></a>
5454 <a class="project-icon tooltipped" data-position="bottom" data-delay="50" data-tooltip="${ _ (
55- "Merge with current project"
56- ) } " id="global-project-merge-{ID}"><i class="material-icons">merge_type</i></a>
55+ "Merge with current project"
56+ ) } " id="global-project-merge-{ID}"><i class="material-icons">merge_type</i></a>
5757 <a class="project-icon tooltipped" data-position="bottom" data-delay="50" data-tooltip="${ `${
58- Planet . ProjectStorage . isLiked ( this . id ) ? "Unlike" : "Like"
59- } project`} "><i class="material-icons"id="global-like-icon-{ID}"></i><span class="likes-count" id="global-project-likes-{ID}"></span></a>
58+ Planet . ProjectStorage . isLiked ( this . id ) ? "Unlike" : "Like"
59+ } project`} "><i class="material-icons"id="global-like-icon-{ID}"></i><span class="likes-count" id="global-project-likes-{ID}"></span></a>
6060
6161 <div id="global-share-{ID}">
6262 <a class="project-icon tooltipped" data-position="bottom" data-delay="50" data-tooltip="${ _ (
63- "Share project"
64- ) } " id="global-project-share-{ID}"><i class="material-icons">share</i></a>
63+ "Share project"
64+ ) } " id="global-project-share-{ID}"><i class="material-icons">share</i></a>
6565
6666 <div class="card share-card" id="global-sharebox-{ID}" style="display:none;">
6767 <div class="card-content shareurltext">
6868 <div class="shareurltitle">${ _ ( "Share" ) } </div>
6969 <input type="text" name="shareurl" class="shareurlinput" data-originalurl="https://musicblocks.sugarlabs.org/index.html?id={ID}">
7070 <a class="copyshareurl tooltipped" onclick="copyURLToClipboard()" data-clipboard-text="https://musicblocks.sugarlabs.org/index.html?id={ID}&run=True" data-delay="50" data-tooltip="${ _ (
71- "Copy link to clipboard"
72- ) } "><i class="material-icons"alt="Copy!">file_copy</i></a>
71+ "Copy link to clipboard"
72+ ) } "><i class="material-icons"alt="Copy!">file_copy</i></a>
7373 <div class="shareurl-advanced" id="global-advanced-{ID}">
7474 <div class="shareurltitle">${ _ ( "Flags" ) } </div>
7575 <div><input type="checkbox" name="run" id="global-checkboxrun-{ID}" checked><label for="global-checkboxrun-{ID}">${ _ (
76- "Run project on startup."
77- ) } </label></div>
76+ "Run project on startup."
77+ ) } </label></div>
7878 <div><input type="checkbox" name="show" id="global-checkboxshow-{ID}"><label for="global-checkboxshow-{ID}">${ _ (
79- "Show code blocks on startup."
80- ) } </label></div>
79+ "Show code blocks on startup."
80+ ) } </label></div>
8181 <div><input type="checkbox" name="collapse" id="global-checkboxcollapse-{ID}"><label for="global-checkboxcollapse-{ID}">${ _ (
82- "Collapse code blocks on startup."
83- ) } </label></div>
82+ "Collapse code blocks on startup."
83+ ) } </label></div>
8484 </div>
8585 </div>
8686
8787 <div class="card-action">
8888 <a onclick="toggleExpandable('global-advanced-{ID}','shareurl-advanced');">${ _ (
89- "Advanced Options"
90- ) } </a>
89+ "Advanced Options"
90+ ) } </a>
9191 </div>
9292 </div>
9393 </div>
@@ -132,43 +132,45 @@ class GlobalCard {
132132 }
133133
134134 // set title text
135- frag . getElementById ( `global-project-title-${ this . id } ` ) . textContent =
136- this . ProjectData . ProjectName ;
135+ frag . getElementById (
136+ `global-project-title-${ this . id } `
137+ ) . textContent = this . ProjectData . ProjectName ;
137138
138139 // set number of likes
139- frag . getElementById ( `global-project-likes-${ this . id } ` ) . textContent =
140- this . ProjectData . ProjectLikes . toString ( ) ;
140+ frag . getElementById (
141+ `global-project-likes-${ this . id } `
142+ ) . textContent = this . ProjectData . ProjectLikes . toString ( ) ;
141143
142144 // set view button listener
143145 // eslint-disable-next-line no-unused-vars
144146 frag . getElementById ( `global-project-more-details-${ this . id } ` ) . addEventListener (
145147 "click" ,
146- ( evt ) => {
148+ evt => {
147149 Planet . GlobalPlanet . ProjectViewer . open ( this . id ) ;
148150 }
149151 ) ;
150152
151153 // set open button listener
152154 // eslint-disable-next-line no-unused-vars
153- frag . getElementById ( `global-project-open-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
155+ frag . getElementById ( `global-project-open-${ this . id } ` ) . addEventListener ( "click" , evt => {
154156 Planet . GlobalPlanet . openGlobalProject ( this . id ) ;
155157 } ) ;
156158
157159 // set image listener
158160 // eslint-disable-next-line no-unused-vars
159- frag . getElementById ( `global-project-image-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
161+ frag . getElementById ( `global-project-image-${ this . id } ` ) . addEventListener ( "click" , evt => {
160162 Planet . GlobalPlanet . ProjectViewer . open ( this . id ) ;
161163 } ) ;
162164
163165 // set merge modify listener
164166 // eslint-disable-next-line no-unused-vars
165- frag . getElementById ( `global-project-merge-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
167+ frag . getElementById ( `global-project-merge-${ this . id } ` ) . addEventListener ( "click" , evt => {
166168 Planet . GlobalPlanet . mergeGlobalProject ( this . id ) ;
167169 } ) ;
168170
169171 // set share button listener
170172 // eslint-disable-next-line no-unused-vars
171- frag . getElementById ( `global-project-share-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
173+ frag . getElementById ( `global-project-share-${ this . id } ` ) . addEventListener ( "click" , evt => {
172174 const s = document . getElementById ( `global-sharebox-${ this . id } ` ) ;
173175
174176 if ( s . style . display == "none" ) {
@@ -182,20 +184,17 @@ class GlobalCard {
182184
183185 // set share checkbox listener
184186 // eslint-disable-next-line no-unused-vars
185- frag . getElementById ( `global-checkboxrun-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
187+ frag . getElementById ( `global-checkboxrun-${ this . id } ` ) . addEventListener ( "click" , evt => {
186188 updateCheckboxes ( `global-sharebox-${ this . id } ` ) ;
187189 } ) ;
188190 // eslint-disable-next-line no-unused-vars
189- frag . getElementById ( `global-checkboxshow-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
191+ frag . getElementById ( `global-checkboxshow-${ this . id } ` ) . addEventListener ( "click" , evt => {
190192 updateCheckboxes ( `global-sharebox-${ this . id } ` ) ;
191193 } ) ;
192194 // eslint-disable-next-line no-unused-vars
193- frag . getElementById ( `global-checkboxcollapse-${ this . id } ` ) . addEventListener (
194- "click" ,
195- ( evt ) => {
196- updateCheckboxes ( `global-sharebox-${ this . id } ` ) ;
197- }
198- ) ;
195+ frag . getElementById ( `global-checkboxcollapse-${ this . id } ` ) . addEventListener ( "click" , evt => {
196+ updateCheckboxes ( `global-sharebox-${ this . id } ` ) ;
197+ } ) ;
199198
200199 // set like icon
201200 const likeIconId = `global-like-icon-${ this . id } ` ;
@@ -205,7 +204,7 @@ class GlobalCard {
205204 : "favorite_border" ;
206205
207206 // eslint-disable-next-line no-unused-vars
208- frag . getElementById ( `global-like-icon-${ this . id } ` ) . addEventListener ( "click" , ( evt ) => {
207+ frag . getElementById ( `global-like-icon-${ this . id } ` ) . addEventListener ( "click" , evt => {
209208 this . like ( ) ;
210209 } ) ;
211210
@@ -219,7 +218,7 @@ class GlobalCard {
219218 let like = true ;
220219 if ( Planet . ProjectStorage . isLiked ( this . id ) ) like = false ;
221220 this . likeTimeout = setTimeout ( ( ) => {
222- Planet . ServerInterface . likeProject ( this . id , like , ( data ) => {
221+ Planet . ServerInterface . likeProject ( this . id , like , data => {
223222 this . afterLike ( data , like ) ;
224223 } ) ;
225224 } , 500 ) ;
@@ -255,13 +254,13 @@ class GlobalCard {
255254function copyURLToClipboard ( ) {
256255 const clipboard = new ClipboardJS ( ".copyshareurl" ) ;
257256
258- clipboard . on ( "success" , ( e ) => {
257+ clipboard . on ( "success" , e => {
259258 // eslint-disable-next-line no-console
260259 console . info ( "Copied:" , e . text ) ;
261260 e . clearSelection ( ) ;
262261 } ) ;
263262
264- clipboard . on ( "error" , ( e ) => {
263+ clipboard . on ( "error" , e => {
265264 alert ( "Failed to copy!" ) ;
266265 // eslint-disable-next-line no-console
267266 console . error ( "Failed to copy:" , e . action ) ;
0 commit comments