Skip to content

Commit

Permalink
Various fixes to New UI.
Browse files Browse the repository at this point in the history
Add proper styling for spoiler blocks. (#6)
Fixed minor issue with relative url replacement regex.
Upgraded eslint@5.5.0
  • Loading branch information
dscalzi committed Sep 5, 2018
1 parent 7851fdb commit 2a9db6c
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 104 deletions.
25 changes: 25 additions & 0 deletions app/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,31 @@ input:checked + .toggleSwitchSlider:before {
border-radius: 10px;
box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.50);
}
.bbCodeSpoilerButton {
background: none;
border: none;
outline: none;
cursor: pointer;
font-size: 16px;
transition: 0.25s ease;
width: 100%;
border-bottom: 1px solid white;
padding-bottom: 15px;
}
.bbCodeSpoilerButton:hover,
.bbCodeSpoilerButton:focus {
text-shadow: 0px 0px 20px #ffffff, 0px 0px 20px #ffffff, 0px 0px 20px #ffffff;
}
.bbCodeSpoilerButton:active {
color: #c7c7c7;
text-shadow: 0px 0px 20px #c7c7c7, 0px 0px 20px #c7c7c7, 0px 0px 20px #c7c7c7;
}
.bbCodeSpoilerText {
display: none;
padding: 15px 0px;
border-bottom: 1px solid white;
}


#newsArticleContentWrapper {
width: 80%;
Expand Down
10 changes: 8 additions & 2 deletions app/assets/js/scripts/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,12 @@ function displayArticle(articleObject, index){
newsArticleComments.innerHTML = articleObject.comments
newsArticleComments.href = articleObject.commentsLink
newsArticleContentScrollable.innerHTML = '<div id="newsArticleContentWrapper"><div class="newsArticleSpacerTop"></div>' + articleObject.content + '<div class="newsArticleSpacerBot"></div></div>'
Array.from(newsArticleContentScrollable.getElementsByClassName('bbCodeSpoilerButton')).forEach(v => {
v.onclick = () => {
const text = v.parentElement.getElementsByClassName('bbCodeSpoilerText')[0]
text.style.display = text.style.display === 'block' ? 'none' : 'block'
}
})
newsNavigationStatus.innerHTML = index + ' of ' + newsArr.length
newsContent.setAttribute('article', index-1)
}
Expand Down Expand Up @@ -1061,10 +1067,10 @@ function loadNews(){

// Fix relative links in content.
let content = el.find('content\\:encoded').text()
let regex = /src="(?!http:\/\/|https:\/\/)(.+)"/g
let regex = /src="(?!http:\/\/|https:\/\/)(.+?)"/g
let matches
while((matches = regex.exec(content))){
content = content.replace(matches[1], newsHost + matches[1])
content = content.replace(`"${matches[1]}"`, `"${newsHost + matches[1]}"`)
}

let link = el.find('link').text()
Expand Down
166 changes: 65 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"devDependencies": {
"electron": "^2.0.8",
"electron-builder": "^20.28.3",
"eslint": "^5.4.0"
"eslint": "^5.5.0"
},
"build": {
"appId": "westeroscraftlauncher",
Expand Down

0 comments on commit 2a9db6c

Please sign in to comment.