From 8b63b6c5d0e8b87a19ff29a8fdc81b8db82907ee Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Wed, 10 Sep 2014 17:43:17 +0200 Subject: [PATCH] Change how HTML links are handled. Now, require target=_blank for links that open a new page, and don't require yuu-href-internal. Show separate error messages for browser vs. standalone running. Add email contact link. --- src/index.html | 66 ++++++++++++++++++++++++++++++-------------- src/yuu/core.js | 9 ++++++ src/yuu/data/yuu.css | 4 +++ src/yuu/director.js | 7 ----- 4 files changed, 58 insertions(+), 28 deletions(-) diff --git a/src/index.html b/src/index.html index 1fedd23..dd3f3fd 100644 --- a/src/index.html +++ b/src/index.html @@ -49,19 +49,41 @@
-

There was a serious problem. You'll have to restart. Sorry - about that.

-

+ There was a serious problem. You'll have to restart. Sorry + about that. +

+

+

+ If this problem persists, + check our + support page. If it doesn't help, + email us. + Please include a screenshot of the problem, the rest of the + text in this error message, and + information about your + system's GPU. +

+

Supported browsers include recent versions of - Mozilla Firefox - and Google Chrome + Mozilla Firefox + and Google Chrome on most desktop computers, - Chrome + Chrome for Android, and Safari on Mac OS X 10.7 and later - if + if you enable WebGL manually.

+

+ If you are running one of these browsers and still have a problem, + check our + support page. If it doesn't help, + email us. + Please include a screenshot of the problem and the rest of + the text in this error message. +

Error Log

       
@@ -113,43 +135,43 @@ data-yuu-animation="yuu-from-top" data-yuu-dismiss-key="escape">
-

Pixel Witch Lesson #6

+

Pixel Witch Lesson #6

Designed & Implemented
Joe Wreschnig
Additional Programming
Brandon Jones & Colin MacKenzie IV - (glMatrix) + (glMatrix)
Christoph Burgmer - (ayepromise) + (ayepromise)
Ian McEwan, Ashima Arts - (WebGL Noise) + (WebGL Noise)
Jorik Tangelder - (Hammer.js) + (Hammer.js)
Fonts
Carrois Type Design - (Fira) + (Fira)
Dave Gandy - (Font Awesome) + (Font Awesome)
Special Thanks
Amelia Gorman
Jessicatz Fairymeadow
-
Kenney.nl
+
Kenney.nl
Richard - "The Clock Guy" + "The Clock Guy" Oliver
@@ -157,16 +179,16 @@

Copyright ©2014 - Yukkuri Games + Yukkuri Games and others

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either - version + version 2 of the License, or (at your option) - any later version. + any later version.


@@ -194,8 +216,10 @@


diff --git a/src/yuu/core.js b/src/yuu/core.js index 25d3ed2..22a1fb4 100644 --- a/src/yuu/core.js +++ b/src/yuu/core.js @@ -70,6 +70,9 @@ /** Initialize Yuu and call all registered hooks */ + document.body.className += (navigator.standalone || gui) + ? " standalone" : " browser"; + if (gui) { var win = gui.Window.get(); var nativeMenuBar = new gui.Menu({ type: "menubar" }); @@ -89,6 +92,12 @@ wkdoc.hidden = false; wkdoc.dispatchEvent(ev); }); + win.on('new-win-policy', function (frame, url, policy) { + if (url.startsWith('chrome')) + policy.forceNewPopup(); + else + policy.forceDownload(); + }); } return new Promise(function (resolve) { diff --git a/src/yuu/data/yuu.css b/src/yuu/data/yuu.css index 37eb3fd..86b933f 100644 --- a/src/yuu/data/yuu.css +++ b/src/yuu/data/yuu.css @@ -363,3 +363,7 @@ dt { dd { margin-left: 0; } + +body.standalone .browser, body.browser .standalone { + display: none; +} diff --git a/src/yuu/director.js b/src/yuu/director.js index 385a3e7..e1c0b53 100644 --- a/src/yuu/director.js +++ b/src/yuu/director.js @@ -580,13 +580,6 @@ } }, elements); - yf.each(function (a) { - a.onclick = function (event) { - yuu.openURL(this.href); - yuu.stopPropagation(event, true); - }; - }, element.querySelectorAll("a[href]:not([yuu-href-internal])")); - this._director = director; element.className = className + " " + this.animation; -- 2.20.1