├── icon_128.png ├── icon_16.png ├── icon_64.png ├── icons ├── check.png ├── crop.png ├── down.png ├── group.png ├── logo.png ├── right.png ├── sort.png ├── cancel.png ├── search.png ├── add-folder.png └── delete-button.png ├── screenshot ├── s1.png └── s2.png ├── manifest.json ├── LICENSE.md ├── README.md ├── popup.html ├── js ├── tools.js ├── print.js ├── sortable.js ├── popup.js └── jquery.min.js └── css ├── main.css └── font.css /icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icon_128.png -------------------------------------------------------------------------------- /icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icon_16.png -------------------------------------------------------------------------------- /icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icon_64.png -------------------------------------------------------------------------------- /icons/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/check.png -------------------------------------------------------------------------------- /icons/crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/crop.png -------------------------------------------------------------------------------- /icons/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/down.png -------------------------------------------------------------------------------- /icons/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/group.png -------------------------------------------------------------------------------- /icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/logo.png -------------------------------------------------------------------------------- /icons/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/right.png -------------------------------------------------------------------------------- /icons/sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/sort.png -------------------------------------------------------------------------------- /icons/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/cancel.png -------------------------------------------------------------------------------- /icons/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/search.png -------------------------------------------------------------------------------- /screenshot/s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/screenshot/s1.png -------------------------------------------------------------------------------- /screenshot/s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/screenshot/s2.png -------------------------------------------------------------------------------- /icons/add-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/add-folder.png -------------------------------------------------------------------------------- /icons/delete-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koolzz/bookmark-beautifier/HEAD/icons/delete-button.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Bookmark beautifier", 4 | "short_name":"Bbeautifier", 5 | "version": "1.0.5.5", 6 | "description": "A browser extension that sorts and organizes bookmarks, also has an edit mode.", 7 | "permissions": [ 8 | "bookmarks" 9 | ], 10 | "icons": { 11 | "128": "icon_128.png", 12 | "64": "icon_64.png", 13 | "16": "icon_16.png" 14 | }, 15 | "browser_action": { 16 | "default_title": "Bookmark beautifier", 17 | "default_icon": "icon_128.png", 18 | "default_popup": "popup.html" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Mykola Yurchenko 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![logo](https://cloud.githubusercontent.com/assets/17416048/23990418/a5bcf738-0a3e-11e7-8326-34e2633c65ba.png) Bookmark Beautifier 2 | Chrome browser extension for sorting and organizing bookmarks. Simplifies the bookmark managing process by providing functions such as sorting, grouping similar links into folders and shortening obscure titles. 3 | 4 | ## Install on Chrome 5 | * Get Bookmark-beautifier directly from [Chrome Web Store](https://chrome.google.com/webstore/detail/bookmark-beautifier/ahnaocfoepojfegbafgokdjnpnhajjgb?hl=en) 6 | * For dev branch get code from this repo and follow [these instructions](https://developer.chrome.com/extensions/getstarted#unpacked) 7 | 8 | ## Using 9 | * [RubaXa Sortable](https://github.com/RubaXa/Sortable) js library used for implementing a reorderable bookmark list 10 | 11 | ## Feedback 12 | 13 | All bugs, feature requests, pull requests, feedback, etc., are welcome. [Create an issue](https://github.com/koolzz/bookmark-beautifier/issues), or [leave a comment](https://chrome.google.com/webstore/detail/bookmark-beautifier/ahnaocfoepojfegbafgokdjnpnhajjgb/support?utm_campaign=en&utm_source=en-et-na-us-oc-webstrhm&utm_medium=et). 14 | 15 | ## License 16 | 17 | MIT [License](https://github.com/koolzz/bookmark-beautifier/blob/master/LICENSE.md). 18 | -------------------------------------------------------------------------------- /popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 |
31 | Tooltip text 32 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /js/tools.js: -------------------------------------------------------------------------------- 1 | function sort(list) { 2 | list.children.sort(sortByName); 3 | list.children.forEach(function(folder) { 4 | if (typeof folder.url === 'undefined' && folder.children.length > 0) 5 | sort(folder); 6 | }); 7 | } 8 | 9 | function group(list) { 10 | var dictionary = []; 11 | list.children.forEach(function(folder) { 12 | if (typeof folder.url === 'undefined' && folder.children.length > 0 && folder.id <= ROOT_TABS) { 13 | group(folder); 14 | return; 15 | } 16 | if (typeof folder.url != 'undefined') { 17 | var domain = getHostname(folder.url); 18 | if (domain === null) 19 | return; 20 | 21 | //creates an array of results, nly have 2 cases empty or 1 element 22 | var result = $.grep(dictionary, function(e) { 23 | return e.key == domain; 24 | }); 25 | //for 0 create new entry, else increment excisting entry 26 | if (result == 0) { 27 | dictionary.push({ 28 | key: String(domain), 29 | value: 1, 30 | parentId: folder.parentId, 31 | folderName: String(capitalizeFirstLetter(getFolderName(domain))), 32 | bookmarkList: [folder] 33 | }); 34 | } else { 35 | result[0].value++; 36 | result[0].bookmarkList.push(folder); 37 | } 38 | } 39 | }); 40 | $.each(dictionary, function(key, value) { 41 | var folderFound = false; 42 | if (value.value > 1) { 43 | dictionary[key].bookmarkList.forEach(function(bookmark) { 44 | var index = list.children.indexOf(bookmark); 45 | if (index > -1) { 46 | list.children.splice(index, 1); 47 | } 48 | }); 49 | $.each(list.children, function(index, bookmark) { 50 | if (typeof bookmark.url === 'undefined' && bookmark.title === value.folderName) { 51 | dictionary[key].bookmarkList.forEach(function(e) { 52 | e.parentId = bookmark.id; 53 | bookmark.children.push(e); 54 | }); 55 | return false; 56 | } else if (index === list.children.length - 1) { 57 | list.children.push({ 58 | title: value.folderName, 59 | parentId: value.parentId, 60 | create: true, 61 | children: dictionary[key].bookmarkList 62 | }); 63 | } 64 | }); 65 | } 66 | }); 67 | } 68 | 69 | function crop(list) { 70 | list.children.forEach(function(folder) { 71 | if (typeof folder.url === 'undefined' && folder.children.length > 0) 72 | crop(folder); 73 | 74 | if (typeof folder.url != 'undefined') { 75 | var oldTitle = folder.title; 76 | oldTitle = stripPunctuation(oldTitle); 77 | while (oldTitle.length > 70) { 78 | var lastSpace = oldTitle.lastIndexOf(" "); 79 | var firstSpace = oldTitle.indexOf(" "); 80 | if (lastSpace != -1 && lastSpace != firstSpace) { 81 | oldTitle = oldTitle.substring(0, lastSpace); 82 | folder.rename = true; 83 | folder.title = oldTitle; 84 | } else { 85 | return; 86 | } 87 | } 88 | } 89 | 90 | }); 91 | } 92 | -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | html { 2 | overflow: hidden; 3 | display: block; 4 | } 5 | 6 | body { 7 | height: 600px; 8 | width: 358px; 9 | background-color: #009688; 10 | } 11 | 12 | 13 | /* Header */ 14 | 15 | .header { 16 | background-color: #009688; 17 | width: 358px; 18 | height: 47px; 19 | } 20 | 21 | #search { 22 | position: relative; 23 | margin-left: 14px; 24 | top: 1px; 25 | width: 300px; 26 | font-size: 18px; 27 | color: #ffffff; 28 | display: inline-block; 29 | overflow: hidden; 30 | padding-top: 15px; 31 | font-family: "Roboto"; 32 | } 33 | 34 | #create_new_folder { 35 | position: absolute; 36 | margin-left: 14px; 37 | top: 1px; 38 | width: 227px; 39 | font-size: 18px; 40 | color: #ffffff; 41 | display: inline-block; 42 | overflow: hidden; 43 | padding-top: 15px; 44 | font-family: "Roboto"; 45 | transition: all .15s ease-in-out; 46 | } 47 | 48 | #search_header{ 49 | width: 320px; 50 | } 51 | 52 | #create_new_folder:hover, #learn:hover { 53 | opacity: 0.5; 54 | } 55 | 56 | #create_new_folder:focus { 57 | opacity: 1; 58 | } 59 | 60 | #search::-webkit-input-placeholder, #create_new_folder::-webkit-input-placeholder { 61 | color: rgb(255, 255, 255); 62 | } 63 | 64 | #search:focus::-webkit-input-placeholder, #create_new_folder:focus::-webkit-input-placeholder { 65 | color: transparent; 66 | } 67 | 68 | #search:focus, #search:focus+#search_icon, #create_new_folder:focus { 69 | border-color: inherit; 70 | -webkit-box-shadow: none; 71 | box-shadow: none; 72 | } 73 | 74 | #search_icon { 75 | margin-left: -21px;s 76 | margin-bottom: 3px; 77 | width: 1.7rem; 78 | height: 1.7rem; 79 | opacity: inherit; 80 | } 81 | 82 | #resetSearch { 83 | width: 20px; 84 | height: 20px; 85 | position: absolute; 86 | left: 295px; 87 | top: 15px; 88 | padding: 0; 89 | background-color: #009688; 90 | background-repeat: no-repeat; 91 | color: #ffffff; 92 | border: none; 93 | cursor: pointer; 94 | overflow: hidden; 95 | outline: none; 96 | transition: all .15s ease-in-out; 97 | } 98 | #resetSearch img{ 99 | width: 20px; 100 | height: 20px; 101 | } 102 | 103 | #learn { 104 | position: absolute; 105 | width: 20px; 106 | height: : 20px; 107 | top: 16px; 108 | left: 327px; 109 | color: white; 110 | transition: all .15s ease-in-out; 111 | } 112 | 113 | 114 | /* Bookmarks */ 115 | 116 | #bookmarks { 117 | background-color: #ffffff; 118 | overflow-y: auto !important; 119 | overflow-x: hidden; 120 | height: 503px; 121 | width: 358px; 122 | font size: 19px; 123 | } 124 | 125 | #bookmarks ul { 126 | margin: 0; 127 | padding: 0; 128 | list-style-type: none; 129 | } 130 | 131 | #bookmarks .bFolder { 132 | display: inline-block; 133 | color: #000; 134 | width: 358px; 135 | padding: 17px 12px 13px 8px; 136 | text-decoration: none; 137 | font-weight: normal; 138 | border-top: 1px solid #ddd; 139 | font size: 15px; 140 | } 141 | 142 | .bLink:hover { 143 | border: 1px; 144 | } 145 | 146 | #bookmarks .bLink a { 147 | display: inline-block; 148 | color: #000; 149 | width: 346px; 150 | padding: 14px 3px 14px 17px; 151 | text-decoration: none; 152 | font-weight: normal; 153 | border-top: 1px solid #ddd; 154 | min-height: 20px; 155 | font size: 19px; 156 | } 157 | 158 | #bookmarks .bLink a:empty { 159 | height: 40px; 160 | } 161 | 162 | #bookmarks .bLink a:empty:after { 163 | font-style: italic; 164 | content: "No title"; 165 | } 166 | 167 | #bookmarks>ul { 168 | border-left: 1px solid #ddd; 169 | border-right: 1px solid #ddd; 170 | border-bottom: 1px solid #ddd; 171 | } 172 | 173 | #bookmarks .selectedLink { 174 | background-color: #F0F5FF; 175 | } 176 | 177 | #bookmarks .editSelectedVal { 178 | background-color: rgba(0, 0, 0, 0.1); 179 | width: 346px; 180 | padding: 14px 12px 14px 8px; 181 | border: none; 182 | } 183 | 184 | #bookmarks .ghost a { 185 | opacity: 0.4; 186 | } 187 | 188 | .dropIcon { 189 | position: relative; 190 | margin-top: -2px; 191 | width: 22px; 192 | height: 17px; 193 | } 194 | 195 | #root { 196 | margin-left: 13px; 197 | } 198 | 199 | .linkIcon { 200 | position: relative; 201 | margin-top: -2px; 202 | margin-right: 6px; 203 | width: 17px; 204 | height: 17px; 205 | } 206 | 207 | 208 | /* Footer */ 209 | 210 | .footer { 211 | margin-bottom: 0px; 212 | background-color: #009688; 213 | width: 358px; 214 | height: 50px; 215 | } 216 | 217 | #sort, #group, #crop, #new_folder { 218 | position: relative; 219 | margin-left: 55px; 220 | margin-top: 8px; 221 | } 222 | 223 | #sort { 224 | margin-left: 28px; 225 | height: 29px; 226 | } 227 | 228 | #group { 229 | height: 34px; 230 | } 231 | 232 | #crop { 233 | height: 31px; 234 | } 235 | 236 | #new_folder { 237 | height: 30px; 238 | } 239 | 240 | #sort:hover, #group:hover, #crop:hover, #new_folder:hover { 241 | opacity: 0.5; 242 | } 243 | 244 | .decision { 245 | width: 358px; 246 | } 247 | 248 | #apply, #reject { 249 | position: absolute; 250 | width: 27px; 251 | height: 27px; 252 | margin-left: 124px; 253 | margin-top: 11px; 254 | } 255 | 256 | #reject { 257 | margin-left: 209px; 258 | } 259 | 260 | #apply:hover, #reject:hover { 261 | opacity: 0.5; 262 | } 263 | 264 | #trash { 265 | position: absolute; 266 | opacity: 0; 267 | top: 560px; 268 | width: 4rem; 269 | height: 4rem; 270 | left: 292; 271 | } 272 | 273 | #trash:hover { 274 | opacity: 0.5; 275 | } 276 | 277 | .add_new_folder { 278 | position: absolute; 279 | } 280 | 281 | #apply_folder, #reject_folder { 282 | position: absolute; 283 | width: 27px; 284 | height: 27px; 285 | top: 15px; 286 | left: 260; 287 | color: white; 288 | } 289 | 290 | #reject_folder { 291 | left: 310px; 292 | } 293 | 294 | #apply_folder:hover, #reject_folder:hover { 295 | opacity: 0.5; 296 | } 297 | 298 | #tooltiptext { 299 | position: absolute; 300 | top: 528px; 301 | display: none; 302 | width: 358px; 303 | background-color: #323a46; 304 | color: #fff; 305 | text-align: center; 306 | font-size: 16px; 307 | } 308 | 309 | #bookmarks .showspace ul:empty { 310 | min-height: 20px; 311 | } 312 | 313 | #bookmarks .showspace ul:empty:after { 314 | padding-left: 40%; 315 | content: "Drag link here"; 316 | } 317 | 318 | #bookmarks .unusedPlaceHolder a { 319 | padding-bottom: 0; 320 | padding-top: 0; 321 | height: 50px; 322 | border-top: none; 323 | } 324 | 325 | 326 | 327 | #bookmarks .unusedPlaceHolder a::before { 328 | position: relative; 329 | top: 5px; 330 | } 331 | -------------------------------------------------------------------------------- /js/print.js: -------------------------------------------------------------------------------- 1 | function printBookmarks(callbackList, showChildren) { 2 | chrome.bookmarks.getTree(function(root) { 3 | $('#bookmarks').empty(); 4 | ROOT_TABS = root[0].children.length; 5 | root.forEach(function(folder) { 6 | $('#bookmarks').append(printBookmarkFolder(folder, showChildren)); 7 | $('#bookmarks .bFolder').each(function(index, val) { 8 | val = $(val).parent(); 9 | var depth = $(val).parents("ul").length, 10 | padding = 20; 11 | val.children().find('a').css('padding-left', depth * padding + 13); 12 | }); 13 | 14 | if (callbackList) { 15 | for (var i = 0, len = callbackList.length; i < len; i++) { 16 | callbackList[i](); 17 | } 18 | } 19 | }); 20 | }); 21 | } 22 | 23 | function printBookmarkFolder(bookmarkFolder, notShowChildren) { 24 | var list = $("