diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/NewsCtrl.js | 3 | ||||
| -rwxr-xr-x | www/js/app.js | 55 | ||||
| -rw-r--r-- | www/templates/menu.html | 2 |
3 files changed, 6 insertions, 54 deletions
diff --git a/www/js/NewsCtrl.js b/www/js/NewsCtrl.js index 1e84e535..86916c2e 100644 --- a/www/js/NewsCtrl.js +++ b/www/js/NewsCtrl.js @@ -104,6 +104,7 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro $scope.newsItems = []; + /* $http.get(zm.blogUrl, { responseType: 'text', @@ -124,6 +125,6 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro }); } - }); + }); */ }]); diff --git a/www/js/app.js b/www/js/app.js index 1473cd9b..d01006d0 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -805,57 +805,7 @@ angular.module('zmApp', [ //console.log ("UPDATE " + zmVersion); }); - NVR.log("Checking for news updates"); - $http.get(zm.blogUrl, { - responseType: 'text', - transformResponse: undefined - }) - - .then(function (datastr) { - // again, for cordova-http - - datastr = datastr.data; - var trunc = "])}while(1);</x>"; - datastr = datastr.substr(trunc.length); - - var data = JSON.parse(datastr); - $rootScope.newBlogPost = ""; - if (data.payload.posts.length <= 0) { - $rootScope.newBlogPost = ""; - return; - } - - var lastDate = NVR.getLatestBlogPostChecked(); - //console.log ("************ BLOG LAST DATE " + lastDate); - if (!lastDate) { - - $rootScope.newBlogPost = "(" + $translate.instant('kNewPost') + ")"; - NVR.setLatestBlogPostChecked(moment().format("YYYY-MM-DD HH:mm:ss")); - return; - - } - var mLastDate = moment(lastDate); - var mItemDate = moment(data.payload.posts[0].createdAt); - - if (mItemDate.diff(mLastDate, 'seconds') > 0) { - /*console.log ("DIFF IS "+mItemDate.diff(mLastDate, 'seconds')); - console.log ("DIFF mLastDate="+mLastDate); - console.log ("DIFF mItemDate="+mItemDate); - console.log ("FORMAT DIFF mLastDate="+mLastDate.format("YYYY-MM-DD HH:mm:ss") ); - console.log ("FORMAT DIFF mItemDate="+mItemDate.format("YYYY-MM-DD HH:mm:ss") );*/ - - NVR.debug("New post dated " + mItemDate.format("YYYY-MM-DD HH:mm:ss") + " found, last date checked was " + mLastDate.format("YYYY-MM-DD HH:mm:ss")); - - $rootScope.newBlogPost = "(" + $translate.instant('kNewPost') + ")"; - NVR.setLatestBlogPostChecked(mItemDate.format("YYYY-MM-DD HH:mm:ss")); - - - - } else { - NVR.debug("Latest post dated " + mItemDate.format("YYYY-MM-DD HH:mm:ss") + " but you read " + lastDate); - } - - }); + } } @@ -2350,7 +2300,7 @@ angular.module('zmApp', [ }) - +/* .state('app.news', { data: { requireLogin: false @@ -2361,6 +2311,7 @@ angular.module('zmApp', [ controller: 'zmApp.NewsCtrl', }) + */ .state('app.monitors', { data: { diff --git a/www/templates/menu.html b/www/templates/menu.html index 1a630b98..f621424c 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -126,7 +126,7 @@ - <div ng-if="$root.showBlog"> + <div ng-if="$root.showBlog && 0"> <!--<ion-item nav-clear menu-close ng-click="navigateView('app.news')" >--> <ion-item nav-clear menu-close href="#/app/news"> <span class=" item-icon-left"> |
