Alex Trofimov 13 лет назад
Родитель
Сommit
3b3aa145d9

+ 2 - 0
inc/classes/BxDolTemplate.php

@@ -309,6 +309,8 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton {
         $this->addJs(array(
             'jquery.js',
             'jquery.migrate.js',
+            'jquery.easing.js',
+            'jquery.cookie.js',
             'functions.js',
             'jquery.dolPopup.js',
             'jquery.ui.position.min.js',

+ 106 - 46
inc/js/jquery.cookie.js

@@ -1,47 +1,107 @@
 /*!
-* jQuery Cookie Plugin
-* https://github.com/carhartl/jquery-cookie
-*
-* Copyright 2011, Klaus Hartl
-* Dual licensed under the MIT or GPL Version 2 licenses.
-* http://www.opensource.org/licenses/mit-license.php
-* http://www.opensource.org/licenses/GPL-2.0
-*/
-(function($) {
-    $.cookie = function(key, value, options) {
-
-        // key and at least value given, set cookie...
-        if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
-            options = $.extend({}, options);
-
-            if (value === null || value === undefined) {
-                options.expires = -1;
-            }
-
-            if (typeof options.expires === 'number') {
-                var days = options.expires, t = options.expires = new Date();
-                t.setDate(t.getDate() + days);
-            }
-
-            value = String(value);
-
-            return (document.cookie = [
-                encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
-                options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
-                options.path ? '; path=' + options.path : '',
-                options.domain ? '; domain=' + options.domain : '',
-                options.secure ? '; secure' : ''
-            ].join(''));
-        }
-
-        // key and possibly options given, get cookie...
-        options = value || {};
-        var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
-
-        var pairs = document.cookie.split('; ');
-        for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
-            if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
-        }
-        return null;
-    };
-})(jQuery);
+ * jQuery Cookie Plugin v1.3.1
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2013 Klaus Hartl
+ * Released under the MIT license
+ */
+(function (factory) {
+	if (typeof define === 'function' && define.amd) {
+		// AMD. Register as anonymous module.
+		define(['jquery'], factory);
+	} else {
+		// Browser globals.
+		factory(jQuery);
+	}
+}(function ($) {
+
+	var pluses = /\+/g;
+
+	function decode(s) {
+		if (config.raw) {
+			return s;
+		}
+		try {
+			// If we can't decode the cookie, ignore it, it's unusable.
+			return decodeURIComponent(s.replace(pluses, ' '));
+		} catch(e) {}
+	}
+
+	function decodeAndParse(s) {
+		if (s.indexOf('"') === 0) {
+			// This is a quoted cookie as according to RFC2068, unescape...
+			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+		}
+
+		s = decode(s);
+
+		try {
+			// If we can't parse the cookie, ignore it, it's unusable.
+			return config.json ? JSON.parse(s) : s;
+		} catch(e) {}
+	}
+
+	var config = $.cookie = function (key, value, options) {
+
+		// Write
+		if (value !== undefined) {
+			options = $.extend({}, config.defaults, options);
+
+			if (typeof options.expires === 'number') {
+				var days = options.expires, t = options.expires = new Date();
+				t.setDate(t.getDate() + days);
+			}
+
+			value = config.json ? JSON.stringify(value) : String(value);
+
+			return (document.cookie = [
+				config.raw ? key : encodeURIComponent(key),
+				'=',
+				config.raw ? value : encodeURIComponent(value),
+				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+				options.path    ? '; path=' + options.path : '',
+				options.domain  ? '; domain=' + options.domain : '',
+				options.secure  ? '; secure' : ''
+			].join(''));
+		}
+
+		// Read
+
+		var result = key ? undefined : {};
+
+		// To prevent the for loop in the first place assign an empty array
+		// in case there are no cookies at all. Also prevents odd result when
+		// calling $.cookie().
+		var cookies = document.cookie ? document.cookie.split('; ') : [];
+
+		for (var i = 0, l = cookies.length; i < l; i++) {
+			var parts = cookies[i].split('=');
+			var name = decode(parts.shift());
+			var cookie = parts.join('=');
+
+			if (key && key === name) {
+				result = decodeAndParse(cookie);
+				break;
+			}
+
+			// Prevent storing a cookie that we couldn't decode.
+			if (!key && (cookie = decodeAndParse(cookie)) !== undefined) {
+				result[name] = cookie;
+			}
+		}
+
+		return result;
+	};
+
+	config.defaults = {};
+
+	$.removeCookie = function (key, options) {
+		if ($.cookie(key) !== undefined) {
+			// Must not alter options, thus extending a fresh object...
+			$.cookie(key, '', $.extend({}, options, { expires: -1 }));
+			return true;
+		}
+		return false;
+	};
+
+}));

+ 3 - 2
install/sql/v70.sql

@@ -2826,7 +2826,8 @@ INSERT INTO `sys_menu_templates` (`id`, `template`, `title`) VALUES
 (6, 'menu_vertical.html', '_sys_menu_template_title_ver'),
 (7, 'menu_floating_blocks.html', '_sys_menu_template_title_floating_blocks'),
 (8, 'menu_main_submenu.html', '_sys_menu_template_title_main_submenu'),
-(9, 'menu_action.html', '_sys_menu_template_title_action');
+(9, 'menu_action.html', '_sys_menu_template_title_action'),
+(10, 'menu_floating_circles.html', '_sys_menu_template_title_floating_circles');
 
 CREATE TABLE IF NOT EXISTS `sys_objects_menu` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -2901,7 +2902,7 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 -- action menu
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('sys_site_action', 'system', 'action', '_sys_menu_item_title_system_action', '', 'javascript:void(0);', 'bx_menu_popup_inline(\'#bx-menu-action-popup-sys_site_action\', this);', '', 'collapse', '', 2147483647, 1, 0, 0);
+('sys_site_action', 'system', 'action', '_sys_menu_item_title_system_action', '', 'javascript:void(0);', 'bx_menu_action_toggle (this);', '', 'caret-left', '', 2147483647, 1, 0, 0);
 
 -- footer menu
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES

+ 1 - 0
modules/boonex/english/data/langs/system.xml

@@ -3340,6 +3340,7 @@ More info about URI DNSBL: <br />
     <string name="_sys_menu_template_title_ver_lite"><![CDATA[Vertical Links (lite)]]></string>
     <string name="_sys_menu_template_title_toolbar"><![CDATA[Toolbar Buttons]]></string>
     <string name="_sys_menu_template_title_floating_blocks"><![CDATA[Floating Blocks]]></string>
+    <string name="_sys_menu_template_title_floating_circles"><![CDATA[Floating Circles]]></string>
     <string name="_sys_menu_template_title_action"><![CDATA[Action Menu]]></string>
 
     <string name="_sys_designbox_0"><![CDATA[Content only]]></string>

+ 1 - 1
modules/boonex/notes/install/sql/enable.sql

@@ -114,7 +114,7 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 -- Dumping data for 'bx_notes_view' menu
 --
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_view', '_bx_notes_menu_title_view_note', 'bx_notes_view', 'bx_notes', 4, 0, 1, 'BxNotesMenuViewNote', 'modules/boonex/notes/classes/BxNotesMenuViewNote.php');
+('bx_notes_view', '_bx_notes_menu_title_view_note', 'bx_notes_view', 'bx_notes', 10, 0, 1, 'BxNotesMenuViewNote', 'modules/boonex/notes/classes/BxNotesMenuViewNote.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_notes_view', 'bx_notes', '_bx_notes_menu_set_title_view_note', 0);

+ 1 - 1
template/_sub_footer.html

@@ -41,7 +41,7 @@
     __boonex_footers__
 </div>
 
-
+<bx_menu:sys_site_action />
 
 <bx_include_auto:_footer.html />
 

+ 0 - 1
template/_sub_header.html

@@ -52,7 +52,6 @@
 
             <div id="bx-menu-main-container" class="bx-clearfix"> 
                 <bx_menu:sys_site_submenu />
-                <bx_menu:sys_site_action />
             </div>
 
             <bx_injection:injection_top_menu_after />

+ 15 - 8
template/css/default.css

@@ -218,18 +218,10 @@
 .bx-def-color-bg-hl-hover:hover {
     background-color: rgb(220, 220, 255);
     background-color: rgba(200, 200, 255, 0.2);
-
-    -moz-box-shadow: inset 0px 0px -1px 0px rgba(200, 200, 255, 0.2);
-    -webkit-box-shadow: inset 0px 0px -1px 0px rgba(200, 200, 255, 0.2);
-    box-shadow: inset 0px 0px -1px 0px rgba(200, 200, 255, 0.2);
 }
 
 .bx-def-color-bg-active {
     background-color: rgba(255, 234, 193, 0.5);
-
-    -moz-box-shadow: inset 0px 0px -1px 0px rgba(255, 234, 193, 0.5);
-    -webkit-box-shadow: inset 0px 0px -1px 0px rgba(255, 234, 193, 0.5);
-    box-shadow: inset 0px 0px -1px 0px rgba(255, 234, 193, 0.5);
 }
 
 /* hr */
@@ -320,6 +312,21 @@
 	-webkit-border-radius:3px;	
 }
 
+/* circle */
+.bx-def-circle {
+    background-color:#fff;
+    border:2px solid #fff;
+    border-radius:50%;
+	-moz-border-radius:50%;
+	-webkit-border-radius:50%;
+
+    -webkit-box-shadow: 0 1px 3px rgba(51, 51, 51, 0.5);
+    -moz-box-shadow: 0 1px 3px rgba(51, 51, 51, 0.5);
+    box-shadow: 0 0px 2px rgba(51, 51, 51, 0.5);
+
+    overflow:hidden;
+}
+
 /* fonts */
 
 /* NOTE: bx-def-font, h1, h2, h3 styles were copied to editor.css */

+ 99 - 31
template/css/menu.css

@@ -163,37 +163,6 @@ ul.bx-menu-main {
     color:#000;
 }
 
-
-/* --------------- action menu */
-
-#bx-menu-action {
-    float:right;
-}
-
-ul.bx-menu-action {
-    padding:0;
-    margin:0;
-    list-style:none;
-    line-height:39px;
-}
-.bx-menu-action li {
-    float:left;
-    margin:0;
-}
-.bx-menu-action li a {
-    text-decoration:none;
-    line-height:normal;
-}
-.bx-menu-action li .sys-icon {
-    display:inline-block;
-    width:24px;
-    height:24px;
-    font-size:24px;
-    text-align:center;
-    vertical-align:middle;
-}
-
-
 /* --------------- toolbar menu */
 
 #bx-popup-ajax-wrapper-sys_site .bx-popup-content-wrapped {
@@ -342,6 +311,105 @@ ul.bx-menu-floating-blocks {
 }
 
 
+/* --------------- floating circles menu */
+
+ul.bx-menu-floating-circles {
+    padding:0;
+    margin:0;
+    list-style:none;    
+}
+
+.bx-menu-floating-circles li {
+    display:inline;
+    display:inline-block;
+    width:44px;
+    height:44px;
+    vertical-align:top;
+    opacity:0.8;
+}
+
+.bx-menu-floating-circles li:hover,
+.bx-menu-floating-circles li:active {
+    opacity:1.0;
+}
+
+.bx-menu-floating-circles li a {
+    display:block;
+    width:100%;
+    height:100%;
+    text-decoration:none;
+}
+
+.bx-menu-floating-circles li .sys-icon {
+    display:block;
+    padding:10px;
+    width:24px;
+    height:24px;
+    line-height:24px;
+    font-size:24px;
+    text-align:center;
+    vertical-align:middle;
+}
+
+.bx-menu-floating-circles li img {
+    width:100%;
+    height:100%;
+    background-position:center center;
+    background-repeat:no-repeat;
+}
+
+/* --------------- action menu */
+
+.bx-menu-action-wrapper {
+    position:fixed; 
+    height:44px; 
+    bottom:0px; 
+    right:-5px;
+    z-index:910;
+}
+
+.bx-menu-action-buttons,
+.bx-menu-action {
+    position:relative;
+    float:right;
+}
+
+ul.bx-menu-action {
+    padding:0;
+    margin-top:20px;
+    list-style:none;
+}
+.bx-menu-action li {
+    float:left;
+    margin:0;
+}
+.bx-menu-action li a {
+    display:block;
+    text-decoration:none;
+    line-height:normal;
+
+    transform:rotate(180deg);
+    -ms-transform:rotate(180deg);
+    -webkit-transform:rotate(180deg);
+
+    transition: transform .5s;
+    -webkit-transition: -webkit-transform .5s;
+}
+.bx-menu-action li a.bx-menu-action-hidden {
+    transform:rotate(0deg);
+    -ms-transform:rotate(0deg);
+    -webkit-transform:rotate(0deg);
+}
+
+.bx-menu-action li .sys-icon {
+    display:inline-block;
+    width:24px;
+    height:24px;
+    font-size:24px;
+    text-align:center;
+    vertical-align:middle;
+}
+
 /* --------------- interactive block menu */
 ul.bx-menu-inter {
 	padding:0;

+ 31 - 6
template/menu_action.html

@@ -1,7 +1,32 @@
-<ul id="bx-menu-action" class="bx-menu-action bx-menu-object-__object__ bx-def-font-h3 bx-clearfix">
-    <bx_repeat:menu_items>
-        <li class="bx-def-padding-sec-right bx-def-padding-sec-left __class_add__"><a href="__link__" target="__target__" onclick="__onclick__"><i class="sys-icon __icon__"></i>__title__</a></li>
-    </bx_repeat:menu_items>
-</ul>
+<div class="bx-menu-action-wrapper bx-clearfix">
+    <ul id="bx-menu-action" class="bx-menu-action bx-menu-object-__object__ bx-def-font-h3 bx-def-margin-sec-left bx-clearfix">
+        <bx_repeat:menu_items>
+            <li class="bx-def-circle __class_add__"><a class="bx-menu-action-toggle" href="__link__" target="__target__" onclick="__onclick__"><i class="sys-icon __icon__"></i><span>__title__</span></a></li>
+        </bx_repeat:menu_items>
+    </ul>
+    <div class="bx-menu-action-buttons">
+        __buttons__
+    </div>
+</div>
+<script language="javascript">
+    var sBxMenuActionHide = 'bx-menu-action-hide-__buttons_object__';
 
-<div id="bx-menu-action-popup-__object__" style="display:none">__popup__</div>
+    $(document).ready(function () {
+        if ($.cookie(sBxMenuActionHide))
+            bx_menu_action_toggle($('.bx-menu-action-toggle'), true);
+    });
+
+    function bx_menu_action_toggle (e, bForceHide) {
+        if ($('.bx-menu-action-buttons').is(':visible') || ('undefined' != typeof(bForceHide) && bForceHide)) {
+            $(e).addClass('bx-menu-action-hidden');
+            $('.bx-menu-action-buttons').animate({left:'100%', opacity:0}, bForceHide ? 0 : 1000, 'easeInOutCubic', function () {
+                $(this).hide();
+            });
+            $.cookie(sBxMenuActionHide, 1);
+        } else {
+            $(e).removeClass('bx-menu-action-hidden');
+            $('.bx-menu-action-buttons').show().animate({left:'0px', opacity:1}, 1000, 'easeInOutCubic');
+            $.removeCookie(sBxMenuActionHide);
+        }
+    }
+</script>

+ 2 - 1
template/scripts/BxBaseMenuAction.php

@@ -43,7 +43,8 @@ class BxBaseMenuAction extends BxTemplMenu
         if (!$sMenu)
             return false;
 
-        $a['popup'] = BxTemplFunctions::getInstance()->transBox('<div class="bx-def-padding bx-def-color-bg-block">' . $sMenu . '</div>');
+        $a['buttons'] = $sMenu;
+        $a['buttons_object'] = $this->_sMenu;
         
         return $a;
     }