aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:52:13 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:52:13 -0300
commit75d2225cd98feafd5e5e75df5505914295f569ff (patch)
tree4f003195a72dbe96240968bcc04cddabf0824059 /mod
parent009578973540995e73d82c4820528560f77c4d93 (diff)
parentad3bb7b13a75b7a2e23a6be637737ecd11567ed0 (diff)
downloadelgg-75d2225cd98feafd5e5e75df5505914295f569ff.tar.gz
elgg-75d2225cd98feafd5e5e75df5505914295f569ff.tar.bz2
Merge commit 'ad3bb7b13a75b7a2e23a6be637737ecd11567ed0' as 'mod/magic_topbar'
Diffstat (limited to 'mod')
-rw-r--r--mod/magic_topbar/manifest.xml16
-rw-r--r--mod/magic_topbar/start.php16
-rw-r--r--mod/magic_topbar/views/default/magic_topbar/css.php18
-rw-r--r--mod/magic_topbar/views/default/magic_topbar/js.php40
4 files changed, 90 insertions, 0 deletions
diff --git a/mod/magic_topbar/manifest.xml b/mod/magic_topbar/manifest.xml
new file mode 100644
index 000000000..4ce8e37a4
--- /dev/null
+++ b/mod/magic_topbar/manifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
+ <name>Magic Topbar</name>
+ <author>Lorea developers</author>
+ <version>0.2.1</version>
+ <category>bundled</category>
+ <description>This plugin shows topbar all time, improving usability.</description>
+ <website>https://lorea.cc/</website>
+ <copyright>(C) Lorea 2011</copyright>
+ <license>GNU General Public License version 2</license>
+ <requires>
+ <type>elgg_release</type>
+ <version>1.8</version>
+ </requires>
+ <activate_on_install>true</activate_on_install>
+</plugin_manifest>
diff --git a/mod/magic_topbar/start.php b/mod/magic_topbar/start.php
new file mode 100644
index 000000000..36babf170
--- /dev/null
+++ b/mod/magic_topbar/start.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Elgg Magic Topbar plugin
+ *
+ * @package ElggMagicTopbar
+ */
+
+elgg_register_event_handler('init', 'system', 'magic_topbar_init');
+
+/**
+ * Initialize the magic topbar plugin.
+ */
+function magic_topbar_init() {
+ elgg_extend_view('css/elgg','magic_topbar/css');
+ elgg_extend_view('js/elgg','magic_topbar/js');
+}
diff --git a/mod/magic_topbar/views/default/magic_topbar/css.php b/mod/magic_topbar/views/default/magic_topbar/css.php
new file mode 100644
index 000000000..718c09bd0
--- /dev/null
+++ b/mod/magic_topbar/views/default/magic_topbar/css.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Magic Topbar CSS
+ *
+ * @package ElggMagicTopbar
+*/
+?>
+
+/* Magic Topbar Plugin */
+
+.elgg-page-topbar{
+ position: fixed;
+ width:100%;
+}
+.elgg-page-header {
+ margin-top: 0px;
+ padding-top: 24px;
+}
diff --git a/mod/magic_topbar/views/default/magic_topbar/js.php b/mod/magic_topbar/views/default/magic_topbar/js.php
new file mode 100644
index 000000000..cb51913f3
--- /dev/null
+++ b/mod/magic_topbar/views/default/magic_topbar/js.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Hide the topbar when no using with an animation.
+ *
+ * @package ElggMagicTopbar
+ */
+?>
+
+$(function() {
+
+ var $topbar = $(".elgg-page-topbar"),
+ $window = $(window);
+
+ $topbar.css({position: 'fixed', width: '100%'});
+
+ $window.scroll(function() {
+ $topbar.stop();
+ var opacity;
+ if ($window.scrollTop() > 14) {
+ $topbar.animate({opacity: 0}, 'fast');
+ } else {
+ $topbar.css({opacity: 1});
+ }
+ });
+
+ $topbar.mouseenter(function(){
+ $topbar.stop();
+ $topbar.animate({opacity: 1});
+ })
+ .mouseleave(function(){
+ $topbar.stop();
+ var opacity;
+ if ($window.scrollTop() > 14) {
+ opacity = 0;
+ } else {
+ opacity = 1;
+ }
+ $topbar.animate({opacity: opacity});
+ });
+});