You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/08/12 10:03:58 UTC

[3/6] docs commit: Making jquery changes to work on all browsers

Making jquery changes to work on all browsers


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/98aa8882
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/98aa8882
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/98aa8882

Branch: refs/heads/cordova-website
Commit: 98aa8882ac830829531ae0364a8ef7c37af527cb
Parents: 847af70
Author: Raghav Katyal <ra...@microsoft.com>
Authored: Tue Aug 11 17:12:19 2015 -0700
Committer: Dmitry Blotsky <dm...@gmail.com>
Committed: Wed Aug 12 01:00:45 2015 -0700

----------------------------------------------------------------------
 www/blog/index.html    |  7 ++++---
 www/static/js/index.js | 30 +++++++++++++++++++-----------
 2 files changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/98aa8882/www/blog/index.html
----------------------------------------------------------------------
diff --git a/www/blog/index.html b/www/blog/index.html
index 47f0f47..f763f5f 100644
--- a/www/blog/index.html
+++ b/www/blog/index.html
@@ -23,10 +23,11 @@ title: Apache Cordova Blog
                     <div class="title"><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></div>
                     <div>
                     	<span class="date">{{ post.date | date_to_string }}</span>
-                		<span> - by </span>
-                		<span class="author"><a href="{{ post.author.url }}">{{ post.author.name }}</a></span>
-                		<a class="comment" href="{{ site.baseurl }}{{ post.url }}#disqus_thread">Comments</a>
+                		  <span> - by </span>
+                		  <span class="author"><a href="{{ post.author.url }}">{{ post.author.name }}</a></span>
+                		  <a class="comment" href="{{ site.baseurl }}{{ post.url }}#disqus_thread">Comments</a>
                   	</div>	
+                  </div>
                 </header>
                 <section class="post-excerpt">
                   <p>{{ post.content | strip_html | truncatewords:80 }}</p>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/98aa8882/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index 0da1d7e..ad46691 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -74,6 +74,13 @@ function getCookie(cname) {
     return "";
 }
 
+function getTimeFromDateTime(dateTime) {
+    var date_value = dateTime.substr(0,10);
+    date_value = date_value.replace(/-/g,'/');
+    var time_value = dateTime.substr(10);
+    return new Date(date_value + time_value).getTime();
+}
+
 var lastVisit = getCookie("visitTime");
 function checkNotification() {
     var dates = [];
@@ -84,7 +91,7 @@ function checkNotification() {
     }
     var new_blog_count = 0;
     for(var i = 0; i < dates.length ; i++) {
-        var blog_time = new Date(dates[i]).getTime();
+        var blog_time = getTimeFromDateTime(dates[i]);
         if(blog_time > lastVisit) {
             new_blog_count++;
         }
@@ -100,17 +107,18 @@ document.getElementById("blog_button").onclick = function() {
     setCookie("visitTime", currentTime, 365);
 };
 
-var new_blog_count = checkNotification();
-if(new_blog_count) {
-    document.getElementById("new_blog_count").innerHTML = new_blog_count;
-}
+$(document).ready(function () {
 
-$('.adorner').each(function(i) {
-    var blog_time = new Date($(this).attr('blogTime')).getTime();
-    if(blog_time > lastVisit) {
-        this.style.backgroundColor = "#3992ab";
+    $('.adorner').each(function(i) {
+        var blog_time = getTimeFromDateTime($(this).attr('blogTime'));
+        if(blog_time > lastVisit) {
+            this.style.backgroundColor = "#3992ab";
+        }
+    });
+
+    var new_blog_count = checkNotification();
+    if(new_blog_count) {
+        document.getElementById("new_blog_count").innerHTML = new_blog_count;
     }
-});
 
-$(document).ready(function () {
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org