3.0 source code
This commit is contained in:
14
OfficeWeb/vendor/perfect-scrollbar/.bower.json
vendored
Normal file
14
OfficeWeb/vendor/perfect-scrollbar/.bower.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "perfect-scrollbar",
|
||||
"homepage": "https://github.com/noraesae/perfect-scrollbar",
|
||||
"version": "0.4.8",
|
||||
"_release": "0.4.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.4.8",
|
||||
"commit": "af55a6eb3bc9419aadfc482cad2df788b27efae9"
|
||||
},
|
||||
"_source": "git://github.com/noraesae/perfect-scrollbar.git",
|
||||
"_target": "*",
|
||||
"_originalSource": "perfect-scrollbar"
|
||||
}
|
||||
3
OfficeWeb/vendor/perfect-scrollbar/.csslintrc
vendored
Normal file
3
OfficeWeb/vendor/perfect-scrollbar/.csslintrc
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"adjoining-classes": false
|
||||
}
|
||||
2
OfficeWeb/vendor/perfect-scrollbar/.gitignore
vendored
Normal file
2
OfficeWeb/vendor/perfect-scrollbar/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
61
OfficeWeb/vendor/perfect-scrollbar/.jshintrc
vendored
Normal file
61
OfficeWeb/vendor/perfect-scrollbar/.jshintrc
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"passfail" : false,
|
||||
"maxerr" : 100,
|
||||
|
||||
"browser" : true,
|
||||
|
||||
"node" : true,
|
||||
"rhino" : false,
|
||||
"couch" : false,
|
||||
"wsh" : false,
|
||||
|
||||
"jquery" : true,
|
||||
"prototypejs" : false,
|
||||
"mootools" : false,
|
||||
"dojo" : false,
|
||||
|
||||
"predef" : [
|
||||
"require",
|
||||
"define"
|
||||
],
|
||||
|
||||
"debug" : false,
|
||||
"devel" : true,
|
||||
|
||||
"strict" : true,
|
||||
"globalstrict" : true,
|
||||
|
||||
"asi" : false,
|
||||
"laxbreak" : false,
|
||||
"bitwise" : true,
|
||||
"boss" : false,
|
||||
"curly" : true,
|
||||
"eqeqeq" : true,
|
||||
"eqnull" : false,
|
||||
"evil" : false,
|
||||
"expr" : false,
|
||||
"forin" : false,
|
||||
"immed" : true,
|
||||
"latedef" : true,
|
||||
"loopfunc" : false,
|
||||
"noarg" : true,
|
||||
"regexp" : true,
|
||||
"regexdash" : false,
|
||||
"scripturl" : true,
|
||||
"shadow" : false,
|
||||
"supernew" : false,
|
||||
"undef" : true,
|
||||
|
||||
"newcap" : true,
|
||||
"noempty" : false,
|
||||
"nonew" : true,
|
||||
"nomen" : false,
|
||||
"onevar" : false,
|
||||
"plusplus" : false,
|
||||
"sub" : false,
|
||||
"trailing" : true,
|
||||
"white" : true,
|
||||
"indent" : 2,
|
||||
"laxcomma" : true,
|
||||
"camelcase" : true
|
||||
}
|
||||
5
OfficeWeb/vendor/perfect-scrollbar/.travis.yml
vendored
Normal file
5
OfficeWeb/vendor/perfect-scrollbar/.travis.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
||||
87
OfficeWeb/vendor/perfect-scrollbar/Gruntfile.js
vendored
Normal file
87
OfficeWeb/vendor/perfect-scrollbar/Gruntfile.js
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
// Metadata.
|
||||
pkg: grunt.file.readJSON('perfect-scrollbar.jquery.json'),
|
||||
version: grunt.file.readJSON('package.json').version,
|
||||
banner: '/*! <%= pkg.title || pkg.name %> - v<%= version %>\n' +
|
||||
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
|
||||
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
|
||||
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
|
||||
clean: {
|
||||
files: ['min']
|
||||
},
|
||||
// Task configuration.
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
min: {
|
||||
files: {
|
||||
'min/perfect-scrollbar-<%= version %>.min.js': ['src/perfect-scrollbar.js'],
|
||||
'min/perfect-scrollbar-<%= version %>.with-mousewheel.min.js': [
|
||||
'src/perfect-scrollbar.js',
|
||||
'src/jquery.mousewheel.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
gruntfile: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
src: 'Gruntfile.js'
|
||||
},
|
||||
src: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
src: 'src/perfect-scrollbar.js'
|
||||
}
|
||||
},
|
||||
csslint: {
|
||||
strict: {
|
||||
options: {
|
||||
csslintrc: '.csslintrc',
|
||||
'import': 2
|
||||
},
|
||||
src: ['src/perfect-scrollbar.css']
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
minify: {
|
||||
expand: true,
|
||||
cwd: 'src/',
|
||||
src: ['perfect-scrollbar.css'],
|
||||
dest: 'min/',
|
||||
ext: '-<%= version %>.min.css'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// These plugins provide necessary tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-csslint');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
|
||||
grunt.registerTask('default', 'List commands', function () {
|
||||
grunt.log.writeln("");
|
||||
|
||||
grunt.log.writeln("Run 'grunt lint' to lint the source files");
|
||||
grunt.log.writeln("Run 'grunt build' to minify the source files");
|
||||
});
|
||||
|
||||
grunt.registerTask('lint', ['jshint', 'csslint']);
|
||||
grunt.registerTask('build', ['clean', 'uglify', 'cssmin']);
|
||||
grunt.registerTask('travis', ['lint']);
|
||||
|
||||
};
|
||||
206
OfficeWeb/vendor/perfect-scrollbar/README.md
vendored
Normal file
206
OfficeWeb/vendor/perfect-scrollbar/README.md
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
perfect-scrollbar
|
||||
=================
|
||||
|
||||
Tiny but perfect jQuery scrollbar plugin
|
||||
|
||||
Why perfect-scrollbar?
|
||||
------------------
|
||||
|
||||
I worked on the personal project recently, and I was trying to find the jQuery scrollbar plugin that's *perfect*. But there was no *perfect* scrollbar plugin. That's why I decided to make one.
|
||||
|
||||
perfect-scrollbar is very tiny but *perfect*(for me, and maybe for the most of developers) jQuery scrollbar plugin.
|
||||
I hope you love this!
|
||||
|
||||
Demo: http://noraesae.github.com/perfect-scrollbar/
|
||||
|
||||
What means *perfect*?
|
||||
---------------------
|
||||
|
||||
*perfect* means...
|
||||
|
||||
* There should be no css change on any original element.
|
||||
* The scrollbar should not affect the original design layout.
|
||||
* The design of the scrollbar should be (nearly) fully customizable.
|
||||
* If the size of the container or the content changes, the scrollbar size and position should be able to change.
|
||||
|
||||
Then perfect-scrollbar is really *perfect*?
|
||||
-------------------------------------------
|
||||
|
||||
Yes! the only thing that's not *perfect* is my English.
|
||||
|
||||
* perfect-scrollbar has some requirements, but doesn't change or add any style on original elements.
|
||||
* perfect-scrollbar is designed not to have width or height. It's fixed on the right and bottom side of the container.
|
||||
* You can change nearly all css styles of the scrollbar. The scrollbar design has no dependency on scripts.
|
||||
* perfect-scrollbar support 'update' function. Whenever you need to update the size or position of the scrollbar, just update.
|
||||
* Additionally, perfect-scrollbar do use 'scrollTop' and 'scrollLeft', not absolute position or something messy.
|
||||
|
||||
It's cool, isn't it?
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
You can download the latest stable version with download links in [Github Page](http://noraesae.github.io/perfect-scrollbar/). You also can find all releases in [Releases](https://github.com/noraesae/perfect-scrollbar/releases) page.
|
||||
|
||||
If you want to use the development version of the plugin, use the source files which are not minified. They're in the `src` directory. The development version may be unstable, but some known bugs can be fixed.
|
||||
|
||||
```
|
||||
git clone https://github.com/noraesae/perfect-scrollbar.git
|
||||
cd perfect-scrollbar/src
|
||||
```
|
||||
|
||||
You can use [Bower](http://bower.io/) to install the plugin. The plugin is registered as `perfect-scrollbar`.
|
||||
|
||||
```
|
||||
bower install perfect-scrollbar
|
||||
```
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
To make this plugin *perfect*, some requirements were not avoidable. But they're all very trivial and there's nothing to worry about.
|
||||
|
||||
* the container must have a 'position' css style.
|
||||
* the container must have an 'overflow:hidden' css style.
|
||||
* the scrollbar's position must be 'absolute'.
|
||||
* the scrollbar-x must have a 'bottom' css style, and the scrollbar-y must have a 'right' css style.
|
||||
|
||||
The requirement below is for perfect-scrollbar <= 0.3.4
|
||||
|
||||
* there must be the *one* content element(like div) for the container.
|
||||
|
||||
Optional parameters
|
||||
-------------------
|
||||
|
||||
perfect-scrollbar supports optional parameters.
|
||||
|
||||
### wheelSpeed
|
||||
The scroll speed applied to mousewheel event.
|
||||
**Default: 10**
|
||||
|
||||
### wheelPropagation
|
||||
If this option is true, when the scroll reach the end of the side, mousewheel event will be propagated to parent element.
|
||||
**Default: false**
|
||||
|
||||
### minScrollbarLength
|
||||
When set to an integer value, the thumb part of the scrollbar will not shrink below that number of pixels.
|
||||
**Default: null**
|
||||
|
||||
### useBothWheelAxes
|
||||
When set to true, and only one (vertical or horizontal) scrollbar is visible then both vertical and horizontal scrolling will affect the scrollbar.
|
||||
**Default: false**
|
||||
|
||||
### useKeyboard
|
||||
When set to true, the scroll works with arrow keys on the keyboard. The element is scrolled only when the mouse cursor hovers the element.
|
||||
**Default: true**
|
||||
|
||||
### suppressScrollX
|
||||
When set to true, the scroll bar in X axis will not be available, regardless of the content width.
|
||||
**Default: false**
|
||||
|
||||
### suppressScrollY
|
||||
When set to true, the scroll bar in Y axis will not be available, regardless of the content height.
|
||||
**Default: false**
|
||||
|
||||
### scrollXMarginOffset
|
||||
The number of pixels the content width can surpass the container width without enabling the X axis scroll bar. Allows some "wiggle room" or "offset break", so that X axis scroll bar is not enabled just because of a few pixels.
|
||||
**Default: 0**
|
||||
|
||||
### scrollYMarginOffset
|
||||
The number of pixels the content height can surpass the container height without enabling the Y axis scroll bar. Allows some "wiggle room" or "offset break", so that Y axis scroll bar is not enabled just because of a few pixels.
|
||||
**Default: 0**
|
||||
|
||||
### includePadding
|
||||
When set to true, it uses `innerWidth` and `innerHeight` for the container size instead of `width` and `height`. When your container element has non-zero padding and the scrollbar layout looks weird, this option can be helpful.
|
||||
**Default: false**
|
||||
|
||||
How to Use
|
||||
----------
|
||||
|
||||
```html
|
||||
<style>
|
||||
#Demo { position: 'relative'; }
|
||||
</style>
|
||||
<div id='Demo'>
|
||||
<div>
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
When the html document is like above, just use like this:
|
||||
```javascript
|
||||
$('#Demo').perfectScrollbar();
|
||||
```
|
||||
|
||||
With optional parameters:
|
||||
```javascript
|
||||
$("#Demo").perfectScrollbar({
|
||||
wheelSpeed: 20,
|
||||
wheelPropagation: true,
|
||||
minScrollbarLength: 20
|
||||
})
|
||||
```
|
||||
|
||||
If the size of your container or content changes:
|
||||
```javascript
|
||||
$('#Demo').perfectScrollbar('update');
|
||||
```
|
||||
If you want to destory the scrollbar:
|
||||
```javascript
|
||||
$('#Demo').perfectScrollbar('destroy');
|
||||
```
|
||||
|
||||
If you want to scroll to somewhere, just use scroll-top css and update.
|
||||
```javascript
|
||||
$("#Demo").scrollTop(0);
|
||||
$("#Demo").perfectScrollbar('update');
|
||||
```
|
||||
|
||||
Also you can get the informations about how to use the plugin from example codes in the `examples` directory of the source tree.
|
||||
|
||||
Very helpful friends
|
||||
--------------------
|
||||
|
||||
perfect-scrollbar supports [jquery-mousewheel](https://github.com/brandonaaron/jquery-mousewheel). If you want to use mousewheel features, please include jquery-mousewheel before using perfect-scrollbar.
|
||||
|
||||
If you want to make this plugin's update function more responsive, [jquery-resize](https://github.com/cowboy/jquery-resize) can be helpful.
|
||||
|
||||
Contribution
|
||||
------------
|
||||
|
||||
#### Please read [Contributing](https://github.com/noraesae/perfect-scrollbar/wiki/Contributing) in the wiki before making any contibution.
|
||||
|
||||
|
||||
I *really* welcome contributions! Please feel free to fork and issue pull requests when...
|
||||
|
||||
* You have a very nice idea to improve this plugin!
|
||||
* You found a bug!
|
||||
* You're good at English and can help my bad English!
|
||||
|
||||
For IE problems, please refer to [IE Support](https://github.com/noraesae/perfect-scrollbar#ie-support)
|
||||
|
||||
IE Support
|
||||
----------
|
||||
|
||||
This plugin supports old IE browsers in the **minimum** range. The plugin is tested in IEs >= IE6 and works(not well, but works).
|
||||
|
||||
**But the project will not accept the patches to fix IE problems in IE 6/7/8.**
|
||||
|
||||
From jQuery 2.0, jQuery also will not support IE 6/7/8. I also think that supporting old browsers really breaks the web development conventions.
|
||||
|
||||
When old IEs should be supported, please fork the project and make patches personally.
|
||||
|
||||
Helpdesk
|
||||
--------
|
||||
|
||||
If you have any idea to improve this project or any problem using this, please feel free to upload an [issue](https://github.com/noraesae/perfect-scrollbar/issues).
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
The MIT License (MIT) Copyright (c) 2012, 2014 Hyeonje Alex Jun and other contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
25
OfficeWeb/vendor/perfect-scrollbar/bower.json
vendored
Normal file
25
OfficeWeb/vendor/perfect-scrollbar/bower.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "perfect-scrollbar",
|
||||
"version": "0.4.9",
|
||||
"homepage": "http://noraesae.github.io/perfect-scrollbar/",
|
||||
"authors": [
|
||||
"Hyeonje Alex Jun <noraesae@yuiazu.net>"
|
||||
],
|
||||
"description": "Tiny but perfect jQuery scrollbar plugin",
|
||||
"main": [
|
||||
"min/perfect-scrollbar-0.4.9.min.css",
|
||||
"min/perfect-scrollbar-0.4.9.min.js",
|
||||
"min/perfect-scrollbar-0.4.9.with-mousewheel.min.js"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "2.x"
|
||||
}
|
||||
}
|
||||
BIN
OfficeWeb/vendor/perfect-scrollbar/examples/azusa.jpg
vendored
Normal file
BIN
OfficeWeb/vendor/perfect-scrollbar/examples/azusa.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
29
OfficeWeb/vendor/perfect-scrollbar/examples/options-default.html
vendored
Normal file
29
OfficeWeb/vendor/perfect-scrollbar/examples/options-default.html
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
|
||||
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
|
||||
.spacer { text-align:center }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
35
OfficeWeb/vendor/perfect-scrollbar/examples/options-minScrollbarLength.html
vendored
Normal file
35
OfficeWeb/vendor/perfect-scrollbar/examples/options-minScrollbarLength.html
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; }
|
||||
.contentHolder .content { background-image: url('./azusa.jpg'); width: 12800px; height: 7200px; }
|
||||
.spacer { text-align:center }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
$('#LongThumb').perfectScrollbar({minScrollbarLength:100});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="text-align:center">No minimum</h1>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">100px minimum</h1>
|
||||
<div id="LongThumb" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
43
OfficeWeb/vendor/perfect-scrollbar/examples/options-suppressScrollAxis.html
vendored
Normal file
43
OfficeWeb/vendor/perfect-scrollbar/examples/options-suppressScrollAxis.html
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
|
||||
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
|
||||
.spacer { text-align:center }
|
||||
h2 { text-align: center; }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
$('#SuppressScrollX').perfectScrollbar({suppressScrollX: true});
|
||||
$('#SuppressScrollY').perfectScrollbar({suppressScrollY: true});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Default</h2>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h2>suppressScrollX: true</h2>
|
||||
<div id="SuppressScrollX" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h2>suppressScrollY: true</h2>
|
||||
<div id="SuppressScrollY" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
42
OfficeWeb/vendor/perfect-scrollbar/examples/options-useBothWheelAxes.html
vendored
Normal file
42
OfficeWeb/vendor/perfect-scrollbar/examples/options-useBothWheelAxes.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; }
|
||||
.contentHolder .content-x { background-image: url('./azusa.jpg'); width: 1920px; height: 360px; }
|
||||
.contentHolder .content-y { background-image: url('./azusa.jpg'); width: 640px; height: 1080px; }
|
||||
.spacer { text-align:center; }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
$('#CanScrollWithYAxis').perfectScrollbar({useBothWheelAxes: true});
|
||||
$('#CanScrollWithXAxis').perfectScrollbar({useBothWheelAxes: true});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="text-align:center">Default.</h1>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content-x">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">Can scroll X axis with Y axis wheel.</h1>
|
||||
<div id="CanScrollWithYAxis" class="contentHolder">
|
||||
<div class="content-x">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">Can scroll Y axis with X axis wheel.</h1>
|
||||
<div id="CanScrollWithXAxis" class="contentHolder">
|
||||
<div class="content-y">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
40
OfficeWeb/vendor/perfect-scrollbar/examples/options-wheelPropagation.html
vendored
Normal file
40
OfficeWeb/vendor/perfect-scrollbar/examples/options-wheelPropagation.html
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
|
||||
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
|
||||
.spacer { text-align:center }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
$('#NoWheelPropagation').perfectScrollbar({wheelPropagation:true});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="text-align:center">Default; wheelPropagation:false</h1>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">wheelPropagation:true</h1>
|
||||
<div id="NoWheelPropagation" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer">
|
||||
Note<br>that<br>there<br>is<br>plenty<br>of<br>text<br>after<br>the<br>image<br>to<br>ensure<br>that<br>it<br>is<br>possible<br>to<br>down<br>
|
||||
after<br>the<br>bottom<br>of<br>the<br>image<br>has<br>been<br>reached<br>to<br>enable<br>the<br>wheel<br>propagation<br>to<br>be<br>tested<br>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
42
OfficeWeb/vendor/perfect-scrollbar/examples/options-wheelSpeed.html
vendored
Normal file
42
OfficeWeb/vendor/perfect-scrollbar/examples/options-wheelSpeed.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
|
||||
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
|
||||
.spacer { text-align:center }
|
||||
</style>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
$('#Default').perfectScrollbar();
|
||||
$('#FastWheelSpeed').perfectScrollbar({wheelSpeed:100});
|
||||
$('#SlowWheelSpeed').perfectScrollbar({wheelSpeed:1});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="text-align:center">Default; wheelSpeed:10</h1>
|
||||
<div id="Default" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">Fast: wheelSpeed:100</h1>
|
||||
<div id="FastWheelSpeed" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
<h1 style="text-align:center">Slow: wheelSpeed:1</h1>
|
||||
<div id="SlowWheelSpeed" class="contentHolder">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
57
OfficeWeb/vendor/perfect-scrollbar/examples/reach-the-end-callback.html
vendored
Normal file
57
OfficeWeb/vendor/perfect-scrollbar/examples/reach-the-end-callback.html
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
#description {
|
||||
border: 1px solid gray;
|
||||
height:150px;
|
||||
width: 400px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
#status {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function ($) {
|
||||
var $container = $('#description');
|
||||
var $status = $('#status');
|
||||
$container.perfectScrollbar();
|
||||
$container.scroll(function(e) {
|
||||
if($container.scrollTop() === 0) {
|
||||
$status.text('it reaches the top!');
|
||||
}
|
||||
else if ($container.scrollTop() === $container.prop('scrollHeight') - $container.height()) {
|
||||
$status.text('it reaches the end!');
|
||||
} else {
|
||||
$status.text('');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="description" class="wrapper">
|
||||
<p>Hello, world! 0</p>
|
||||
<p>Hello, world! 1</p>
|
||||
<p>Hello, world! 2</p>
|
||||
<p>Hello, world! 3</p>
|
||||
<p>Hello, world! 4</p>
|
||||
<p>Hello, world! 5</p>
|
||||
<p>Hello, world! 6</p>
|
||||
<p>Hello, world! 7</p>
|
||||
<p>Hello, world! 8</p>
|
||||
<p>Hello, world! 9</p>
|
||||
</div>
|
||||
<div id="status">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
45
OfficeWeb/vendor/perfect-scrollbar/examples/text-content.html
vendored
Normal file
45
OfficeWeb/vendor/perfect-scrollbar/examples/text-content.html
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<title>perfect-scrollbar example</title>
|
||||
<link href="../src/perfect-scrollbar.css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="../src/jquery.mousewheel.js"></script>
|
||||
<script src="../src/perfect-scrollbar.js"></script>
|
||||
<style>
|
||||
#description {
|
||||
border: 1px solid gray;
|
||||
height:150px;
|
||||
width: 400px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function ($) {
|
||||
$('#description').perfectScrollbar({
|
||||
wheelSpeed: 20,
|
||||
wheelPropagation: false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="description" class="wrapper">
|
||||
<div>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
<p>The command takes options applicable</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
5
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.min.css
vendored
Normal file
5
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.min.css
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/*! perfect-scrollbar - v0.4.9
|
||||
* http://noraesae.github.com/perfect-scrollbar/
|
||||
* Copyright (c) 2014 Hyeonje Jun; Licensed MIT */
|
||||
|
||||
.ps-container .ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-x-rail,.ps-container.hover .ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-x-rail:hover,.ps-container .ps-scrollbar-x-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x-rail.in-scrolling{opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail{position:absolute;right:3px;width:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-y-rail,.ps-container.hover .ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-y-rail:hover,.ps-container .ps-scrollbar-y-rail.hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail.in-scrolling{opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-x{font-size:0}.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x,.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x{background-color:#999}.ps-container .ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-y{font-size:0}.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y,.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y{background-color:#999}.ps-container.ie .ps-scrollbar-x,.ps-container.ie .ps-scrollbar-y{visibility:hidden}.ps-container.ie:hover .ps-scrollbar-x,.ps-container.ie:hover .ps-scrollbar-y,.ps-container.ie.hover .ps-scrollbar-x,.ps-container.ie.hover .ps-scrollbar-y{visibility:visible}
|
||||
4
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.min.js
vendored
Normal file
4
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.with-mousewheel.min.js
vendored
Normal file
4
OfficeWeb/vendor/perfect-scrollbar/min/perfect-scrollbar-0.4.9.with-mousewheel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
18
OfficeWeb/vendor/perfect-scrollbar/package.json
vendored
Normal file
18
OfficeWeb/vendor/perfect-scrollbar/package.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "perfect-scrollbar",
|
||||
"version": "0.4.9",
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-jshint": "~0.1.1",
|
||||
"grunt-contrib-uglify": "~0.1.1",
|
||||
"grunt-contrib-cssmin": "~0.6.1",
|
||||
"grunt-contrib-csslint": "~0.1.2",
|
||||
"grunt-contrib-clean": "~0.4.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt travis --verbose"
|
||||
}
|
||||
}
|
||||
37
OfficeWeb/vendor/perfect-scrollbar/perfect-scrollbar.jquery.json
vendored
Normal file
37
OfficeWeb/vendor/perfect-scrollbar/perfect-scrollbar.jquery.json
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "perfect-scrollbar",
|
||||
"title": "perfect-scrollbar",
|
||||
"description": "Tiny but perfect jquery scrollbar plugin.",
|
||||
"version": "0.4.9",
|
||||
"author": {
|
||||
"name": "Hyeonje Alex Jun",
|
||||
"email": "noraesae@yuiazu.net",
|
||||
"url": "https://github.com/noraesae/"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/noraesae/perfect-scrollbar#license"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": ">=1.8"
|
||||
},
|
||||
"keywords": [
|
||||
"ui",
|
||||
"scroll",
|
||||
"scrollbar"
|
||||
],
|
||||
"homepage": "http://noraesae.github.com/perfect-scrollbar/",
|
||||
"docs": "https://github.com/noraesae/perfect-scrollbar/",
|
||||
"download": "http://noraesae.github.com/perfect-scrollbar/",
|
||||
"demo": "http://noraesae.github.com/perfect-scrollbar/",
|
||||
"bugs": "https://github.com/noraesae/perfect-scrollbar/issues/",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Hyeonje Alex Jun",
|
||||
"email": "noraesae@yuiazu.net",
|
||||
"url": "https://github.com/noraesae/"
|
||||
}
|
||||
]
|
||||
}
|
||||
201
OfficeWeb/vendor/perfect-scrollbar/src/jquery.mousewheel.js
vendored
Normal file
201
OfficeWeb/vendor/perfect-scrollbar/src/jquery.mousewheel.js
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 3.1.9
|
||||
*
|
||||
* Requires: jQuery 1.2.2+
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS style for Browserify
|
||||
module.exports = factory;
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
|
||||
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
|
||||
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
|
||||
slice = Array.prototype.slice,
|
||||
nullLowestDeltaTimeout, lowestDelta;
|
||||
|
||||
if ( $.event.fixHooks ) {
|
||||
for ( var i = toFix.length; i; ) {
|
||||
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
var special = $.event.special.mousewheel = {
|
||||
version: '3.1.9',
|
||||
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.addEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
// Store the line height and page height for this particular element
|
||||
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
|
||||
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.removeEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
},
|
||||
|
||||
getLineHeight: function(elem) {
|
||||
return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']().css('fontSize'), 10);
|
||||
},
|
||||
|
||||
getPageHeight: function(elem) {
|
||||
return $(elem).height();
|
||||
},
|
||||
|
||||
settings: {
|
||||
adjustOldDeltas: true
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind('mousewheel', fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event,
|
||||
args = slice.call(arguments, 1),
|
||||
delta = 0,
|
||||
deltaX = 0,
|
||||
deltaY = 0,
|
||||
absDelta = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = 'mousewheel';
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
|
||||
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
|
||||
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
|
||||
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
|
||||
|
||||
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
|
||||
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaX = deltaY * -1;
|
||||
deltaY = 0;
|
||||
}
|
||||
|
||||
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
|
||||
delta = deltaY === 0 ? deltaX : deltaY;
|
||||
|
||||
// New school wheel delta (wheel event)
|
||||
if ( 'deltaY' in orgEvent ) {
|
||||
deltaY = orgEvent.deltaY * -1;
|
||||
delta = deltaY;
|
||||
}
|
||||
if ( 'deltaX' in orgEvent ) {
|
||||
deltaX = orgEvent.deltaX;
|
||||
if ( deltaY === 0 ) { delta = deltaX * -1; }
|
||||
}
|
||||
|
||||
// No change actually happened, no reason to go any further
|
||||
if ( deltaY === 0 && deltaX === 0 ) { return; }
|
||||
|
||||
// Need to convert lines and pages to pixels if we aren't already in pixels
|
||||
// There are three delta modes:
|
||||
// * deltaMode 0 is by pixels, nothing to do
|
||||
// * deltaMode 1 is by lines
|
||||
// * deltaMode 2 is by pages
|
||||
if ( orgEvent.deltaMode === 1 ) {
|
||||
var lineHeight = $.data(this, 'mousewheel-line-height');
|
||||
delta *= lineHeight;
|
||||
deltaY *= lineHeight;
|
||||
deltaX *= lineHeight;
|
||||
} else if ( orgEvent.deltaMode === 2 ) {
|
||||
var pageHeight = $.data(this, 'mousewheel-page-height');
|
||||
delta *= pageHeight;
|
||||
deltaY *= pageHeight;
|
||||
deltaX *= pageHeight;
|
||||
}
|
||||
|
||||
// Store lowest absolute delta to normalize the delta values
|
||||
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
|
||||
|
||||
if ( !lowestDelta || absDelta < lowestDelta ) {
|
||||
lowestDelta = absDelta;
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
lowestDelta /= 40;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
// Divide all the things by 40!
|
||||
delta /= 40;
|
||||
deltaX /= 40;
|
||||
deltaY /= 40;
|
||||
}
|
||||
|
||||
// Get a whole, normalized value for the deltas
|
||||
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
|
||||
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
|
||||
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
|
||||
|
||||
// Add information to the event object
|
||||
event.deltaX = deltaX;
|
||||
event.deltaY = deltaY;
|
||||
event.deltaFactor = lowestDelta;
|
||||
// Go ahead and set deltaMode to 0 since we converted to pixels
|
||||
// Although this is a little odd since we overwrite the deltaX/Y
|
||||
// properties with normalized deltas.
|
||||
event.deltaMode = 0;
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
// Clearout lowestDelta after sometime to better
|
||||
// handle multiple device types that give different
|
||||
// a different lowestDelta
|
||||
// Ex: trackpad = 3 and mouse wheel = 120
|
||||
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
|
||||
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
function nullLowestDelta() {
|
||||
lowestDelta = null;
|
||||
}
|
||||
|
||||
function shouldAdjustOldDeltas(orgEvent, absDelta) {
|
||||
// If this is an older event and the delta is divisable by 120,
|
||||
// then we are assuming that the browser is treating this as an
|
||||
// older mouse wheel event and that we should divide the deltas
|
||||
// by 40 to try and get a more usable deltaFactor.
|
||||
// Side note, this actually impacts the reported scroll distance
|
||||
// in older browsers and can cause scrolling to be slower than native.
|
||||
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
|
||||
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
|
||||
}
|
||||
|
||||
}));
|
||||
125
OfficeWeb/vendor/perfect-scrollbar/src/perfect-scrollbar.css
vendored
Normal file
125
OfficeWeb/vendor/perfect-scrollbar/src/perfect-scrollbar.css
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
.ps-container .ps-scrollbar-x-rail {
|
||||
position: absolute; /* please don't change 'position' */
|
||||
bottom: 3px; /* there must be 'bottom' for ps-scrollbar-x-rail */
|
||||
height: 8px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity = 0);
|
||||
-o-transition: background-color .2s linear, opacity .2s linear;
|
||||
-webkit-transition: background-color .2s linear, opacity .2s linear;
|
||||
-moz-transition: background-color .2s linear, opacity .2s linear;
|
||||
transition: background-color .2s linear, opacity .2s linear;
|
||||
}
|
||||
|
||||
.ps-container:hover .ps-scrollbar-x-rail,
|
||||
.ps-container.hover .ps-scrollbar-x-rail {
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity = 60);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-x-rail:hover,
|
||||
.ps-container .ps-scrollbar-x-rail.hover {
|
||||
background-color: #eee;
|
||||
opacity: 0.9;
|
||||
filter: alpha(opacity = 90);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-x-rail.in-scrolling {
|
||||
background-color: #eee;
|
||||
opacity: 0.9;
|
||||
filter: alpha(opacity = 90);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-y-rail {
|
||||
position: absolute; /* please don't change 'position' */
|
||||
right: 3px; /* there must be 'right' for ps-scrollbar-y-rail */
|
||||
width: 8px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity = 0);
|
||||
-o-transition: background-color .2s linear, opacity .2s linear;
|
||||
-webkit-transition: background-color .2s linear, opacity .2s linear;
|
||||
-moz-transition: background-color .2s linear, opacity .2s linear;
|
||||
transition: background-color .2s linear, opacity .2s linear;
|
||||
}
|
||||
|
||||
.ps-container:hover .ps-scrollbar-y-rail,
|
||||
.ps-container.hover .ps-scrollbar-y-rail {
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity = 60);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-y-rail:hover,
|
||||
.ps-container .ps-scrollbar-y-rail.hover {
|
||||
background-color: #eee;
|
||||
opacity: 0.9;
|
||||
filter: alpha(opacity = 90);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-y-rail.in-scrolling {
|
||||
background-color: #eee;
|
||||
opacity: 0.9;
|
||||
filter: alpha(opacity = 90);
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-x {
|
||||
position: absolute; /* please don't change 'position' */
|
||||
bottom: 0; /* there must be 'bottom' for ps-scrollbar-x */
|
||||
height: 8px;
|
||||
background-color: #aaa;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-o-transition: background-color .2s linear;
|
||||
-webkit-transition: background-color.2s linear;
|
||||
-moz-transition: background-color .2s linear;
|
||||
transition: background-color .2s linear;
|
||||
}
|
||||
|
||||
.ps-container.ie6 .ps-scrollbar-x {
|
||||
font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x,
|
||||
.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-y {
|
||||
position: absolute; /* please don't change 'position' */
|
||||
right: 0; /* there must be 'right' for ps-scrollbar-y */
|
||||
width: 8px;
|
||||
background-color: #aaa;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-o-transition: background-color .2s linear;
|
||||
-webkit-transition: background-color.2s linear;
|
||||
-moz-transition: background-color .2s linear;
|
||||
transition: background-color .2s linear;
|
||||
}
|
||||
|
||||
.ps-container.ie6 .ps-scrollbar-y {
|
||||
font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */
|
||||
}
|
||||
|
||||
.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y,
|
||||
.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.ps-container.ie .ps-scrollbar-x,
|
||||
.ps-container.ie .ps-scrollbar-y {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.ps-container.ie:hover .ps-scrollbar-x,
|
||||
.ps-container.ie:hover .ps-scrollbar-y,
|
||||
.ps-container.ie.hover .ps-scrollbar-x,
|
||||
.ps-container.ie.hover .ps-scrollbar-y {
|
||||
visibility: visible;
|
||||
}
|
||||
607
OfficeWeb/vendor/perfect-scrollbar/src/perfect-scrollbar.js
vendored
Normal file
607
OfficeWeb/vendor/perfect-scrollbar/src/perfect-scrollbar.js
vendored
Normal file
@@ -0,0 +1,607 @@
|
||||
/* Copyright (c) 2012, 2014 Hyeonje Alex Jun and other contributors
|
||||
* Licensed under the MIT License
|
||||
*/
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
'use strict';
|
||||
|
||||
// The default settings for the plugin
|
||||
var defaultSettings = {
|
||||
wheelSpeed: 10,
|
||||
wheelPropagation: false,
|
||||
minScrollbarLength: null,
|
||||
useBothWheelAxes: false,
|
||||
useKeyboard: true,
|
||||
suppressScrollX: false,
|
||||
suppressScrollY: false,
|
||||
scrollXMarginOffset: 0,
|
||||
scrollYMarginOffset: 0,
|
||||
includePadding: false
|
||||
};
|
||||
|
||||
var getEventClassName = (function () {
|
||||
var incrementingId = 0;
|
||||
return function () {
|
||||
var id = incrementingId;
|
||||
incrementingId += 1;
|
||||
return '.perfect-scrollbar-' + id;
|
||||
};
|
||||
}());
|
||||
|
||||
$.fn.perfectScrollbar = function (suppliedSettings, option) {
|
||||
|
||||
return this.each(function () {
|
||||
// Use the default settings
|
||||
var settings = $.extend(true, {}, defaultSettings),
|
||||
$this = $(this);
|
||||
|
||||
if (typeof suppliedSettings === "object") {
|
||||
// But over-ride any supplied
|
||||
$.extend(true, settings, suppliedSettings);
|
||||
} else {
|
||||
// If no settings were supplied, then the first param must be the option
|
||||
option = suppliedSettings;
|
||||
}
|
||||
|
||||
// Catch options
|
||||
|
||||
if (option === 'update') {
|
||||
if ($this.data('perfect-scrollbar-update')) {
|
||||
$this.data('perfect-scrollbar-update')();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
else if (option === 'destroy') {
|
||||
if ($this.data('perfect-scrollbar-destroy')) {
|
||||
$this.data('perfect-scrollbar-destroy')();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
if ($this.data('perfect-scrollbar')) {
|
||||
// if there's already perfect-scrollbar
|
||||
return $this.data('perfect-scrollbar');
|
||||
}
|
||||
|
||||
|
||||
// Or generate new perfectScrollbar
|
||||
|
||||
// Set class to the container
|
||||
$this.addClass('ps-container');
|
||||
|
||||
var $scrollbarXRail = $("<div class='ps-scrollbar-x-rail'></div>").appendTo($this),
|
||||
$scrollbarYRail = $("<div class='ps-scrollbar-y-rail'></div>").appendTo($this),
|
||||
$scrollbarX = $("<div class='ps-scrollbar-x'></div>").appendTo($scrollbarXRail),
|
||||
$scrollbarY = $("<div class='ps-scrollbar-y'></div>").appendTo($scrollbarYRail),
|
||||
scrollbarXActive,
|
||||
scrollbarYActive,
|
||||
containerWidth,
|
||||
containerHeight,
|
||||
contentWidth,
|
||||
contentHeight,
|
||||
scrollbarXWidth,
|
||||
scrollbarXLeft,
|
||||
scrollbarXBottom = parseInt($scrollbarXRail.css('bottom'), 10),
|
||||
scrollbarYHeight,
|
||||
scrollbarYTop,
|
||||
scrollbarYRight = parseInt($scrollbarYRail.css('right'), 10),
|
||||
eventClassName = getEventClassName();
|
||||
|
||||
var updateContentScrollTop = function (currentTop, deltaY) {
|
||||
var newTop = currentTop + deltaY,
|
||||
maxTop = containerHeight - scrollbarYHeight;
|
||||
|
||||
if (newTop < 0) {
|
||||
scrollbarYTop = 0;
|
||||
}
|
||||
else if (newTop > maxTop) {
|
||||
scrollbarYTop = maxTop;
|
||||
}
|
||||
else {
|
||||
scrollbarYTop = newTop;
|
||||
}
|
||||
|
||||
var scrollTop = parseInt(scrollbarYTop * (contentHeight - containerHeight) / (containerHeight - scrollbarYHeight), 10);
|
||||
$this.scrollTop(scrollTop);
|
||||
$scrollbarXRail.css({bottom: scrollbarXBottom - scrollTop});
|
||||
};
|
||||
|
||||
var updateContentScrollLeft = function (currentLeft, deltaX) {
|
||||
var newLeft = currentLeft + deltaX,
|
||||
maxLeft = containerWidth - scrollbarXWidth;
|
||||
|
||||
if (newLeft < 0) {
|
||||
scrollbarXLeft = 0;
|
||||
}
|
||||
else if (newLeft > maxLeft) {
|
||||
scrollbarXLeft = maxLeft;
|
||||
}
|
||||
else {
|
||||
scrollbarXLeft = newLeft;
|
||||
}
|
||||
|
||||
var scrollLeft = parseInt(scrollbarXLeft * (contentWidth - containerWidth) / (containerWidth - scrollbarXWidth), 10);
|
||||
$this.scrollLeft(scrollLeft);
|
||||
$scrollbarYRail.css({right: scrollbarYRight - scrollLeft});
|
||||
};
|
||||
|
||||
var getSettingsAdjustedThumbSize = function (thumbSize) {
|
||||
if (settings.minScrollbarLength) {
|
||||
thumbSize = Math.max(thumbSize, settings.minScrollbarLength);
|
||||
}
|
||||
return thumbSize;
|
||||
};
|
||||
|
||||
var updateScrollbarCss = function () {
|
||||
$scrollbarXRail.css({left: $this.scrollLeft(), bottom: scrollbarXBottom - $this.scrollTop(), width: containerWidth, display: scrollbarXActive ? "inherit": "none"});
|
||||
$scrollbarYRail.css({top: $this.scrollTop(), right: scrollbarYRight - $this.scrollLeft(), height: containerHeight, display: scrollbarYActive ? "inherit": "none"});
|
||||
$scrollbarX.css({left: scrollbarXLeft, width: scrollbarXWidth});
|
||||
$scrollbarY.css({top: scrollbarYTop, height: scrollbarYHeight});
|
||||
};
|
||||
|
||||
var updateBarSizeAndPosition = function () {
|
||||
containerWidth = settings.includePadding ? $this.innerWidth() : $this.width();
|
||||
containerHeight = settings.includePadding ? $this.innerHeight() : $this.height();
|
||||
contentWidth = $this.prop('scrollWidth');
|
||||
contentHeight = $this.prop('scrollHeight');
|
||||
|
||||
if (!settings.suppressScrollX && containerWidth + settings.scrollXMarginOffset < contentWidth) {
|
||||
scrollbarXActive = true;
|
||||
scrollbarXWidth = getSettingsAdjustedThumbSize(parseInt(containerWidth * containerWidth / contentWidth, 10));
|
||||
scrollbarXLeft = parseInt($this.scrollLeft() * (containerWidth - scrollbarXWidth) / (contentWidth - containerWidth), 10);
|
||||
}
|
||||
else {
|
||||
scrollbarXActive = false;
|
||||
scrollbarXWidth = 0;
|
||||
scrollbarXLeft = 0;
|
||||
$this.scrollLeft(0);
|
||||
}
|
||||
|
||||
if (!settings.suppressScrollY && containerHeight + settings.scrollYMarginOffset < contentHeight) {
|
||||
scrollbarYActive = true;
|
||||
scrollbarYHeight = getSettingsAdjustedThumbSize(parseInt(containerHeight * containerHeight / contentHeight, 10));
|
||||
scrollbarYTop = parseInt($this.scrollTop() * (containerHeight - scrollbarYHeight) / (contentHeight - containerHeight), 10);
|
||||
}
|
||||
else {
|
||||
scrollbarYActive = false;
|
||||
scrollbarYHeight = 0;
|
||||
scrollbarYTop = 0;
|
||||
$this.scrollTop(0);
|
||||
}
|
||||
|
||||
if (scrollbarYTop >= containerHeight - scrollbarYHeight) {
|
||||
scrollbarYTop = containerHeight - scrollbarYHeight;
|
||||
}
|
||||
if (scrollbarXLeft >= containerWidth - scrollbarXWidth) {
|
||||
scrollbarXLeft = containerWidth - scrollbarXWidth;
|
||||
}
|
||||
|
||||
updateScrollbarCss();
|
||||
};
|
||||
|
||||
var bindMouseScrollXHandler = function () {
|
||||
var currentLeft,
|
||||
currentPageX;
|
||||
|
||||
$scrollbarX.bind('mousedown' + eventClassName, function (e) {
|
||||
currentPageX = e.pageX;
|
||||
currentLeft = $scrollbarX.position().left;
|
||||
$scrollbarXRail.addClass('in-scrolling');
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind('mousemove' + eventClassName, function (e) {
|
||||
if ($scrollbarXRail.hasClass('in-scrolling')) {
|
||||
updateContentScrollLeft(currentLeft, e.pageX - currentPageX);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).bind('mouseup' + eventClassName, function (e) {
|
||||
if ($scrollbarXRail.hasClass('in-scrolling')) {
|
||||
$scrollbarXRail.removeClass('in-scrolling');
|
||||
}
|
||||
});
|
||||
|
||||
currentLeft =
|
||||
currentPageX = null;
|
||||
};
|
||||
|
||||
var bindMouseScrollYHandler = function () {
|
||||
var currentTop,
|
||||
currentPageY;
|
||||
|
||||
$scrollbarY.bind('mousedown' + eventClassName, function (e) {
|
||||
currentPageY = e.pageY;
|
||||
currentTop = $scrollbarY.position().top;
|
||||
$scrollbarYRail.addClass('in-scrolling');
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind('mousemove' + eventClassName, function (e) {
|
||||
if ($scrollbarYRail.hasClass('in-scrolling')) {
|
||||
updateContentScrollTop(currentTop, e.pageY - currentPageY);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).bind('mouseup' + eventClassName, function (e) {
|
||||
if ($scrollbarYRail.hasClass('in-scrolling')) {
|
||||
$scrollbarYRail.removeClass('in-scrolling');
|
||||
}
|
||||
});
|
||||
|
||||
currentTop =
|
||||
currentPageY = null;
|
||||
};
|
||||
|
||||
// check if the default scrolling should be prevented.
|
||||
var shouldPreventDefault = function (deltaX, deltaY) {
|
||||
var scrollTop = $this.scrollTop();
|
||||
if (deltaX === 0) {
|
||||
if (!scrollbarYActive) {
|
||||
return false;
|
||||
}
|
||||
if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= contentHeight - containerHeight && deltaY < 0)) {
|
||||
return !settings.wheelPropagation;
|
||||
}
|
||||
}
|
||||
|
||||
var scrollLeft = $this.scrollLeft();
|
||||
if (deltaY === 0) {
|
||||
if (!scrollbarXActive) {
|
||||
return false;
|
||||
}
|
||||
if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= contentWidth - containerWidth && deltaX > 0)) {
|
||||
return !settings.wheelPropagation;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// bind handlers
|
||||
var bindMouseWheelHandler = function () {
|
||||
// FIXME: Backward compatibility.
|
||||
// After e.deltaFactor applied, wheelSpeed should have smaller value.
|
||||
// Currently, there's no way to change the settings after the scrollbar initialized.
|
||||
// But if the way is implemented in the future, wheelSpeed should be reset.
|
||||
settings.wheelSpeed /= 10;
|
||||
|
||||
var shouldPrevent = false;
|
||||
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
|
||||
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
|
||||
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;
|
||||
|
||||
shouldPrevent = false;
|
||||
if (!settings.useBothWheelAxes) {
|
||||
// deltaX will only be used for horizontal scrolling and deltaY will
|
||||
// only be used for vertical scrolling - this is the default
|
||||
$this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));
|
||||
$this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));
|
||||
} else if (scrollbarYActive && !scrollbarXActive) {
|
||||
// only vertical scrollbar is active and useBothWheelAxes option is
|
||||
// active, so let's scroll vertical bar using both mouse wheel axes
|
||||
if (deltaY) {
|
||||
$this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));
|
||||
} else {
|
||||
$this.scrollTop($this.scrollTop() + (deltaX * settings.wheelSpeed));
|
||||
}
|
||||
shouldPrevent = true;
|
||||
} else if (scrollbarXActive && !scrollbarYActive) {
|
||||
// useBothWheelAxes and only horizontal bar is active, so use both
|
||||
// wheel axes for horizontal bar
|
||||
if (deltaX) {
|
||||
$this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));
|
||||
} else {
|
||||
$this.scrollLeft($this.scrollLeft() - (deltaY * settings.wheelSpeed));
|
||||
}
|
||||
shouldPrevent = true;
|
||||
}
|
||||
|
||||
// update bar position
|
||||
updateBarSizeAndPosition();
|
||||
|
||||
shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY));
|
||||
if (shouldPrevent) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// fix Firefox scroll problem
|
||||
$this.bind('MozMousePixelScroll' + eventClassName, function (e) {
|
||||
if (shouldPrevent) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var bindKeyboardHandler = function () {
|
||||
var hovered = false;
|
||||
$this.bind('mouseenter' + eventClassName, function (e) {
|
||||
hovered = true;
|
||||
});
|
||||
$this.bind('mouseleave' + eventClassName, function (e) {
|
||||
hovered = false;
|
||||
});
|
||||
|
||||
var shouldPrevent = false;
|
||||
$(document).bind('keydown' + eventClassName, function (e) {
|
||||
if (!hovered || $(document.activeElement).is(":input,[contenteditable]")) {
|
||||
return;
|
||||
}
|
||||
|
||||
var deltaX = 0,
|
||||
deltaY = 0;
|
||||
|
||||
switch (e.which) {
|
||||
case 37: // left
|
||||
deltaX = -30;
|
||||
break;
|
||||
case 38: // up
|
||||
deltaY = 30;
|
||||
break;
|
||||
case 39: // right
|
||||
deltaX = 30;
|
||||
break;
|
||||
case 40: // down
|
||||
deltaY = -30;
|
||||
break;
|
||||
case 33: // page up
|
||||
deltaY = 90;
|
||||
break;
|
||||
case 32: // space bar
|
||||
case 34: // page down
|
||||
deltaY = -90;
|
||||
break;
|
||||
case 35: // end
|
||||
deltaY = -containerHeight;
|
||||
break;
|
||||
case 36: // home
|
||||
deltaY = containerHeight;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
$this.scrollTop($this.scrollTop() - deltaY);
|
||||
$this.scrollLeft($this.scrollLeft() + deltaX);
|
||||
|
||||
shouldPrevent = shouldPreventDefault(deltaX, deltaY);
|
||||
if (shouldPrevent) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var bindRailClickHandler = function () {
|
||||
var stopPropagation = function (e) { e.stopPropagation(); };
|
||||
|
||||
$scrollbarY.bind('click' + eventClassName, stopPropagation);
|
||||
$scrollbarYRail.bind('click' + eventClassName, function (e) {
|
||||
var halfOfScrollbarLength = parseInt(scrollbarYHeight / 2, 10),
|
||||
positionTop = e.pageY - $scrollbarYRail.offset().top - halfOfScrollbarLength,
|
||||
maxPositionTop = containerHeight - scrollbarYHeight,
|
||||
positionRatio = positionTop / maxPositionTop;
|
||||
|
||||
if (positionRatio < 0) {
|
||||
positionRatio = 0;
|
||||
} else if (positionRatio > 1) {
|
||||
positionRatio = 1;
|
||||
}
|
||||
|
||||
$this.scrollTop((contentHeight - containerHeight) * positionRatio);
|
||||
});
|
||||
|
||||
$scrollbarX.bind('click' + eventClassName, stopPropagation);
|
||||
$scrollbarXRail.bind('click' + eventClassName, function (e) {
|
||||
var halfOfScrollbarLength = parseInt(scrollbarXWidth / 2, 10),
|
||||
positionLeft = e.pageX - $scrollbarXRail.offset().left - halfOfScrollbarLength,
|
||||
maxPositionLeft = containerWidth - scrollbarXWidth,
|
||||
positionRatio = positionLeft / maxPositionLeft;
|
||||
|
||||
if (positionRatio < 0) {
|
||||
positionRatio = 0;
|
||||
} else if (positionRatio > 1) {
|
||||
positionRatio = 1;
|
||||
}
|
||||
|
||||
$this.scrollLeft((contentWidth - containerWidth) * positionRatio);
|
||||
});
|
||||
};
|
||||
|
||||
// bind mobile touch handler
|
||||
var bindMobileTouchHandler = function () {
|
||||
var applyTouchMove = function (differenceX, differenceY) {
|
||||
$this.scrollTop($this.scrollTop() - differenceY);
|
||||
$this.scrollLeft($this.scrollLeft() - differenceX);
|
||||
|
||||
// update bar position
|
||||
updateBarSizeAndPosition();
|
||||
};
|
||||
|
||||
var startCoords = {},
|
||||
startTime = 0,
|
||||
speed = {},
|
||||
breakingProcess = null,
|
||||
inGlobalTouch = false;
|
||||
|
||||
$(window).bind("touchstart" + eventClassName, function (e) {
|
||||
inGlobalTouch = true;
|
||||
});
|
||||
$(window).bind("touchend" + eventClassName, function (e) {
|
||||
inGlobalTouch = false;
|
||||
});
|
||||
|
||||
$this.bind("touchstart" + eventClassName, function (e) {
|
||||
var touch = e.originalEvent.targetTouches[0];
|
||||
|
||||
startCoords.pageX = touch.pageX;
|
||||
startCoords.pageY = touch.pageY;
|
||||
|
||||
startTime = (new Date()).getTime();
|
||||
|
||||
if (breakingProcess !== null) {
|
||||
clearInterval(breakingProcess);
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
$this.bind("touchmove" + eventClassName, function (e) {
|
||||
if (!inGlobalTouch && e.originalEvent.targetTouches.length === 1) {
|
||||
var touch = e.originalEvent.targetTouches[0];
|
||||
|
||||
var currentCoords = {};
|
||||
currentCoords.pageX = touch.pageX;
|
||||
currentCoords.pageY = touch.pageY;
|
||||
|
||||
var differenceX = currentCoords.pageX - startCoords.pageX,
|
||||
differenceY = currentCoords.pageY - startCoords.pageY;
|
||||
|
||||
applyTouchMove(differenceX, differenceY);
|
||||
startCoords = currentCoords;
|
||||
|
||||
var currentTime = (new Date()).getTime();
|
||||
|
||||
var timeGap = currentTime - startTime;
|
||||
if (timeGap > 0) {
|
||||
speed.x = differenceX / timeGap;
|
||||
speed.y = differenceY / timeGap;
|
||||
startTime = currentTime;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
$this.bind("touchend" + eventClassName, function (e) {
|
||||
clearInterval(breakingProcess);
|
||||
breakingProcess = setInterval(function () {
|
||||
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
|
||||
clearInterval(breakingProcess);
|
||||
return;
|
||||
}
|
||||
|
||||
applyTouchMove(speed.x * 30, speed.y * 30);
|
||||
|
||||
speed.x *= 0.8;
|
||||
speed.y *= 0.8;
|
||||
}, 10);
|
||||
});
|
||||
};
|
||||
|
||||
var bindScrollHandler = function () {
|
||||
$this.bind('scroll' + eventClassName, function (e) {
|
||||
updateBarSizeAndPosition();
|
||||
});
|
||||
};
|
||||
|
||||
var destroy = function () {
|
||||
$this.unbind(eventClassName);
|
||||
$(window).unbind(eventClassName);
|
||||
$(document).unbind(eventClassName);
|
||||
$this.data('perfect-scrollbar', null);
|
||||
$this.data('perfect-scrollbar-update', null);
|
||||
$this.data('perfect-scrollbar-destroy', null);
|
||||
$scrollbarX.remove();
|
||||
$scrollbarY.remove();
|
||||
$scrollbarXRail.remove();
|
||||
$scrollbarYRail.remove();
|
||||
|
||||
// clean all variables
|
||||
$scrollbarX =
|
||||
$scrollbarY =
|
||||
containerWidth =
|
||||
containerHeight =
|
||||
contentWidth =
|
||||
contentHeight =
|
||||
scrollbarXWidth =
|
||||
scrollbarXLeft =
|
||||
scrollbarXBottom =
|
||||
scrollbarYHeight =
|
||||
scrollbarYTop =
|
||||
scrollbarYRight = null;
|
||||
};
|
||||
|
||||
var ieSupport = function (version) {
|
||||
$this.addClass('ie').addClass('ie' + version);
|
||||
|
||||
var bindHoverHandlers = function () {
|
||||
var mouseenter = function () {
|
||||
$(this).addClass('hover');
|
||||
};
|
||||
var mouseleave = function () {
|
||||
$(this).removeClass('hover');
|
||||
};
|
||||
$this.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
|
||||
$scrollbarXRail.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
|
||||
$scrollbarYRail.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
|
||||
$scrollbarX.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
|
||||
$scrollbarY.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
|
||||
};
|
||||
|
||||
var fixIe6ScrollbarPosition = function () {
|
||||
updateScrollbarCss = function () {
|
||||
$scrollbarX.css({left: scrollbarXLeft + $this.scrollLeft(), bottom: scrollbarXBottom, width: scrollbarXWidth});
|
||||
$scrollbarY.css({top: scrollbarYTop + $this.scrollTop(), right: scrollbarYRight, height: scrollbarYHeight});
|
||||
$scrollbarX.hide().show();
|
||||
$scrollbarY.hide().show();
|
||||
};
|
||||
};
|
||||
|
||||
if (version === 6) {
|
||||
bindHoverHandlers();
|
||||
fixIe6ScrollbarPosition();
|
||||
}
|
||||
};
|
||||
|
||||
var supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);
|
||||
|
||||
var initialize = function () {
|
||||
var ieMatch = navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);
|
||||
if (ieMatch && ieMatch[1] === 'msie') {
|
||||
// must be executed at first, because 'ieSupport' may addClass to the container
|
||||
ieSupport(parseInt(ieMatch[2], 10));
|
||||
}
|
||||
|
||||
updateBarSizeAndPosition();
|
||||
bindScrollHandler();
|
||||
bindMouseScrollXHandler();
|
||||
bindMouseScrollYHandler();
|
||||
bindRailClickHandler();
|
||||
if (supportsTouch) {
|
||||
bindMobileTouchHandler();
|
||||
}
|
||||
if ($this.mousewheel) {
|
||||
bindMouseWheelHandler();
|
||||
}
|
||||
if (settings.useKeyboard) {
|
||||
bindKeyboardHandler();
|
||||
}
|
||||
$this.data('perfect-scrollbar', $this);
|
||||
$this.data('perfect-scrollbar-update', updateBarSizeAndPosition);
|
||||
$this.data('perfect-scrollbar-destroy', destroy);
|
||||
};
|
||||
|
||||
// initialize
|
||||
initialize();
|
||||
|
||||
return $this;
|
||||
});
|
||||
};
|
||||
}));
|
||||
Reference in New Issue
Block a user