rotate images/videos in gallery view

This commit is contained in:
cSuwwi 2019-07-17 21:35:18 +02:00
parent dce04bf3df
commit 148703ceb8
No known key found for this signature in database
GPG Key ID: 395BAD6707582FCA
3 changed files with 151 additions and 125 deletions

250
package-lock.json generated
View File

@ -9,10 +9,10 @@
"integrity": "sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ==",
"dev": true,
"requires": {
"fast-deep-equal": "2.0.1",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.4.1",
"uri-js": "4.2.2"
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"argparse": {
@ -21,7 +21,7 @@
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "1.0.3"
"sprintf-js": "~1.0.2"
}
},
"asn1": {
@ -30,7 +30,7 @@
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
"dev": true,
"requires": {
"safer-buffer": "2.1.2"
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
@ -69,7 +69,7 @@
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"dev": true,
"requires": {
"tweetnacl": "0.14.5"
"tweetnacl": "^0.14.3"
}
},
"brace-expansion": {
@ -78,7 +78,7 @@
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "1.0.0",
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
@ -100,7 +100,7 @@
"integrity": "sha512-4lqjRnG9MbqWpWgaQDORUB8jcTwEpWGGFWwTiVy00MMrYshV085uwqtHDNNLtHrnnB5U+rwtVV/sHAocm+CVNQ==",
"dev": true,
"requires": {
"got": "6.7.1"
"got": "^6.3.0"
}
},
"cli": {
@ -110,7 +110,7 @@
"dev": true,
"requires": {
"exit": "0.1.2",
"glob": "7.1.4"
"glob": "^7.1.1"
}
},
"coffeescript": {
@ -125,7 +125,7 @@
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"requires": {
"delayed-stream": "1.0.0"
"delayed-stream": "~1.0.0"
}
},
"concat-map": {
@ -140,7 +140,7 @@
"integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
"dev": true,
"requires": {
"date-now": "0.1.4"
"date-now": "^0.1.4"
}
},
"core-util-is": {
@ -155,7 +155,7 @@
"integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=",
"dev": true,
"requires": {
"capture-stack-trace": "1.0.1"
"capture-stack-trace": "^1.0.0"
}
},
"dashdash": {
@ -164,7 +164,7 @@
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"dev": true,
"requires": {
"assert-plus": "1.0.0"
"assert-plus": "^1.0.0"
}
},
"date-now": {
@ -185,8 +185,8 @@
"integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
"dev": true,
"requires": {
"domelementtype": "1.3.1",
"entities": "1.1.2"
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
},
"dependencies": {
"entities": {
@ -209,7 +209,7 @@
"integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=",
"dev": true,
"requires": {
"domelementtype": "1.3.1"
"domelementtype": "1"
}
},
"domutils": {
@ -218,8 +218,8 @@
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
"dev": true,
"requires": {
"dom-serializer": "0.1.1",
"domelementtype": "1.3.1"
"dom-serializer": "0",
"domelementtype": "1"
}
},
"duplexer3": {
@ -234,8 +234,8 @@
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"dev": true,
"requires": {
"jsbn": "0.1.1",
"safer-buffer": "2.1.2"
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"entities": {
@ -298,9 +298,9 @@
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"dev": true,
"requires": {
"asynckit": "0.4.0",
"combined-stream": "1.0.8",
"mime-types": "2.1.24"
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"fs.realpath": {
@ -321,7 +321,7 @@
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"dev": true,
"requires": {
"assert-plus": "1.0.0"
"assert-plus": "^1.0.0"
}
},
"glob": {
@ -330,12 +330,12 @@
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.4",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"got": {
@ -344,17 +344,17 @@
"integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
"dev": true,
"requires": {
"create-error-class": "3.0.2",
"duplexer3": "0.1.4",
"get-stream": "3.0.0",
"is-redirect": "1.0.0",
"is-retry-allowed": "1.1.0",
"is-stream": "1.1.0",
"lowercase-keys": "1.0.1",
"safe-buffer": "5.1.2",
"timed-out": "4.0.1",
"unzip-response": "2.0.1",
"url-parse-lax": "1.0.0"
"create-error-class": "^3.0.0",
"duplexer3": "^0.1.4",
"get-stream": "^3.0.0",
"is-redirect": "^1.0.0",
"is-retry-allowed": "^1.0.0",
"is-stream": "^1.0.0",
"lowercase-keys": "^1.0.0",
"safe-buffer": "^5.0.1",
"timed-out": "^4.0.0",
"unzip-response": "^2.0.1",
"url-parse-lax": "^1.0.0"
}
},
"har-schema": {
@ -369,8 +369,8 @@
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"dev": true,
"requires": {
"ajv": "6.10.1",
"har-schema": "2.0.0"
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"htmlparser2": {
@ -379,11 +379,11 @@
"integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
"dev": true,
"requires": {
"domelementtype": "1.3.1",
"domhandler": "2.3.0",
"domutils": "1.5.1",
"entities": "1.0.0",
"readable-stream": "1.1.14"
"domelementtype": "1",
"domhandler": "2.3",
"domutils": "1.5",
"entities": "1.0",
"readable-stream": "1.1"
}
},
"http-signature": {
@ -392,9 +392,9 @@
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"dev": true,
"requires": {
"assert-plus": "1.0.0",
"jsprim": "1.4.1",
"sshpk": "1.16.1"
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"immediate": {
@ -409,8 +409,8 @@
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
@ -467,14 +467,14 @@
"integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==",
"dev": true,
"requires": {
"cli": "1.0.1",
"console-browserify": "1.1.0",
"exit": "0.1.2",
"htmlparser2": "3.8.3",
"lodash": "4.17.14",
"minimatch": "3.0.4",
"shelljs": "0.3.0",
"strip-json-comments": "1.0.4"
"cli": "~1.0.0",
"console-browserify": "1.1.x",
"exit": "0.1.x",
"htmlparser2": "3.8.x",
"lodash": "~4.17.11",
"minimatch": "~3.0.2",
"shelljs": "0.3.x",
"strip-json-comments": "1.0.x"
}
},
"json-schema": {
@ -513,10 +513,10 @@
"integrity": "sha512-NmKajvAFQpbg3taXQXr/ccS2wcucR1AZ+NtyWp2Nq7HHVsXhcJFR8p0Baf32C2yVvBylFWVeKf+WI2AnvlPhpA==",
"dev": true,
"requires": {
"lie": "3.3.0",
"pako": "1.0.10",
"readable-stream": "2.3.6",
"set-immediate-shim": "1.0.1"
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"set-immediate-shim": "~1.0.1"
},
"dependencies": {
"isarray": {
@ -531,13 +531,13 @@
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.4",
"isarray": "1.0.0",
"process-nextick-args": "2.0.1",
"safe-buffer": "5.1.2",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
@ -546,7 +546,7 @@
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "5.1.2"
"safe-buffer": "~5.1.0"
}
}
}
@ -557,7 +557,7 @@
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
"dev": true,
"requires": {
"immediate": "3.0.6"
"immediate": "~3.0.5"
}
},
"linkify-it": {
@ -566,7 +566,7 @@
"integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==",
"dev": true,
"requires": {
"uc.micro": "1.0.6"
"uc.micro": "^1.0.1"
}
},
"lodash": {
@ -587,8 +587,8 @@
"integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==",
"dev": true,
"requires": {
"lodash._reinterpolate": "3.0.0",
"lodash.templatesettings": "4.2.0"
"lodash._reinterpolate": "^3.0.0",
"lodash.templatesettings": "^4.0.0"
}
},
"lodash.templatesettings": {
@ -597,7 +597,7 @@
"integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==",
"dev": true,
"requires": {
"lodash._reinterpolate": "3.0.0"
"lodash._reinterpolate": "^3.0.0"
}
},
"lowercase-keys": {
@ -612,11 +612,11 @@
"integrity": "sha512-bUVTYGt/K/mYr3HlE+PBe6TOTyWghcpSZqOD9t+NFRlwJMhp9Kp6WQ8fJ26I6v1Xo71UmPYt1S4Hc9Lq8GZx2Q==",
"dev": true,
"requires": {
"argparse": "1.0.10",
"entities": "1.1.2",
"linkify-it": "2.1.0",
"mdurl": "1.0.1",
"uc.micro": "1.0.6"
"argparse": "^1.0.7",
"entities": "~1.1.1",
"linkify-it": "^2.0.0",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
},
"dependencies": {
"entities": {
@ -660,7 +660,7 @@
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "1.1.11"
"brace-expansion": "^1.1.7"
}
},
"oauth-sign": {
@ -675,7 +675,7 @@
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1.0.2"
"wrappy": "1"
}
},
"pako": {
@ -732,10 +732,10 @@
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.4",
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "0.10.31"
"string_decoder": "~0.10.x"
}
},
"request": {
@ -744,26 +744,26 @@
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"dev": true,
"requires": {
"aws-sign2": "0.7.0",
"aws4": "1.8.0",
"caseless": "0.12.0",
"combined-stream": "1.0.8",
"extend": "3.0.2",
"forever-agent": "0.6.1",
"form-data": "2.3.3",
"har-validator": "5.1.3",
"http-signature": "1.2.0",
"is-typedarray": "1.0.0",
"isstream": "0.1.2",
"json-stringify-safe": "5.0.1",
"mime-types": "2.1.24",
"oauth-sign": "0.9.0",
"performance-now": "2.1.0",
"qs": "6.5.2",
"safe-buffer": "5.1.2",
"tough-cookie": "2.4.3",
"tunnel-agent": "0.6.0",
"uuid": "3.3.2"
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
@ -802,15 +802,15 @@
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
"dev": true,
"requires": {
"asn1": "0.2.4",
"assert-plus": "1.0.0",
"bcrypt-pbkdf": "1.0.2",
"dashdash": "1.14.1",
"ecc-jsbn": "0.1.2",
"getpass": "0.1.7",
"jsbn": "0.1.1",
"safer-buffer": "2.1.2",
"tweetnacl": "0.14.5"
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"string_decoder": {
@ -837,8 +837,8 @@
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"dev": true,
"requires": {
"psl": "1.2.0",
"punycode": "1.4.1"
"psl": "^1.1.24",
"punycode": "^1.4.1"
},
"dependencies": {
"punycode": {
@ -855,7 +855,7 @@
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
"requires": {
"safe-buffer": "5.1.2"
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
@ -882,7 +882,7 @@
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
"punycode": "2.1.1"
"punycode": "^2.1.0"
}
},
"url-parse-lax": {
@ -891,7 +891,7 @@
"integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=",
"dev": true,
"requires": {
"prepend-http": "1.0.4"
"prepend-http": "^1.0.1"
}
},
"util-deprecate": {
@ -912,9 +912,9 @@
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"dev": true,
"requires": {
"assert-plus": "1.0.0",
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "1.3.0"
"extsprintf": "^1.2.0"
}
},
"wrappy": {

View File

@ -250,6 +250,10 @@ Gallery =
Gallery.cb.pause
when Conf['Slideshow']
Gallery.cb.toggleSlideshow
when Conf['Rotate image anticlockwise']
Gallery.cb.rotateLeft
when Conf['Rotate image clockwise']
Gallery.cb.rotateRight
return unless cb
e.stopPropagation()
@ -302,6 +306,20 @@ Gallery =
$.rmClass Gallery.nodes.buttons, 'gal-playing'
Gallery.slideshow = false
rotateLeft: ->
{current, frame} = Gallery.nodes
{style, dataRotate} = current
dataRotate = 0 if (!dataRotate || dataRotate <= -360)
style.transform = 'rotate(' + (dataRotate - 90) + 'deg)'
current.dataRotate = dataRotate - 90
rotateRight: ->
{current, frame} = Gallery.nodes
{style, dataRotate} = current
dataRotate = 0 if (!dataRotate || dataRotate >= 360)
style.transform = 'rotate(' + (dataRotate + 90) + 'deg)'
current.dataRotate = dataRotate + 90
close: ->
$.off Gallery.nodes.current, 'error', Gallery.error
ImageCommon.pause Gallery.nodes.current

View File

@ -1006,6 +1006,14 @@ Config =
'Ctrl+Right'
'Toggle the gallery slideshow mode.'
]
'Rotate image clockwise': [
'Shift+Right'
'Rotate image clockwise in gallery.'
]
'Rotate image anticlockwise': [
'Shift+Left'
'Rotate image anticlockwise in gallery.'
]
'fappeTyme': [
'f'
'Toggle Fappe Tyme.'