From 7f974deb7e7fe101741c9ad86ed5b07a8d11db06 Mon Sep 17 00:00:00 2001 From: "Silas S. Brown" <ssb22@cam.ac.uk> Date: Sun, 29 Nov 2015 21:13:35 +0000 Subject: [PATCH] Update Web Adjuster, css-generate.py git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/adjuster@2355 29193198-4895-4776-b068-10539e920549 --- adjuster.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adjuster.py b/adjuster.py index ea18027..ad26d0b 100755 --- a/adjuster.py +++ b/adjuster.py @@ -1412,11 +1412,15 @@ document.write('<a href="javascript:location.reload(true)">refreshing this page< if title: title += " on current page" # because page won't be visible while choosing bookmarks, unlike on desktops else: title=theSys+" bookmarklet - Web Adjuster" # will be the default name of the bookmark # TODO: we say txt[0]+'z' in the instructions to display on another device below, but if there are enough filters to get up to 'z' then the title on the other device will be whatever THAT filter is; might be better to just use txt in that situation - i0 = "<h3>%s bookmarklet</h3>To install this bookmarklet on %s, follow the instructions below. You might want to take some notes first, because this page will <em>not</em> be displayed throughout the process! If you have another device, you can show another copy of these instructions on it by going to <tt>http://%sz</tt><h4>Instructions</h4><ol><li>" % (theSys, theSys, self.request.host+options.submitPath+txt[0]) + i0 = "<h3>%s bookmarklet</h3>To install this bookmarklet on %s, follow the instructions below. You might want to take some notes first, because this page will <em>not</em> be displayed throughout the process! If you have another device, you can show another copy of these instructions on it by going to <tt>http://%sz</tt>" % (theSys, theSys, self.request.host+options.submitPath+txt[0]) + if "Firefox/" in self.request.headers.get("User-Agent",""): i0 += "<h4>Not Yet Working On Mobile Firefox!</h4>Please use Chrome/Safari.<p>TODO: extension for mobile Firefox?" + i0 += "<h4>Instructions</h4><ol><li>" sharp = "<li>You should see a sharp sign (#). If you don't, you might have to scroll a little to the right to get it into view. When you see the sharp sign, press immediately to the right of it. (This can be difficult, depending on your eyesight and the size of your fingers. You must put the text cursor <em>immediately</em> to the right of that sharp. Keep trying until you get it in <em>exactly</em> the right place.)<li>Use the backspace key to delete everything up to and including the sharp. The code should now start with the word <tt>javascript</tt>.<li>" if txt[0]=='i': i0 += "Press Menu (centre square button below) and Bookmark, to bookmark <b>this</b> page<li>Change the name if you want, and press Done<li>Press Bookmarks (one to the right of menu)<li>Press Edit (bottom left)<li>Find the bookmark you made and press it<li>Long-press the <em>second</em> line to get the selection menu on it<li>Press Select<li>Gently drag the left-most marker over to the left so that it scrolls to the extreme left of the address"+sharp+"Press \"Done\" three times to come back here." - else: i0 += "Press Menu and Save to Bookmarks, to bookmark <b>this</b> page<li>Change the label if you want, but <b>do not</b> press OK<li>Long-press the <em>second</em> line to get the selection on it<li>Gently drag the marker over to the left so that it scrolls to the extreme left of the address"+sharp+"Press \"OK\" to come back here." - return self.doResponse2(htmlhead(title)+i0+"<li>The bookmarklet is now ready for use. Go to whatever page you want to use it on, and select it from the bookmarks to use it.</ol></body></html>","noFilterOptions",False) + else: i0 += "Press Menu and Save to Bookmarks, to bookmark <b>this</b> page (on some phones that option is just a drawing of a star)<li>Change the label if you want, but <b>do not</b> press OK<li>Long-press the <em>second</em> line to get the selection on it<li>Gently drag the marker over to the left so that it scrolls to the extreme left of the address"+sharp+"Press \"OK\" to come back here." + i0 += "<li>The bookmarklet is now ready for use. Go to whatever page you want to use it on, and select it from the bookmarks to use it." + if txt[0]=='a': i0 += " <b>On later versions of Android, it doesn't work to choose the bookmark directly</b>: you have to start typing <tt>javascript:</tt> in the URL box and select it that way." + return self.doResponse2(htmlhead(title)+i0+"</ol></body></html>","noFilterOptions",False) txt = zlib.decompressobj().decompress(base64.b64decode(txt),16834) # limit to 16k to avoid zip bombs (limit is also in the compress below) self.request.uri = "%s (input not logged, len=%d)" % (options.submitPath,len(txt)) else: txt = self.request.arguments.get("i",None) -- GitLab