cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject docs commit: Fixing readability and cookie logic.
Date Tue, 13 Oct 2015 00:40:57 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/cordova-website 99aacf9cb -> 477b61673


Fixing readability and cookie logic.


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

Branch: refs/heads/cordova-website
Commit: 477b61673f1d8dcfc54be04711754c7685eece3c
Parents: 99aacf9
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Mon Oct 12 17:40:50 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Mon Oct 12 17:40:50 2015 -0700

----------------------------------------------------------------------
 www/_includes/banner.html    |  6 ++--
 www/static/css-src/main.scss | 70 +++++++++++++++++++++------------------
 www/static/js/index.js       | 32 +++++++++---------
 3 files changed, 57 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/477b6167/www/_includes/banner.html
----------------------------------------------------------------------
diff --git a/www/_includes/banner.html b/www/_includes/banner.html
index ca9b5b1..fbef641 100644
--- a/www/_includes/banner.html
+++ b/www/_includes/banner.html
@@ -1,6 +1,6 @@
-<div class="updates-banner hidden" id="banner">
+<div class="survey-banner hidden" id="survey-banner">
     <div class="container">
         <p class="message">Click <a href="https://apachecordovabot.typeform.com/to/BCc5co"
target="_blank">here</a> to help us improve your Cordova experience.</p>
     </div>
-    <div class="dismiss-btn" id="dismiss-btn"></div>
-</div>
\ No newline at end of file
+    <div class="dismiss-btn" id="survey-banner-dismiss-btn"></div>
+</div>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/477b6167/www/static/css-src/main.scss
----------------------------------------------------------------------
diff --git a/www/static/css-src/main.scss b/www/static/css-src/main.scss
index 3b9ac15..7d334b9 100644
--- a/www/static/css-src/main.scss
+++ b/www/static/css-src/main.scss
@@ -136,38 +136,44 @@ code.prettyprint {
 }
 
 /*----- Updates Banner -----*/
-.updates-banner {
-  background-color: #FFCC00;
-  color: #1E1E1E;
-  font-size: 16px;
-  position: relative;}
-
-.updates-banner .container p {
-  margin: 10px 0;
-  padding-right: 42px; }
-
-.updates-banner .dismiss-btn {
-  position: absolute;
-  top: 0;
-  right: 0;
-  height: 100%;
-  width: 42px;
-  cursor: pointer; }
-
-.updates-banner .dismiss-btn {
-  opacity: 0.5;
-  cursor: pointer; }
-
-.updates-banner .dismiss-btn:hover {
-  opacity: 1; }
-
-.updates-banner .dismiss-btn:after {
-  content: "\00d7";
-  font-size: 24px;
-  font-weight: bold;
-  display: block;
-  margin-left: 10px;
-  margin-top: 2px; }
+.survey-banner {
+    background-color: #FFCC00;
+    color: #1E1E1E;
+    font-size: 16px;
+    position: relative;
+}
+
+.survey-banner .container p {
+    margin: 10px 0;
+    padding-right: 42px;
+}
+
+.survey-banner .dismiss-btn {
+    position: absolute;
+    top: 0;
+    right: 0;
+    height: 100%;
+    width: 42px;
+    cursor: pointer;
+}
+
+.survey-banner .dismiss-btn {
+    opacity: 0.5;
+    cursor: pointer;
+}
+
+.survey-banner .dismiss-btn:hover {
+    opacity: 1;
+}
+
+.survey-banner .dismiss-btn:after {
+    content: "\00d7";
+    font-size: 24px;
+    font-weight: bold;
+    display: block;
+    margin-left: 10px;
+    margin-top: 2px;
+}
 
 @import 'home';
 @import 'blog';

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/477b6167/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index 82f1b81..9d23471 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -60,7 +60,8 @@ function setCookie(cname, cvalue, exdays) {
     var d = new Date();
     d.setTime(d.getTime() + (exdays*24*60*60*1000));
     var expires = "expires="+d.toUTCString();
-    document.cookie = cname + "=" + cvalue + "; " + expires + "path=/";
+    document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
+    console.log(document.cookie);
 }
 
 function getCookie(cname) {
@@ -71,6 +72,7 @@ function getCookie(cname) {
         while (c.charAt(0)==' ') c = c.substring(1);
         if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
     }
+    console.log(document.cookie);
     return "";
 }
 
@@ -94,18 +96,12 @@ function checkNotification() {
     return new_blog_count;
 }
 
-function setBannerCookie() {
-    setCookie("banner", "set", 365);
+function dismissSurvey() {
+    setCookie("surveyDismissed", 1, 365);
 }
 
-function isBannerDismissed() {
-    var isCookieSet = getCookie("banner");
-    if (isCookieSet) {
-        return true;
-    }
-    else {
-        return false;
-    }
+function isSurveyDismissed() {
+    return getCookie("surveyDismissed");
 }
 
 $(document).ready(function () {
@@ -117,20 +113,23 @@ $(document).ready(function () {
             this.style.backgroundColor = "#3992ab";
         }
     });
+
     var new_blog_count = checkNotification();
     if (new_blog_count) {
         document.getElementById("new_blog_count").innerHTML = new_blog_count;
     }
 
-    if(!isBannerDismissed()) {
-        $("#banner").removeClass("hidden");
+    // code for survey banner
+    if(!isSurveyDismissed()) {
+        $("#survey-banner").removeClass("hidden");
     }
 
-    $("#dismiss-btn").click(function() {
-        setBannerCookie();
-        $("#banner").hide();
+    $("#survey-banner-dismiss-btn").click(function() {
+        dismissSurvey();
+        $("#survey-banner").addClass("hidden");
     });
 
+    // code for click-to-copy functionality
     var client = new ZeroClipboard();
     client.on("ready", function(e) {
         var copyButtons = document.getElementsByClassName("btn-copy");
@@ -186,6 +185,7 @@ $(document).ready(function () {
         }
     });
 
+    // jira search code
     $("#jira-search-button").on("click", submitJiraSearchForm);
     $("#jira-search-box").on("keypress", function searchKeypressEventHandler (e) {
         if(e.keyCode == 13) submitJiraSearchForm();


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


Mime
View raw message