Merge branch 'alert'

Conflicts:
	.meteor/versions
This commit is contained in:
Sacha Greif 2014-09-16 09:13:24 +09:00
commit cec0dd5a43
15 changed files with 307 additions and 5 deletions

View file

@ -65,4 +65,5 @@ npm-container
matb33:collection-hooks
djedi:sanitize-html
rajit:bootstrap3-datepicker
telescope-update-prompt

View file

@ -100,12 +100,13 @@ telescope-i18n@0.0.0
telescope-lib@0.2.9
telescope-module-embedly@0.2.9
telescope-module-share@0.0.0
telescope-newsletter@0.0.0
telescope-newsletter@0.1.0
telescope-rss@0.0.0
telescope-search@0.0.0
telescope-tags@0.0.0
telescope-theme-base@0.0.0
telescope-theme-hubble@0.0.0
telescope-update-prompt@0.1.0
templating@1.0.6
tmeasday:crypto-base@3.1.2
tmeasday:crypto-md5@3.1.2

View file

@ -1,4 +1,8 @@
## v0.9.3 “UpdateScope”
* Removed unneeded allow insert on Posts and Comments.
* Renaming `postMeta` template to `postInfo` to avoid ambiguity.
* Fixing avatar code.
## v0.9.3 “DailyScope”

1
lib/version.js Normal file
View file

@ -0,0 +1 @@
telescopeVersion = "0.9.4";

View file

@ -1,4 +1,8 @@
Package.describe({summary: "Telescope email digest package"});
Package.describe({
summary: "Telescope email newsletter package",
version: '0.1.0',
name: "telescope-newsletter"
});
Npm.depends({later: "1.1.6"});
@ -30,9 +34,9 @@ Package.onUse(function (api) {
], ['client', 'server']);
api.add_files([
'lib/client/newsletter_banner.html',
'lib/client/newsletter_banner.js',
'lib/client/newsletter_banner.css'
'lib/client/templates/newsletter_banner.html',
'lib/client/templates/newsletter_banner.js',
'lib/client/templates/newsletter_banner.css'
], ['client']);
api.add_files([

View file

@ -0,0 +1 @@
.build*

View file

@ -0,0 +1,22 @@
.update-banner{
overflow: hidden;
}
.update-content{
float: left;
}
.update-version{
float: left;
background: #DD3416;
color: white;
text-align: center;
padding: 5px 10px;
margin: 0px 15px 0px 0px;
}
.update-prompt{
font-weight: bold;
line-height: 1;
margin-bottom: 5px;
}
.update-message{
font-size: 14px;
}

View file

@ -0,0 +1,15 @@
<template name="updateBanner">
{{#if showBanner}}
<div class="update-banner grid-module grid">
<h3 class="update-version">{{version}}</h3>
<div class="update-content">
<h4 class="update-prompt">A new version of Telescope is available.</h4>
<p class="update-message">
You have: {{currentVersion}}. Note: this message is only displayed to admins.
<a href="https://github.com/TelescopeJS/Telescope/blob/master/History.md" target="_blank">View changelog</a> |
<a href="http://telesc.pe/docs/updating" target="_blank">View update instructions</a>
</p>
</div>
</div>
{{/if}}
</template>

View file

@ -0,0 +1,14 @@
Template[getTemplate('updateBanner')].helpers({
showBanner: function () {
return Session.get('updateVersion');
},
version: function () {
return Session.get('updateVersion');
},
currentVersion: function () {
return telescopeVersion;
},
message: function () {
return Session.get('updateMessage');
}
});

View file

@ -0,0 +1,39 @@
compareVersions = function (v1, v2) { // return true if v2 is newer than v1
var v1Array = v1.split('.');
var v2Array = v2.split('.');
// go through each segment of v2 and stop if we find one that's higher
// than the equivalent segment of v1; else return false
return v2Array.some( function (value, index) {
return value > v1Array[index];
});
return false;
}
Meteor.startup(function () {
Session.set('updateVersion', null);
if(Meteor.user() && isAdmin(Meteor.user())){
var url = 'http://version.telescopeapp.org/';
HTTP.get(url, {
params: {
currentVersion: telescopeVersion,
siteTitle: getSetting('title'),
siteUrl: getSiteUrl()
}
}, function (error, result) {
if(result){
// console.log(result);
var currentVersion = telescopeVersion;
var newVersion = result.content;
var message = "";
if (compareVersions(currentVersion, newVersion)){
Session.set('updateVersion', newVersion);
}
}
});
}
});
heroModules.push({
template: 'updateBanner'
});

View file

@ -0,0 +1,29 @@
Package.describe({
summary: "Telescope update prompt package.",
version: '0.1.0',
name: "telescope-update-prompt"
});
Package.onUse(function (api) {
api.use(['telescope-lib', 'telescope-base', 'http'], ['client', 'server']);
api.use([
'jquery',
'underscore',
'iron:router',
'templating'
], 'client');
api.add_files([
'lib/client/update.js',
'lib/client/templates/update_banner.html',
'lib/client/templates/update_banner.js',
'lib/client/templates/update_banner.css'
], ['client']);
api.export([
'compareVersions'
]);
});

View file

@ -0,0 +1,171 @@
{
"dependencies": [
[
"application-configuration",
"1.0.0"
],
[
"binary-heap",
"1.0.0"
],
[
"blaze",
"1.0.3"
],
[
"blaze-tools",
"1.0.0"
],
[
"callback-hook",
"1.0.0"
],
[
"check",
"1.0.0"
],
[
"deps",
"1.0.1"
],
[
"ejson",
"1.0.0"
],
[
"follower-livedata",
"1.0.0"
],
[
"geojson-utils",
"1.0.0"
],
[
"html-tools",
"1.0.0"
],
[
"htmljs",
"1.0.0"
],
[
"http",
"1.0.3"
],
[
"id-map",
"1.0.0"
],
[
"iron:core",
"0.3.2"
],
[
"iron:dynamic-template",
"0.3.0"
],
[
"iron:layout",
"0.3.0"
],
[
"iron:router",
"0.9.1"
],
[
"jquery",
"1.0.0"
],
[
"json",
"1.0.0"
],
[
"livedata",
"1.0.7"
],
[
"logging",
"1.0.2"
],
[
"meteor",
"1.0.2"
],
[
"minifiers",
"1.0.2"
],
[
"minimongo",
"1.0.1"
],
[
"mongo-livedata",
"1.0.3"
],
[
"observe-sequence",
"1.0.1"
],
[
"ordered-dict",
"1.0.0"
],
[
"random",
"1.0.0"
],
[
"reactive-dict",
"1.0.0"
],
[
"retry",
"1.0.0"
],
[
"routepolicy",
"1.0.0"
],
[
"spacebars",
"1.0.0"
],
[
"spacebars-compiler",
"1.0.1"
],
[
"telescope-base",
"0.0.0"
],
[
"telescope-i18n",
"0.0.0"
],
[
"telescope-lib",
"0.2.9"
],
[
"templating",
"1.0.4"
],
[
"ui",
"1.0.0"
],
[
"underscore",
"1.0.0"
],
[
"webapp",
"1.0.2"
]
],
"pluginDependencies": [],
"toolVersion": "meteor-tool@1.0.26",
"format": "1.0"
}