Просмотр исходного кода

#1001 Templates HEAD section reorganization

Alex Trofimov 8 лет назад
Родитель
Сommit
96b946d74c

+ 0 - 148
modules/boonex/decorous/data/template/system/_header.html

@@ -1,148 +0,0 @@
-<!DOCTYPE html>
-<html lang="__lang__">
-<head>
-    <bx_injection:injection_head_begin />
-    
-    <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
-    <title>__page_header__</title>
-    <base href="<bx_url_root />" />
-
-    __meta_info__
-    __page_robots__
-
-    <meta http-equiv="Content-Style-Type" content="text/css" />
-
-    <bx_include_css_styles />
-    <bx_include_css_system />
-    <bx_include_css />
-
-    __dol_images__
-    __dol_lang__
-    __dol_options__
-
-    <bx_include_js_system />
-    <bx_include_js />
-    <script type="text/javascript" language="javascript">
-
-        var sUrlRoot = '<bx_url_root />';
-
-        var bUseSvgLoading = true;
-        if(!bUseSvgLoading) {
-	        var aSpinnerOpts = {
-	            lines: 7, // The number of lines to draw
-	            length: 0, // The length of each line
-	            width: 8, // The line thickness
-	            radius: 7, // The radius of the inner circle
-	            corners: 1, // Corner roundness (0..1)
-	            rotate: 0, // The rotation offset
-	            direction: 1, // 1: clockwise, -1: counterclockwise
-	            color: '#3a8686', // #rgb or #rrggbb or array of colors
-	            speed: 1, // Rounds per second
-	            trail: 60, // Afterglow percentage
-	            shadow: false, // Whether to render a shadow
-	            hwaccel: false, // Whether to use hardware acceleration
-	            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
-	            zIndex: 2e9, // The z-index (defaults to 2000000000)
-	            top: '50%', // Top position relative to parent in px
-	            left: '50%' // Left position relative to parent in px
-	        };
-
-	        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
-	            lines: 6,
-	            width: 6,
-	            radius: 4,
-	            color: '#333',
-	            top: '50%',
-	            left: 'calc(100% - 20px)'
-	        });
-        }
-
-        $(document).ready(function () {
-            bx_time('__lang__');            
-
-            bx_activate_anim_icons('#3e8685');
-
-            // init link conversion
-            $('a.bx-link').dolConverLinks();
-
-            //responsive template
-            var mainContent = $('.cd-main-content'),
-                header = $('.cd-main-header'),
-                sidebar = $('.cd-side-nav'),
-                sidebarTrigger = $('.cd-nav-trigger');
-
-            //on window scrolling - fix sidebar nav
-            var scrolling = false;
-            checkScrollbarPosition();
-            $(window).on('scroll', function(){
-                if( !scrolling ) {
-                    (!window.requestAnimationFrame) ? setTimeout(checkScrollbarPosition, 300) : window.requestAnimationFrame(checkScrollbarPosition);
-                    scrolling = true;
-                }
-            });
-
-            //mobile only - open sidebar when user clicks the hamburger menu
-            sidebarTrigger.on('click', function(event){
-                event.preventDefault();
-                $([sidebar, sidebarTrigger]).toggleClass('nav-is-visible');
-            });
-
-            function checkMQ() {
-                //check if mobile or desktop device
-                return window.getComputedStyle(document.querySelector('.cd-main-content'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
-            }
-
-            function checkScrollbarPosition() {
-                var mq = checkMQ();
-                
-                if( mq != 'mobile' ) {
-                    var sidebarHeight = sidebar.outerHeight(),
-                        windowHeight = $(window).height(),
-                        mainContentHeight = mainContent.outerHeight(),
-                        scrollTop = $(window).scrollTop();
-
-                    ( ( scrollTop + windowHeight > sidebarHeight ) && ( mainContentHeight - sidebarHeight != 0 ) ) ? sidebar.addClass('is-fixed').css('bottom', 0) : sidebar.removeClass('is-fixed').attr('style', '');
-                }
-                scrolling = false;
-            }
-
-            // hide toolbar on scrolldown, show - on scroll up
-            var mq = checkMQ();
-            if(mq == 'mobile')
-	            new Headroom($('#bx-toolbar').get(0), {
-	                tolerance: {
-	                    down: 10,
-	                    up: 20
-	                },
-	                offset: 200,
-	                classes: {
-	                    initial: "bx-toolbar-anim",
-	                    pinned: "bx-toolbar-reset",
-	                    unpinned: "bx-toolbar-up"
-	                },
-	                onUnpin: function() {
-	                    bx_menu_slide_close_all_opened();
-
-	                    if(sidebar.hasClass('nav-is-visible'))
-	                    	sidebar.toggleClass('nav-is-visible');
-	                }
-	            }).init();
-        });
-
-        (function(w) {
-            var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
-            if ($.cookie('devicePixelRatio') == dpr || dpr < 2)
-                return;
-            $.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
-            window.location.reload();
-        })(window);
-    </script>
-    __extra_js__
-
-    <bx_injection:injection_head />
-
-</head>
-
-<body class="bx-def-font bx-def-image-bg-page bx-def-color-bg-page" <bx_injection:injection_body /> >
-    <bx_injection:injection_header />    

+ 41 - 0
modules/boonex/decorous/data/template/system/_header_js_custom.html

@@ -0,0 +1,41 @@
+<script type="text/javascript" language="javascript">
+    $(document).ready(function () {
+        bx_activate_anim_icons('#283c50');
+
+        //responsive template
+        var mainContent = $('.cd-main-content'),
+            header = $('.cd-main-header'),
+            sidebar = $('.cd-side-nav'),
+            sidebarTrigger = $('.cd-nav-trigger');
+
+        //on window scrolling - fix sidebar nav
+        var scrolling = false;
+        checkScrollbarPosition();
+        $(window).on('scroll', function(){
+            if( !scrolling ) {
+                (!window.requestAnimationFrame) ? setTimeout(checkScrollbarPosition, 300) : window.requestAnimationFrame(checkScrollbarPosition);
+                scrolling = true;
+            }
+        });
+
+        //mobile only - open sidebar when user clicks the hamburger menu
+        sidebarTrigger.on('click', function(event){
+            event.preventDefault();
+            $([sidebar, sidebarTrigger]).toggleClass('nav-is-visible');
+        });
+
+        function checkScrollbarPosition() {
+            var mq = checkMQ();
+            
+            if( mq != 'mobile' ) {
+                var sidebarHeight = sidebar.outerHeight(),
+                    windowHeight = $(window).height(),
+                    mainContentHeight = mainContent.outerHeight(),
+                    scrollTop = $(window).scrollTop();
+
+                ( ( scrollTop + windowHeight > sidebarHeight ) && ( mainContentHeight - sidebarHeight != 0 ) ) ? sidebar.addClass('is-fixed').css('bottom', 0) : sidebar.removeClass('is-fixed').attr('style', '');
+            }
+            scrolling = false;
+        }
+    });
+</script>

+ 32 - 0
modules/boonex/decorous/data/template/system/_header_js_toolbar.html

@@ -0,0 +1,32 @@
+<script type="text/javascript" language="javascript">
+    function checkMQ() {
+        //check if mobile or desktop device
+        return window.getComputedStyle(document.querySelector('.cd-main-content'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
+    }
+
+    $(document).ready(function () {
+        var mq = checkMQ();
+        if(mq == 'mobile') {
+            // hide toolbar on scrolldown, show - on scroll up
+            new Headroom($('#bx-toolbar').get(0), {
+                tolerance: {
+                    down: 10,
+                    up: 20
+                },
+                offset: 200,
+                classes: {
+                    initial: "bx-toolbar-anim",
+                    pinned: "bx-toolbar-reset",
+                    unpinned: "bx-toolbar-up"
+                },
+                onUnpin: function() {
+                    bx_menu_slide_close_all_opened();
+
+                    if(sidebar.hasClass('nav-is-visible'))
+                        sidebar.toggleClass('nav-is-visible');
+
+                }
+            }).init();
+        }
+    });
+</script>

+ 0 - 106
modules/boonex/ocean/data/template/system/_header.html

@@ -1,106 +0,0 @@
-<!DOCTYPE html>
-<html lang="__lang__">
-<head>
-    <bx_injection:injection_head_begin />
-
-    <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
-    <title>__page_header__</title>
-    <base href="<bx_url_root />" />
-
-    __meta_info__
-    __page_robots__
-
-    <meta http-equiv="Content-Style-Type" content="text/css" />
-
-    <bx_include_css_styles />
-    <bx_include_css_system />
-    <bx_include_css />
-    <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600' rel='stylesheet' type='text/css' />
-
-    __dol_images__
-    __dol_lang__
-    __dol_options__
-
-    <bx_include_js_system />
-    <bx_include_js />
-    <script type="text/javascript" language="javascript">
-
-        var sUrlRoot = '<bx_url_root />';
-
-        var bUseSvgLoading = true;
-        if(!bUseSvgLoading) {
-	        var aSpinnerOpts = {
-	            lines: 7, // The number of lines to draw
-	            length: 0, // The length of each line
-	            width: 8, // The line thickness
-	            radius: 7, // The radius of the inner circle
-	            corners: 1, // Corner roundness (0..1)
-	            rotate: 0, // The rotation offset
-	            direction: 1, // 1: clockwise, -1: counterclockwise
-	            color: '#3a8686', // #rgb or #rrggbb or array of colors
-	            speed: 1, // Rounds per second
-	            trail: 60, // Afterglow percentage
-	            shadow: false, // Whether to render a shadow
-	            hwaccel: false, // Whether to use hardware acceleration
-	            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
-	            zIndex: 2e9, // The z-index (defaults to 2000000000)
-	            top: '50%', // Top position relative to parent in px
-	            left: '50%' // Left position relative to parent in px
-	        };
-
-	        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
-	            lines: 6,
-	            width: 6,
-	            radius: 4,
-	            color: '#333',
-	            top: '50%',
-	            left: 'calc(100% - 20px)'
-	        }); 
-        }
-
-        $(document).ready(function () {
-            bx_time('__lang__');            
-
-            bx_activate_anim_icons('#29789c');
-
-            $('#bx-toolbar').css({opacity: 0.9});
-
-            // hide toolbar on scrolldown, show - on scroll up
-            new Headroom($('#bx-toolbar').get(0), {
-                tolerance: {
-                  down: 10,
-                  up: 20
-                },
-                offset: 200,
-                classes: {
-                  initial: "bx-toolbar-anim",
-                  pinned: "bx-toolbar-reset",
-                  unpinned: "bx-toolbar-up"
-                },
-                onUnpin: function() {
-                    bx_menu_slide_close_all_opened();
-                }
-            }).init();
-
-            // init link conversion
-            $('a.bx-link').dolConverLinks();
-        });
-
-        (function(w) {
-            var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
-            if ($.cookie('devicePixelRatio') == dpr || dpr < 2)
-                return;
-            $.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
-            window.location.reload();
-        })(window);
-
-    </script>
-    __extra_js__
-
-    <bx_injection:injection_head />
-
-</head>
-
-<body class="bx-def-font bx-def-color-bg-page" <bx_injection:injection_body /> >
-    <bx_injection:injection_header />    

+ 10 - 0
modules/boonex/ocean/data/template/system/_header_js_custom.html

@@ -0,0 +1,10 @@
+
+<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600' rel='stylesheet' type='text/css' />
+
+<script type="text/javascript" language="javascript">
+    $(document).ready(function () {
+        bx_activate_anim_icons('#29789c');
+
+        $('#bx-toolbar').css({opacity: 0.9});
+    });
+</script>

+ 0 - 104
modules/boonex/protean/data/template/system/_header.html

@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html lang="__lang__">
-<head>
-    <bx_injection:injection_head_begin />
-
-    <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
-    <title>__page_header__</title>
-    <base href="<bx_url_root />" />
-
-    __meta_info__
-    __page_robots__
-
-    <meta http-equiv="Content-Style-Type" content="text/css" />
-
-    <bx_include_css_styles />
-    <bx_include_css_system />
-    <bx_include_css />
-
-    __dol_images__
-    __dol_lang__
-    __dol_options__
-
-    <bx_include_js_system />
-    <bx_include_js />
-    <script type="text/javascript" language="javascript">
-
-        var sUrlRoot = '<bx_url_root />';
-
-        var bUseSvgLoading = false;
-        if(!bUseSvgLoading) {
-	        var aSpinnerOpts = {
-	            lines: 7, // The number of lines to draw
-	            length: 0, // The length of each line
-	            width: 8, // The line thickness
-	            radius: 7, // The radius of the inner circle
-	            corners: 1, // Corner roundness (0..1)
-	            rotate: 0, // The rotation offset
-	            direction: 1, // 1: clockwise, -1: counterclockwise
-	            color: '#3a8686', // #rgb or #rrggbb or array of colors
-	            speed: 1, // Rounds per second
-	            trail: 60, // Afterglow percentage
-	            shadow: false, // Whether to render a shadow
-	            hwaccel: false, // Whether to use hardware acceleration
-	            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
-	            zIndex: 2e9, // The z-index (defaults to 2000000000)
-	            top: '50%', // Top position relative to parent in px
-	            left: '50%' // Left position relative to parent in px
-	        };
-
-	        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
-	            lines: 6,
-	            width: 6,
-	            radius: 4,
-	            color: '#333',
-	            top: '50%',
-	            left: 'calc(100% - 20px)'
-	        });
-        }
-
-        $(document).ready(function () {
-            bx_time('__lang__');            
-
-            bx_activate_anim_icons('#3e8685');
-
-            // hide toolbar on scrolldown, show - on scroll up
-            new Headroom($('#bx-toolbar').get(0), {
-                tolerance: {
-                    down: 10,
-                    up: 20
-                },
-                offset: 200,
-                classes: {
-                    initial: "bx-toolbar-anim",
-                    pinned: "bx-toolbar-reset",
-                    unpinned: "bx-toolbar-up"
-                },
-                onUnpin: function() {
-                    bx_menu_slide_close_all_opened();
-                }
-            }).init();
-
-			// init link conversion
-			$('a.bx-link').dolConverLinks();
-        });
-
-        (function(w) {
-            var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
-            if ($.cookie('devicePixelRatio') == dpr || dpr < 2)
-                return;
-            $.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
-            window.location.reload();
-        })(window);
-
-
-    </script>
-    __extra_js__
-
-    <bx_injection:injection_head />
-
-</head>
-
-<body class="bx-def-font bx-def-image-bg-page bx-def-color-bg-page" <bx_injection:injection_body /> >
-    <bx_injection:injection_header />    

+ 5 - 0
modules/boonex/protean/data/template/system/_header_js_custom.html

@@ -0,0 +1,5 @@
+<script type="text/javascript" language="javascript">
+    $(document).ready(function () {
+        bx_activate_anim_icons('#283C50');
+    });
+</script>

+ 32 - 0
modules/boonex/protean/data/template/system/_header_js_spinner.html

@@ -0,0 +1,32 @@
+<script type="text/javascript" language="javascript">
+    var bUseSvgLoading = false;
+    if(!bUseSvgLoading) {
+        var aSpinnerOpts = {
+            lines: 7, // The number of lines to draw
+            length: 0, // The length of each line
+            width: 8, // The line thickness
+            radius: 7, // The radius of the inner circle
+            corners: 1, // Corner roundness (0..1)
+            rotate: 0, // The rotation offset
+            direction: 1, // 1: clockwise, -1: counterclockwise
+            color: '#283C50', // #rgb or #rrggbb or array of colors
+            speed: 1, // Rounds per second
+            trail: 60, // Afterglow percentage
+            shadow: false, // Whether to render a shadow
+            hwaccel: false, // Whether to use hardware acceleration
+            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
+            zIndex: 2e9, // The z-index (defaults to 2000000000)
+            top: '50%', // Top position relative to parent in px
+            left: '50%' // Left position relative to parent in px
+        };
+
+        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
+            lines: 6,
+            width: 6,
+            radius: 4,
+            color: '#333',
+            top: '50%',
+            left: 'calc(100% - 20px)'
+        });
+    }
+</script>

+ 5 - 70
template/_header.html

@@ -23,77 +23,12 @@
 
     <bx_include_js_system />
     <bx_include_js />
-    <script type="text/javascript" language="javascript">
+   
+    <bx_include_auto:_header_js.html />
+    <bx_include_auto:_header_js_spinner.html />
+    <bx_include_auto:_header_js_toolbar.html />
+    <bx_include_auto:_header_js_custom.html />
 
-        var sUrlRoot = '<bx_url_root />';
-
-        var bUseSvgLoading = true;
-        if(!bUseSvgLoading) {
-	        var aSpinnerOpts = {
-	            lines: 7, // The number of lines to draw
-	            length: 0, // The length of each line
-	            width: 8, // The line thickness
-	            radius: 7, // The radius of the inner circle
-	            corners: 1, // Corner roundness (0..1)
-	            rotate: 0, // The rotation offset
-	            direction: 1, // 1: clockwise, -1: counterclockwise
-	            color: '#3a8686', // #rgb or #rrggbb or array of colors
-	            speed: 1, // Rounds per second
-	            trail: 60, // Afterglow percentage
-	            shadow: false, // Whether to render a shadow
-	            hwaccel: false, // Whether to use hardware acceleration
-	            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
-	            zIndex: 2e9, // The z-index (defaults to 2000000000)
-	            top: '50%', // Top position relative to parent in px
-	            left: '50%' // Left position relative to parent in px
-	        };
-
-	        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
-	            lines: 6,
-	            width: 6,
-	            radius: 4,
-	            color: '#333',
-	            top: '50%',
-	            left: 'calc(100% - 20px)'
-	        });
-        }
-
-        $(document).ready(function () {
-            bx_time('__lang__');            
-
-            bx_activate_anim_icons('#3e8685');
-
-            // hide toolbar on scrolldown, show - on scroll up
-            new Headroom($('#bx-toolbar').get(0), {
-                tolerance: {
-                    down: 10,
-                    up: 20
-                },
-                offset: 200,
-                classes: {
-                    initial: "bx-toolbar-anim",
-                    pinned: "bx-toolbar-reset",
-                    unpinned: "bx-toolbar-up"
-                },
-                onUnpin: function() {
-                    bx_menu_slide_close_all_opened();
-                }
-            }).init();
-
-            // init link conversion
-            $('a.bx-link').dolConverLinks();
-        });
-
-        (function(w) {
-            var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
-            if ($.cookie('devicePixelRatio') == dpr || dpr < 2)
-                return;
-            $.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
-            window.location.reload();
-        })(window);
-
-
-    </script>
     __extra_js__
 
     <bx_injection:injection_head />

+ 18 - 0
template/_header_js.html

@@ -0,0 +1,18 @@
+<script type="text/javascript" language="javascript">
+    var sUrlRoot = '<bx_url_root />';
+
+    $(document).ready(function () {
+        bx_time('__lang__');
+
+        // init link conversion
+        $('a.bx-link').dolConverLinks();
+    });
+
+    (function(w) {
+        var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
+        if ($.cookie('devicePixelRatio') == dpr || dpr <= 2)
+            return;
+        $.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
+        window.location.reload();
+    })(window);
+</script>

+ 5 - 0
template/_header_js_custom.html

@@ -0,0 +1,5 @@
+<script type="text/javascript" language="javascript">
+    $(document).ready(function () {
+        bx_activate_anim_icons('#3e8685');
+    });
+</script>

+ 32 - 0
template/_header_js_spinner.html

@@ -0,0 +1,32 @@
+<script type="text/javascript" language="javascript">
+    var bUseSvgLoading = true;
+    if(!bUseSvgLoading) {
+        var aSpinnerOpts = {
+            lines: 7, // The number of lines to draw
+            length: 0, // The length of each line
+            width: 8, // The line thickness
+            radius: 7, // The radius of the inner circle
+            corners: 1, // Corner roundness (0..1)
+            rotate: 0, // The rotation offset
+            direction: 1, // 1: clockwise, -1: counterclockwise
+            color: '#3a8686', // #rgb or #rrggbb or array of colors
+            speed: 1, // Rounds per second
+            trail: 60, // Afterglow percentage
+            shadow: false, // Whether to render a shadow
+            hwaccel: false, // Whether to use hardware acceleration
+            className: 'bx-sys-spinner', // The CSS class to assign to the spinner
+            zIndex: 2e9, // The z-index (defaults to 2000000000)
+            top: '50%', // Top position relative to parent in px
+            left: '50%' // Left position relative to parent in px
+        };
+
+        var aSpinnerSmallOpts = $.extend({}, aSpinnerOpts, {
+            lines: 6,
+            width: 6,
+            radius: 4,
+            color: '#333',
+            top: '50%',
+            left: 'calc(100% - 20px)'
+        });
+    }
+</script>

+ 20 - 0
template/_header_js_toolbar.html

@@ -0,0 +1,20 @@
+<script type="text/javascript" language="javascript">
+    $(document).ready(function () {
+        // hide toolbar on scrolldown, show - on scroll up
+        new Headroom($('#bx-toolbar').get(0), {
+            tolerance: {
+                down: 10,
+                up: 20
+            },
+            offset: 200,
+            classes: {
+                initial: "bx-toolbar-anim",
+                pinned: "bx-toolbar-reset",
+                unpinned: "bx-toolbar-up"
+            },
+            onUnpin: function() {
+                bx_menu_slide_close_all_opened();
+            }
+        }).init();
+    });
+</script>