├── readme.md ├── styles.css ├── bookmarklet.txt ├── LICENSE ├── code.js ├── worknotes.md ├── index.html └── source.opml /readme.md: -------------------------------------------------------------------------------- 1 | # bookmarkletMaker 2 | 3 | A browser-based app that makes bookmarklets easier to make. 4 | 5 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: whitesmoke; 3 | } 4 | .divPageBody { 5 | font-family: "Ubuntu"; 6 | font-size: 24px; 7 | line-height: 140%; 8 | width: 700px; 9 | margin-top: 140px; 10 | margin-left: auto; 11 | margin-right: auto; 12 | margin-bottom: 400px; 13 | } 14 | 15 | .divBookmarklet { 16 | margin-top: 20px; 17 | margin-bottom: 20px; 18 | } 19 | .divBookmarklet a { 20 | font-size: 28px; 21 | font-weight: bold; 22 | color: black; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /bookmarklet.txt: -------------------------------------------------------------------------------- 1 | var params = ""; 2 | function addparam (name, val) { 3 | if (params.length > 0) { 4 | params += "&"; 5 | } 6 | params += name + "=" + encodeURIComponent (val); 7 | } 8 | addparam ("[%command%]", "true"); 9 | addparam ("title", document.title); 10 | addparam ("description", window.getSelection ().toString ()); 11 | addparam ("link", window.location.href); 12 | var callUrl = "[%app%]?" + params; 13 | console.log (callUrl); 14 | window.open(callUrl, %27_blank%27); 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Dave Winer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /code.js: -------------------------------------------------------------------------------- 1 | function getAllUrlParams (searchstring) { 2 | var s = searchstring; 3 | var allparams = new Object (); 4 | if (beginsWith (s, "?")) { 5 | s = stringDelete (s, 1, 1); 6 | } 7 | var splits = s.split ("&"); 8 | splits.forEach (function (item) { 9 | var splits = item.split ("="); 10 | allparams [splits [0]] = decodeURIComponent (splits [1]); 11 | }); 12 | return (allparams); 13 | } 14 | function startup () { 15 | console.log ("startup"); 16 | 17 | var replacetable = { 18 | app: "https://feedland.org/", 19 | command: "linkblog" 20 | }; 21 | 22 | var urlParams = getAllUrlParams (location.search); 23 | if (urlParams.app !== undefined) { 24 | replacetable.app = urlParams.app; 25 | } 26 | if (urlParams.command !== undefined) { //10/21/23 by DW 27 | replacetable.command = urlParams.command; 28 | } 29 | if (urlParams.name !== undefined) { 30 | $(".ancBookmarklet").text (urlParams.name); 31 | } 32 | 33 | readHttpFileThruProxy ("http://scripting.com/code/bookmarkletmaker/bookmarklet.txt", undefined, function (theText) { 34 | if (theText !== undefined) { 35 | theText = multipleReplaceAll (theText, replacetable, true, "[%", "%]"); 36 | $(".divBookmarklet a").attr ("href", "javascript:(function () {" + theText + "})();"); 37 | } 38 | }); 39 | 40 | hitCounter (); 41 | } 42 | -------------------------------------------------------------------------------- /worknotes.md: -------------------------------------------------------------------------------- 1 | #### 10/21/23; 12:33:00 PM by DW 2 | 3 | Added a new optional command url param that says where it should redirect back to. This was previously hardcoded to "linkblog" -- but that won't work for subscribing. The default is still linkblog so the old bookmarklet for linkblogging should continue to work. 4 | 5 | Here's how it works with a different command. 6 | 7 | http://scripting.com/code/bookmarkletmaker/?app=https://a8c.feedland.org/&name=Subscribe&command=subscribe 8 | 9 | The post announcing the feature. 10 | 11 | https://github.com/scripting/a8c-FeedLand-Support/issues/31 12 | 13 | #### 8/3/23; 11:24:08 AM by DW 14 | 15 | http://scripting.com/code/bookmarkletmaker/index.html?app=https://feedland.org/&name=def 16 | 17 | http://scripting.com/code/bookmarkletmaker/index.html?app=http://scriptingola.coo/&name=abc 18 | 19 | #### 5/24/23; 4:01:34 PM by DW 20 | 21 | http://scripting.com/code/bookmarkletmaker/index.html?app=http://scripting.com/code/marktwain/&name=MarkTwain 22 | 23 | #### 5/9/23; 4:54:44 PM by DW 24 | 25 | http://scripting.com/code/testing/bookmarkletmaker/index.html?app=http://scripting.com/code/marktwain/&name=MarkTwain 26 | 27 | https://scripting.com/code/testing/bookmarkletmaker/index.html?app=http://scripting.com/code/marktwain/&name=MT 28 | 29 | https://scripting.com/code/testing/bookmarkletmaker/index.html?app=http://scripting.com/code/marktwain/ 30 | 31 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |Here's your bookmarklet:
25 |Drag it up to the browser toolbar to activate it.
29 |