Browse code

Initial commit

Benjamin Roth authored on26/03/2015 16:10:20
Showing17 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+order deny,allow
2
+allow from all
0 3
\ No newline at end of file
1 4
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+;;
2
+; List modules which are required to be loaded beforehand
3
+;;
4
+requires[] = "core"
5
+
6
+;;
7
+; Configure what you want the autoload creator to register
8
+;;
9
+register_namespaces = true
10
+register_classes    = true
11
+register_templates  = true
12
+
13
+;;
14
+; Override the default configuration for certain sub directories
15
+;;
16
+[vendor/*]
17
+register_namespaces = false
18
+register_classes    = false
19
+register_templates  = false
0 20
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+/**
4
+ * Contao Open Source CMS
5
+ *
6
+ * Copyright (c) 2005-2015 Leo Feyer
7
+ *
8
+ * @license LGPL-3.0+
9
+ */
10
+
11
+
12
+/**
13
+ * Register the namespaces
14
+ */
15
+ClassLoader::addNamespaces(array
16
+(
17
+	'eSalesMedia',
18
+));
19
+
20
+
21
+/**
22
+ * Register the classes
23
+ */
24
+ClassLoader::addClasses(array
25
+(
26
+	// Elements
27
+	'eSalesMedia\OnePage\ContentPageStart'   => 'system/modules/eSM_onePage/elements/ContentPageStart.php',
28
+	'eSalesMedia\OnePage\ContentPageStop'    => 'system/modules/eSM_onePage/elements/ContentPageStop.php',
29
+));
30
+
31
+
32
+/**
33
+ * Register the templates
34
+ */
35
+TemplateLoader::addFiles(array
36
+(
37
+	'ce_onepage_page_start' => 'system/modules/eSM_onePage/templates/elements',
38
+	'ce_onepage_page_stop' => 'system/modules/eSM_onePage/templates/elements',
39
+	'j_onepage_scroll' => 'system/modules/eSM_onePage/templates/jquery',
40
+));
0 41
new file mode 100644
... ...
@@ -0,0 +1,27 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+/**
16
+ * onepage scroll version
17
+ */
18
+define('JQMOUSEWHEEL', '3.1.12');
19
+
20
+$GLOBALS['TL_CTE']['onePage'] = array
21
+(
22
+    'onepageStart' => 'OnePage\\ContentPageStart',
23
+    'onepageStop' => 'OnePage\\ContentPageStop',
24
+);
25
+
26
+$GLOBALS['TL_WRAPPERS']['start'][] = 'onepageStart';
27
+$GLOBALS['TL_WRAPPERS']['stop'][] = 'onepageStop';
0 28
\ No newline at end of file
1 29
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+/**
16
+ * Table tl_content
17
+ */
18
+/**
19
+ * Add palettes to tl_content
20
+ */
21
+$GLOBALS['TL_DCA']['tl_content']['palettes']['onepageStart'] = '{type_legend},type;{onepage_legend},eSM_op_valign,eSM_op_theme,eSM_op_scrollIndicator;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop';
22
+$GLOBALS['TL_DCA']['tl_content']['palettes']['onepageStop'] = '{type_legend},type;{onepage_legend},eSM_op_scrollIndicator;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop';
23
+
24
+
25
+/**
26
+ * Add fields to tl_content
27
+ */
28
+
29
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_op_theme'] = array
30
+(
31
+	'label'                   => &$GLOBALS['TL_LANG']['tl_content']['eSM_op_theme'],
32
+	'exclude'                 => true,
33
+	'inputType'               => 'select',
34
+    'options'                 => array('theme-1','theme-2','theme-3','theme-4','theme-5'),
35
+	'eval'                    => array('tl_class'=>'w50','includeBlankOption'=>true),
36
+	'sql'                     => "varchar(32) NOT NULL default ''"
37
+);
38
+
39
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_op_valign'] = array
40
+(
41
+    'label'                   => &$GLOBALS['TL_LANG']['tl_content']['eSM_op_valign'],
42
+    'exclude'                 => true,
43
+    'inputType'               => 'select',
44
+    'default'                 => 'top',
45
+    'options'                 => array('top','center','bottom'),
46
+    'reference'               => $GLOBALS['TL_LANG']['REF']['onepage'],
47
+    'eval'                    => array('tl_class'=>'w50'),
48
+    'sql'                     => "varchar(32) NOT NULL default ''"
49
+);
50
+
51
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_op_scrollIndicator'] = array
52
+(
53
+    'label'                   => &$GLOBALS['TL_LANG']['tl_content']['eSM_op_scrollIndicator'],
54
+    'exclude'                 => true,
55
+    'inputType'               => 'checkbox',
56
+    'eval'                    => array('tl_class'=>'clr'),
57
+    'sql'                     => "char(1) NOT NULL default ''"
58
+);
0 59
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+namespace eSalesMedia\OnePage;
16
+
17
+
18
+/**
19
+ * Wrapper for page section
20
+ */
21
+class ContentPageStart extends \ContentElement
22
+{
23
+
24
+	/**
25
+	 * Template
26
+	 * @var string
27
+	 */
28
+	protected $strTemplate = 'ce_onepage_page_start';
29
+
30
+
31
+	/**
32
+	 * Generate the content element
33
+	 */
34
+	protected function compile()
35
+	{
36
+		if (TL_MODE == 'BE')
37
+		{
38
+			$this->strTemplate = 'be_wildcard';
39
+			$this->Template = new \BackendTemplate($this->strTemplate);
40
+			$this->Template->wildcard = '### '.utf8_strtoupper($GLOBALS['TL_LANG']['MSC']['onepage']['valign'].': '.$GLOBALS['TL_LANG']['REF']['onepage'][$this->eSM_op_valign]).' ###';
41
+		}
42
+
43
+    }
44
+}
0 45
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+namespace eSalesMedia\OnePage;
16
+
17
+
18
+/**
19
+ * Wrapper for page section
20
+ */
21
+class ContentPageStop extends \ContentElement
22
+{
23
+
24
+    /**
25
+     * Template
26
+     * @var string
27
+     */
28
+    protected $strTemplate = 'ce_onepage_page_stop';
29
+
30
+
31
+    /**
32
+     * Generate the content element
33
+     */
34
+    protected function compile()
35
+    {
36
+        if (TL_MODE == 'BE')
37
+        {
38
+            $this->strTemplate = 'be_wildcard';
39
+            $this->Template = new \BackendTemplate($this->strTemplate);
40
+        }
41
+
42
+    }
43
+}
0 44
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+
16
+$GLOBALS['TL_LANG']['CTE']['onePage'] = 'One-Page';
17
+$GLOBALS['TL_LANG']['CTE']['onepageStart'][0] = 'Seitensektion-Startelement';
18
+$GLOBALS['TL_LANG']['CTE']['onepageStart'][1] = 'Beginnt eine neue Seitensektion (In der Regel volle Viewport-Höhe).';
19
+$GLOBALS['TL_LANG']['CTE']['onepageStop'][0] = 'Seitensektion-Endelement';
20
+$GLOBALS['TL_LANG']['CTE']['onepageStop'][1] = 'Schließt eine Seitensektion';
21
+
22
+$GLOBALS['TL_LANG']['MSC']['onepage']['valign'] = 'Vertikale Ausrichtung';
23
+$GLOBALS['TL_LANG']['REF']['onepage']['top'] = 'Oben';
24
+$GLOBALS['TL_LANG']['REF']['onepage']['center'] = 'Mitte';
25
+$GLOBALS['TL_LANG']['REF']['onepage']['bottom'] = 'Unten';
0 26
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+/**
4
+ * eSales Media One-Page toolkit for Contao Open Source CMS
5
+ *
6
+ * Copyright (C) 2015 eSales Media
7
+ *
8
+ * @package    eSM_onePage
9
+ * @link       http://www.esales-media.de
10
+ * @license    commercial
11
+ *
12
+ * @author     Benjamin Roth <benjamin@esales-media.de>
13
+ */
14
+
15
+/**
16
+ * Fields
17
+ */
18
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_valign'][0] = 'Vertikale Ausrichtung';
19
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_valign'][1] = 'Die vertikale Ausrichtung innerhalb der Seitensektion.';
20
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_theme'][0] = 'Thema';
21
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_theme'][1] = 'Bietet die Möglichkeit ein Theme für die Seitensektion zu wählen.';
22
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_scrollIndicator'][0] = 'Scroll-Anzeige';
23
+$GLOBALS['TL_LANG']['tl_content']['eSM_op_scrollIndicator'][1] = 'Stellt eine Link dar um zwischen den Seitensektionen zu scrollen.';
24
+
25
+
26
+/**
27
+ * Legends
28
+ */
29
+$GLOBALS['TL_LANG']['tl_content']['onepage_legend'] = 'One-Page';
0 30
\ No newline at end of file
1 31
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+
2
+<div class="<?php echo $this->class; ?> onepage-page<?php if ($this->eSM_op_theme): ?> <?php echo $this->eSM_op_theme; ?><?php endif; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
3
+
4
+<?php if ($this->eSM_op_scrollIndicator): ?>
5
+  <a class="onepage-scroll-prev"><?php echo $GLOBALS['TL_LANG']['MSC']['goBack']; ?></a>
6
+<?php endif; ?>
7
+
8
+  <div class="onepage-page-content<?php if ($this->eSM_op_valign): ?> onepage-valign-<?php echo $this->eSM_op_valign; ?><?php endif; ?>">
0 9
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+
2
+  </div>
3
+
4
+<?php if ($this->eSM_op_scrollIndicator): ?>
5
+  <a class="onepage-scroll-next"><?php echo $GLOBALS['TL_LANG']['MSC']['continue']; ?></a>
6
+<?php endif; ?>
7
+
8
+</div>
0 9
new file mode 100644
... ...
@@ -0,0 +1,59 @@
1
+<script src="system/modules/eSM_onePage/vendor/jquery-mousewheel/<?php echo JQMOUSEWHEEL; ?>/assets/js/jquery.mousewheel.min.js"></script>
2
+<script>
3
+(function($) {
4
+  $(document).ready(function() {
5
+    /*$('.onepage-page').on('mousewheel', function(event) {
6
+      event.preventDefault();
7
+      var self = $(this);
8
+      if (event.deltaY == -1)
9
+      {
10
+        if (self.nextAll('.onepage-page').length)
11
+        {
12
+          $('html, body').animate({
13
+            scrollTop: self.nextAll('.onepage-page').eq(0).offset().top
14
+          }, 500);
15
+        }
16
+      } else if (event.deltaY == 1)
17
+      {
18
+          if (self.prevAll('.onepage-page').length)
19
+          {
20
+            $('html, body').animate({
21
+              scrollTop: self.prevAll('.onepage-page').eq(0).offset().top
22
+            }, 500);
23
+          }
24
+      }
25
+    });*/
26
+      $('.onepage-scroll-next').click(function(e) {
27
+          e.preventDefault();
28
+
29
+          var currentPage = $(this).closest('.onepage-page');
30
+          if (currentPage.length)
31
+          {
32
+              if (currentPage.nextAll('.onepage-page').length)
33
+              {
34
+                  $('html, body').animate({
35
+                      scrollTop: currentPage.nextAll('.onepage-page').eq(0).offset().top
36
+                  }, 500);
37
+              }
38
+          }
39
+          return false;
40
+      });
41
+
42
+      $('.onepage-scroll-prev').click(function(e) {
43
+          e.preventDefault();
44
+
45
+          var currentPage = $(this).closest('.onepage-page');
46
+          if (currentPage.length)
47
+          {
48
+              if (currentPage.prevAll('.onepage-page').length)
49
+              {
50
+                  $('html, body').animate({
51
+                      scrollTop: currentPage.prevAll('.onepage-page').eq(0).offset().top
52
+                  }, 500);
53
+              }
54
+          }
55
+          return false;
56
+      })
57
+  });
58
+})(jQuery);
59
+</script>
0 60
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+Copyright 2006, 2014 jQuery Foundation and other contributors,
2
+https://jquery.org/
3
+
4
+This software consists of voluntary contributions made by many
5
+individuals. For exact contribution history, see the revision history
6
+available at https://github.com/jquery/jquery-mousewheel
7
+
8
+The following license applies to all parts of this software except as
9
+documented below:
10
+
11
+====
12
+
13
+Permission is hereby granted, free of charge, to any person obtaining
14
+a copy of this software and associated documentation files (the
15
+"Software"), to deal in the Software without restriction, including
16
+without limitation the rights to use, copy, modify, merge, publish,
17
+distribute, sublicense, and/or sell copies of the Software, and to
18
+permit persons to whom the Software is furnished to do so, subject to
19
+the following conditions:
20
+
21
+The above copyright notice and this permission notice shall be
22
+included in all copies or substantial portions of the Software.
23
+
24
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
+
32
+====
33
+
34
+All files located in the node_modules and external directories are
35
+externally maintained libraries used by this software which have their
36
+own licenses; we recommend you read them, as their terms may differ from
37
+the terms above.
0 38
new file mode 100644
... ...
@@ -0,0 +1,76 @@
1
+# jQuery Mouse Wheel Plugin
2
+
3
+A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support with delta normalization.
4
+
5
+In order to use the plugin, simply bind the `mousewheel` event to an element.
6
+
7
+It also provides two helper methods called `mousewheel` and `unmousewheel`
8
+that act just like other event helper methods in jQuery.
9
+
10
+The event object is updated with the normalized `deltaX` and `deltaY` properties.
11
+In addition there is a new property on the event object called `deltaFactor`. Multiply
12
+the `deltaFactor` by `deltaX` or `deltaY` to get the scroll distance that the browser
13
+has reported.
14
+
15
+Here is an example of using both the bind and helper method syntax:
16
+
17
+```js
18
+// using on
19
+$('#my_elem').on('mousewheel', function(event) {
20
+    console.log(event.deltaX, event.deltaY, event.deltaFactor);
21
+});
22
+
23
+// using the event helper
24
+$('#my_elem').mousewheel(function(event) {
25
+    console.log(event.deltaX, event.deltaY, event.deltaFactor);
26
+});
27
+```
28
+
29
+The old behavior of adding three arguments (`delta`, `deltaX`, and `deltaY`) to the
30
+event handler is now deprecated and will be removed in later releases.
31
+
32
+
33
+## The Deltas...
34
+
35
+The combination of Browsers, Operating Systems, and Devices offer a huge range of possible delta values. In fact if the user
36
+uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
37
+values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
38
+acceleration that is used. This number has the potential to be in the thousands depending on the device.
39
+Check out some of the data collected from users [here](http://mousewheeldatacollector.herokuapp.com/).
40
+
41
+### Getting the scroll distance
42
+
43
+In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
44
+scroll based on the users input. This can be done by multiplying the `deltaFactor` by the `deltaX` or `deltaY`
45
+event property to find the scroll distance the browser reported.
46
+
47
+The `deltaFactor` property was added to the event object in 3.1.5 so that the actual reported delta value can be
48
+extracted. This is a non-standard property.
49
+
50
+
51
+## Using with [Browserify](http://browserify.org)
52
+
53
+Support for browserify is baked in.
54
+
55
+```bash
56
+npm install jquery-mousewheel
57
+npm install jquery-browserify
58
+```
59
+
60
+In your server-side node.js code:
61
+
62
+```js
63
+var express = require('express');
64
+var app = express.createServer();
65
+
66
+app.use(require('browserify')({
67
+    require : [ 'jquery-browserify', 'jquery-mousewheel' ]
68
+}));
69
+```
70
+
71
+In your browser-side javascript:
72
+
73
+```js
74
+var $ = require('jquery-browserify');
75
+require('jquery-mousewheel')($);
76
+```
0 77
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+order deny,allow
2
+allow from all
0 3
\ No newline at end of file
1 4
new file mode 100644
... ...
@@ -0,0 +1,221 @@
1
+/*!
2
+ * jQuery Mousewheel 3.1.12
3
+ *
4
+ * Copyright 2014 jQuery Foundation and other contributors
5
+ * Released under the MIT license.
6
+ * http://jquery.org/license
7
+ */
8
+
9
+(function (factory) {
10
+    if ( typeof define === 'function' && define.amd ) {
11
+        // AMD. Register as an anonymous module.
12
+        define(['jquery'], factory);
13
+    } else if (typeof exports === 'object') {
14
+        // Node/CommonJS style for Browserify
15
+        module.exports = factory;
16
+    } else {
17
+        // Browser globals
18
+        factory(jQuery);
19
+    }
20
+}(function ($) {
21
+
22
+    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
23
+        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
24
+                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
25
+        slice  = Array.prototype.slice,
26
+        nullLowestDeltaTimeout, lowestDelta;
27
+
28
+    if ( $.event.fixHooks ) {
29
+        for ( var i = toFix.length; i; ) {
30
+            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
31
+        }
32
+    }
33
+
34
+    var special = $.event.special.mousewheel = {
35
+        version: '3.1.12',
36
+
37
+        setup: function() {
38
+            if ( this.addEventListener ) {
39
+                for ( var i = toBind.length; i; ) {
40
+                    this.addEventListener( toBind[--i], handler, false );
41
+                }
42
+            } else {
43
+                this.onmousewheel = handler;
44
+            }
45
+            // Store the line height and page height for this particular element
46
+            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
47
+            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
48
+        },
49
+
50
+        teardown: function() {
51
+            if ( this.removeEventListener ) {
52
+                for ( var i = toBind.length; i; ) {
53
+                    this.removeEventListener( toBind[--i], handler, false );
54
+                }
55
+            } else {
56
+                this.onmousewheel = null;
57
+            }
58
+            // Clean up the data we added to the element
59
+            $.removeData(this, 'mousewheel-line-height');
60
+            $.removeData(this, 'mousewheel-page-height');
61
+        },
62
+
63
+        getLineHeight: function(elem) {
64
+            var $elem = $(elem),
65
+                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
66
+            if (!$parent.length) {
67
+                $parent = $('body');
68
+            }
69
+            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
70
+        },
71
+
72
+        getPageHeight: function(elem) {
73
+            return $(elem).height();
74
+        },
75
+
76
+        settings: {
77
+            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
78
+            normalizeOffset: true  // calls getBoundingClientRect for each event
79
+        }
80
+    };
81
+
82
+    $.fn.extend({
83
+        mousewheel: function(fn) {
84
+            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
85
+        },
86
+
87
+        unmousewheel: function(fn) {
88
+            return this.unbind('mousewheel', fn);
89
+        }
90
+    });
91
+
92
+
93
+    function handler(event) {
94
+        var orgEvent   = event || window.event,
95
+            args       = slice.call(arguments, 1),
96
+            delta      = 0,
97
+            deltaX     = 0,
98
+            deltaY     = 0,
99
+            absDelta   = 0,
100
+            offsetX    = 0,
101
+            offsetY    = 0;
102
+        event = $.event.fix(orgEvent);
103
+        event.type = 'mousewheel';
104
+
105
+        // Old school scrollwheel delta
106
+        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
107
+        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
108
+        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
109
+        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
110
+
111
+        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
112
+        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
113
+            deltaX = deltaY * -1;
114
+            deltaY = 0;
115
+        }
116
+
117
+        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
118
+        delta = deltaY === 0 ? deltaX : deltaY;
119
+
120
+        // New school wheel delta (wheel event)
121
+        if ( 'deltaY' in orgEvent ) {
122
+            deltaY = orgEvent.deltaY * -1;
123
+            delta  = deltaY;
124
+        }
125
+        if ( 'deltaX' in orgEvent ) {
126
+            deltaX = orgEvent.deltaX;
127
+            if ( deltaY === 0 ) { delta  = deltaX * -1; }
128
+        }
129
+
130
+        // No change actually happened, no reason to go any further
131
+        if ( deltaY === 0 && deltaX === 0 ) { return; }
132
+
133
+        // Need to convert lines and pages to pixels if we aren't already in pixels
134
+        // There are three delta modes:
135
+        //   * deltaMode 0 is by pixels, nothing to do
136
+        //   * deltaMode 1 is by lines
137
+        //   * deltaMode 2 is by pages
138
+        if ( orgEvent.deltaMode === 1 ) {
139
+            var lineHeight = $.data(this, 'mousewheel-line-height');
140
+            delta  *= lineHeight;
141
+            deltaY *= lineHeight;
142
+            deltaX *= lineHeight;
143
+        } else if ( orgEvent.deltaMode === 2 ) {
144
+            var pageHeight = $.data(this, 'mousewheel-page-height');
145
+            delta  *= pageHeight;
146
+            deltaY *= pageHeight;
147
+            deltaX *= pageHeight;
148
+        }
149
+
150
+        // Store lowest absolute delta to normalize the delta values
151
+        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
152
+
153
+        if ( !lowestDelta || absDelta < lowestDelta ) {
154
+            lowestDelta = absDelta;
155
+
156
+            // Adjust older deltas if necessary
157
+            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
158
+                lowestDelta /= 40;
159
+            }
160
+        }
161
+
162
+        // Adjust older deltas if necessary
163
+        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
164
+            // Divide all the things by 40!
165
+            delta  /= 40;
166
+            deltaX /= 40;
167
+            deltaY /= 40;
168
+        }
169
+
170
+        // Get a whole, normalized value for the deltas
171
+        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
172
+        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
173
+        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
174
+
175
+        // Normalise offsetX and offsetY properties
176
+        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
177
+            var boundingRect = this.getBoundingClientRect();
178
+            offsetX = event.clientX - boundingRect.left;
179
+            offsetY = event.clientY - boundingRect.top;
180
+        }
181
+
182
+        // Add information to the event object
183
+        event.deltaX = deltaX;
184
+        event.deltaY = deltaY;
185
+        event.deltaFactor = lowestDelta;
186
+        event.offsetX = offsetX;
187
+        event.offsetY = offsetY;
188
+        // Go ahead and set deltaMode to 0 since we converted to pixels
189
+        // Although this is a little odd since we overwrite the deltaX/Y
190
+        // properties with normalized deltas.
191
+        event.deltaMode = 0;
192
+
193
+        // Add event and delta to the front of the arguments
194
+        args.unshift(event, delta, deltaX, deltaY);
195
+
196
+        // Clearout lowestDelta after sometime to better
197
+        // handle multiple device types that give different
198
+        // a different lowestDelta
199
+        // Ex: trackpad = 3 and mouse wheel = 120
200
+        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
201
+        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
202
+
203
+        return ($.event.dispatch || $.event.handle).apply(this, args);
204
+    }
205
+
206
+    function nullLowestDelta() {
207
+        lowestDelta = null;
208
+    }
209
+
210
+    function shouldAdjustOldDeltas(orgEvent, absDelta) {
211
+        // If this is an older event and the delta is divisable by 120,
212
+        // then we are assuming that the browser is treating this as an
213
+        // older mouse wheel event and that we should divide the deltas
214
+        // by 40 to try and get a more usable deltaFactor.
215
+        // Side note, this actually impacts the reported scroll distance
216
+        // in older browsers and can cause scrolling to be slower than native.
217
+        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
218
+        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
219
+    }
220
+
221
+}));
0 222
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
2
+ * Licensed under the MIT License (LICENSE.txt).
3
+ *
4
+ * Version: 3.1.12
5
+ *
6
+ * Requires: jQuery 1.2.2+
7
+ */
8
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
0 9
\ No newline at end of file