Skip to content

Commit

Permalink
merge dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mwager committed Jan 27, 2015
2 parents 7e0b77a + ad1d63c commit 1aac2ab
Show file tree
Hide file tree
Showing 169 changed files with 3,819 additions and 2,441 deletions.
2 changes: 1 addition & 1 deletion .jshintignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ api/server/website/views

# do no lint the optimized webapp sources:
api/server/website/app
api/server/push_demo.js

PushPlugin
casperjs
pushplugin_tmp_TODO_verfolgen

aog*
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ ios_build : build
@echo "$(OK_COLOR)AtOneGo $(FINAL_VERSION) - building with cordova for ios...$(NO_COLOR)"
cd mobile && cordova -d build ios # && cordova -d run ios

ios_build_dev : build_dev
@echo
@echo "$(OK_COLOR)AtOneGo $(FINAL_VERSION) - building with cordova for ios...$(NO_COLOR)"
cd mobile && cordova -d build ios # && cordova -d run ios

ios_device : build
@echo
@echo "$(OK_COLOR)AtOneGo $(FINAL_VERSION) - building with cordova for ios directly. not running. use xcode to start on device after build...$(NO_COLOR)"
Expand Down
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"strong-agent": "latest",

"cluster": "~0.7.7",
"domain": "~0.1.5",
"domain": "~0.0.0",

"cookie": "0.0.4",
"connect": "2.7.x",
"connect-flash": "~0.1.0",
"connect-timeout": "0.0.x",
"connect-mongo": "0.3.2",
"connect-mongo": "0.7.0",

"express": "3.0.x",
"mongoose": "~3.6.10",
Expand Down
11 changes: 10 additions & 1 deletion api/server/app/controllers/website_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ WebsiteController = function (app, mongoose, _config) {

function getLogin(req, res) {
renderTemplate('login', {
uer: req.user,
user: req.user,
login_post_url: config[ENV].WEBSITE_BASE_URL + 'login',
}, req, res);
}
Expand Down Expand Up @@ -480,6 +480,15 @@ WebsiteController = function (app, mongoose, _config) {
// 4. POST change password goes here
app.post('/password/change', postChangePassword);

// serve the single page html file for the app to support push state
// hmm this gets tricky...
// app.get('/app', function serveApp(req, res) {
// renderTemplate('webapp', {
// user: req.user,
// ENV: ENV
// }, req, res);
// });

// admin panel:
app.get('/login', getLogin);
app.post('/login', postLogin);
Expand Down
10 changes: 7 additions & 3 deletions api/server/website/views/imprint.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ <h4><%- (lang === 'de') ? 'Angaben gemäß § 5 TMG' : 'Information according to
<p><%- (lang === 'de') ? 'AtOneGo ist ein freies (und kostenloses) Angebot von ' : 'AtOneGo is a free service by ' %>
<a target="_blank" href="http://mwager.de">Michael Wager</a>
<br/>
Haspingerstrasse 2<br/>
<!--
Strasse...<br/>
86165 Augsburg<%- (lang !== 'de') ? ', Germany' : '' %><br/>
E-mail: <a href="mailto:[email protected]">[email protected]</a><br/>
E-mail: <a href="mailto:"></a><br/>
-->

</p>

<h2>Thanks!</h2>
<p>
Design: <a target="_blank" href="http://projekthelden.de">Projekthelden</a><br/>
<%- (lang === 'de') ? 'Texte' : 'Texts' %>: Daniel Koeppel<br/>
<%- (lang === 'de') ? 'Texte' : 'Texts' %>:
<a target="_blank" href="https://twitter.com/rhymesdaniel">Daniel Koeppel</a><br/>
<%- (lang === 'de') ? 'Übersetzungen' : 'Translations' %>: Tobias Gast</p>

<div class="divider"></div>
Expand Down
21 changes: 11 additions & 10 deletions api/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var

// production: sessions in DB
sessionCollectionName = 'aog-sessions',
sessionStore,
// sessionStore,

// experimenting, not used anymore
// socketIO = require('socket.io'),
Expand Down Expand Up @@ -226,7 +226,7 @@ function configureExpress() {
app.configure(function () {
var dbFromConf,
mongoStoreConf,
onSessionStoreConnected,
// onSessionStoreConnected,
isLive;

// ?
Expand All @@ -250,23 +250,24 @@ function configureExpress() {

mongoStoreConf = {
// use existing mongoose connection !
mongoose_connection: mongoose.connections[0],
mongooseConnection: mongoose.connections[0],
db: isLive ? 'atonego' : dbFromConf.DATABASE,
host: process.env.OPENSHIFT_MONGODB_DB_HOST || dbFromConf.HOST,
port: process.env.OPENSHIFT_MONGODB_DB_PORT|| dbFromConf.PORT || 27017,
username: process.env.OPENSHIFT_MONGODB_DB_USERNAME || '', // optional
password: process.env.OPENSHIFT_MONGODB_DB_PASSWORD || '', // optional
collection: sessionCollectionName, // 'mySessions' // optional, default: sessions

ttl: 30
};
// ttl: 30,

onSessionStoreConnected = function (conf) {
logger.log(('Mongo Session Storage Module connected to database `' +
conf.db.databaseName + '`. CollectionName: `' + sessionCollectionName + '` (-;').green);
autoRemove: 'interval',
autoRemoveInterval: 10 // In minutes. Default
};

sessionStore = new MongoStore(mongoStoreConf, onSessionStoreConnected);
// onSessionStoreConnected = function (conf) {
// logger.log(('Mongo Session Storage Module connected to database `' +
// conf.db.databaseName + '`. CollectionName: `' + sessionCollectionName + '` (-;').green);
// };

// wir wollen keine cookies, deshalb checken wir einen token im header
// jedes requests um benutzer zu identifizieren
Expand All @@ -277,7 +278,7 @@ function configureExpress() {
// maxAge: Date.now() + (360000),

secret: config[ENV].SECRET,
store : sessionStore
store : new MongoStore(mongoStoreConf/*, onSessionStoreConnected*/)
// key: 'connect.sid'
}));

Expand Down
5 changes: 2 additions & 3 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>AtOneGo</title>

<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=0.5, maximum-scale=0.5" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />

<link rel="stylesheet" href="styles/main.css"/>
Expand All @@ -16,7 +16,6 @@
<div id="app-main"></div>
</div>

<div id="ghostbuster-overlay"></div>
<div id="notification" class="aog-white"></div>

<script type="text/javascript">
Expand Down Expand Up @@ -89,7 +88,7 @@
<!-- pushplugin replace -->

<!-- build:js scripts/aog.js -->
<script data-main="scripts/config" src="scripts/libs/require.js"></script>
<script data-main="scripts/config" src="bower_components/requirejs/require.js"></script>
<!-- endbuild -->

</body>
Expand Down
37 changes: 37 additions & 0 deletions app/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ define(function (require) {
// setTimeout
var notifyTimer;

var isCordova = typeof window.cordova !== 'undefined';


// cache DOM Selectors
$(document).ready(function () {
$htmlBody = $('html,body');
Expand All @@ -45,6 +48,8 @@ define(function (require) {
});

common = _.extend(common, {
isCordova: isCordova,

PAGED_EDIT_LOCK: false,

// moment.js formatting:
Expand Down Expand Up @@ -588,6 +593,38 @@ define(function (require) {
var encodedData = window.btoa(unescape(encodeURIComponent( val )));

return encodedData;
},

/**
* Generates a client id for google analytics tracking
*/
generateClientID: function(appVersion, userID) {
if(!isCordova) {
return 'user-' + userID + '-' + appVersion;
}
else {
return 'user-' + userID + '-' +
window.device.platform + '-' +
window.device.version + '-' +
window.device.model + '-' +
appVersion;
}
},

getUA: function() {
var ua = navigator.userAgent;

// cordova api?
// do not usw uuid!
// 'Device UUID: ' + device.uuid + ' - ' +
if(isCordova && window.device && device.model) {
var tmp = device.platform + ' v' + device.version + '/' +
device.model + ' - cordova v' + device.cordova;

return ua + ' || ' + tmp;
}

return ua;
}

}, Backbone.Events);
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ require.config({
JrFork : '../scripts/libs/junior_fork',

// storage stuff
VanillaStorage: '../bower_components/vanilla-storage/src/VanillaStorage',
WebSQLStorage: '../bower_components/vanilla-storage/src/WebSQLStorage',
IDBStorage: '../bower_components/vanilla-storage/src/IDBStorage',
storageHelpers: '../bower_components/vanilla-storage/src/storageHelpers',
cryptojs : '../scripts/libs/cryptojs.aes.3.1.2'
localforage: '../bower_components/localforage/dist/localforage',
cryptojs : '../scripts/libs/cryptojs.aes.3.1.2'
},

shim: {
Expand Down
5 changes: 1 addition & 4 deletions app/scripts/config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ require.config({
// IScroll : '../scripts/libs/iscroll-lite'

// storage stuff
VanillaStorage: '../bower_components/vanilla-storage/src/VanillaStorage',
WebSQLStorage: '../bower_components/vanilla-storage/src/WebSQLStorage',
IDBStorage: '../bower_components/vanilla-storage/src/IDBStorage',
storageHelpers: '../bower_components/vanilla-storage/src/storageHelpers',
localforage: '../bower_components/localforage/dist/localforage',
cryptojs : '../scripts/libs/cryptojs.aes.3.1.2'
},

Expand Down
Loading

0 comments on commit 1aac2ab

Please sign in to comment.