1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix metadata manager layout

This commit is contained in:
Luke Pulverenti 2015-09-01 15:18:25 -04:00
parent 994b8ec70b
commit a878877550
26 changed files with 2939 additions and 500 deletions

View file

@ -0,0 +1,20 @@
{
"name": "hammerjs",
"version": "2.0.4",
"main": "hammer.js",
"ignore": [
"tests",
"src"
],
"homepage": "https://github.com/hammerjs/hammer.js",
"_release": "2.0.4",
"_resolution": {
"type": "version",
"tag": "2.0.4",
"commit": "7fc11efb37d6f2334ce957e26e9cf53690e10fa5"
},
"_source": "git://github.com/hammerjs/hammer.js.git",
"_target": "~2.0.4",
"_originalSource": "hammer.js",
"_direct": true
}

View file

@ -0,0 +1,3 @@
{
"json": "bower.json"
}

View file

@ -0,0 +1,21 @@
# ide
.idea
.iml
# node
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
tests/build.js
npm-debug.log
node_modules

View file

@ -0,0 +1,8 @@
{
"preset": "google",
"excludeFiles": [
"*.js",
"tests/**/assets",
"node_modules/**"
]
}

View file

@ -0,0 +1,22 @@
{
"browser": true,
"curly": true,
"eqnull": true,
"expr": true,
"maxerr": 100,
"freeze": true,
"newcap": true,
"node": true,
"quotmark": "single",
"strict": true,
"sub": true,
"trailing": true,
"undef": true,
"unused": true,
"camelcase": true,
"indent": 4,
"validthis": true,
"globals": {
"define": false
}
}

View file

@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.10"
before_script:
- npm install -g grunt-cli
script:
- grunt test-travis

View file

@ -0,0 +1,30 @@
# Changelog
### 2.0.4, 2014-09-28
- Fix IE pointer issue. [#665](https://github.com/hammerjs/hammer.js/pull/665)
- Fix multi-touch at different elements. [#668](https://github.com/hammerjs/hammer.js/pull/668)
- Added experimental [single-user Touch input handler](src/input/singletouch.js). This to improve performance/ux when only a single user has to be supported. Plans are to release 2.1 with this as default, and a settings to enable the multi-user handler.
### 2.0.3, 2014-09-10
- Manager.set improvements.
- Fix requireFailure() call in Manager.options.recognizers.
- Make DIRECTION_ALL for pan and swipe gestures less blocking.
- Fix Swipe recognizer threshold option.
- Expose the Input classes.
- Added the option `inputClass` to set the used input handler.
### 2.0.2, 2014-07-26
- Improved mouse and pointer-events input, now able to move outside the window.
- Added the export name (`Hammer`) as an argument to the wrapper.
- Add the option *experimental* `inputTarget` to change the element that receives the events.
- Improved performance when only one touch being active.
- Fixed the jumping deltaXY bug when going from single to multi-touch.
- Improved velocity calculations.
### 2.0.1, 2014-07-15
- Fix issue when no document.body is available
- Added pressup event for the press recognizer
- Removed alternative for Object.create
### 2.0.0, 2014-07-11
- Full rewrite of the library.

View file

@ -0,0 +1,41 @@
# Contributing to Hammer.js
Looking to contribute something to Hammer.js? **Here's how you can help.**
## Reporting issues
We only accept issues that are bug reports or feature requests. Bugs must be
isolated and reproducible problems that can be fixed within the Hammer.js.
Please read the following guidelines before opening any issue.
1. [**Read the documentation**](https://hammerjs.github.io)
2. **Search for existing issues.** We get a lot of duplicate issues, and you'd
help us out a lot by first checking if someone else has reported the same issue.
Moreover, the issue may have already been resolved with a fix available. Also
take a look if your problem is explained at the Wiki.
3. **Create an isolated and reproducible test case.** Be sure the problem exists
in Hammer's code with a reduced test case that should be included in each bug
report.
4. **Include a live example.** Make use of jsFiddle or jsBin to share your
isolated test cases. Also, a screen capture would work, with tools like LICEcap.
5. **Share as much information as possible.** Include operating system and
version, browser and version, version of Hammer.js, customized or vanilla build,
etc. where appropriate. Also include steps to reproduce the bug.
## Pull requests
1. Changes must be done in `/src` files, never just the compiled files. Also, don't
commit the compiled files.
2. Try not to pollute your pull request with unintended changes. Keep them simple
and small
3. Try to share which browsers your code has been tested in before submitting a
pull request
4. Write tests for your code, these can be found in `/tests`.

View file

@ -0,0 +1,123 @@
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
usebanner:
taskName:
options:
position: 'top'
banner: '
/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n
* <%= pkg.homepage %>\n
*\n
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;\n
* Licensed under the <%= _.pluck(pkg.licenses, "type").join(", ") %> license */'
linebreak: true
files:
src: ['./hammer.js','./hammer.min.js']
concat:
build:
src: [
'src/hammer.prefix'
'src/utils.js'
'src/input.js'
'src/input/*.js'
'src/touchaction.js'
'src/recognizer.js'
'src/recognizers/*.js'
'src/hammer.js'
'src/manager.js'
'src/expose.js'
'src/hammer.suffix']
dest: 'hammer.js'
uglify:
min:
options:
report: 'gzip'
sourceMap: 'hammer.min.map'
files:
'hammer.min.js': ['hammer.js']
# special test build that exposes everything so it's testable
test:
options:
wrap: "$H"
comments: 'all'
exportAll: true
mangle: false
beautify: true
compress:
global_defs:
exportName: 'Hammer'
files:
'tests/build.js': [
'src/utils.js'
'src/input.js'
'src/input/*.js'
'src/touchaction.js'
'src/recognizer.js'
'src/recognizers/*.js'
'src/hammer.js'
'src/manager.js'
'src/expose.js']
'string-replace':
version:
files:
'hammer.js': 'hammer.js'
options:
replacements: [
pattern: '{{PKG_VERSION}}'
replacement: '<%= pkg.version %>'
]
jshint:
options:
jshintrc: true
build:
src: ['hammer.js']
jscs:
src: [
'src/**/*.js'
'tests/unit/*.js'
]
options:
config: "./.jscsrc"
force: true
watch:
scripts:
files: ['src/**/*.js']
tasks: ['concat','string-replace','uglify','jshint','jscs']
options:
interrupt: true
connect:
server:
options:
hostname: "0.0.0.0"
port: 8000
qunit:
all: ['tests/unit/index.html']
# Load tasks
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-qunit'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-jshint'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-string-replace'
grunt.loadNpmTasks 'grunt-banner'
grunt.loadNpmTasks 'grunt-jscs-checker'
# Default task(s)
grunt.registerTask 'default', ['connect', 'watch']
grunt.registerTask 'default-test', ['connect', 'uglify:test', 'watch']
grunt.registerTask 'build', ['concat', 'string-replace', 'uglify:min', 'usebanner', 'test']
grunt.registerTask 'test', ['jshint', 'jscs', 'uglify:test', 'qunit']
grunt.registerTask 'test-travis', ['build']

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2011-2014 by Jorik Tangelder (Eight Media)
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,9 @@
{
"name": "hammerjs",
"version": "2.0.4",
"main": "hammer.js",
"ignore": [
"tests",
"src"
]
}

View file

@ -0,0 +1,8 @@
{
"name": "hammerjs",
"version": "2.0.3",
"main": "hammer.js",
"scripts": [
"hammer.js"
]
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,50 @@
{
"name": "hammerjs",
"title": "Hammer.JS",
"description": "A javascript library for multi-touch gestures",
"version": "2.0.4",
"homepage": "http://hammerjs.github.io/",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/hammerjs/hammer.js/blob/master/LICENSE.md"
}
],
"keywords": [
"touch",
"gestures"
],
"author": {
"name": "Jorik Tangelder",
"email": "j.tangelder@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github.com/hammerjs/hammer.js.git"
},
"bugs": {
"url": "https://github.com/hammerjs/hammer.js/issues"
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.x",
"grunt-banner": "^0.2.3",
"grunt-contrib-concat": "0.4.x",
"grunt-contrib-connect": "0.7.x",
"grunt-contrib-jshint": "0.10.x",
"grunt-contrib-qunit": "^0.5.1",
"grunt-contrib-uglify": "0.4.x",
"grunt-contrib-watch": "0.6.x",
"grunt-jscs-checker": "^0.4.1",
"grunt-string-replace": "^0.2.7",
"hammer-jquery": "git://github.com/hammerjs/jquery.hammer.js#master",
"hammer-simulator": "git://github.com/hammerjs/simulator#master"
},
"main": "hammer.js",
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}

View file

@ -610,11 +610,26 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
}
}
@media all and (max-width: 600px) {
.primaryDetailsContainer {
width: 68%;
}
.portraitDetailImageContainer + .primaryDetailsContainer {
width: 68%;
}
}
@media all and (max-width: 400px) {
.primaryDetailsContainer {
width: 60%;
}
.portraitDetailImageContainer + .primaryDetailsContainer {
width: 60%;
}
}
@media all and (min-width: 500px) {

View file

@ -56,7 +56,7 @@
<div id="fldDateAdded" style="display: none;">
<paper-input id="txtDateAdded" type="date" label="${LabelDateAdded}"></paper-input>
</div>
<div id="fldStatus" style="display: none;">
<div id="fldStatus" style="display: none;margin:1em 0;">
<label for="selectStatus">${LabelStatus}</label>
<select id="selectStatus" data-mini="true"></select>
</div>
@ -100,13 +100,16 @@
<paper-input id="txtTagline" type="text" label="${LabelTagline}"></paper-input>
</div>
<div>
<paper-textarea id="txtOverview" label="${LabelOverview}"></paper-textarea>
<label for="txtOverview" class="likePaperLabel">${LabelOverview}</label>
<textarea id="txtOverview" class="likePaperText" data-role="none"></textarea>
<br />
</div>
<div id="fldShortOverview" style="display: none;">
<paper-input id="txtShortOverview" type="text" label="${LabelShortOverview}"></paper-input>
</div>
<div id="fldPremiereDate" style="display: none;">
<paper-input id="txtPremiereDate" type="date" label="${LabelReleaseDate}"></paper-input>
<label for="txtPremiereDate" class="likePaperLabel">${LabelReleaseDate}</label>
<input id="txtPremiereDate" type="date" class="likePaperText" data-role="none" />
</div>
<div id="fldYear" style="display: none;">
<paper-input id="txtProductionYear" type="number" label="${LabelYear}"></paper-input>
@ -115,7 +118,8 @@
<paper-input id="txtPlaceOfBirth" type="text" label="${LabelPlaceOfBirth}"></paper-input>
</div>
<div id="fldEndDate" style="display: none;">
<paper-input id="txtEndDate" type="date" label="${LabelEndDate}"></paper-input>
<label for="txtEndDate" class="likePaperLabel">${LabelEndDate}</label>
<input id="txtEndDate" type="date" class="likePaperText" data-role="none" />
</div>
<div id="fldAirDays" style="display: none;">
<p>${LabelAirDays}</p>
@ -133,7 +137,7 @@
</div>
<div id="fldAirTime" style="display: none;">
<paper-input id="txtAirTime" type="time" label="${LabelAirTime}"></paper-input>
<paper-input id="txtAirTime" type="text" label="${LabelAirTime}"></paper-input>
</div>
<div id="fldSeriesRuntime" style="display: none;">
<paper-input id="txtSeriesRuntime" type="number" label="${LabelRuntimeMinutes}"></paper-input>

View file

@ -15,7 +15,7 @@
<paper-tab><iron-icon icon="schedule"></iron-icon>${TabUpcoming}</paper-tab>
</paper-tabs>
<div class="legacyTabs">
<a href="index.html" class="ui-btn-active"><iron-icon icon="home"></iron-icon>${TabHome}</a>
<a href="index.html"><iron-icon icon="home"></iron-icon>${TabHome}</a>
<a href="index.html?tab=1"><iron-icon icon="navigate-next"></iron-icon>${TabNextUp}</a>
<a href="index.html?tab=2"><iron-icon icon="favorite"></iron-icon>${TabFavorites}</a>
<a href="index.html?tab=3"><iron-icon icon="schedule"></iron-icon>${TabUpcoming}</a>

View file

@ -16,7 +16,7 @@
<paper-tab><iron-icon icon="refresh"></iron-icon>${TabSeries}</paper-tab>
</paper-tabs>
<div class="legacyTabs">
<a href="livetv.html" class="ui-btn-active"><iron-icon icon="info"></iron-icon>${TabSuggestions}</a>
<a href="livetv.html"><iron-icon icon="info"></iron-icon>${TabSuggestions}</a>
<a href="livetv.html?tab=1"><iron-icon icon="grid-on"></iron-icon>${TabGuide}</a>
<a href="livetv.html?tab=2"><iron-icon icon="live-tv"></iron-icon>${TabChannels}</a>
<a href="livetv.html?tab=3"><iron-icon icon="slideshow"></iron-icon>${TabRecordings}</a>

View file

@ -185,7 +185,7 @@
$('#fldPlayers', page).hide();
}
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "MusicVideo" || item.Type == "Series" || item.Type == "Game") {
if (item.Type == "Movie" || item.Type == "Trailer") {
$('#fldCriticRating', page).show();
$('#fldCriticRatingSummary', page).show();
} else {
@ -320,14 +320,14 @@
}
if (item.Type == "Person") {
page.querySelector('#txtPremiereDate').label = Globalize.translate('LabelBirthDate');
page.querySelector('#txtProductionYear').label = Globalize.translate('LabelBirthYear');
page.querySelector('#txtEndDate').label = Globalize.translate('LabelDeathDate');
page.querySelector("label[for='txtPremiereDate']").innerHTML = Globalize.translate('LabelBirthDate');
page.querySelector("label[for='txtEndDate']").innerHTML = Globalize.translate('LabelDeathDate');
$('#fldPlaceOfBirth', page).show();
} else {
page.querySelector('#txtPremiereDate').label = Globalize.translate('LabelReleaseDate');
page.querySelector('#txtProductionYear').label = Globalize.translate('LabelYear');
page.querySelector('#txtEndDate').label = Globalize.translate('LabelEndDate');
page.querySelector("label[for='txtPremiereDate']").innerHTML = Globalize.translate('LabelReleaseDate');
page.querySelector("label[for='txtEndDate']").innerHTML = Globalize.translate('LabelEndDate');
$('#fldPlaceOfBirth', page).hide();
}
@ -444,7 +444,7 @@
$('#txtPath', page).val(item.Path || '');
$('#txtName', page).val(item.Name || "");
$('#txtOverview', page).val(item.Overview || "");
page.querySelector('#txtOverview').value = item.Overview || '';
$('#txtShortOverview', page).val(item.ShortOverview || "");
$('#txtTagline', page).val((item.Taglines && item.Taglines.length ? item.Taglines[0] : ''));
$('#txtSortName', page).val(item.ForcedSortName || "");
@ -528,7 +528,8 @@
}
$('#txtProductionYear', page).val(item.ProductionYear || "");
$('#txtAirTime', page).val(item.AirTime || "");
$('#txtAirTime', page).val(item.AirTime || '');
var placeofBirth = item.ProductionLocations && item.ProductionLocations.length ? item.ProductionLocations[0] : '';
$('#txtPlaceOfBirth', page).val(placeofBirth);
@ -1484,6 +1485,7 @@
}).on('tabchange', function () {
var selected = this.selected;
showTab(page, selected);
loadTab(page, parseInt(this.selected));
});
@ -1519,7 +1521,7 @@
tabs.noSlide = true;
tabs.noink = true;
$(ownerpage).on('pagebeforeshow', function () {
$(ownerpage).on('pageshowready', function () {
var selected = tabs.selected;
@ -1532,7 +1534,6 @@
Logger.log('selected tab will be ' + selected);
tabs.selected = selected;
Events.trigger(tabs, 'tabchange');
} else {
Events.trigger(tabs, 'tabchange');

View file

@ -67,17 +67,15 @@
setInitialCollapsibleState(page, item, context, user);
renderDetails(page, item, context);
var hasBackdrop = LibraryBrowser.renderDetailPageBackdrop(page, item);
var hasBackdrop = false;
// For these types, make the backdrop a little smaller so that the items are more quickly accessible
if (item.Type == 'MusicArtist' || item.Type == "MusicAlbum" || item.Type == "Playlist" || item.Type == "BoxSet" || item.Type == "Audio") {
$('#itemBackdrop', page).addClass('noBackdrop').css('background-image', 'none');
Backdrops.setBackdrops(page, [item]);
}
else if (item.Type == "Season" || item.Type == "Series") {
page.querySelector('#itemBackdrop').classList.add('smallBackdrop');
} else {
page.querySelector('#itemBackdrop').classList.remove('smallBackdrop');
else {
hasBackdrop = LibraryBrowser.renderDetailPageBackdrop(page, item);
}
var transparentHeader = hasBackdrop && page.classList.contains('noSecondaryNavPage');

View file

@ -160,8 +160,12 @@
return true;
}
$(pages).on('swipeleft', function (e) {
require(['hammer'], function (Hammer) {
var hammertime = new Hammer(pages);
hammertime.get('swipe').set({ direction: Hammer.DIRECTION_HORIZONTAL });
hammertime.on('swipeleft', function (e) {
if (allowSwipe(e)) {
var selected = parseInt(pages.selected || '0');
if (selected < (pageCount - 1)) {
@ -172,8 +176,7 @@
}
});
$(pages).on('swiperight', function (e) {
hammertime.on('swiperight', function (e) {
if (allowSwipe(e)) {
var selected = parseInt(pages.selected || '0');
if (selected > 0) {
@ -183,6 +186,7 @@
}
}
});
});
},
enableFullPaperTabs: function () {

View file

@ -47,8 +47,8 @@ var Dashboard = {
$.mobile.panel.prototype.options.classes.modalOpen = "largePanelModalOpen ui-panel-dismiss-open";
$.mobile.panel.prototype.options.classes.panel = "largePanel ui-panel";
$.event.special.swipe.verticalDistanceThreshold = 40;
$.mobile.page.prototype.options.domCache = true;
//$.event.special.swipe.verticalDistanceThreshold = 40;
//$.mobile.page.prototype.options.domCache = true;
@ -2108,6 +2108,10 @@ var AppInfo = {};
return {};
});
define("hammer", ["bower_components/hammerjs/hammer.min"], function (Hammer) {
return Hammer;
});
$.extend(AppInfo, Dashboard.getAppInfo(appName, deviceId, deviceName));
var drawer = document.querySelector('.mainDrawerPanel');
@ -2285,6 +2289,7 @@ $(document).on('pagecreate', ".page", function () {
var isSettingsPage = page.classList.contains('type-interior');
if (isSettingsPage) {
require(['jqmicons']);
Dashboard.ensureToolsMenu(page);
Dashboard.getCurrentUser().done(function (user) {

View file

@ -737,55 +737,6 @@ $.ui.plugin = {
(function( $, window, undefined ) {
// Subtract the height of external toolbars from the page height, if the page does not have
// internal toolbars of the same type. We take care to use the widget options if we find a
// widget instance and the element's data-attributes otherwise.
var compensateToolbars = function( page, desiredHeight ) {
var pageParent = page.parent(),
toolbarsAffectingHeight = [],
// We use this function to filter fixed toolbars with option updatePagePadding set to
// true (which is the default) from our height subtraction, because fixed toolbars with
// option updatePagePadding set to true compensate for their presence by adding padding
// to the active page. We want to avoid double-counting by also subtracting their
// height from the desired page height.
noPadders = function() {
var theElement = $( this ),
widgetOptions = $.mobile.toolbar && theElement.data( "mobile-toolbar" ) ?
theElement.toolbar( "option" ) : {
position: theElement.attr( "data-" + $.mobile.ns + "position" ),
updatePagePadding: ( theElement.attr( "data-" + $.mobile.ns +
"update-page-padding" ) !== false )
};
return !( widgetOptions.position === "fixed" &&
widgetOptions.updatePagePadding === true );
},
externalHeaders = pageParent.children( ":jqmData(role='header')" ).filter( noPadders ),
internalHeaders = page.children( ":jqmData(role='header')" ),
externalFooters = pageParent.children( ":jqmData(role='footer')" ).filter( noPadders ),
internalFooters = page.children( ":jqmData(role='footer')" );
// If we have no internal headers, but we do have external headers, then their height
// reduces the page height
if ( internalHeaders.length === 0 && externalHeaders.length > 0 ) {
toolbarsAffectingHeight = toolbarsAffectingHeight.concat( externalHeaders.toArray() );
}
// If we have no internal footers, but we do have external footers, then their height
// reduces the page height
if ( internalFooters.length === 0 && externalFooters.length > 0 ) {
toolbarsAffectingHeight = toolbarsAffectingHeight.concat( externalFooters.toArray() );
}
$.each( toolbarsAffectingHeight, function( index, value ) {
desiredHeight -= $( value ).outerHeight();
});
// Height must be at least zero
return Math.max( 0, desiredHeight );
};
$.extend( $.mobile, {
// define the window and the document objects
window: $( window ),
@ -803,17 +754,7 @@ $.ui.plugin = {
ypos = $.mobile.defaultHomeScroll;
}
// prevent scrollstart and scrollstop events
$.event.special.scrollstart.enabled = false;
setTimeout(function() {
window.scrollTo( 0, ypos );
$.mobile.document.trigger( "silentscroll", { x: 0, y: ypos });
}, 20 );
setTimeout(function() {
$.event.special.scrollstart.enabled = true;
}, 150 );
window.scrollTo(0, ypos);
},
getClosestBaseUrl: function( ele ) {
@ -916,8 +857,7 @@ $.ui.plugin = {
pageHeight = page.height(),
pageOuterHeight = page.outerHeight( true );
height = compensateToolbars( page,
( typeof height === "number" ) ? height : $.mobile.getScreenHeight() );
height = (typeof height === "number") ? height : $.mobile.getScreenHeight();
// Remove any previous min-height setting
page.css( "min-height", "" );
@ -1621,7 +1561,7 @@ var dataPropertyName = "virtualMouseBindings",
clickBlockList = [],
blockMouseTriggers = false,
blockTouchTriggers = false,
eventCaptureSupported = "addEventListener" in document,
eventCaptureSupported = false,
$document = $( document ),
nextTouchID = 1,
lastTouchID = 0, threshold,
@ -2028,395 +1968,8 @@ function getSpecialEventObject( eventType ) {
for ( i = 0; i < virtualEventNames.length; i++ ) {
$.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );
}
// Add a capture click handler to block clicks.
// Note that we require event capture support for this so if the device
// doesn't support it, we punt for now and rely solely on mouse events.
if ( eventCaptureSupported ) {
document.addEventListener( "click", function( e ) {
var cnt = clickBlockList.length,
target = e.target,
x, y, ele, i, o, touchID;
if ( cnt ) {
x = e.clientX;
y = e.clientY;
threshold = $.vmouse.clickDistanceThreshold;
// The idea here is to run through the clickBlockList to see if
// the current click event is in the proximity of one of our
// vclick events that had preventDefault() called on it. If we find
// one, then we block the click.
//
// Why do we have to rely on proximity?
//
// Because the target of the touch event that triggered the vclick
// can be different from the target of the click event synthesized
// by the browser. The target of a mouse/click event that is synthesized
// from a touch event seems to be implementation specific. For example,
// some browsers will fire mouse/click events for a link that is near
// a touch event, even though the target of the touchstart/touchend event
// says the user touched outside the link. Also, it seems that with most
// browsers, the target of the mouse/click event is not calculated until the
// time it is dispatched, so if you replace an element that you touched
// with another element, the target of the mouse/click will be the new
// element underneath that point.
//
// Aside from proximity, we also check to see if the target and any
// of its ancestors were the ones that blocked a click. This is necessary
// because of the strange mouse/click target calculation done in the
// Android 2.1 browser, where if you click on an element, and there is a
// mouse/click handler on one of its ancestors, the target will be the
// innermost child of the touched element, even if that child is no where
// near the point of touch.
ele = target;
while ( ele ) {
for ( i = 0; i < cnt; i++ ) {
o = clickBlockList[ i ];
touchID = 0;
if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
$.data( ele, touchTargetPropertyName ) === o.touchID ) {
// XXX: We may want to consider removing matches from the block list
// instead of waiting for the reset timer to fire.
e.preventDefault();
e.stopPropagation();
return;
}
}
ele = ele.parentNode;
}
}
}, true);
}
})( jQuery, window, document );
(function( $, window, undefined ) {
var $document = $( document ),
supportTouch = $.mobile.support.touch,
scrollEvent = "touchmove scroll",
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
touchStopEvent = supportTouch ? "touchend" : "mouseup",
touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
// setup new event shortcuts
$.each( ( "touchstart touchmove touchend " +
"tap taphold " +
"swipe swipeleft swiperight " +
"scrollstart scrollstop" ).split( " " ), function( i, name ) {
$.fn[ name ] = function( fn ) {
return fn ? this.bind( name, fn ) : this.trigger( name );
};
// jQuery < 1.8
if ( $.attrFn ) {
$.attrFn[ name ] = true;
}
});
function triggerCustomEvent( obj, eventType, event, bubble ) {
var originalType = event.type;
event.type = eventType;
if ( bubble ) {
$.event.trigger( event, undefined, obj );
} else {
$.event.dispatch.call( obj, event );
}
event.type = originalType;
}
// also handles scrollstop
$.event.special.scrollstart = {
enabled: true,
setup: function() {
var thisObject = this,
$this = $( thisObject ),
scrolling,
timer;
function trigger( event, state ) {
scrolling = state;
triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event );
}
// iPhone triggers scroll after a small delay; use touchmove instead
$this.bind( scrollEvent, function( event ) {
if ( !$.event.special.scrollstart.enabled ) {
return;
}
if ( !scrolling ) {
trigger( event, true );
}
clearTimeout( timer );
timer = setTimeout( function() {
trigger( event, false );
}, 50 );
});
},
teardown: function() {
$( this ).unbind( scrollEvent );
}
};
// also handles taphold
$.event.special.tap = {
tapholdThreshold: 750,
emitTapOnTaphold: true,
setup: function() {
var thisObject = this,
$this = $( thisObject ),
isTaphold = false;
$this.bind( "vmousedown", function( event ) {
isTaphold = false;
if ( event.which && event.which !== 1 ) {
return false;
}
var origTarget = event.target,
timer;
function clearTapTimer() {
clearTimeout( timer );
}
function clearTapHandlers() {
clearTapTimer();
$this.unbind( "vclick", clickHandler )
.unbind( "vmouseup", clearTapTimer );
$document.unbind( "vmousecancel", clearTapHandlers );
}
function clickHandler( event ) {
clearTapHandlers();
// ONLY trigger a 'tap' event if the start target is
// the same as the stop target.
if ( !isTaphold && origTarget === event.target ) {
triggerCustomEvent( thisObject, "tap", event );
} else if ( isTaphold ) {
event.preventDefault();
}
}
$this.bind( "vmouseup", clearTapTimer )
.bind( "vclick", clickHandler );
$document.bind( "vmousecancel", clearTapHandlers );
timer = setTimeout( function() {
if ( !$.event.special.tap.emitTapOnTaphold ) {
isTaphold = true;
}
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
}, $.event.special.tap.tapholdThreshold );
});
},
teardown: function() {
$( this ).unbind( "vmousedown" ).unbind( "vclick" ).unbind( "vmouseup" );
$document.unbind( "vmousecancel" );
}
};
// Also handles swipeleft, swiperight
$.event.special.swipe = {
// More than this horizontal displacement, and we will suppress scrolling.
scrollSupressionThreshold: 30,
// More time than this, and it isn't a swipe.
durationThreshold: 1000,
// Swipe horizontal displacement must be more than this.
horizontalDistanceThreshold: 30,
// Swipe vertical displacement must be less than this.
verticalDistanceThreshold: 30,
getLocation: function ( event ) {
var winPageX = window.pageXOffset,
winPageY = window.pageYOffset,
x = event.clientX,
y = event.clientY;
if ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) ||
event.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) {
// iOS4 clientX/clientY have the value that should have been
// in pageX/pageY. While pageX/page/ have the value 0
x = x - winPageX;
y = y - winPageY;
} else if ( y < ( event.pageY - winPageY) || x < ( event.pageX - winPageX ) ) {
// Some Android browsers have totally bogus values for clientX/Y
// when scrolling/zooming a page. Detectable since clientX/clientY
// should never be smaller than pageX/pageY minus page scroll
x = event.pageX - winPageX;
y = event.pageY - winPageY;
}
return {
x: x,
y: y
};
},
start: function( event ) {
var data = event.originalEvent.touches ?
event.originalEvent.touches[ 0 ] : event,
location = $.event.special.swipe.getLocation( data );
return {
time: ( new Date() ).getTime(),
coords: [ location.x, location.y ],
origin: $( event.target )
};
},
stop: function( event ) {
var data = event.originalEvent.touches ?
event.originalEvent.touches[ 0 ] : event,
location = $.event.special.swipe.getLocation( data );
return {
time: ( new Date() ).getTime(),
coords: [ location.x, location.y ]
};
},
handleSwipe: function( start, stop, thisObject, origTarget ) {
if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
var direction = start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight";
triggerCustomEvent( thisObject, "swipe", $.Event( "swipe", { target: origTarget, swipestart: start, swipestop: stop }), true );
triggerCustomEvent( thisObject, direction,$.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true );
return true;
}
return false;
},
// This serves as a flag to ensure that at most one swipe event event is
// in work at any given time
eventInProgress: false,
setup: function() {
var events,
thisObject = this,
$this = $( thisObject ),
context = {};
// Retrieve the events data for this element and add the swipe context
events = $.data( this, "mobile-events" );
if ( !events ) {
events = { length: 0 };
$.data( this, "mobile-events", events );
}
events.length++;
events.swipe = context;
context.start = function( event ) {
// Bail if we're already working on a swipe event
if ( $.event.special.swipe.eventInProgress ) {
return;
}
$.event.special.swipe.eventInProgress = true;
var stop,
start = $.event.special.swipe.start( event ),
origTarget = event.target,
emitted = false;
context.move = function( event ) {
if ( !start || event.isDefaultPrevented() ) {
return;
}
stop = $.event.special.swipe.stop( event );
if ( !emitted ) {
emitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget );
if ( emitted ) {
// Reset the context to make way for the next swipe event
$.event.special.swipe.eventInProgress = false;
}
}
// prevent scrolling
if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
event.preventDefault();
}
};
context.stop = function() {
emitted = true;
// Reset the context to make way for the next swipe event
$.event.special.swipe.eventInProgress = false;
$document.off( touchMoveEvent, context.move );
context.move = null;
};
$document.on( touchMoveEvent, context.move )
.one( touchStopEvent, context.stop );
};
$this.on( touchStartEvent, context.start );
},
teardown: function() {
var events, context;
events = $.data( this, "mobile-events" );
if ( events ) {
context = events.swipe;
delete events.swipe;
events.length--;
if ( events.length === 0 ) {
$.removeData( this, "mobile-events" );
}
}
if ( context ) {
if ( context.start ) {
$( this ).off( touchStartEvent, context.start );
}
if ( context.move ) {
$document.off( touchMoveEvent, context.move );
}
if ( context.stop ) {
$document.off( touchStopEvent, context.stop );
}
}
}
};
$.each({
scrollstop: "scrollstart",
taphold: "tap",
swipeleft: "swipe.left",
swiperight: "swipe.right"
}, function( event, sourceEvent ) {
$.event.special[ event ] = {
setup: function() {
$( this ).bind( sourceEvent, $.noop );
},
teardown: function() {
$( this ).unbind( sourceEvent );
}
};
});
})( jQuery, this );
(function( $, undefined ) {
var props = {
"animation": {},
@ -4545,18 +4098,11 @@ $.fn.grid = function( options ) {
},
scrollPage: function() {
// By using scrollTo instead of silentScroll, we can keep things better in order
// Just to be precautios, disable scrollstart listening like silentScroll would
$.event.special.scrollstart.enabled = false;
//if we are hiding the url bar or the page was previously scrolled scroll to hide or return to position
if ( $.mobile.hideUrlBar || this.toScroll !== $.mobile.defaultHomeScroll ) {
window.scrollTo( 0, this.toScroll );
}
// reenable scrollstart listening like silentScroll would
setTimeout( function() {
$.event.special.scrollstart.enabled = true;
}, 150 );
},
startIn: function( screenHeight, reverseClass, none, preventFocus ) {

View file

@ -478,3 +478,33 @@ paper-dropdown-menu {
paper-dialog paper-radio-group paper-radio-button {
padding: 6px 12px;
}
.likePaperText {
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
background: none !important;
background-color: transparent !important;
border: 1px solid gray !important;
border-width: 0 0 1px 0 !important;
color: #fff !important;
box-shadow: none;
outline: none !important;
padding: 0 !important;
position: relative;
text-indent: 0px !important;
width: 100%;
-webkit-writing-mode: horizontal-tb;
margin: 0 0 1em 0 !important;
}
.likePaperText:focus {
border-color: #52B54B !important;
}
.likePaperLabel {
margin: 1em 0 .5em !important;
color: #858585 !important;
display: block;
}