cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject docs commit: Adding survey banner. This closes #382.
Date Mon, 12 Oct 2015 23:00:49 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/cordova-website 056cc1a81 -> 99aacf9cb


Adding survey banner. This closes #382.


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

Branch: refs/heads/cordova-website
Commit: 99aacf9cba2e72d81e5f42d6195307bf6ad37036
Parents: 056cc1a
Author: Raghav Katyal <rakatyal@microsoft.com>
Authored: Fri Oct 9 18:08:20 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Mon Oct 12 15:58:33 2015 -0700

----------------------------------------------------------------------
 www/_includes/banner.html    |  6 ++++++
 www/_layouts/cordova.html    |  1 +
 www/static/css-src/main.scss | 34 ++++++++++++++++++++++++++++++++++
 www/static/js/index.js       | 23 +++++++++++++++++++++++
 4 files changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/99aacf9c/www/_includes/banner.html
----------------------------------------------------------------------
diff --git a/www/_includes/banner.html b/www/_includes/banner.html
new file mode 100644
index 0000000..ca9b5b1
--- /dev/null
+++ b/www/_includes/banner.html
@@ -0,0 +1,6 @@
+<div class="updates-banner hidden" id="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

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/99aacf9c/www/_layouts/cordova.html
----------------------------------------------------------------------
diff --git a/www/_layouts/cordova.html b/www/_layouts/cordova.html
index 69c27fd..815d2b6 100644
--- a/www/_layouts/cordova.html
+++ b/www/_layouts/cordova.html
@@ -7,6 +7,7 @@ analytics_id: UA-64283057-3
 {% include head.html %}
 <body>
     {% include header.html %}
+    {% include banner.html %}
     {{ content }}
     {% include footer.html %}
     {% include analytics.html %}

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/99aacf9c/www/static/css-src/main.scss
----------------------------------------------------------------------
diff --git a/www/static/css-src/main.scss b/www/static/css-src/main.scss
index ea2410e..3b9ac15 100644
--- a/www/static/css-src/main.scss
+++ b/www/static/css-src/main.scss
@@ -135,6 +135,40 @@ code.prettyprint {
     border: none !important;
 }
 
+/*----- 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; }
+
 @import 'home';
 @import 'blog';
 @import 'plugins';

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/99aacf9c/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index d0176ce..82f1b81 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -94,6 +94,20 @@ function checkNotification() {
     return new_blog_count;
 }
 
+function setBannerCookie() {
+    setCookie("banner", "set", 365);
+}
+
+function isBannerDismissed() {
+    var isCookieSet = getCookie("banner");
+    if (isCookieSet) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+
 $(document).ready(function () {
 
     // code for blog badge
@@ -108,6 +122,15 @@ $(document).ready(function () {
         document.getElementById("new_blog_count").innerHTML = new_blog_count;
     }
 
+    if(!isBannerDismissed()) {
+        $("#banner").removeClass("hidden");
+    }
+
+    $("#dismiss-btn").click(function() {
+        setBannerCookie();
+        $("#banner").hide();
+    });
+
     var client = new ZeroClipboard();
     client.on("ready", function(e) {
         var copyButtons = document.getElementsByClassName("btn-copy");


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


Mime
View raw message