Revert "Announcement feature"
This commit is contained in:
@ -124,30 +124,6 @@ main = (function(main, global) {
|
|||||||
Mousetrap.bind('g c', toggleMainChat);
|
Mousetrap.bind('g c', toggleMainChat);
|
||||||
});
|
});
|
||||||
|
|
||||||
function localStorageIO(item = '', input = null) {
|
|
||||||
if (input) {
|
|
||||||
try {
|
|
||||||
input = typeof input === 'string' ? input : JSON.stringify(input);
|
|
||||||
} catch (e) {
|
|
||||||
// Do Nothing
|
|
||||||
}
|
|
||||||
localStorage.setItem(item, input);
|
|
||||||
return input;
|
|
||||||
} else {
|
|
||||||
let data = typeof localStorage.getItem(item)
|
|
||||||
!== 'undefined' && localStorage.getItem(item)
|
|
||||||
!== null ? localStorage.getItem(item) : '';
|
|
||||||
try {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
} catch (e) {
|
|
||||||
// Do Nothing
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
main.localStorageIO = localStorageIO;
|
|
||||||
|
|
||||||
return main;
|
return main;
|
||||||
}(main, window));
|
}(main, window));
|
||||||
|
|
||||||
@ -636,49 +612,4 @@ $(document).ready(function() {
|
|||||||
// Repo
|
// Repo
|
||||||
window.location = 'https://github.com/freecodecamp/freecodecamp/';
|
window.location = 'https://github.com/freecodecamp/freecodecamp/';
|
||||||
});
|
});
|
||||||
|
|
||||||
function getCurrentBillBoard(cb) {
|
|
||||||
$.ajax({
|
|
||||||
url: '/api/flyers/findOne?'
|
|
||||||
+ 'filter=%7B%22order%22%3A%20%20%22id%20DESC%22%7D',
|
|
||||||
method: 'GET',
|
|
||||||
dataType: 'JSON',
|
|
||||||
data: {'order': 'id DESC'}
|
|
||||||
}).done((resp) => {
|
|
||||||
cb(resp);
|
|
||||||
});
|
|
||||||
$('#dismissBill').on('click', (e) => {
|
|
||||||
const elemData
|
|
||||||
= e.target.parentNode.parentNode.children;
|
|
||||||
|
|
||||||
const res
|
|
||||||
= elemData[Object.keys(elemData).filter((key)=> {
|
|
||||||
return elemData[key].id === 'billContent';
|
|
||||||
|
|
||||||
})[0]].innerHTML;
|
|
||||||
|
|
||||||
main.localStorageIO('lastBillBoardSeen', res);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleNewBillBoard(resp) {
|
|
||||||
const data = typeof main.localStorageIO('lastBillBoardSeen')
|
|
||||||
!== 'undefined' && main.localStorageIO('lastBillBoardSeen')
|
|
||||||
!== null ? main.localStorageIO('lastBillBoardSeen') : '';
|
|
||||||
if (
|
|
||||||
data.replace(/\s*/gi, '')
|
|
||||||
.replace(/\&\w*\;/gi, '')
|
|
||||||
.replace(/(\<|\/|\>)/gi, '')
|
|
||||||
!== resp.message
|
|
||||||
.replace(/\s*/gi, '')
|
|
||||||
.replace(/\&\w*\;/gi, '')
|
|
||||||
.replace(/(\<|\/|\>)/gi, '')
|
|
||||||
&& resp.active
|
|
||||||
) {
|
|
||||||
$('#billContent').html(resp.message);
|
|
||||||
$('#billBoard').fadeIn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getCurrentBillBoard(handleNewBillBoard);
|
|
||||||
});
|
});
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "flyer",
|
|
||||||
"base": "PersistedModel",
|
|
||||||
"idInjection": true,
|
|
||||||
"trackChanges": false,
|
|
||||||
"properties": {
|
|
||||||
"message": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"active": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"validations": [],
|
|
||||||
"relations": {
|
|
||||||
|
|
||||||
},
|
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "*",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "DENY"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "READ",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"methods": []
|
|
||||||
}
|
|
@ -66,9 +66,5 @@
|
|||||||
"userIdentity": {
|
"userIdentity": {
|
||||||
"dataSource": "db",
|
"dataSource": "db",
|
||||||
"public": true
|
"public": true
|
||||||
},
|
|
||||||
"flyer": {
|
|
||||||
"dataSource": "db",
|
|
||||||
"public": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
extends ../layout
|
extends ../layout
|
||||||
block content
|
block content
|
||||||
include ../partials/flyer
|
|
||||||
script(src="/bower_components/cal-heatmap/cal-heatmap.min.js")
|
script(src="/bower_components/cal-heatmap/cal-heatmap.min.js")
|
||||||
script.
|
script.
|
||||||
var challengeName = 'Profile View';
|
var challengeName = 'Profile View';
|
||||||
@ -171,4 +170,4 @@ block content
|
|||||||
if (challenge.solution)
|
if (challenge.solution)
|
||||||
a(href='/challenges/' + removeOldTerms(challenge.name) + '?solution=' + encodeURIComponent(encodeFcc(challenge.solution)), target='_blank')= removeOldTerms(challenge.name)
|
a(href='/challenges/' + removeOldTerms(challenge.name) + '?solution=' + encodeURIComponent(encodeFcc(challenge.solution)), target='_blank')= removeOldTerms(challenge.name)
|
||||||
else
|
else
|
||||||
a(href='/challenges/' + removeOldTerms(challenge.name))= removeOldTerms(challenge.name)
|
a(href='/challenges/' + removeOldTerms(challenge.name))= removeOldTerms(challenge.name)
|
@ -4,7 +4,6 @@ block content
|
|||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
||||||
link(rel='stylesheet', href='/css/ubuntu.css')
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
|
@ -4,7 +4,6 @@ block content
|
|||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
||||||
link(rel='stylesheet', href='/css/ubuntu.css')
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-md-3.col-lg-3
|
.col-md-3.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
|
@ -4,7 +4,6 @@ block content
|
|||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/addon/lint/lint.css')
|
||||||
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
link(rel='stylesheet', href='/bower_components/CodeMirror/theme/monokai.css')
|
||||||
link(rel='stylesheet', href='/css/ubuntu.css')
|
link(rel='stylesheet', href='/css/ubuntu.css')
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
.scroll-locker(id = "scroll-locker")
|
.scroll-locker(id = "scroll-locker")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
extends ../layout-wide
|
extends ../layout-wide
|
||||||
block content
|
block content
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-md-8.col-md-offset-2
|
.col-md-8.col-md-offset-2
|
||||||
for step, index in description
|
for step, index in description
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
extends ../layout-wide
|
extends ../layout-wide
|
||||||
block content
|
block content
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-12.col-md-4
|
.col-xs-12.col-sm-12.col-md-4
|
||||||
h4.text-center.challenge-instructions-title= name
|
h4.text-center.challenge-instructions-title= name
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
extends ../layout-wide
|
extends ../layout-wide
|
||||||
block content
|
block content
|
||||||
include ../partials/flyer
|
|
||||||
.row
|
.row
|
||||||
.col-md-4
|
.col-md-4
|
||||||
h4.text-center.challenge-instructions-title= name
|
h4.text-center.challenge-instructions-title= name
|
||||||
|
@ -6,7 +6,7 @@ html(lang='en')
|
|||||||
body.top-and-bottom-margins
|
body.top-and-bottom-margins
|
||||||
include partials/scripts
|
include partials/scripts
|
||||||
include partials/navbar
|
include partials/navbar
|
||||||
include partials/flash
|
|
||||||
.container
|
.container
|
||||||
|
include partials/flash
|
||||||
block content
|
block content
|
||||||
include partials/footer
|
include partials/footer
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
.container
|
.row.flashMessage
|
||||||
.row.flashMessage.negative-30
|
.col-xs-12
|
||||||
.col-xs-12
|
if (messages.errors || messages.error)
|
||||||
if (messages.errors || messages.error)
|
.alert.alert-danger.fade.in
|
||||||
.alert.alert-danger.fade.in
|
button.close(type='button', data-dismiss='alert')
|
||||||
button.close(type='button', data-dismiss='alert')
|
span.ion-close-circled
|
||||||
span.ion-close-circled
|
for error in (messages.errors || messages.error)
|
||||||
for error in (messages.errors || messages.error)
|
div!= error.msg || error
|
||||||
div!= error.msg || error
|
if messages.info
|
||||||
if messages.info
|
.alert.alert-info.fade.in
|
||||||
.alert.alert-info.fade.in
|
button.close(type='button', data-dismiss='alert')
|
||||||
button.close(type='button', data-dismiss='alert')
|
span.ion-close-circled
|
||||||
span.ion-close-circled
|
for info in messages.info
|
||||||
for info in messages.info
|
div!= info.msg
|
||||||
div!= info.msg
|
if messages.success
|
||||||
if messages.success
|
.alert.alert-success.fade.in
|
||||||
.alert.alert-success.fade.in
|
button.close(type='button', data-dismiss='alert')
|
||||||
button.close(type='button', data-dismiss='alert')
|
span.ion-close-circled
|
||||||
span.ion-close-circled
|
for success in messages.success
|
||||||
for success in messages.success
|
div!= success.msg
|
||||||
div!= success.msg
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
if (user && user.points > 5)
|
|
||||||
.container
|
|
||||||
.row.flashMessage.negative-30
|
|
||||||
.col-xs-12
|
|
||||||
#billBoard.alert.alert-info.fade.in(style="display: none;")
|
|
||||||
button.close(type='button', data-dismiss='alert')
|
|
||||||
span.ion-close-circled#dismissBill
|
|
||||||
#billContent
|
|
Reference in New Issue
Block a user