Nasty hacks away from submodules: my unified vision has not been realised
This commit is contained in:
parent
729edc7611
commit
b3065d45d2
|
@ -1,6 +1,3 @@
|
||||||
[submodule "themes/navy/layout/partial/shared-partials"]
|
[submodule "themes/navy/layout/partial/shared-partials"]
|
||||||
path = themes/navy/layout/partial/shared-partials
|
path = themes/navy/layout/partial/shared-partials
|
||||||
url = https://github.com/status-im/status.im-partials
|
url = https://github.com/status-im/status.im-partials
|
||||||
[submodule "themes/navy/source/js/shared-js"]
|
|
||||||
path = themes/navy/source/js/shared-js
|
|
||||||
url = git@github.com:status-im/status-im-js.git
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"hexo": {
|
"hexo": {
|
||||||
"version": "3.8.0"
|
"version": "3.7.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf public/*",
|
"clean": "rm -rf public/*",
|
||||||
|
@ -26,7 +26,8 @@
|
||||||
"hexo-renderer-stylus": "^0.3.1",
|
"hexo-renderer-stylus": "^0.3.1",
|
||||||
"hexo-server": "^0.2.0",
|
"hexo-server": "^0.2.0",
|
||||||
"lodash": "^4.5.1",
|
"lodash": "^4.5.1",
|
||||||
"lunr": "^2.1.2"
|
"lunr": "^2.1.2",
|
||||||
|
"moment": "^2.24.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1aac6836d674dbd9006775345a947cf7a8783752
|
Subproject commit ef5db8a4de18fe58b1e5e44c7b7f965b13850a91
|
|
@ -1,3 +1,15 @@
|
||||||
|
/* global $ */
|
||||||
|
const moment = require('moment');
|
||||||
|
|
||||||
|
function formatDate(date) {
|
||||||
|
const day = moment().date(date.get('date')).format('DD');
|
||||||
|
const month = moment().month(date.get('month')).format('MMM');
|
||||||
|
const hour = moment().hour(date.get('hour')).format('HH');
|
||||||
|
const minute = moment().minute(date.get('minute')).format('mm');
|
||||||
|
|
||||||
|
return `${day} ${month} at ${hour}:${minute}`;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
// Fixes Parallax effect and div to popup overlapping with the main menu options
|
// Fixes Parallax effect and div to popup overlapping with the main menu options
|
||||||
|
@ -28,41 +40,29 @@ $(document).ready(function () {
|
||||||
return str.split(/\s+/).slice(0,25).join(" ");
|
return str.split(/\s+/).slice(0,25).join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
var months = {'01':'Jan', '02':'Feb', '03':'Mar', '04':'Apr', '05':'May', '06':'Jun', '07':'Jul', '08':'Aug', '09':'Sep', '10':'Oct', '11':'Nov', '12':'Dec'};
|
let url_news = 'https://our.status.im/ghost/api/v0.1/posts/?order=published_at%20desc&limit=2&formats=plaintext&client_id=ghost-frontend&client_secret=2b055fcd57ba';
|
||||||
url = 'https://our.status.im/ghost/api/v0.1/posts/?order=published_at%20desc&limit=2&formats=plaintext&client_id=ghost-frontend&client_secret=2b055fcd57ba';
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: 'get',
|
||||||
url: url,
|
url: url_news,
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
response.posts = response.posts.reverse();
|
response.posts = response.posts.reverse();
|
||||||
$.each(response.posts, function (index, val) {
|
|
||||||
var excerpt = '';
|
$.each(response.posts, function(index, val) {
|
||||||
if(val.custom_excerpt != null) {
|
const date = moment(val.published_at);
|
||||||
excerpt = val.custom_excerpt;
|
|
||||||
}else{
|
$('.latest-news').prepend(
|
||||||
excerpt = getWords(val.plaintext);
|
`<div class="post">
|
||||||
}
|
<time>${formatDate(date)}</time>
|
||||||
var newDate = new Date(val.published_at);
|
<h4><a href="https://our.status.im/${val.slug}">${val.title}</a></h4>
|
||||||
var minutes = newDate.getMinutes();
|
</div>`
|
||||||
minutes = minutes + "";
|
);
|
||||||
if(minutes.length == 1){
|
|
||||||
minutes = '0' + minutes;
|
|
||||||
}
|
|
||||||
$('.latest-posts').prepend(' \
|
|
||||||
<div class="post"> \
|
|
||||||
<time>'+ newDate.getDate() + ' ' + months[(newDate.getMonth()+1)] + ' at ' + newDate.getHours() + ':' + minutes + '</time> \
|
|
||||||
<h4><a href="https://our.status.im/'+ val.slug +'">'+ val.title +'</a></h3> \
|
|
||||||
</div> \
|
|
||||||
');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Popups */
|
|
||||||
|
|
||||||
var addClassToElement = require('./shared-js/js/utils').addClassToElement;
|
var addClassToElement = require('./shared-js/js/utils').addClassToElement;
|
||||||
var removeClassFromElement = require('./shared-js/js/utils').removeClassFromElement;
|
var removeClassFromElement = require('./shared-js/js/utils').removeClassFromElement;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue