-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c34606
commit 4a9a5f5
Showing
9 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
HOST=127.0.0.1 | ||
PORT=3333 | ||
NODE_ENV=development | ||
|
||
CACHE_VIEWS=false | ||
HASH_DRIVER=bcrypt | ||
|
||
APP_NAME=SesTemplateManager | ||
APP_URL=http://${HOST}:${PORT} | ||
APP_KEY=123456789 | ||
|
||
CACHE_VIEWS=false | ||
|
||
HASH_DRIVER=bcrypt | ||
|
||
AWS_PROFILE_NAME=default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,6 @@ $(document).ready(function(){ | |
} | ||
}); | ||
}); | ||
|
||
checkAppVersion(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#newVersionIndicator { | ||
background: #e26262; | ||
color: #313131; | ||
width: 185px; | ||
position: absolute; | ||
top: 0; | ||
left: 0px; | ||
text-align: center; | ||
border-radius: 0 0 5px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
const currentVersion = "v1.3"; | ||
|
||
function populateTextSectionContent() { | ||
//Will strip template html of html tags leaving inner content for the template text field | ||
const htmlString = $('#templateHtml').val(); | ||
const textContent = htmlString.replace(/<[^>]*>/g, ""); | ||
$('#templateText').val(textContent); | ||
} | ||
|
||
async function checkAppVersion(){ | ||
const versionChecked = sessionStorage.getItem('versionChecked'); | ||
if (!versionChecked) { | ||
await $.get(`https://api.github.com/repos/MattRuddick/ses-template-manager/tags`, (response) => { | ||
try { | ||
const latestVersion = response[0].name; | ||
if (currentVersion !== latestVersion) { | ||
sessionStorage.setItem('versionOutdated', 'true'); | ||
sessionStorage.setItem('latestVersion', latestVersion); | ||
} | ||
} catch { | ||
console.warn('App version could not be checked.'); | ||
} | ||
}).always(() => { | ||
// still mark versionCheck as done even if request failed. failsafe should the repo/url/git endpoint structure change in the future | ||
sessionStorage.setItem('versionChecked', 'true'); // indicates we have already checked the version | ||
}); | ||
} | ||
|
||
if (sessionStorage.getItem('versionOutdated')) { | ||
const latestVersion = sessionStorage.getItem('latestVersion'); | ||
$('body').append(`<a id="newVersionIndicator" href="https://github.com/MattRuddick/ses-template-manager/releases/tag/${latestVersion}" target="_blank">New Version Available</a>`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,5 +47,7 @@ $(document).ready(() => { | |
} | ||
}); | ||
}); | ||
|
||
checkAppVersion(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters