Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 278 additions & 51 deletions src/Cupsc/WebBundle/Resources/views/layout.html.twig

Large diffs are not rendered by default.

1,156 changes: 1,156 additions & 0 deletions web/javascripts/custom.js

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions web/javascripts/libs/ios-orientationchange-fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*! A fix for the iOS orientationchange zoom bug.
Script by @scottjehl, rebound by @wilto.
MIT License.
*/
(function(w){

// This fix addresses an iOS bug, so return early if the UA claims it's something else.
var ua = navigator.userAgent;
if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){
return;
}

var doc = w.document;

if( !doc.querySelector ){ return; }

var meta = doc.querySelector( "meta[name=viewport]" ),
initialContent = meta && meta.getAttribute( "content" ),
disabledZoom = initialContent + ",maximum-scale=1",
enabledZoom = initialContent + ",maximum-scale=10",
enabled = true,
x, y, z, aig;

if( !meta ){ return; }

function restoreZoom(){
meta.setAttribute( "content", enabledZoom );
enabled = true;
}

function disableZoom(){
meta.setAttribute( "content", disabledZoom );
enabled = false;
}

function checkTilt( e ){
aig = e.accelerationIncludingGravity;
x = Math.abs( aig.x );
y = Math.abs( aig.y );
z = Math.abs( aig.z );

// If portrait orientation and in one of the danger zones
if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){
if( enabled ){
disableZoom();
}
}
else if( !enabled ){
restoreZoom();
}
}

w.addEventListener( "orientationchange", restoreZoom, false );
w.addEventListener( "devicemotion", checkTilt, false );

})( this );
4 changes: 4 additions & 0 deletions web/javascripts/libs/jquery-min.js

Large diffs are not rendered by default.

Loading