├── 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 | bookmarkletmaker 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

Here's your bookmarklet:

25 |
26 | XYZ 27 |
28 |

Drag it up to the browser toolbar to activate it.

29 |
30 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /source.opml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | nodeEditor: bookmarkletMaker 18 | Wed, 10 May 2023 15:08:34 GMT 19 | Sat, 21 Oct 2023 16:36:00 GMT 20 | Dave Winer 21 | http://davewiner.com/ 22 | 1, 2, 16 23 | 1 24 | 263 25 | 378 26 | 1157 27 | 1596 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | --------------------------------------------------------------------------------