@@ -6,6 +6,10 @@ notifications = {
66funMessageIntervalTimer = null ;
77isWizard = false
88
9+ const PLATFORMS = [ "aplite" , "basalt" , "chalk" , "diorite" , "emery" ]
10+ const GREYSCALE_PLATFORMS = [ "aplite" , "diorite" ]
11+
12+
913// Worker functions
1014
1115function displayLoginPage ( ) {
@@ -191,7 +195,7 @@ function getEditScreenshotsForPlatform_cb(data, platform) {
191195 } ) ;
192196
193197 for ( var i = numScreenshots ; i < 5 ; i ++ ) {
194- var srclink = ( platform == "chalk" ) ? "/res/img/screenshotRound.png" : "/res/img/screenshotSquare.png"
198+ var srclink = getScreenshotPlaceholderImagePath ( platform )
195199 $ ( `#e-screenshot-${ shortPlatform } -${ i + 1 } -i` ) . attr ( "src" , srclink ) ;
196200 $ ( `#e-screenshot-${ shortPlatform } -${ i + 1 } -btn-add` ) . removeClass ( "hidden" ) ;
197201 $ ( `#e-screenshot-${ shortPlatform } -${ i + 1 } -btn-delete` ) . addClass ( "hidden" ) ;
@@ -270,22 +274,22 @@ function deleteScreenshot_ecb(data) {
270274}
271275function html_populateScreenshotTabList ( ) {
272276 //Create the HTML for the edit dialogue screenshot list
273- var platforms = [ "aplite" , "basalt" , "chalk" , "diorite" ]
274277 var maxScreenshots = 5
275278 var output = ""
276279 var exClass = "show active"
277280
278- platforms . forEach ( p => {
279- pshort = p . substr ( 0 , 1 )
281+ PLATFORMS . forEach ( p => {
282+ pshort = p . substring ( 0 , 1 )
280283 output += `<div class="tab-pane fade ${ exClass } " id="e-scr-${ p } " role="tabpanel" aria-labelledby="e-scr-${ p } -tab">`
281284 output += `<div class="row">`
282285
283- var placeholder = ( p == "chalk" ) ? "/res/img/screenshotRound.png" : "/res/img/screenshotSquare.png"
286+ placeholder = getScreenshotPlaceholderImagePath ( p )
287+
284288 var exImgClass = ( p == "chalk" ) ? "roundScr" : ""
285289
286290 for ( var i = 1 ; i <= maxScreenshots ; i ++ ) {
287- output += `<div class="card img-card noshadow border-lite ml-3 mt-3">
288- <img id="e-screenshot-${ pshort } -${ i } -i" class="card-img-top ${ exImgClass } " src="${ placeholder } " />
291+ output += `<div class="card img-card ${ p } noshadow border-lite ml-3 mt-3">
292+ <img id="e-screenshot-${ pshort } -${ i } -i" class="card-img-top ${ exImgClass } ${ p } " src="${ placeholder } " />
289293 <div class="card-body wide hidden" id="e-screenshot-${ pshort } -${ i } -btn-delete">
290294 <button class="btn btn-danger" id="e-screenshot-${ pshort } -${ i } -btn-delete-btn" onclick="deleteScreenshotFromButton(this.getAttribute('data-uuid'), '${ p } ')">Delete</button>
291295 </div>
@@ -401,12 +405,11 @@ function deleteBanner_ecb(data) {
401405}
402406function html_populateBannerTabList ( ) {
403407 //Create the HTML for the edit dialogue banner list
404- var platforms = [ "aplite" , "basalt" , "chalk" , "diorite" ]
405408 var maxBanners = 3
406409 var output = ""
407410 var exClass = "show active"
408411
409- platforms . forEach ( p => {
412+ PLATFORMS . forEach ( p => {
410413 pshort = p . substr ( 0 , 1 )
411414 output += `<div class="tab-pane fade ${ exClass } " id="e-banner-${ p } " role="tabpanel" aria-labelledby="e-banner-${ p } -tab">`
412415 output += `<div class="row">`
@@ -635,31 +638,30 @@ function submitAddImage(imagePrefix, imageFile) {
635638 $ ( `#${ imagePrefix } -removebtn` ) . removeClass ( "hidden" ) ;
636639}
637640function submitRemoveImage ( imagePrefix ) {
638- var srclink = ( imagePrefix . split ( "-" ) [ 2 ] == "c" ) ? "/res/img/screenshotRound.png" : "/res/img/screenshotSquare.png" ;
641+ var srclink = getScreenshotPlaceholderImagePath ( imagePrefix . split ( "-" ) [ 2 ] )
639642 $ ( `#${ imagePrefix } -f` ) . val ( "" ) ;
640643 $ ( `#${ imagePrefix } -i` ) . attr ( "src" , srclink ) ;
641644 $ ( `#${ imagePrefix } -addbtn` ) . removeClass ( "hidden" ) ;
642645 $ ( `#${ imagePrefix } -removebtn` ) . addClass ( "hidden" ) ;
643646}
644647function html_populateAddImageTabList ( ) {
645648 //Create the HTML for the add images screenshot list
646- var platforms = [ "aplite" , "basalt" , "chalk" , "diorite" ]
647649 var maxScreenshots = 5
648650 var output = ""
649651 var exClass = "show active"
650652
651- platforms . forEach ( p => {
653+ PLATFORMS . forEach ( p => {
652654 pshort = p . substr ( 0 , 1 )
653655 output += `<div class="tab-pane fade ${ exClass } " id="scr-${ p } " role="tabpanel" aria-labelledby="scr-${ p } -tab">`
654656 output += `<div class="row">`
655657
656- var placeholder = ( p == "chalk" ) ? "/res/img/screenshotRound.png" : "/res/img/screenshotSquare.png"
658+ var placeholder = getScreenshotPlaceholderImagePath ( p )
657659 var exImgClass = ( p == "chalk" ) ? "roundScr" : ""
658660
659661 for ( var i = 1 ; i <= maxScreenshots ; i ++ ) {
660- output += `<div class="card img-card noshadow border-lite ml-3 mt-3">
662+ output += `<div class="card img-card ${ p } noshadow border-lite ml-3 mt-3">
661663 <label for="i-screenshot-${ pshort } -${ i } -f">
662- <img id = "i-screenshot-${ pshort } -${ i } -i" class="card-img-top ${ exImgClass } " src="${ placeholder } " />
664+ <img id = "i-screenshot-${ pshort } -${ i } -i" class="card-img-top ${ exImgClass } ${ p } " src="${ placeholder } " />
663665 <div class="card-body wide">
664666 <a class="btn btn-primary" id="i-screenshot-${ pshort } -${ i } -addbtn">Add</a>
665667 <button class="btn btn-primary hidden" id="i-screenshot-${ pshort } -${ i } -removebtn" onclick="submitRemoveImage('i-screenshot-${ pshort } -${ i } ')">Remove</button>
@@ -1116,7 +1118,7 @@ function changePreviewWatchPlatform(platform, sender, forceFetch = false) {
11161118 $ ( '#previewImageContainer' ) . removeClass ( "chalk" ) ;
11171119 if ( platform == "chalk" ) {
11181120 $ ( '#previewImageContainer' ) . addClass ( "chalk" ) ;
1119- } else if ( [ "aplite" , "diorite" ] . includes ( platform ) ) {
1121+ } else if ( GREYSCALE_PLATFORMS . includes ( platform ) ) {
11201122 $ ( '#previewImageContainer' ) . addClass ( "bandw" ) ;
11211123 }
11221124}
@@ -1137,7 +1139,7 @@ function updateFunMessage() {
11371139 "Extracting" ,
11381140 "Unzipping" ,
11391141 "Point it. Zoom it. Snap it. Press it" ,
1140- "Just checking twitter real quick" ,
1142+ "Just checking bluesky real quick" ,
11411143 "Working" ,
11421144 "Still working" ,
11431145 "Thinking" ,
@@ -1309,13 +1311,14 @@ function getAppDetails_cb(data) {
13091311
13101312 //Icons
13111313 $ ( '.tinyicon' ) . addClass ( "bandw" ) ;
1312- // $('.supports-emery').addClass("hidden");
13131314 var favouriteSupportedPlatform = "basalt"
1315+ if ( data . compatibility . emery . supported ) { $ ( '.supports-emery' ) . removeClass ( "bandw" ) ; favouriteSupportedPlatform = "emery" }
13141316 if ( data . compatibility . aplite . supported ) { $ ( '.supports-aplite' ) . removeClass ( "bandw" ) ; favouriteSupportedPlatform = "aplite" }
13151317 if ( data . compatibility . chalk . supported ) { $ ( '.supports-chalk' ) . removeClass ( "bandw" ) ; favouriteSupportedPlatform = "chalk" }
13161318 if ( data . compatibility . diorite . supported ) { $ ( '.supports-diorite' ) . removeClass ( "bandw" ) ; favouriteSupportedPlatform = "diorite" }
13171319 if ( data . compatibility . basalt . supported ) { $ ( '.supports-basalt' ) . removeClass ( "bandw" ) ; favouriteSupportedPlatform = "basalt" }
13181320
1321+
13191322 changePreviewWatchPlatform ( favouriteSupportedPlatform )
13201323
13211324 // if (data.compatibility.emery.supported) { $('.supports-emery').removeClass("bandw"); $('.supports-emery').removeClass("hidden"); }
@@ -1368,7 +1371,7 @@ function genericAPIErrorHandler(data, statusCode, cbo) {
13681371
13691372 if ( statusCode == 0 ) {
13701373 //Network error
1371- showAlert ( "Connection Error" , "Failed to talk to Rebble. Please check your internet connection. If the problem persists check <a target='_blank' href='https://twitter.com/pebble_dev'>Twitter </a> or <a target='_blank' href='https://rebble.io/discord'>Discord</a>." )
1374+ showAlert ( "Connection Error" , "Failed to talk to Rebble. Please check your internet connection. If the problem persists check <a target='_blank' href='https://bsky.app/profile/rebble.io'>Bluesky </a> or <a target='_blank' href='https://rebble.io/discord'>Discord</a>." )
13721375 }
13731376
13741377 if ( statusCode == 500 ) {
@@ -1474,7 +1477,7 @@ function submitNewApp() {
14741477 //if ($('#usePlatformSpecificScreenshots').prop("checked")) {
14751478
14761479 //The weird order here is order of preference for largeIcon platform. Basalt looks best
1477- [ "basalt" , "aplite" , "diorite" , "chalk" ] . forEach ( platform => {
1480+ [ "basalt" , "aplite" , "diorite" , "chalk" , "emery" ] . forEach ( platform => {
14781481 var short = platform . substr ( 0 , 1 ) ;
14791482 for ( var i = 1 ; i < 6 ; i ++ ) {
14801483 if ( $ ( `#i-screenshot-${ short } -${ i } -f` ) . prop ( "files" ) [ 0 ] != undefined ) {
@@ -1489,6 +1492,7 @@ function submitNewApp() {
14891492 console . log ( "Is an app, yo" )
14901493 formData . append ( "large_icon" , $ ( '#i-icon-large-f' ) . prop ( "files" ) [ 0 ] )
14911494 formData . append ( "small_icon" , $ ( '#i-icon-small-f' ) . prop ( "files" ) [ 0 ] )
1495+ formData . append ( "timeline_enabled" , $ ( '#i-timeline' ) . prop ( "checked" ) )
14921496 } else {
14931497 // Use a screenshot as largeIcon
14941498 formData . append ( "large_icon" , largeIcon )
@@ -1502,6 +1506,7 @@ function submitNewApp() {
15021506 formData . append ( "source" , $ ( '#i-source' ) . val ( ) ) ;
15031507 }
15041508
1509+
15051510 //Attach pbw
15061511 formData . append ( "pbw" , $ ( '#i-pbw' ) . prop ( 'files' ) [ 0 ] ) ;
15071512
@@ -1801,6 +1806,18 @@ function friendlyTimeAgo(lc) {
18011806 return out + " " + units + " ago" ;
18021807}
18031808
1809+ function getScreenshotPlaceholderImagePath ( platform ) {
1810+ // Accepts aplite, basalt etc as well as a, b etc
1811+ platform = platform . substring ( 0 , 1 ) . toLowerCase ( )
1812+ const default_path = "/res/img/screenshotSquare.png"
1813+ const non_defaults = {
1814+ "c" : "/res/img/screenshotRound.png" ,
1815+ "e" : "/res/img/screenshotEmery.png"
1816+ }
1817+ let placeholder = ( non_defaults . hasOwnProperty ( platform ) ) ? non_defaults [ platform ] : default_path
1818+ return placeholder
1819+ }
1820+
18041821function initDevPortal ( ) {
18051822 //Check if we need to log in
18061823 checkAuthState ( ) ;
@@ -1819,10 +1836,12 @@ function initDevPortal() {
18191836 $ ( '.rbtype' ) . on ( 'click' , function ( e ) {
18201837 if ( $ ( '#i-iswatchface' ) . prop ( "checked" ) ) {
18211838 $ ( '#appCategory' ) . addClass ( "hidden" ) ;
1839+ $ ( '#uses_timeline' ) . addClass ( "hidden" )
18221840 $ ( '#appIconContainer' ) . addClass ( "hidden" ) ;
18231841 $ ( '.newappOrFace' ) . text ( "Watchface" ) ;
18241842 } else {
18251843 $ ( '#appCategory' ) . removeClass ( "hidden" ) ;
1844+ $ ( '#uses_timeline' ) . removeClass ( "hidden" )
18261845 $ ( '#appIconContainer' ) . removeClass ( "hidden" ) ;
18271846 $ ( '.newappOrFace' ) . text ( "App" )
18281847 }
@@ -1862,4 +1881,4 @@ function initDevPortal() {
18621881}
18631882
18641883
1865- initDevPortal ( ) ;
1884+ initDevPortal ( ) ;
0 commit comments