Job detail page

Attempt to get mousewheel (trackpad) scrolling to not be super aggressive.
This commit is contained in:
Chris Houseknecht 2014-07-02 12:34:54 -04:00
parent 85457eec87
commit 7e45143fa1
15 changed files with 9911 additions and 30 deletions

View File

@ -957,7 +957,6 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
result.push(plays[newKeys[idx]]);
idx++;
}
scope.plays = result;
if (scope.liveEventProcessing) {
scope.$emit('FixPlaysScroll');

View File

@ -723,7 +723,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
.directive('awCustomScroll', [ function() {
return function(scope, element, attrs) {
var theme = (attrs.scrollTheme) ? attrs.scrollTheme : 'dark-thin',
inertia = (attrs.scrollInertia) ? parseInt(attrs.scrollInertia,10) : 500,
//inertia = (attrs.scrollInertia) ? parseInt(attrs.scrollInertia,10) : 500,
axis = ($(element).attr('data-scroll-axis')) ? $(element).attr('data-scroll-axis') : 'y';
$(element).mCustomScrollbar({
advanced:{
@ -734,8 +734,15 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
},
axis: axis,
theme: theme,
mouseWheel: true,
scrollInertia: inertia,
mouseWheel: {
enable: true,
preventDefault: true,
normalizeDelta: false
},
keyboard: {
enable: true,
scrollAmount: 20
},
callbacks: {
onTotalScroll: scope[attrs.onTotalScroll],
onTotalScrollOfset: attrs.onTotalScrollOffset,

View File

@ -1,26 +0,0 @@
{
"name": "jquery-mousewheel",
"version": "3.1.11",
"main": "./jquery.mousewheel.js",
"ignore": [
"*.json",
"*.markdown",
"*.txt",
".*",
"Gruntfile.js",
"test"
],
"dependencies": {
"jquery": ">=1.2.2"
},
"homepage": "https://github.com/brandonaaron/jquery-mousewheel",
"_release": "3.1.11",
"_resolution": {
"type": "version",
"tag": "3.1.11",
"commit": "0f395d8949f937b987f384cc8833c30a0648fd9b"
},
"_source": "git://github.com/brandonaaron/jquery-mousewheel.git",
"_target": ">=3.0.6",
"_originalSource": "jquery-mousewheel"
}

View File

@ -0,0 +1,4 @@
.DS_Store
/npm-debug.log
/node_modules
/test/browserify/node_modules

View File

@ -0,0 +1,19 @@
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"indent": 4,
"jquery" : true,
"latedef": true,
"noarg": true,
"node": true,
"noempty": true,
"plusplus": false,
"quotmark": "single",
"strict": false,
"trailing": true,
"unused": true,
"globals": { "define": true, "require": true }
}

View File

@ -0,0 +1,47 @@
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: ['jquery.mousewheel.js']
},
uglify: {
options: {
compress: true,
mangle: true,
preserveComments: 'some',
report: 'gzip'
},
build: {
src: 'jquery.mousewheel.js',
dest: 'jquery.mousewheel.min.js'
}
},
connect: {
server: {
options: {
hostname: '*',
keepalive: true,
middleware: function(connect, options) {
return [
connect.static(options.base),
connect.directory(options.base)
];
}
}
}
}
});
// Load the plugin that provides the 'uglify' task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify']);
};

View File

@ -0,0 +1,20 @@
Copyright (c) 2013, Brandon Aaron (http://brandon.aaron.sh)
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.

View File

@ -0,0 +1,16 @@
{
"name": "jquery-mousewheel",
"version": "3.1.11",
"main": "./jquery.mousewheel.js",
"ignore": [
"*.json",
"*.markdown",
"*.txt",
".*",
"Gruntfile.js",
"test"
],
"dependencies": {
"jquery": ">=1.2.2"
}
}

View File

@ -0,0 +1,27 @@
{
"name": "mousewheel",
"title": "jQuery Mousewheel",
"description": "A jQuery plugin that adds cross-browser mouse wheel support.",
"keywords": [
"mousewheel",
"mouse",
"event"
],
"version": "3.1.11",
"author": {
"name": "Brandon Aaron",
"url": "http://brandon.aaron.sh"
},
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt"
}
],
"bugs": "https://github.com/brandonaaron/jquery-mousewheel/issues",
"homepage": "https://github.com/brandonaaron/jquery-mousewheel",
"download": "https://github.com/brandonaaron/jquery-mousewheel/tags",
"dependencies": {
"jquery": ">=1.2.2"
}
}

View File

@ -0,0 +1,15 @@
# browserify test
First run
```js
npm install jquery-browserify
```
Then run
```js
browserify main.js > bundle.js
```
Then open index.html and console and scroll with the mousewheel. Should see the events being logged.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
<script src="bundle.js"></script>
<script>
$(document).bind('mousewheel', function(e) { console.log(e); });
</script>

View File

@ -0,0 +1,2 @@
var $ = require('jquery-browserify');
require('../../jquery.mousewheel.js')($);

View File

@ -0,0 +1,239 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="iso-8859-1">
<title>Testing mousewheel plugin</title>
<style>
html {
font: 13px Arial, sans-serif;
}
#stage {
color: #fff;
position: relative;
zoom: 1;
}
#test1, #test2, #test3, #test4, #test5, #test6, #test7 {
float: left;
}
#test1 {
background-color: #000;
width: 120px;
height: 100px;
}
#test2 {
background-color: #333;
width: 120px;
height: 100px;
}
#test3 {
background-color: #666;
width: 120px;
height: 100px;
}
#test4 {
background-color: #000;
width: 120px;
height: 100px;
}
#test5 {
background-color: #333;
padding: 5px;
width: 400px;
height: 400px;
}
#test6 {
background-color: #666;
padding: 5px;
width: 250px;
height: 250px;
}
#test7 {
background-color: #000;
padding: 5px;
width: 100px;
height: 100px;
}
#forceScroll {
clear: both;
height: 1000px;
}
#logger {
position: absolute;
top: 100px;
left: 0;
width: 480px;
height: 310px;
overflow: auto;
z-index: 100;
}
#logger p {
color: #000;
padding: 2px;
border-bottom: 1px solid #ccc;
margin: 0;
}
#logger p:nth-child(even) {
background-color: #ffffe8;
}
#logger p:nth-child(10n) {
border-bottom-color: #000;
}
</style>
<script>
(function() {
var verMatch = /v=([\w\.]+)/.exec(location.search),
version = verMatch && verMatch[1],
src;
if (version)
src = 'code.jquery.com/jquery-' + version;
else
src = 'code.jquery.com/jquery-git';
document.write('<script src="http://' + src + '.js"><\/script>');
})();
</script>
<script>
$(function() {
$('#userAgent').html(navigator.userAgent);
$('#jqueryVersion').html($.fn.jquery);
var loghandle = function(event, delta) {
var o = '', id = event.currentTarget.id || event.currentTarget.nodeName;
o = '#' + id + ':';
if (delta > 0)
o += ' up (' + delta + ')';
else if (delta < 0)
o += ' down (' + delta + ')';
if (event.deltaY > 0)
o += ' north (' + event.deltaY + ')';
else if (event.deltaY < 0)
o += ' south (' + event.deltaY + ')';
if (event.deltaX > 0)
o += ' east (' + event.deltaX + ')';
else if (event.deltaX < 0)
o += ' west (' + event.deltaX + ')';
o += ' deltaFactor (' + event.deltaFactor + ')';
log( o );
};
$(document)
.mousewheel(function(event, delta) {
loghandle(event, delta);
});
$('#test1')
.mousewheel(function(event, delta) {
loghandle(event, delta);
log('pageX: ' + event.pageX + ' pageY: ' + event.pageY );
});
$('#test2')
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false; // prevent default
});
$('#test3')
.hover(function() { log('#test3: mouseover'); }, function() { log('#test3: mouseout'); })
.mousewheel(function() {
log('#test3: I should not have been logged');
})
.unmousewheel();
var testRemoval = function() {
log('#test4: I should not have been logged');
};
$('#test4')
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false;
})
.mousewheel(testRemoval)
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false;
})
.unmousewheel(testRemoval);
$('#test5')
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.stopPropagation();
event.preventDefault();
});
$('#test6')
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.stopPropagation();
event.preventDefault();
});
$('#test7')
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.preventDefault();
});
function log(msg) {
$('#logger').append('<p>' + msg + '<\/p>')[0].scrollTop = 999999;
}
});
</script>
<script src="../jquery.mousewheel.js"></script>
</head>
<body>
<h1 id="banner">jQuery mousewheel.js Test with jQuery <span id="jqueryVersion"></span></h1>
<h2 id="userAgent"></h2>
<ul>
<li><strong>Test1</strong> is just using the plain on <code>mousewheel()</code> with a function passed in and does not prevent default. (Also logs the value of <code>pageX</code> and <code>pageY</code> event properties.)</li>
<li><strong>Test2</strong> should prevent the default action.</li>
<li><strong>Test3</strong> should only log a <code>mouseover</code> and <code>mouseout</code> event. Testing <code>unmousewheel()</code>.</li>
<li><strong>Test4</strong> has two handlers.</li>
<li><strong>Test5</strong> is like Test2 but has children. The children should not scroll until mousing over them.</li>
<li><strong>Test6</strong> is like Test5 but should not scroll children or parents.</li>
<li><strong>Test7</strong> is like Test6 but has no children. It will propagate the event and scroll test 6 as well.</li>
</ul>
<div id="stage">
<div id="test1"><p>Test1</p></div>
<div id="test2"><p>Test2</p></div>
<div id="test3"><p>Test3</p></div>
<div id="test4"><p>Test4</p></div>
<div id="test5">
<p>Test5</p>
<div id="test6">
<p>Test6</p>
<div id="test7"><p>Test7</p></div>
</div>
</div>
<div id="logger"></div>
</div>
<div id="forceScroll"></div>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!doctype html>
<html>
<head>
<title>Scroll Test</title>
<style>
html, body { margin: 0; padding: 0; width: 100%; height: 100%; }
#emulated, #native {
width: 40%;
height: 100%;
}
#emulated { float: left; overflow: hidden; }
#native { float: right; overflow: auto; }
</style>
<script>
(function() {
var verMatch = /v=([\w\.]+)/.exec(location.search),
version = verMatch && verMatch[1],
src;
if (version)
src = 'code.jquery.com/jquery-' + version;
else
src = 'code.jquery.com/jquery-git';
document.write('<script src="http://' + src + '.js"><\/script>');
})();
</script>
<script src="../jquery.mousewheel.js"></script>
<script>
var lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus nibh ac ultricies blandit. Nunc blandit blandit lobortis. Maecenas id dolor scelerisque, facilisis dolor eu, interdum urna. Nullam consectetur lectus quis mi interdum accumsan. Nulla malesuada est nec neque suscipit pulvinar. Vivamus sagittis, nunc a porttitor tempus, mi neque eleifend diam, nec porttitor metus dui a orci. Cras tempus lobortis nisl ut sagittis. Maecenas semper in magna mollis venenatis. Vestibulum fermentum tincidunt fringilla.';
$(function() {
for (var i=0; i<30; i++) {
var html = '<p>' + i + ' ' + lorem + '</p>';
$('#emulated').append(html);
$('#native').append(html);
}
$('#emulated').bind('mousewheel', function(event) {
event.preventDefault();
var scrollTop = this.scrollTop;
this.scrollTop = (scrollTop + ((event.deltaY * event.deltaFactor) * -1));
//console.log(event.deltaY, event.deltaFactor, event.originalEvent.deltaMode, event.originalEvent.wheelDelta);
});
});
</script>
</head>
<body>
<div id="emulated"></div>
<div id="native"></div>
</body>
</html>