[Libreoffice-commits] online.git: 2 commits - loleaflet/dist loleaflet/src loolwsd/FileServer.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sat Jul 23 02:58:08 UTC 2016
loleaflet/dist/devtools-detect/index.js | 53 ++++++++++++++++++++
loleaflet/dist/devtools-detect/license | 21 ++++++++
loleaflet/dist/devtools-detect/package.json | 71 ++++++++++++++++++++++++++++
loleaflet/dist/devtools-detect/readme.md | 53 ++++++++++++++++++++
loleaflet/dist/loleaflet.html | 1
loleaflet/src/map/Map.js | 6 +-
loolwsd/FileServer.cpp | 1
7 files changed, 205 insertions(+), 1 deletion(-)
New commits:
commit 9510c1aca7614d7f518c583f6349716143076d5e
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Jul 22 22:52:33 2016 -0400
loowsd: log file server requests
Change-Id: Ia3e9ebf2888a629b8e5fb0b83dd526fcaec03835
Reviewed-on: https://gerrit.libreoffice.org/27452
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/FileServer.cpp b/loolwsd/FileServer.cpp
index 7363abf..60cb58e 100644
--- a/loolwsd/FileServer.cpp
+++ b/loolwsd/FileServer.cpp
@@ -110,6 +110,7 @@ void FileServerRequestHandler::handleRequest(HTTPServerRequest& request, HTTPSer
try
{
Poco::URI requestUri(request.getURI());
+ Log::trace("Fileserver request: " + requestUri.toString());
requestUri.normalize(); // avoid .'s and ..'s
std::vector<std::string> requestSegments;
commit e685f6a3067ea98da8f412802281b5b08a9944f5
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Jul 22 22:50:52 2016 -0400
loleaflet: disable grey-out when debug-tools is open
Change-Id: Id3d2502fc7a38303395e70b710adaeaf7fae92a6
Reviewed-on: https://gerrit.libreoffice.org/27451
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loleaflet/dist/devtools-detect/index.js b/loleaflet/dist/devtools-detect/index.js
new file mode 100644
index 0000000..342f7fc
--- /dev/null
+++ b/loleaflet/dist/devtools-detect/index.js
@@ -0,0 +1,53 @@
+/* eslint-disable spaced-comment */
+/*!
+ devtools-detect
+ Detect if DevTools is open
+ https://github.com/sindresorhus/devtools-detect
+ by Sindre Sorhus
+ MIT License
+*/
+(function () {
+ 'use strict';
+ var devtools = {
+ open: false,
+ orientation: null
+ };
+ var threshold = 160;
+ var emitEvent = function (state, orientation) {
+ window.dispatchEvent(new CustomEvent('devtoolschange', {
+ detail: {
+ open: state,
+ orientation: orientation
+ }
+ }));
+ };
+
+ setInterval(function () {
+ var widthThreshold = window.outerWidth - window.innerWidth > threshold;
+ var heightThreshold = window.outerHeight - window.innerHeight > threshold;
+ var orientation = widthThreshold ? 'vertical' : 'horizontal';
+
+ if ((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) ||
+ widthThreshold || heightThreshold) {
+ if (!devtools.open || devtools.orientation !== orientation) {
+ emitEvent(true, orientation);
+ }
+
+ devtools.open = true;
+ devtools.orientation = orientation;
+ } else {
+ if (devtools.open) {
+ emitEvent(false, null);
+ }
+
+ devtools.open = false;
+ devtools.orientation = null;
+ }
+ }, 500);
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = devtools;
+ } else {
+ window.devtools = devtools;
+ }
+})();
diff --git a/loleaflet/dist/devtools-detect/license b/loleaflet/dist/devtools-detect/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/loleaflet/dist/devtools-detect/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
+
+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.
diff --git a/loleaflet/dist/devtools-detect/package.json b/loleaflet/dist/devtools-detect/package.json
new file mode 100644
index 0000000..aee7557
--- /dev/null
+++ b/loleaflet/dist/devtools-detect/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "devtools-detect",
+ "version": "2.1.1",
+ "description": "Detect if DevTools is open and its orientation",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/sindresorhus/devtools-detect"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus at gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "browser",
+ "detect",
+ "identify",
+ "check",
+ "dev",
+ "devtools",
+ "developer",
+ "orientation",
+ "placement",
+ "docked"
+ ],
+ "scripts": {
+ "test": "xo"
+ },
+ "devDependencies": {
+ "xo": "*"
+ },
+ "xo": {
+ "envs": [
+ "browser"
+ ]
+ },
+ "gitHead": "62cda4f9f2f1c211da23a72c592f488ef789da1f",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/devtools-detect/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/devtools-detect",
+ "_id": "devtools-detect at 2.1.1",
+ "_shasum": "a11ceb04cb5a546540758d6357c9f9c089f6bf30",
+ "_from": "devtools-detect@",
+ "_npmVersion": "2.14.7",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus at gmail.com"
+ },
+ "dist": {
+ "shasum": "a11ceb04cb5a546540758d6357c9f9c089f6bf30",
+ "tarball": "https://registry.npmjs.org/devtools-detect/-/devtools-detect-2.1.1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus at gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/devtools-detect/-/devtools-detect-2.1.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/loleaflet/dist/devtools-detect/readme.md b/loleaflet/dist/devtools-detect/readme.md
new file mode 100644
index 0000000..82f51ad
--- /dev/null
+++ b/loleaflet/dist/devtools-detect/readme.md
@@ -0,0 +1,53 @@
+# devtools-detect
+
+> Detect if DevTools is open and its orientation
+
+Useful for when you want something special to happen when DevTools is open. Like pausing canvas, adding style debug info, etc.
+
+
+## [Demo](http://sindresorhus.com/devtools-detect)
+
+
+## Install
+
+```
+$ npm install --save devtools-detect
+```
+
+
+## Usage
+
+```html
+<script src="node_modules/devtools-detect/index.js"></script>
+<script>
+ // check if it's open
+ console.log('is DevTools open?', window.devtools.open);
+ // check it's orientation, null if not open
+ console.log('and DevTools orientation?', window.devtools.orientation);
+
+ // get notified when it's opened/closed or orientation changes
+ window.addEventListener('devtoolschange', function (e) {
+ console.log('is DevTools open?', e.detail.open);
+ console.log('and DevTools orientation?', e.detail.orientation);
+ });
+</script>
+```
+
+
+## Support
+
+- Chrome DevTools
+- Safari DevTools
+- Firefox DevTools
+- Firebug
+- Firebug Lite
+
+
+## Caveats
+
+Doesn't work if DevTools is undocked and will show false positive if you toggle any kind of sidebar.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index 371b0c7..85d2fe1 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -62,6 +62,7 @@
<script src="/loleaflet/%VERSION%/branding.js"></script> <!-- logo onclick handler -->
<script>vex.defaultOptions.className = 'vex-theme-plain';</script>
<script src="/loleaflet/%VERSION%/errormessages.js"></script>
+ <script src="/loleaflet/%VERSION%/devtools-detect/index.js"></script>
<!--The "controls" div holds map controls such as the Zoom button and
it's separated from the map in order to have the controls on the top
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 9d212cf..6c94b31 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -716,7 +716,7 @@ L.Map = L.Evented.extend({
_deactivate: function () {
clearTimeout(vex.timer);
- if (!this._active || vex.dialogID > 0) {
+ if (!window.devtools.open && (!this._active || vex.dialogID > 0)) {
// A dialog is already dimming the screen and probably
// shows an error message. Leave it alone.
this._active = false;
@@ -730,6 +730,10 @@ L.Map = L.Evented.extend({
var map = this;
vex.timer = setTimeout(function() {
+ if (window.devtools.open) {
+ return;
+ }
+
map._active = false;
clearTimeout(vex.timer);
More information about the Libreoffice-commits
mailing list