diff options
author | Arnaud Bos <arnaud.bos@aeon-consulting.fr> | 2012-10-20 02:52:02 +0200 |
---|---|---|
committer | Arnaud Bos <arnaud.bos@aeon-consulting.fr> | 2012-10-20 02:52:02 +0200 |
commit | 3ffd14fa4da0ca71e1f97a070973e4994bae8f61 (patch) | |
tree | dd7fea1a54417fc5df25eb559870c6ad06019ef1 /syte/static/js/common.js | |
parent | 01a8792a5116a305368d9d98fa366923086e0633 (diff) | |
download | pelican-themes-3ffd14fa4da0ca71e1f97a070973e4994bae8f61.tar.gz |
add client side social integration, use webassets
Diffstat (limited to 'syte/static/js/common.js')
-rw-r--r-- | syte/static/js/common.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/syte/static/js/common.js b/syte/static/js/common.js new file mode 100644 index 0000000..a504468 --- /dev/null +++ b/syte/static/js/common.js @@ -0,0 +1,48 @@ +/* +Set of functions common for other script in this theme +*/ +function adjustSelection(e) { + $(".main-nav").children("li").removeClass("sel"), $("#" + e).parent().addClass("sel") +} + +function numberWithCommas(e) { + return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +} + +function prepare_link(event, element) { + event.preventDefault(), event.stopPropagation(); + return $.url(element.href.replace("/#!","")); +} + +function remove_modal() { + $("div[id$=-profile]").modal('hide'); + $(".modal-backdrop").modal('hide'); +} + +var spin_opts = { + lines: 9, + length: 5, + width: 2, + radius: 4, + rotate: 9, + color: "#4c4c4c", + speed: 1.5, + trail: 40, + shadow: !1, + hwaccel: !1, + className: "spinner", + zIndex: 2e9 +} + +var isMobileView = !1 +if (typeof window.matchMedia != "undefined") { + var mediaQuery = window.matchMedia("(max-width:799px)"); + mediaQuery.matches && (isMobileView = !0) +} +$(function () { + $("#mobile-nav-btn") + .click(function () { + $(".main-section") + .toggleClass("nav-opened") + }) +}); |