├── .babelrc ├── .browserslistrc ├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── .stylelintrc.json ├── LICENSE ├── README.md ├── README.zh.md ├── manifest.chrome.json ├── manifest.firefox.json ├── package-lock.json ├── package.json ├── promotion ├── dark.gif ├── export.gif ├── import.gif ├── options.gif ├── scroll.gif └── small-tile.png ├── src ├── assets │ └── me.jpg ├── css │ ├── button.scss │ ├── checkbox.scss │ ├── options.scss │ ├── popup.scss │ ├── radio.scss │ ├── reset.css │ └── title.scss ├── js │ ├── background.js │ ├── contentscript.js │ ├── data │ │ ├── colors.js │ │ └── default-options.js │ ├── feature │ │ └── menu.js │ ├── options.js │ ├── popup.js │ ├── store │ │ └── nav.js │ └── utils │ │ ├── index.js │ │ ├── storage.js │ │ └── tabs.js ├── options.pug └── popup.pug └── static ├── _locales ├── en │ └── messages.json ├── zh_CN │ └── messages.json └── zh_TW │ └── messages.json ├── icon128.png ├── icon16.png ├── icon32.png └── icon48.png /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"], 3 | "plugins": ["@babel/plugin-transform-runtime"] 4 | } 5 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 0.5% 2 | last 2 versions 3 | Firefox ESR 4 | not dead 5 | not ie <= 11 6 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2020": true, 5 | "node": true 6 | }, 7 | "extends": ["eslint:recommended", "prettier"], 8 | "parserOptions": { 9 | "ecmaVersion": 11, 10 | "sourceType": "module" 11 | }, 12 | "globals": { 13 | "chrome": "readonly" 14 | }, 15 | "rules": {} 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .cache/ 3 | dist/ 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .cache/ 3 | dist/ 4 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-sass-guidelines", 3 | "rules": { 4 | "max-nesting-depth": [2, { "ignore": ["pseudo-classes"] }], 5 | "order/properties-alphabetical-order": null 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notion+ Mark Manager 2 | 3 | > Manage your colored texts and comments efficiently in [Notion](https://www.notion.so/). 4 | 5 | ![Chrome Web Store version](https://img.shields.io/chrome-web-store/v/hipgmnlpnimedfepbfbfiaobohhffcfc?style=plastic) 6 | ![Mozilla Add-on](https://img.shields.io/amo/v/notion-mark-manager?style=plastic) 7 | ![GitHub license](https://img.shields.io/github/license/yeefun/notion-mark-manager?style=plastic) 8 | 9 | ![](./promotion/small-tile.png) 10 | 11 | ## Translation 12 | 13 | - [繁體中文](./README.zh.md) 14 | 15 | ## Installation 16 | 17 | - Get the [Chrome Extension](https://chrome.google.com/webstore/detail/notion%20-mark-manager/hipgmnlpnimedfepbfbfiaobohhffcfc) ![Chrome Web Store users](https://img.shields.io/chrome-web-store/users/hipgmnlpnimedfepbfbfiaobohhffcfc?style=plastic) 18 | - Get the [Firefox Add-On](https://addons.mozilla.org/addon/notion-mark-manager/) ![Mozilla Add-on](https://img.shields.io/amo/users/notion-mark-manager?style=plastic) ![Mozilla Add-on](https://img.shields.io/amo/stars/notion-mark-manager?style=plastic) 19 | 20 | ## Intro 21 | 22 | 📹 [Demo Video](https://youtu.be/XRHQ2zVmziI) 23 | 24 | Notion's colored text and comment are multifunctional tools, capable of highlighting texts, taking notes, leaving a message, etc. However, these marks are difficult to organize and file. 25 | 26 | How to use and organize these marks more efficiently? Mark Manager is the best solution: 27 | 28 | ### IMPORT ALL MARKS WITH ONE CLICK. 29 | 30 | ![](./promotion/import.gif) 31 | 32 | All you need is a simple click. Just hit the icon of Mark Manager at the top-right corner while using a Notion page, and Mark Manager will instantly import all the colored texts and comments, orderly sorting them into categories according to their colors. 33 | 34 | ### SCROLL TO THE CONTEXT OF MARKS. 35 | 36 | ![](./promotion/scroll.gif) 37 | 38 | If you click one of the marks on Mark Manager, the Notion page will automatically scroll to the context of this mark. If the mark is a comment, the Notion page will not only scroll but also show the comment. 39 | 40 | ### EXPORT MULTIPLE MARKS QUICKLY. 41 | 42 | ![](./promotion/export.gif) 43 | 44 | If you want to use the marks elsewhere, don’t bother selecting, copying, and pasting them one by one—Mark Manager can help you copy or download to export multiple marks at the same time. 45 | 46 | ### FILTER THE MARKS AS YOU WISH. 47 | 48 | ![](./promotion/options.gif) 49 | 50 | If you want to review only particular colored texts, just right-click Mark Manager icon, choose “Options”, and select the colors you would like to import. 51 | 52 | ### SUPPORT DARK MODE. 53 | 54 | ![](./promotion/dark.gif) 55 | 56 | When you switch Notion to “Dark Mode”, the interface of Mark Manager will automatically shift without reloading the page. 57 | 58 | --- 59 | 60 | Now, feel free to highlight, take notes, and leave a message on Notion—Mark Manager will organize all the marks and help you find them. 61 | 62 | ## Support 63 | 64 | To develop a free, open-source extension takes a lot of effort. **Your support** will encourage me to continue upgrading the product. There are a few things you can do: 65 | 66 | - Tell your friends about it 67 | - Leave a review on the [Chrome](https://chrome.google.com/webstore/detail/notion%20-mark-manager/hipgmnlpnimedfepbfbfiaobohhffcfc) or [Firefox](https://addons.mozilla.org/addon/notion-mark-manager/) store 68 | - Give me a star on [GitHub](https://github.com/yeefun/notion-mark-manager) [![GitHub stars](https://img.shields.io/github/stars/yeefun/notion-mark-manager?style=social)](https://github.com/yeefun/notion-mark-manager/stargazers) 69 | - Report bugs or request features via [GitHub Issues](https://github.com/yeefun/notion-mark-manager/issues/new) or this [form](https://docs.google.com/forms/d/e/1FAIpQLSdc8JGkmEpyjVbut57cd4fHMJGXEk4HITjmUGYo87f4jN-4zQ/viewform?usp=sf_link) 70 | - [Donate me](https://pay.ecpay.com.tw/CreditPayment/ExpressCredit?MerchantID=3220361&Enn=e) 71 | 72 | Thank you! 🙌 73 | 74 | ## Development 75 | 76 | ### Setup 77 | 78 | After cloning the repository, install the dependencies: 79 | 80 | ```shell 81 | npm install 82 | ``` 83 | 84 | Launch the project with: 85 | 86 | ```shell 87 | # for Chrome 88 | npm run dev:c 89 | 90 | # for Firefox 91 | npm run dev:f 92 | ``` 93 | 94 | ### Build 95 | 96 | To build the extension you have to run: 97 | 98 | ```shell 99 | # for Chrome 100 | npm run build:c 101 | 102 | # for Firefox 103 | npm run build:f 104 | ``` 105 | 106 | ## License 107 | 108 | [GPL-3.0](./LICENSE) 109 | -------------------------------------------------------------------------------- /README.zh.md: -------------------------------------------------------------------------------- 1 | # Notion+ 標記管理器 2 | 3 | > 高效管理 [Notion](https://www.notion.so/) 的顏色文字與註解。 4 | 5 | ![Chrome Web Store version](https://img.shields.io/chrome-web-store/v/hipgmnlpnimedfepbfbfiaobohhffcfc?style=plastic) 6 | ![Mozilla Add-on](https://img.shields.io/amo/v/notion-mark-manager?style=plastic) 7 | ![GitHub license](https://img.shields.io/github/license/yeefun/notion-mark-manager?style=plastic) 8 | 9 | ![](./promotion/small-tile.png) 10 | 11 | ## 翻譯 12 | 13 | - [English](./README.md) 14 | 15 | ## 安裝 16 | 17 | - 獲取 [Chrome 擴充功能](https://chrome.google.com/webstore/detail/notion%20-mark-manager/hipgmnlpnimedfepbfbfiaobohhffcfc) ![Chrome Web Store users](https://img.shields.io/chrome-web-store/users/hipgmnlpnimedfepbfbfiaobohhffcfc?style=plastic) 18 | - 獲取 [Firefox 擴充套件](https://addons.mozilla.org/addon/notion-mark-manager/) ![Mozilla Add-on](https://img.shields.io/amo/users/notion-mark-manager?style=plastic) ![Mozilla Add-on](https://img.shields.io/amo/stars/notion-mark-manager?style=plastic) 19 | 20 | ## 介紹 21 | 22 | 📹 [示範影片](https://youtu.be/XRHQ2zVmziI) 23 | 24 | Notion 的顏色文字(colored text)與註解(comment)用途多樣,能劃重點、做筆記、留言……但這些標記日後卻難以查找,只淪為畫面上的點綴。 25 | 26 | 該如何更有效率地使用並管理這些標記呢?Mark Manager,是這個問題的最佳解: 27 | 28 | ### 一鍵導入頁面所有標記 29 | 30 | ![](./promotion/import.gif) 31 | 32 | 只需輕輕一點右上角的 Mark Manager 圖示,當前 Notion 頁面的顏色文字與註解,都會瞬間導入套件,分門別類、依序呈現,讓你快速獲知當頁所有重點與留言。 33 | 34 | ### 捲至標記所在段落 35 | 36 | ![](./promotion/scroll.gif) 37 | 38 | 只要點擊被導入 Mark Manager 的顏色文字或註解,Notion 頁面便會自動捲到該標記所在的段落,讓你知道它的上下文是什麼。如果你點的是註解,頁面除了捲動,還會跳出註解上的留言──是不是很方便呢? 39 | 40 | ### 快速導出多個標記 41 | 42 | ![](./promotion/export.gif) 43 | 44 | 你可能想在其它地方使用這些標記,但一個個選取、複製、貼上實在是很麻煩。Mark Manager 擁有「導出」功能,能讓你同時複製、下載多個標記。 45 | 46 | ### 選擇你想導入的標記 47 | 48 | ![](./promotion/options.gif) 49 | 50 | 你可能只想在 Mark Manager 中檢視某類顏色的文字──沒問題,對套件圖示按下右鍵,點擊「選項」,你就可以決定哪種顏色的文字該被導入套件。 51 | 52 | ### 支援夜間模式(Dark Mode) 53 | 54 | ![](./promotion/dark.gif) 55 | 56 | 如果你是夜間模式的重度用戶,別擔心,Mark Manager 通通都支援!當你切換模式,套件的介面顏色便會隨之變換,你甚至不用重新整理頁面。 57 | 58 | --- 59 | 60 | 現在,你可以放心地在 Notion 劃重點、做筆記或留言,不用再擔心這些標記會消失於茫茫字海中──因為 Mark Manager 會幫你找到它們。 61 | 62 | ## 支持 63 | 64 | 開發一個免費、開源的擴充套件需耗費許多時間與心力,**你的支持**,是我持續把產品變得更好的動力。如果你喜歡 Mark Manager,可以做以下幾件事情: 65 | 66 | - 推薦給你的朋友 67 | - 在 [Chrome](https://chrome.google.com/webstore/detail/notion%20-mark-manager/hipgmnlpnimedfepbfbfiaobohhffcfc) 或 [Firefox](https://addons.mozilla.org/addon/notion-mark-manager/) 商店留下評論 68 | - 幫我的 [GitHub repo](https://github.com/yeefun/notion-mark-manager) 打星星 [![GitHub stars](https://img.shields.io/github/stars/yeefun/notion-mark-manager?style=social)](https://github.com/yeefun/notion-mark-manager/stargazers) 69 | - 透過 [GitHub Issues](https://github.com/yeefun/notion-mark-manager/issues/new) 或[表單](https://docs.google.com/forms/d/e/1FAIpQLSdc8JGkmEpyjVbut57cd4fHMJGXEk4HITjmUGYo87f4jN-4zQ/viewform?usp=sf_link)回報錯誤、許願新功能 70 | - [贊助我](https://pay.ecpay.com.tw/CreditPayment/ExpressCredit?MerchantID=3220361) 71 | 72 | 謝謝你!🙌 73 | 74 | ## 授權條款 75 | 76 | [GPL-3.0](./LICENSE) 77 | -------------------------------------------------------------------------------- /manifest.chrome.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_name__", 3 | "short_name": "__MSG_shortName__", 4 | "default_locale": "en", 5 | "description": "__MSG_description__", 6 | "author": "Yeefun", 7 | "version": "2.1.0", 8 | "manifest_version": 2, 9 | "permissions": ["declarativeContent", "storage"], 10 | "background": { 11 | "scripts": ["js/background.js"], 12 | "persistent": false 13 | }, 14 | "icons": { 15 | "16": "icon16.png", 16 | "32": "icon32.png", 17 | "48": "icon48.png", 18 | "128": "icon128.png" 19 | }, 20 | "page_action": { 21 | "default_icon": { 22 | "16": "icon16.png", 23 | "32": "icon32.png", 24 | "48": "icon48.png", 25 | "128": "icon128.png" 26 | }, 27 | "default_title": "__MSG_shortName__", 28 | "default_popup": "popup.html" 29 | }, 30 | "content_scripts": [ 31 | { 32 | "matches": ["*://www.notion.so/*"], 33 | "js": ["js/contentscript.js"] 34 | } 35 | ], 36 | "options_ui": { 37 | "page": "options.html", 38 | "open_in_tab": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /manifest.firefox.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_name__", 3 | "short_name": "__MSG_shortName__", 4 | "default_locale": "en", 5 | "description": "__MSG_description__", 6 | "author": "Yeefun", 7 | "version": "2.1.0", 8 | "manifest_version": 2, 9 | "permissions": ["storage"], 10 | "background": { 11 | "scripts": ["js/background.js"] 12 | }, 13 | "icons": { 14 | "16": "icon16.png", 15 | "32": "icon32.png", 16 | "48": "icon48.png", 17 | "128": "icon128.png" 18 | }, 19 | "page_action": { 20 | "default_icon": { 21 | "16": "icon16.png", 22 | "32": "icon32.png", 23 | "48": "icon48.png", 24 | "128": "icon128.png" 25 | }, 26 | "default_title": "__MSG_shortName__", 27 | "default_popup": "popup.html", 28 | "show_matches": ["*://www.notion.so/*"] 29 | }, 30 | "content_scripts": [ 31 | { 32 | "matches": ["*://www.notion.so/*"], 33 | "js": ["js/contentscript.js"] 34 | } 35 | ], 36 | "options_ui": { 37 | "page": "options.html", 38 | "open_in_tab": false 39 | }, 40 | "applications": { 41 | "gecko": { 42 | "id": "{9fe40df8-7553-4091-b55a-181349add549}" 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notion-mark-manager", 3 | "version": "2.1.0", 4 | "description": "Manage your colored texts and comments efficiently in Notion.", 5 | "keywords": [ 6 | "chrome-extension", 7 | "firefox-addon", 8 | "notion", 9 | "productivity-tool" 10 | ], 11 | "author": "Yeefun Lin (https://yeefun.github.io/)", 12 | "license": "GPL", 13 | "scripts": { 14 | "predev:f": "rimraf dist && mkdir dist && cp manifest.firefox.json dist/manifest.json && cp -R static/* dist/", 15 | "dev:f": "parcel watch src/* src/**/* --no-source-maps --no-hmr", 16 | "prebuild:f": "rimraf dist", 17 | "build:f": "parcel build src/* src/**/* --no-content-hash --no-cache", 18 | "postbuild:f": "cp manifest.firefox.json dist/manifest.json && cp -R static/* dist/", 19 | "predev:c": "rimraf dist && mkdir dist && cp manifest.chrome.json dist/manifest.json && cp -R static/* dist/", 20 | "dev:c": "parcel watch src/* src/**/* --no-source-maps --no-hmr", 21 | "prebuild:c": "rimraf dist", 22 | "build:c": "parcel build src/* src/**/* --no-content-hash --no-cache", 23 | "postbuild:c": "cp manifest.chrome.json dist/manifest.json && cp -R static/* dist/", 24 | "lint": "eslint --ignore-path .gitignore .", 25 | "lints": "stylelint 'src/css/*.{css,scss}' --fix" 26 | }, 27 | "devDependencies": { 28 | "@babel/core": "^7.11.5", 29 | "@babel/plugin-transform-runtime": "^7.11.5", 30 | "eslint": "^7.7.0", 31 | "eslint-config-prettier": "^6.11.0", 32 | "husky": "^4.2.5", 33 | "parcel-bundler": "^1.12.4", 34 | "prettier": "2.0.5", 35 | "pretty-quick": "^3.0.0", 36 | "pug": "^3.0.0", 37 | "rimraf": "^3.0.2", 38 | "sass": "^1.26.10", 39 | "stylelint": "^13.6.1", 40 | "stylelint-config-sass-guidelines": "^7.0.0" 41 | }, 42 | "engines": { 43 | "node": ">= 12" 44 | }, 45 | "husky": { 46 | "hooks": { 47 | "pre-commit": "pretty-quick --staged --pattern 'src/js/**/*.js'" 48 | } 49 | }, 50 | "dependencies": { 51 | "clipboard": "^2.0.6", 52 | "fea": "^1.1.0", 53 | "feature": "^1.1.0", 54 | "file-saver": "^2.0.2" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /promotion/dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/dark.gif -------------------------------------------------------------------------------- /promotion/export.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/export.gif -------------------------------------------------------------------------------- /promotion/import.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/import.gif -------------------------------------------------------------------------------- /promotion/options.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/options.gif -------------------------------------------------------------------------------- /promotion/scroll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/scroll.gif -------------------------------------------------------------------------------- /promotion/small-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/promotion/small-tile.png -------------------------------------------------------------------------------- /src/assets/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/src/assets/me.jpg -------------------------------------------------------------------------------- /src/css/button.scss: -------------------------------------------------------------------------------- 1 | button { 2 | cursor: pointer; 3 | user-select: none; 4 | transition: background-color 20ms ease-in; 5 | background-color: transparent; 6 | height: 32px; 7 | border-radius: 3px; 8 | font-size: 14px; 9 | border: 0; 10 | outline: 0; 11 | line-height: 1.2; 12 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 13 | 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; 14 | 15 | &.primary { 16 | background-color: rgb(46, 170, 220); 17 | color: #fff; 18 | padding-left: 12px; 19 | padding-right: 12px; 20 | font-weight: 500; 21 | box-shadow: inset 0 0 0 1px rgba(15, 15, 15, 0.1), 22 | 0 1px 2px rgba(15, 15, 15, 0.1); 23 | 24 | &:hover { 25 | background-color: rgb(6, 156, 205); 26 | } 27 | 28 | &:active { 29 | background-color: rgb(0, 141, 190); 30 | } 31 | } 32 | 33 | &.secondary { 34 | padding-left: 12px; 35 | padding-right: 12px; 36 | border: 1px solid rgba(55, 53, 47, 0.16); 37 | color: rgb(55, 53, 47); 38 | 39 | &:hover { 40 | background-color: rgba(55, 53, 47, 0.08); 41 | } 42 | 43 | &:active { 44 | background-color: rgba(55, 53, 47, 0.16); 45 | } 46 | } 47 | } 48 | 49 | .dark { 50 | button { 51 | &.primary { 52 | box-shadow: inset 0 0 0 1px rgba(15, 15, 15, 0.2), 0 1px 2px rgba(15, 15, 15, 0.1); 53 | } 54 | 55 | &.secondary { 56 | border-color: rgba(#fff, 0.14); 57 | color: rgba(#fff, 0.9); 58 | 59 | &:hover { 60 | background-color: rgb(71, 76, 80); 61 | } 62 | 63 | &:active { 64 | background-color: rgb(63, 68, 71); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/css/checkbox.scss: -------------------------------------------------------------------------------- 1 | label { 2 | cursor: pointer; 3 | user-select: none; 4 | 5 | > div { 6 | transition: background-color 200ms ease-out; 7 | } 8 | 9 | &:hover .checkbox { 10 | background-color: rgba(55, 53, 47, 0.08); 11 | } 12 | 13 | &:active .checkbox { 14 | background-color: rgba(55, 53, 47, 0.16); 15 | } 16 | } 17 | 18 | [type='checkbox'] { 19 | display: none; 20 | 21 | &:checked + div { 22 | background-color: rgb(46, 170, 220); 23 | 24 | .unchecked-icon { 25 | display: none; 26 | } 27 | } 28 | 29 | &:not(:checked) + div .checked-icon { 30 | display: none; 31 | } 32 | } 33 | 34 | .checkbox { 35 | width: 14px; 36 | height: 14px; 37 | display: flex; 38 | align-items: center; 39 | justify-content: center; 40 | transition: background-color 120ms ease-in; 41 | } 42 | 43 | .checked-icon { 44 | width: 10px; 45 | height: 10px; 46 | fill: #fff; 47 | } 48 | 49 | .unchecked-icon { 50 | width: 14px; 51 | height: 14px; 52 | } 53 | 54 | .dark { 55 | label { 56 | &:hover .checkbox { 57 | background-color: rgb(71, 76, 80); 58 | } 59 | 60 | &:active .checkbox { 61 | background-color: rgb(63, 68, 71); 62 | } 63 | } 64 | 65 | .unchecked-icon { 66 | fill: rgba(#fff, 0.9); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/css/options.scss: -------------------------------------------------------------------------------- 1 | @import './reset'; 2 | @import './title'; 3 | @import './checkbox'; 4 | @import './radio'; 5 | @import './button'; 6 | 7 | body { 8 | font-size: 14px; 9 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 10 | 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; 11 | color: rgb(55, 53, 47); 12 | line-height: 1.25; 13 | } 14 | 15 | form { 16 | padding: 0 16px 18px; 17 | } 18 | 19 | fieldset { 20 | margin-right: 0; 21 | margin-left: 0; 22 | padding: 0; 23 | border: 0; 24 | margin-bottom: 24px; 25 | 26 | > div + div { 27 | margin-top: 16px; 28 | } 29 | } 30 | 31 | legend { 32 | font-size: 16px; 33 | padding-left: 0; 34 | padding-right: 0; 35 | font-weight: 500; 36 | margin-bottom: 8px; 37 | 38 | &.text-colors { 39 | margin-bottom: 10px; 40 | } 41 | } 42 | 43 | [type='radio'] { 44 | margin-right: 6px; 45 | } 46 | 47 | label { 48 | display: flex; 49 | align-items: center; 50 | width: fit-content; 51 | 52 | > div { 53 | margin-right: 8px; 54 | } 55 | } 56 | 57 | h5 { 58 | margin-bottom: 6px; 59 | } 60 | 61 | .options-wrapper { 62 | display: flex; 63 | padding-right: 0.8px; 64 | padding-left: 0.8px; 65 | flex-wrap: wrap; 66 | 67 | > div { 68 | flex-basis: calc(100% / 3); 69 | 70 | &:nth-child(-n + 3) { 71 | margin-top: 0; 72 | } 73 | } 74 | 75 | &--text-colors { 76 | > div { 77 | margin-top: 4px; 78 | } 79 | 80 | span { 81 | text-transform: capitalize; 82 | } 83 | } 84 | 85 | &--either-or > div:last-child { 86 | flex-basis: calc(100% / 3 * 2); 87 | } 88 | } 89 | 90 | .save-wrapper { 91 | display: flex; 92 | align-items: center; 93 | } 94 | 95 | .form-status { 96 | color: rgba(55, 53, 47, 0.6); 97 | font-size: 14px; 98 | margin-left: 10px; 99 | } 100 | -------------------------------------------------------------------------------- /src/css/popup.scss: -------------------------------------------------------------------------------- 1 | @import './reset'; 2 | @import './checkbox'; 3 | @import './button'; 4 | 5 | $font-colors-light: ( 6 | 'gray': rgb(155, 154, 151), 7 | 'brown': rgb(100, 71, 58), 8 | 'orange': rgb(217, 115, 13), 9 | 'yellow': rgb(223, 171, 1), 10 | 'green': rgb(15, 123, 108), 11 | 'blue': rgb(11, 110, 153), 12 | 'purple': rgb(105, 64, 165), 13 | 'pink': rgb(173, 26, 114), 14 | 'red': rgb(224, 62, 62), 15 | ); 16 | $background-colors-light: ( 17 | 'gray': rgb(235, 236, 237), 18 | 'brown': rgb(233, 229, 227), 19 | 'orange': rgb(250, 235, 221), 20 | 'yellow': rgb(251, 243, 219), 21 | 'green': rgb(221, 237, 234), 22 | 'blue': rgb(221, 235, 241), 23 | 'purple': rgb(234, 228, 242), 24 | 'pink': rgb(244, 223, 235), 25 | 'red': rgb(251, 228, 228), 26 | ); 27 | $font-colors-dark: ( 28 | 'gray': rgba(151, 154, 155, 0.95), 29 | 'brown': rgb(147, 114, 100), 30 | 'orange': rgb(255, 163, 68), 31 | 'yellow': rgb(255, 220, 73), 32 | 'green': rgb(77, 171, 154), 33 | 'blue': rgb(82, 156, 202), 34 | 'purple': rgb(154, 109, 215), 35 | 'pink': rgb(226, 85, 161), 36 | 'red': rgb(255, 115, 105), 37 | ); 38 | $background-colors-dark: ( 39 | 'gray': rgb(69, 75, 78), 40 | 'brown': rgb(67, 64, 64), 41 | 'orange': rgb(89, 74, 58), 42 | 'yellow': rgb(89, 86, 59), 43 | 'green': rgb(53, 76, 75), 44 | 'blue': rgb(54, 73, 84), 45 | 'purple': rgb(68, 63, 87), 46 | 'pink': rgb(83, 59, 76), 47 | 'red': rgb(89, 65, 65), 48 | ); 49 | 50 | @mixin colored-text-color($type, $color, $value) { 51 | @if $type == 'font' { 52 | .font-#{$color} { 53 | color: $value !important; 54 | 55 | span { 56 | color: $value; 57 | } 58 | } 59 | } @else { 60 | .background-#{$color} { 61 | background-color: $value; 62 | color: inherit; 63 | } 64 | } 65 | } 66 | 67 | *::selection { 68 | background-color: rgba(45, 170, 219, 0.3); 69 | } 70 | 71 | body { 72 | max-width: 300px; 73 | width: 300px; 74 | // to solve horizontal overflow for Firefox 75 | overflow-y: scroll; 76 | 77 | font-size: 14px; 78 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 79 | 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; 80 | color: rgb(55, 53, 47); 81 | line-height: 1.25; 82 | padding-top: 43px; 83 | padding-bottom: 43px; 84 | 85 | &.dark { 86 | background-color: rgb(47, 52, 55); 87 | color: rgba(#fff, 0.9); 88 | } 89 | 90 | &.exported { 91 | max-width: 338px; 92 | width: 338px; 93 | padding-bottom: 104px; 94 | 95 | #blocks label { 96 | display: flex; 97 | } 98 | 99 | #menu ul { 100 | display: none; 101 | } 102 | 103 | .exporter-container { 104 | display: block; 105 | } 106 | 107 | &.menu #support { 108 | bottom: 120px; 109 | } 110 | } 111 | 112 | &.menu { 113 | #menu { 114 | display: block; 115 | } 116 | 117 | #support { 118 | bottom: 59px; 119 | } 120 | } 121 | 122 | &.zh { 123 | #support-info { 124 | font-size: 15px; 125 | 126 | .me { 127 | margin-right: 10px; 128 | } 129 | } 130 | } 131 | } 132 | 133 | nav { 134 | position: fixed; 135 | top: 0; 136 | left: 0; 137 | width: 100%; 138 | background-color: #fff; 139 | z-index: 99; 140 | box-shadow: 0 1px 0 rgba(55, 53, 47, 0.09); 141 | transform: translateY(-100%); 142 | opacity: 0; 143 | transition: all 200ms ease-out; 144 | 145 | ul { 146 | display: flex; 147 | } 148 | 149 | .tab { 150 | width: 50%; 151 | text-align: center; 152 | font-size: 16px; 153 | line-height: 42px; 154 | transition: background-color 120ms ease-in; 155 | cursor: pointer; 156 | user-select: none; 157 | 158 | &:hover, 159 | &.active { 160 | background-color: rgba(55, 53, 47, 0.08); 161 | } 162 | 163 | &:active { 164 | background-color: rgba(55, 53, 47, 0.16); 165 | } 166 | } 167 | 168 | &.shown { 169 | opacity: 1; 170 | transform: translateY(0); 171 | } 172 | } 173 | 174 | #blocks { 175 | padding: 14px 8px; 176 | line-height: 1.5; 177 | word-break: break-word; 178 | // 485 + 28 - 43 * 2 179 | min-height: 427px; 180 | box-sizing: border-box; 181 | display: flex; 182 | justify-content: center; 183 | align-items: center; 184 | 185 | > * { 186 | flex: 1 1 auto; 187 | } 188 | 189 | .wrapper { 190 | display: flex; 191 | 192 | + .wrapper { 193 | margin-top: 10px; 194 | } 195 | } 196 | 197 | label { 198 | align-items: center; 199 | padding-right: 16px; 200 | padding-left: 8px; 201 | display: none; 202 | flex: 0 0 auto; 203 | } 204 | } 205 | 206 | #colored-texts-container, 207 | #comments-container { 208 | display: none; 209 | align-self: flex-start; 210 | 211 | &.shown { 212 | display: block; 213 | } 214 | } 215 | 216 | #comments-container { 217 | [style*='rgb(255, 212, 0)'], 218 | [style*='rgb(255,212,0)'] { 219 | color: rgb(55, 53, 47); 220 | } 221 | } 222 | 223 | .block { 224 | padding: 6px 8px; 225 | transition: all 60ms ease-in; 226 | border-radius: 3px; 227 | cursor: pointer; 228 | flex: 1 1 auto; 229 | 230 | &:hover, 231 | &.focused { 232 | box-shadow: 0 0 16px 1px rgba(55, 53, 47, 0.16); 233 | } 234 | 235 | &:active { 236 | box-shadow: 0 0 16px 1px rgba(55, 53, 47, 0.32); 237 | } 238 | } 239 | 240 | .light { 241 | @each $color, $value in $font-colors-light { 242 | @include colored-text-color('font', $color, $value); 243 | } 244 | 245 | @each $color, $value in $background-colors-light { 246 | @include colored-text-color('background', $color, $value); 247 | } 248 | } 249 | 250 | .dark { 251 | .block { 252 | color: rgb(71, 76, 80); 253 | 254 | &:hover, 255 | &.focused { 256 | box-shadow: 0 0 16px 1px rgb(71, 76, 80); 257 | } 258 | 259 | &:hover { 260 | color: rgba(#fff, 0.9); 261 | } 262 | 263 | &:active { 264 | box-shadow: 0 0 16px 1px rgb(63, 68, 71); 265 | } 266 | } 267 | 268 | nav, 269 | #menu { 270 | background-color: rgb(47, 52, 55); 271 | 272 | .tab { 273 | &.active, 274 | &:hover { 275 | background-color: rgb(71, 76, 80); 276 | } 277 | 278 | &:active { 279 | background-color: rgb(63, 68, 71); 280 | } 281 | } 282 | } 283 | 284 | nav { 285 | box-shadow: 0 1px 0 rgba(#fff, 0.07); 286 | } 287 | 288 | #menu ul, 289 | .exporter-options, 290 | .exporter-btns { 291 | box-shadow: 0 -1px 0 rgba(#fff, 0.07); 292 | } 293 | 294 | .exporter-icon { 295 | fill: rgba(#fff, 0.9); 296 | } 297 | 298 | #status { 299 | color: rgba(#fff, 0.6); 300 | } 301 | 302 | #support { 303 | background-color: rgb(80, 85, 88); 304 | box-shadow: rgba(15, 15, 15, 0.2) 0 0 0 1px, rgba(15, 15, 15, 0.2) 0 2px 4px; 305 | 306 | svg { 307 | fill: rgba(#fff, 0.9); 308 | } 309 | 310 | &:hover { 311 | background-color: rgb(98, 102, 104); 312 | } 313 | 314 | &:active { 315 | background-color: rgb(120, 123, 123); 316 | } 317 | } 318 | 319 | #support-info { 320 | .wrapper { 321 | background-color: rgb(47, 52, 55); 322 | box-shadow: rgba(15, 15, 15, 0.1) 0 0 0 1px, 323 | rgba(15, 15, 15, 0.2) 0 5px 10px, rgba(15, 15, 15, 0.4) 0 15px 40px; 324 | } 325 | 326 | a { 327 | border-bottom-color: rgba(#fff, 0.4); 328 | color: rgba(#fff, 0.9); 329 | 330 | &:hover { 331 | border-bottom-color: rgba(#fff, 0.9); 332 | } 333 | } 334 | } 335 | 336 | #prompt { 337 | color: rgba(#fff, 0.4); 338 | } 339 | 340 | #comments-container { 341 | [style*='rgb(255, 212, 0)'], 342 | [style*='rgb(255,212,0)'] { 343 | color: rgba(255, 255, 255, 0.9); 344 | } 345 | } 346 | 347 | @each $color, $value in $font-colors-dark { 348 | @include colored-text-color('font', $color, $value); 349 | } 350 | 351 | @each $color, $value in $background-colors-dark { 352 | @include colored-text-color('background', $color, $value); 353 | } 354 | } 355 | 356 | #menu { 357 | display: none; 358 | position: fixed; 359 | bottom: 0; 360 | left: 0; 361 | width: 100%; 362 | z-index: 49; 363 | background-color: #fff; 364 | 365 | ul { 366 | box-shadow: 0 -1px 0 rgba(55, 53, 47, 0.09); 367 | } 368 | 369 | .tab { 370 | display: flex; 371 | align-items: center; 372 | justify-content: center; 373 | transition: background-color 20ms ease-in; 374 | cursor: pointer; 375 | user-select: none; 376 | line-height: 42px; 377 | 378 | &:hover { 379 | background-color: rgba(55, 53, 47, 0.08); 380 | } 381 | 382 | &:active { 383 | background-color: rgba(55, 53, 47, 0.16); 384 | } 385 | 386 | svg { 387 | margin-right: 8px; 388 | } 389 | } 390 | } 391 | 392 | .exporter-container { 393 | display: none; 394 | } 395 | 396 | .exporter-options { 397 | padding: 14px 16px; 398 | box-shadow: 0 -1px 0 rgba(55, 53, 47, 0.09); 399 | display: flex; 400 | align-items: center; 401 | justify-content: space-between; 402 | 403 | label { 404 | width: fit-content; 405 | display: flex; 406 | align-items: center; 407 | flex: 0 0 auto; 408 | 409 | span { 410 | line-height: 1; 411 | margin-left: 8px; 412 | } 413 | } 414 | } 415 | 416 | #status { 417 | color: rgba(55, 53, 47, 0.6); 418 | font-size: 14px; 419 | margin-left: 10px; 420 | line-height: 1; 421 | } 422 | 423 | .exporter-btns { 424 | padding: 14px 16px; 425 | box-shadow: 0 -1px 0 rgba(55, 53, 47, 0.09); 426 | display: flex; 427 | margin-top: 1px; 428 | 429 | .secondary { 430 | margin-right: auto; 431 | } 432 | 433 | button:last-child { 434 | margin-left: 12px; 435 | } 436 | } 437 | 438 | #exporter-btns-wrapper { 439 | display: none; 440 | 441 | &.shown { 442 | display: block; 443 | } 444 | } 445 | 446 | .exporter-icon { 447 | fill: rgb(55, 53, 47); 448 | width: 16px; 449 | height: 16px; 450 | } 451 | 452 | #support { 453 | user-select: none; 454 | cursor: pointer; 455 | position: fixed; 456 | display: flex; 457 | align-items: center; 458 | justify-content: center; 459 | background-color: #fff; 460 | bottom: 16px; 461 | right: 16px; 462 | width: 36px; 463 | height: 36px; 464 | border-radius: 100%; 465 | box-shadow: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 2px 4px; 466 | z-index: 149; 467 | 468 | svg { 469 | fill: #37352f; 470 | width: 18px; 471 | height: 18px; 472 | } 473 | 474 | &:hover { 475 | background-color: rgb(239, 239, 238); 476 | } 477 | 478 | &:active { 479 | background-color: rgb(223, 223, 222); 480 | } 481 | } 482 | 483 | #support-info { 484 | top: 0; 485 | left: 0; 486 | bottom: 0; 487 | right: 0; 488 | background-color: rgba(15, 15, 15, 0); 489 | position: fixed; 490 | z-index: 499; 491 | display: flex; 492 | justify-content: center; 493 | align-items: center; 494 | line-height: 1.5; 495 | font-size: 16px; 496 | cursor: pointer; 497 | visibility: hidden; 498 | opacity: 0; 499 | transition: background-color 120ms ease-out, opacity 120ms ease-out, 500 | visibility 120ms ease-out; 501 | 502 | &.shown { 503 | opacity: 1; 504 | background-color: rgba(15, 15, 15, 0.6); 505 | visibility: visible; 506 | transition: background-color 300ms ease-out, opacity 0s, 507 | visibility 300ms ease-out; 508 | 509 | .wrapper { 510 | transform: scale(1); 511 | transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1); 512 | } 513 | } 514 | 515 | .wrapper { 516 | box-shadow: rgba(15, 15, 15, 0.05) 0 0 0 1px, 517 | rgba(15, 15, 15, 0.1) 0 5px 10px, rgba(15, 15, 15, 0.2) 0 15px 40px; 518 | border-radius: 3px; 519 | background-color: #fff; 520 | width: 100%; 521 | max-width: calc(100% - 28px); 522 | max-height: calc(100% - 28px); 523 | padding: 6px 14px; 524 | box-sizing: border-box; 525 | cursor: auto; 526 | transform: scale(0.9); 527 | transition: transform 120ms ease-out; 528 | overflow-y: auto; 529 | 530 | > div { 531 | margin-top: 1px; 532 | margin-bottom: 1px; 533 | 534 | &:last-child { 535 | margin-top: 7px; 536 | } 537 | } 538 | 539 | .intro { 540 | display: flex; 541 | align-items: center; 542 | font-size: 13.5px; 543 | margin-top: 4px; 544 | margin-bottom: 6px; 545 | 546 | div { 547 | transform: translateY(1px); 548 | } 549 | } 550 | } 551 | 552 | .me { 553 | width: 48px; 554 | height: auto; 555 | margin-right: 8px; 556 | opacity: 0.86; 557 | border-radius: 50%; 558 | flex-shrink: 0; 559 | } 560 | 561 | a { 562 | cursor: pointer; 563 | border-bottom: 0.05em solid rgba(55, 53, 47, 0.4); 564 | opacity: 0.7; 565 | transition: border-color 100ms ease-in, opacity 100ms ease-in; 566 | text-decoration: none; 567 | color: rgb(55, 53, 47); 568 | 569 | &:hover { 570 | opacity: 1; 571 | border-bottom-color: rgb(55, 53, 47); 572 | } 573 | } 574 | } 575 | 576 | strong { 577 | font-weight: 600; 578 | } 579 | 580 | .text { 581 | padding: 3px 2px; 582 | } 583 | 584 | .bulleted-list { 585 | display: flex; 586 | align-items: flex-start; 587 | padding-left: 2px; 588 | 589 | .text { 590 | flex: 1 1 0; 591 | } 592 | } 593 | 594 | .bullet { 595 | margin-right: 2px; 596 | width: 24px; 597 | display: flex; 598 | align-items: center; 599 | justify-content: center; 600 | flex-grow: 0; 601 | flex-shrink: 0; 602 | min-height: calc(1.5em + 6px); 603 | 604 | div { 605 | font-size: 1.5em; 606 | line-height: 1; 607 | margin-bottom: 0.1em; 608 | } 609 | } 610 | 611 | #loading-spinner { 612 | display: none; 613 | opacity: 0.5; 614 | width: 1.375em; 615 | height: 1.375em; 616 | animation: rotate 1000ms linear infinite; 617 | 618 | &.shown { 619 | display: block; 620 | } 621 | } 622 | 623 | @keyframes rotate { 624 | 0% { 625 | transform: rotate(0); 626 | } 627 | 628 | 100% { 629 | transform: rotate(360deg); 630 | } 631 | } 632 | 633 | #prompt { 634 | display: none; 635 | width: 100%; 636 | font-size: 30px; 637 | padding-left: 8px; 638 | padding-right: 8px; 639 | line-height: 1.3; 640 | text-align: center; 641 | color: rgba(55, 53, 47, 0.4); 642 | 643 | &.shown { 644 | display: block; 645 | } 646 | } 647 | -------------------------------------------------------------------------------- /src/css/radio.scss: -------------------------------------------------------------------------------- 1 | [type='radio'] { 2 | cursor: pointer; 3 | outline: none; 4 | -webkit-appearance: none; 5 | width: 16px; 6 | height: 16px; 7 | border: 1px solid #000; 8 | margin-top: 0; 9 | margin-left: 0; 10 | border-radius: 50%; 11 | transition: all 120ms ease-in; 12 | display: flex; 13 | align-items: center; 14 | justify-content: center; 15 | 16 | &::after { 17 | content: ''; 18 | display: block; 19 | width: 8px; 20 | height: 8px; 21 | background-color: rgb(46, 170, 220); 22 | border-radius: 50%; 23 | transform: scale(0); 24 | transition: transform 120ms ease-in; 25 | } 26 | 27 | &:checked { 28 | border-color: rgb(46, 170, 220); 29 | 30 | &::after { 31 | transform: scale(1); 32 | } 33 | } 34 | } 35 | 36 | label { 37 | &:hover input[type='radio'] { 38 | background-color: rgba(55, 53, 47, 0.08); 39 | } 40 | 41 | &:active input[type='radio'] { 42 | background-color: rgba(55, 53, 47, 0.16); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/css/reset.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0} -------------------------------------------------------------------------------- /src/css/title.scss: -------------------------------------------------------------------------------- 1 | h5 { 2 | font-size: 12px; 3 | text-transform: uppercase; 4 | letter-spacing: 0.6px; 5 | color: rgba(55, 53, 47, 0.6); 6 | font-weight: 500; 7 | } 8 | -------------------------------------------------------------------------------- /src/js/background.js: -------------------------------------------------------------------------------- 1 | (function init() { 2 | // Firefox doesn't support `declarativeContent`. 3 | if (!chrome.declarativeContent) { 4 | return; 5 | } 6 | 7 | chrome.runtime.onInstalled.addListener(function handleInstalled() { 8 | { 9 | // If `ruleIds` is `undefined`, all registered rules of this extension are removed. 10 | const ruleIds = undefined; 11 | chrome.declarativeContent.onPageChanged.removeRules( 12 | ruleIds, 13 | callbackWhenRulesWereRemoved 14 | ); 15 | } 16 | 17 | function callbackWhenRulesWereRemoved() { 18 | chrome.declarativeContent.onPageChanged.addRules([ 19 | { 20 | conditions: [ 21 | new chrome.declarativeContent.PageStateMatcher({ 22 | pageUrl: { hostEquals: 'www.notion.so' }, 23 | }), 24 | ], 25 | actions: [new chrome.declarativeContent.ShowPageAction()], 26 | }, 27 | ]); 28 | } 29 | }); 30 | })(); 31 | -------------------------------------------------------------------------------- /src/js/contentscript.js: -------------------------------------------------------------------------------- 1 | import { 2 | getChromeStorage, 3 | setChromeStorage, 4 | removeFalsy, 5 | } from './utils/index.js'; 6 | import { 7 | DEFAULT_COLOR_NAMES, 8 | DEFAULT_DISPLAYED_TIMES, 9 | } from './data/default-options.js'; 10 | import COLORS from './data/colors.js'; 11 | 12 | (async function init() { 13 | var notionAppInner = undefined; 14 | 15 | await (function resolveWhenNotionAppInnerExist() { 16 | return new Promise((resolve) => { 17 | var intervalId = setInterval(function detectExistNotionAppInner() { 18 | notionAppInner = document.querySelector('.notion-app-inner'); 19 | 20 | if (notionAppInner) { 21 | resolve(undefined); 22 | clearInterval(intervalId); 23 | } 24 | }, 16); 25 | }); 26 | })(); 27 | 28 | var theme = notionAppInner.classList.contains('notion-light-theme') 29 | ? 'light' 30 | : 'dark'; 31 | 32 | { 33 | const getUserOptions = getChromeStorage({ 34 | colorNames: DEFAULT_COLOR_NAMES, 35 | displayedTimes: DEFAULT_DISPLAYED_TIMES, 36 | }); 37 | const userOptions = await getUserOptions(); 38 | 39 | setUpMessageListener(userOptions); 40 | } 41 | 42 | storeCurrentTheme(theme); 43 | 44 | listenThemeChanged(); 45 | 46 | function setUpMessageListener(options) { 47 | chrome.runtime.onMessage.addListener(handleMessage); 48 | 49 | var shouldDisplayOnce = options.displayedTimes === 'once'; 50 | 51 | function handleMessage(message, sender, sendResponse) { 52 | switch (message.action) { 53 | case 'get colored texts': { 54 | const themeColors = getThemeColors(theme); 55 | const checkedColors = getCheckedColors( 56 | themeColors, 57 | options.colorNames 58 | ); 59 | 60 | sendResponse(getColoredTexts(checkedColors, shouldDisplayOnce)); 61 | break; 62 | } 63 | case 'get comments': 64 | sendResponse(getComments()); 65 | break; 66 | 67 | case 'scroll to the colored text': 68 | scrollToTheColoredText(message.blockId); 69 | break; 70 | case 'scroll to the comment': 71 | scrollToTheComment(message.blockId); 72 | break; 73 | } 74 | 75 | function getThemeColors(theme) { 76 | var coloredFonts = COLORS[theme].fonts; 77 | var coloredBackgrounds = COLORS[theme].backgrounds; 78 | 79 | return [...coloredFonts, ...coloredBackgrounds]; 80 | } 81 | 82 | function getCheckedColors(themeColors, colorNames) { 83 | return themeColors.filter(isCheckedColor); 84 | 85 | function isCheckedColor(color) { 86 | return colorNames.includes(color.name); 87 | } 88 | } 89 | } 90 | } 91 | 92 | function storeCurrentTheme(theme) { 93 | setChromeStorage({ theme }); 94 | } 95 | 96 | function listenThemeChanged() { 97 | var mutationObserver = new MutationObserver(handleMutate); 98 | 99 | mutationObserver.observe(notionAppInner, { 100 | attributes: true, 101 | }); 102 | 103 | function handleMutate(mutations) { 104 | mutations.forEach(({ attributeName, target }) => { 105 | if (attributeName != 'class') { 106 | return; 107 | } 108 | 109 | theme = target.classList.contains('notion-light-theme') 110 | ? 'light' 111 | : 'dark'; 112 | 113 | storeCurrentTheme(theme); 114 | }); 115 | } 116 | } 117 | 118 | function getColoredTexts(checkedColors, shouldDisplayOnce) { 119 | var blocks; 120 | 121 | { 122 | if (shouldDisplayOnce) { 123 | blocks = checkedColors 124 | .map(getColoredTextElem) 125 | .flatMap(constructBlock) 126 | .filter(removeFalsy) 127 | .reduce(moveBlockHavingDivWrapperForward, []) 128 | .filter(removeDuplicateBlock); 129 | } else { 130 | blocks = checkedColors 131 | .map(getColoredTextElem) 132 | .flatMap(constructBlock) 133 | .filter(removeFalsy); 134 | 135 | blocks.forEach(modifyWrapperNodeNameAndColorName); 136 | } 137 | } 138 | 139 | return blocks; 140 | 141 | function getColoredTextElem(color) { 142 | return [ 143 | Array.from( 144 | document.querySelectorAll(` 145 | [data-block-id] [style*="${color.value}"], 146 | [data-block-id] [style*="${color.value.replace(/, /g, ',')}"] 147 | `) 148 | ), 149 | color.name, 150 | ]; 151 | } 152 | 153 | function constructBlock([coloredTextElems, colorName]) { 154 | return coloredTextElems.map((coloredTextElem) => { 155 | var id; 156 | var { nodeName: wrapperNodeName } = coloredTextElem; 157 | var contentHtml; 158 | 159 | { 160 | const blockElem = coloredTextElem.closest('[data-block-id]'); 161 | ({ blockId: id } = blockElem.dataset); 162 | const contentElem = blockElem.querySelector('[contenteditable]'); 163 | 164 | if (!contentElem) { 165 | return undefined; 166 | } 167 | 168 | ({ innerHTML: contentHtml } = contentElem); 169 | } 170 | 171 | return { 172 | id, 173 | wrapperNodeName, 174 | colorName, 175 | contentHtml, 176 | }; 177 | }); 178 | } 179 | 180 | function moveBlockHavingDivWrapperForward(acc, block) { 181 | return block.wrapperNodeName === 'DIV' 182 | ? [block, ...acc] 183 | : [...acc, block]; 184 | } 185 | 186 | function removeDuplicateBlock({ id }, idx, blocks) { 187 | return blocks.findIndex(doesIdEqual) === idx; 188 | 189 | function doesIdEqual({ id: otherId }) { 190 | return id === otherId; 191 | } 192 | } 193 | 194 | function modifyWrapperNodeNameAndColorName(block, idx, blocks) { 195 | if (block.wrapperNodeName === 'DIV') { 196 | return; 197 | } 198 | 199 | { 200 | const blockHavingEqualWrapper = blocks 201 | .filter(hasDivWrapper) 202 | .find(doesIdEqual); 203 | 204 | if (blockHavingEqualWrapper === undefined) { 205 | return; 206 | } 207 | 208 | block.wrapperNodeName = 'DIV'; 209 | block.colorName = blockHavingEqualWrapper.colorName; 210 | } 211 | 212 | function doesIdEqual(blockHavingDivWrapper) { 213 | return block.id === blockHavingDivWrapper.id; 214 | } 215 | } 216 | 217 | function hasDivWrapper(block) { 218 | return block.wrapperNodeName === 'DIV'; 219 | } 220 | } 221 | 222 | function getComments() { 223 | var blocks; 224 | 225 | { 226 | const commentIconElems = document.querySelectorAll('.speechBubble'); 227 | 228 | if (commentIconElems.length === 0) { 229 | return []; 230 | } 231 | 232 | blocks = Array.from(commentIconElems) 233 | .map(getClosestBlockElem) 234 | .filter(removeDuplicate) 235 | .map(constructBlock) 236 | .filter(removeFalsy); 237 | } 238 | 239 | return blocks; 240 | 241 | function getClosestBlockElem(elem) { 242 | return elem.closest('[data-block-id]'); 243 | } 244 | 245 | function constructBlock(blockElem) { 246 | var id; 247 | var contentHtml; 248 | 249 | { 250 | const contentElem = blockElem.querySelector('[contenteditable]'); 251 | ({ blockId: id } = blockElem.dataset); 252 | 253 | if (!contentElem) { 254 | return undefined; 255 | } 256 | 257 | ({ innerHTML: contentHtml } = contentElem); 258 | } 259 | 260 | return { 261 | id, 262 | contentHtml, 263 | }; 264 | } 265 | } 266 | 267 | function scrollToTheColoredText(blockId) { 268 | document.body.click(); 269 | 270 | getBlockElem(blockId).scrollIntoView({ 271 | behavior: 'smooth', 272 | block: 'start', 273 | }); 274 | } 275 | 276 | function scrollToTheComment(blockId) { 277 | var intersectionObserver; 278 | 279 | document.body.click(); 280 | 281 | { 282 | const blockElem = getBlockElem(blockId); 283 | 284 | intersectionObserver = new IntersectionObserver(handleIntersect); 285 | 286 | intersectionObserver.observe(blockElem); 287 | 288 | blockElem.scrollIntoView({ 289 | behavior: 'smooth', 290 | block: 'start', 291 | }); 292 | } 293 | 294 | function handleIntersect([entry]) { 295 | var blockElem; 296 | 297 | { 298 | let isIntersecting; 299 | 300 | ({ target: blockElem, isIntersecting } = entry); 301 | 302 | if (!isIntersecting) { 303 | return; 304 | } 305 | } 306 | 307 | setTimeout(openComment, 90); 308 | 309 | intersectionObserver.unobserve(blockElem); 310 | 311 | function openComment() { 312 | var commentUnderlinerElem = blockElem.querySelector( 313 | '[style*="rgb(255, 212, 0)"], [style*="rgb(255,212,0)"]' 314 | ); 315 | 316 | if (commentUnderlinerElem) { 317 | commentUnderlinerElem.click(); 318 | } 319 | } 320 | } 321 | } 322 | 323 | function removeDuplicate(item, idx, arr) { 324 | return arr.indexOf(item) === idx; 325 | } 326 | 327 | function getBlockElem(id) { 328 | return document.querySelector(`[data-block-id="${id}"]`); 329 | } 330 | })(); 331 | -------------------------------------------------------------------------------- /src/js/data/colors.js: -------------------------------------------------------------------------------- 1 | const COLORS = { 2 | light: { 3 | fonts: [ 4 | { 5 | value: 'rgba(120, 119, 116, 1)', 6 | name: 'font-gray', 7 | }, 8 | { 9 | value: 'rgba(159, 107, 83, 1)', 10 | name: 'font-brown', 11 | }, 12 | { 13 | value: 'rgba(217, 115, 13, 1)', 14 | name: 'font-orange', 15 | }, 16 | { 17 | value: 'rgba(203, 145, 47, 1)', 18 | name: 'font-yellow', 19 | }, 20 | { 21 | value: 'rgba(68, 131, 97, 1)', 22 | name: 'font-green', 23 | }, 24 | { 25 | value: 'rgba(51, 126, 169, 1)', 26 | name: 'font-blue', 27 | }, 28 | { 29 | value: 'rgba(144, 101, 176, 1)', 30 | name: 'font-purple', 31 | }, 32 | { 33 | value: 'rgba(193, 76, 138, 1)', 34 | name: 'font-pink', 35 | }, 36 | { 37 | value: 'rgba(212, 76, 71, 1)', 38 | name: 'font-red', 39 | }, 40 | ], 41 | backgrounds: [ 42 | { 43 | value: 'rgba(241, 241, 239, 1)', 44 | name: 'background-gray', 45 | }, 46 | { 47 | value: 'rgba(244, 238, 238, 1)', 48 | name: 'background-brown', 49 | }, 50 | { 51 | value: 'rgba(251, 236, 221, 1)', 52 | name: 'background-orange', 53 | }, 54 | { 55 | value: 'rgba(251, 243, 219, 1)', 56 | name: 'background-yellow', 57 | }, 58 | { 59 | value: 'rgba(237, 243, 236, 1)', 60 | name: 'background-green', 61 | }, 62 | { 63 | value: 'rgba(231, 243, 248, 1)', 64 | name: 'background-blue', 65 | }, 66 | { 67 | value: 'rgba(244, 240, 247, 0.8)', 68 | name: 'background-purple', 69 | }, 70 | { 71 | value: 'rgba(249, 238, 243, 0.8)', 72 | name: 'background-pink', 73 | }, 74 | { 75 | value: 'rgba(253, 235, 236, 1)', 76 | name: 'background-red', 77 | }, 78 | ], 79 | }, 80 | dark: { 81 | fonts: [ 82 | { 83 | value: 'rgba(159, 164, 169, 1)', 84 | name: 'font-gray', 85 | }, 86 | { 87 | value: 'rgba(212, 150, 117, 1)', 88 | name: 'font-brown', 89 | }, 90 | { 91 | value: 'rgba(217, 133, 56, 1)', 92 | name: 'font-orange', 93 | }, 94 | { 95 | value: 'rgba(201, 145, 38, 1)', 96 | name: 'font-yellow', 97 | }, 98 | { 99 | value: 'rgba(113, 178, 131, 1)', 100 | name: 'font-green', 101 | }, 102 | { 103 | value: 'rgba(102, 170, 218, 1)', 104 | name: 'font-blue', 105 | }, 106 | { 107 | value: 'rgba(176, 152, 217, 1)', 108 | name: 'font-purple', 109 | }, 110 | { 111 | value: 'rgba(223, 132, 209, 1)', 112 | name: 'font-pink', 113 | }, 114 | { 115 | value: 'rgba(234, 135, 140, 1)', 116 | name: 'font-red', 117 | }, 118 | ], 119 | backgrounds: [ 120 | { 121 | value: 'rgba(60, 65, 68, 1)', 122 | name: 'background-gray', 123 | }, 124 | { 125 | value: 'rgba(76, 61, 53, 1)', 126 | name: 'background-brown', 127 | }, 128 | { 129 | value: 'rgba(85, 59, 41, 1)', 130 | name: 'background-orange', 131 | }, 132 | { 133 | value: 'rgba(79, 64, 41, 1)', 134 | name: 'background-yellow', 135 | }, 136 | { 137 | value: 'rgba(46, 68, 58, 1)', 138 | name: 'background-green', 139 | }, 140 | { 141 | value: 'rgba(45, 66, 86, 1)', 142 | name: 'background-blue', 143 | }, 144 | { 145 | value: 'rgba(69, 58, 91, 1)', 146 | name: 'background-purple', 147 | }, 148 | { 149 | value: 'rgba(81, 56, 77, 1)', 150 | name: 'background-pink', 151 | }, 152 | { 153 | value: 'rgba(94, 52, 54, 1)', 154 | name: 'background-red', 155 | }, 156 | ], 157 | }, 158 | }; 159 | 160 | export default COLORS; 161 | -------------------------------------------------------------------------------- /src/js/data/default-options.js: -------------------------------------------------------------------------------- 1 | const DEFAULT_OPTIONS = { 2 | colorNames: [ 3 | 'font-gray', 4 | 'font-brown', 5 | 'font-orange', 6 | 'font-yellow', 7 | 'font-green', 8 | 'font-blue', 9 | 'font-purple', 10 | 'font-pink', 11 | 'font-red', 12 | 'background-gray', 13 | 'background-brown', 14 | 'background-orange', 15 | 'background-yellow', 16 | 'background-green', 17 | 'background-blue', 18 | 'background-purple', 19 | 'background-pink', 20 | 'background-red', 21 | ], 22 | tabActivatedFirst: 'colored-texts', 23 | displayedTimes: 'once', 24 | }; 25 | 26 | const DEFAULT_COLOR_NAMES = DEFAULT_OPTIONS.colorNames; 27 | const DEFAULT_TAB_ACTIVATED_FIRST = DEFAULT_OPTIONS.tabActivatedFirst; 28 | const DEFAULT_DISPLAYED_TIMES = DEFAULT_OPTIONS.displayedTimes; 29 | 30 | export { 31 | DEFAULT_OPTIONS as default, 32 | DEFAULT_COLOR_NAMES, 33 | DEFAULT_TAB_ACTIVATED_FIRST, 34 | DEFAULT_DISPLAYED_TIMES, 35 | }; 36 | -------------------------------------------------------------------------------- /src/js/feature/menu.js: -------------------------------------------------------------------------------- 1 | import Clipboard from 'clipboard'; 2 | import { saveAs } from 'file-saver'; 3 | 4 | import nav from '../store/nav.js'; 5 | import { removeFalsy } from '../utils/index.js'; 6 | 7 | var inputsBlock = { 8 | 'colored-texts': undefined, 9 | comments: undefined, 10 | }; 11 | var btnsWrapper = document.getElementById('exporter-btns-wrapper'); 12 | var inputSelectAll = document.getElementById('select-all'); 13 | var status = document.getElementById('status'); 14 | var totalCheckedBlocks = { 15 | 'colored-texts': 0, 16 | comments: 0, 17 | }; 18 | 19 | function listenTabClicked() { 20 | document 21 | .querySelector('#menu .tab') 22 | .addEventListener('click', function handleClickTab() { 23 | document.body.classList.add('exported'); 24 | }); 25 | } 26 | 27 | function listenInputsBlockClicked() { 28 | document 29 | .getElementById('blocks') 30 | .addEventListener('click', function handleClick(evt) { 31 | if (evt.target.nodeName !== 'INPUT') { 32 | return; 33 | } 34 | 35 | if (evt.target.checked) { 36 | totalCheckedBlocks[nav.state.tab] += 1; 37 | 38 | if (!btnsWrapper.classList.contains('shown')) { 39 | btnsWrapper.classList.add('shown'); 40 | } 41 | 42 | { 43 | const currentInputsBlock = getCurrentInputsBlock(); 44 | const areAllBlocksChecked = 45 | totalCheckedBlocks[nav.state.tab] === currentInputsBlock.length; 46 | 47 | if (areAllBlocksChecked) { 48 | inputSelectAll.checked = true; 49 | } 50 | } 51 | } else { 52 | totalCheckedBlocks[nav.state.tab] -= 1; 53 | 54 | { 55 | const areNoBlocksChecked = totalCheckedBlocks[nav.state.tab] === 0; 56 | 57 | if (areNoBlocksChecked) { 58 | btnsWrapper.classList.remove('shown'); 59 | } 60 | } 61 | 62 | inputSelectAll.checked = false; 63 | } 64 | }); 65 | } 66 | 67 | const exporter = (function createExporter() { 68 | return { 69 | listenOptionsClicked, 70 | listenBtnsClicked, 71 | }; 72 | 73 | function listenOptionsClicked() { 74 | inputSelectAll.addEventListener('change', function handleSelectAll() { 75 | var currentInputsBlock = getCurrentInputsBlock(); 76 | 77 | currentInputsBlock.forEach(function toggleInput(input) { 78 | input.checked = inputSelectAll.checked; 79 | }); 80 | 81 | if (inputSelectAll.checked) { 82 | btnsWrapper.classList.add('shown'); 83 | 84 | totalCheckedBlocks[nav.state.tab] = currentInputsBlock.length; 85 | } else { 86 | btnsWrapper.classList.remove('shown'); 87 | 88 | totalCheckedBlocks[nav.state.tab] = 0; 89 | } 90 | }); 91 | } 92 | 93 | function listenBtnsClicked() { 94 | listenCancelClicked(); 95 | listenCopyClicked(); 96 | listenDownloadClicked(); 97 | } 98 | 99 | function listenCancelClicked() { 100 | document 101 | .getElementById('cancel') 102 | .addEventListener('click', function handleCancel() { 103 | document.body.classList.remove('exported'); 104 | 105 | reset(); 106 | }); 107 | 108 | function reset() { 109 | totalCheckedBlocks['colored-texts'] = 0; 110 | totalCheckedBlocks.comments = 0; 111 | 112 | getAllInputsBlock().forEach(function uncheck(input) { 113 | input.checked = false; 114 | }); 115 | 116 | inputSelectAll.checked = false; 117 | 118 | btnsWrapper.classList.remove('shown'); 119 | } 120 | 121 | function getAllInputsBlock() { 122 | return Object.values(inputsBlock) 123 | .filter(removeFalsy) 124 | .map(unary(Array.from)) 125 | .flat(); 126 | 127 | function unary(func) { 128 | return function onlyOneArg(arg) { 129 | return func(arg); 130 | }; 131 | } 132 | } 133 | } 134 | 135 | function listenCopyClicked() { 136 | var clipboard = new Clipboard('#copy', { 137 | text: getCheckedBlocksText, 138 | }); 139 | 140 | clipboard.on('success', function showStatus() { 141 | setStatus(chrome.i18n.getMessage('exportStatusCopy')); 142 | setTimeout(clearStatus, 1500); 143 | }); 144 | } 145 | 146 | function listenDownloadClicked() { 147 | document 148 | .getElementById('download') 149 | .addEventListener('click', function handleDownload() { 150 | var blob = new Blob([getCheckedBlocksText()], { 151 | type: 'text/plain;charset=utf-8', 152 | }); 153 | 154 | saveAs(blob, 'nmm-export.txt'); 155 | 156 | setStatus(chrome.i18n.getMessage('exportStatusDownload')); 157 | setTimeout(clearStatus, 1500); 158 | }); 159 | } 160 | 161 | function getCheckedBlocksText() { 162 | const inputsBlockChecked = Array.from( 163 | document.querySelectorAll(`#${nav.state.tab}-container input:checked`) 164 | ); 165 | 166 | return inputsBlockChecked 167 | .map(getClosestWrapperElem) 168 | .map(extractText) 169 | .join('\n\r'); 170 | 171 | function getClosestWrapperElem(elem) { 172 | return elem.closest('.wrapper'); 173 | } 174 | 175 | function extractText(elem) { 176 | return elem.innerText; 177 | } 178 | } 179 | 180 | function setStatus(content) { 181 | status.textContent = content; 182 | } 183 | 184 | function clearStatus() { 185 | setStatus(''); 186 | } 187 | })(); 188 | 189 | function changeInputSelectAll() { 190 | var currentInputsBlock = getCurrentInputsBlock(); 191 | 192 | inputSelectAll.checked = 193 | totalCheckedBlocks[nav.state.tab] === currentInputsBlock.length; 194 | } 195 | 196 | function hide() { 197 | document.body.classList.remove('menu'); 198 | } 199 | 200 | function show() { 201 | document.body.classList.add('menu'); 202 | } 203 | 204 | function getCurrentInputsBlock() { 205 | if (inputsBlock[nav.state.tab] === undefined) { 206 | return (inputsBlock[nav.state.tab] = document.querySelectorAll( 207 | `#${nav.state.tab}-container input` 208 | )); 209 | } 210 | 211 | return inputsBlock[nav.state.tab]; 212 | } 213 | 214 | export default { 215 | listenTabClicked, 216 | listenInputsBlockClicked, 217 | show, 218 | hide, 219 | exporter, 220 | changeInputSelectAll, 221 | }; 222 | -------------------------------------------------------------------------------- /src/js/options.js: -------------------------------------------------------------------------------- 1 | import { getChromeStorage, setChromeStorage } from './utils/index.js'; 2 | import DEFAULT_OPTIONS from './data/default-options.js'; 3 | 4 | document.addEventListener('DOMContentLoaded', async () => { 5 | const getOptions = getChromeStorage(DEFAULT_OPTIONS); 6 | 7 | var currentOptions = await getOptions(); 8 | 9 | checkInputs(); 10 | 11 | listenOptionsSaved(); 12 | 13 | function checkInputs() { 14 | var { colorNames, tabActivatedFirst, displayedTimes } = currentOptions; 15 | 16 | [...colorNames, tabActivatedFirst, displayedTimes].forEach(checkInput); 17 | 18 | function checkInput(id) { 19 | document.getElementById(id).checked = true; 20 | } 21 | } 22 | 23 | function listenOptionsSaved() { 24 | document.getElementById('form').addEventListener('submit', handleSubmit); 25 | 26 | async function handleSubmit(evt) { 27 | evt.preventDefault(); 28 | 29 | var formStatusElem = document.getElementById('form-status'); 30 | 31 | var newOptions = getNewOptions(); 32 | 33 | await setOptions(newOptions); 34 | 35 | setFormStatus('Your options have been saved!'); 36 | setTimeout(clearFormStatus, 1500); 37 | 38 | currentOptions = newOptions; 39 | 40 | function getNewOptions() { 41 | var newOptions = {}; 42 | 43 | { 44 | const inputNames = ['tab', 'displayed-times', 'color-name']; 45 | 46 | [ 47 | newOptions.tabActivatedFirst, 48 | newOptions.displayedTimes, 49 | ...newOptions.colorNames 50 | ] = inputNames.flatMap(getCheckedInputs).map(extractValue); 51 | } 52 | 53 | return newOptions; 54 | 55 | function getCheckedInputs(name) { 56 | return Array.from( 57 | document.querySelectorAll(`[name="${name}"]:checked`) 58 | ); 59 | } 60 | 61 | function extractValue(input) { 62 | return input.value; 63 | } 64 | } 65 | 66 | function setOptions(options) { 67 | return setChromeStorage(options); 68 | } 69 | 70 | function setFormStatus(content) { 71 | formStatusElem.textContent = content; 72 | } 73 | 74 | function clearFormStatus() { 75 | setFormStatus(''); 76 | } 77 | } 78 | } 79 | }); 80 | -------------------------------------------------------------------------------- /src/js/popup.js: -------------------------------------------------------------------------------- 1 | import menu from './feature/menu.js'; 2 | import nav from './store/nav.js'; 3 | 4 | import { getChromeStorage, sendMessageToContentscript } from './utils/index.js'; 5 | import { DEFAULT_TAB_ACTIVATED_FIRST } from './data/default-options.js'; 6 | 7 | document.addEventListener('DOMContentLoaded', async () => { 8 | var blocks = document.getElementById('blocks'); 9 | var loadingSpinner = document.getElementById('loading-spinner'); 10 | var prompt = document.getElementById('prompt'); 11 | var emptyBlocks = document.getElementById('empty-blocks'); 12 | var coloredTextsContainer = document.getElementById( 13 | 'colored-texts-container' 14 | ); 15 | var commentsContainer = document.getElementById('comments-container'); 16 | var blocksContainers = [coloredTextsContainer, commentsContainer]; 17 | 18 | var coloredTextsHtml = ''; 19 | var commentsHtml = ''; 20 | 21 | localize(); 22 | setTheme(); 23 | 24 | await initNav(); 25 | loadBlocks(); 26 | 27 | listenBlockClicked(); 28 | listenNavTabClicked(); 29 | listenScrollToToggleNav(); 30 | listenSupportClick(); 31 | 32 | menu.listenTabClicked(); 33 | menu.listenInputsBlockClicked(); 34 | menu.exporter.listenOptionsClicked(); 35 | menu.exporter.listenBtnsClicked(); 36 | 37 | function localize() { 38 | const uiLang = chrome.i18n.getUILanguage(); 39 | if (uiLang === 'zh-TW' || uiLang === 'zh-CN') { 40 | addClassName(document.body, 'zh'); 41 | } 42 | 43 | document 44 | .querySelectorAll('[data-i18n]') 45 | .forEach(function setLocalizedString(paragraph) { 46 | setHtml(paragraph, chrome.i18n.getMessage(paragraph.dataset.i18n)); 47 | }); 48 | } 49 | 50 | async function setTheme() { 51 | var theme; 52 | 53 | { 54 | const getTheme = getChromeStorage({ theme: 'light' }); 55 | 56 | ({ theme } = await getTheme()); 57 | } 58 | 59 | addClassName(document.body, theme); 60 | } 61 | 62 | async function initNav() { 63 | await setTab(); 64 | activateTab(nav.state.tab); 65 | 66 | async function setTab() { 67 | var tabActivatedFirst; 68 | 69 | { 70 | const getTabActivatedFirst = getChromeStorage({ 71 | tabActivatedFirst: DEFAULT_TAB_ACTIVATED_FIRST, 72 | }); 73 | 74 | ({ tabActivatedFirst } = await getTabActivatedFirst()); 75 | } 76 | 77 | nav.setTab(tabActivatedFirst); 78 | } 79 | 80 | function activateTab(name) { 81 | addClassName(document.querySelector(`[data-tab="${name}"]`), 'active'); 82 | } 83 | } 84 | 85 | function listenBlockClicked() { 86 | blocks.addEventListener('click', function handleClickBlock(evt) { 87 | var action = ''; 88 | 89 | { 90 | const block = evt.target.closest('.block'); 91 | 92 | if (!block) { 93 | return; 94 | } 95 | 96 | { 97 | let blocks; 98 | 99 | { 100 | const isColoredText = block.classList.contains('colored-text'); 101 | action = isColoredText 102 | ? 'scroll to the colored text' 103 | : 'scroll to the comment'; 104 | blocks = document.querySelectorAll( 105 | isColoredText ? '.colored-text' : '.comment' 106 | ); 107 | } 108 | 109 | { 110 | let scrollToTheBlock; 111 | 112 | { 113 | const { blockId } = block.dataset; 114 | 115 | scrollToTheBlock = sendMessageToContentscript({ 116 | action, 117 | blockId, 118 | }); 119 | } 120 | 121 | scrollToTheBlock(); 122 | } 123 | 124 | focusItem(block, blocks); 125 | } 126 | } 127 | }); 128 | } 129 | 130 | async function loadBlocks() { 131 | var hasAnyBlocks = true; 132 | 133 | loading(); 134 | 135 | if (nav.state.tab === 'colored-texts') { 136 | hasAnyBlocks = await loadColoredTexts(); 137 | 138 | showBlocksContainer(coloredTextsContainer); 139 | } else { 140 | hasAnyBlocks = await loadComments(); 141 | showBlocksContainer(commentsContainer); 142 | } 143 | 144 | loaded(hasAnyBlocks); 145 | } 146 | 147 | function listenNavTabClicked() { 148 | var tabs = document.querySelectorAll('#nav .tab'); 149 | 150 | bindClickEvtListeners(tabs, async function handleClickTab() { 151 | var { tab: currentTab } = this.dataset; 152 | 153 | if (isLoading() || currentTab === nav.state.tab) { 154 | return; 155 | } 156 | 157 | { 158 | let hasAnyBlocks = true; 159 | 160 | loading(); 161 | 162 | activateItem(this, tabs); 163 | nav.setTab(currentTab); 164 | 165 | if (currentTab === 'colored-texts') { 166 | if (coloredTextsHtml === '') { 167 | hasAnyBlocks = await loadColoredTexts(); 168 | } 169 | } else { 170 | if (commentsHtml === '') { 171 | hasAnyBlocks = await loadComments(); 172 | } 173 | } 174 | 175 | showBlocksContainer( 176 | currentTab === 'colored-texts' 177 | ? coloredTextsContainer 178 | : commentsContainer 179 | ); 180 | 181 | menu.changeInputSelectAll(); 182 | 183 | loaded(hasAnyBlocks); 184 | } 185 | }); 186 | } 187 | 188 | var exportedCheckboxHtml = ` 189 | 202 | `; 203 | 204 | async function loadColoredTexts() { 205 | var response = []; 206 | 207 | { 208 | const getColoredTexts = sendMessageToContentscript({ 209 | action: 'get colored texts', 210 | }); 211 | response = (await getColoredTexts()) || []; 212 | } 213 | 214 | if (response.length === 0) { 215 | return false; 216 | } 217 | 218 | coloredTextsHtml = constructColoredTextsHtml(response); 219 | setHtml(coloredTextsContainer, coloredTextsHtml); 220 | 221 | return true; 222 | 223 | function constructColoredTextsHtml(blocks) { 224 | return blocks.map(constructColoredTextHtml).join(''); 225 | 226 | function constructColoredTextHtml({ 227 | id, 228 | wrapperNodeName, 229 | colorName, 230 | contentHtml, 231 | }) { 232 | var hasDivWrapper = wrapperNodeName === 'DIV'; 233 | 234 | return ` 235 |
236 | ${exportedCheckboxHtml} 237 |
241 | ${contentHtml} 242 |
243 |
244 | `; 245 | } 246 | } 247 | } 248 | 249 | async function loadComments() { 250 | var response = []; 251 | 252 | { 253 | const getComments = sendMessageToContentscript({ 254 | action: 'get comments', 255 | }); 256 | response = (await getComments()) || []; 257 | } 258 | 259 | if (response.length === 0) { 260 | return false; 261 | } 262 | 263 | commentsHtml = constructCommentsHtml(response); 264 | setHtml(commentsContainer, commentsHtml); 265 | 266 | return true; 267 | 268 | function constructCommentsHtml(blocks) { 269 | return blocks.map(constructCommentHtml).join(''); 270 | 271 | function constructCommentHtml({ id, contentHtml }) { 272 | return ` 273 |
274 | ${exportedCheckboxHtml} 275 |
${contentHtml}
276 |
277 | `; 278 | } 279 | } 280 | } 281 | 282 | function listenScrollToToggleNav() { 283 | var nav = document.getElementById('nav'); 284 | var beforeScrollY = window.pageYOffset; 285 | 286 | window.addEventListener('scroll', function toggleNav() { 287 | var currentScrollY = this.pageYOffset; 288 | 289 | { 290 | const delta = currentScrollY - beforeScrollY; 291 | 292 | if (delta > 0) { 293 | removeClassName(nav, 'shown'); 294 | } else { 295 | addClassName(nav, 'shown'); 296 | } 297 | } 298 | 299 | beforeScrollY = currentScrollY; 300 | }); 301 | } 302 | 303 | function listenSupportClick() { 304 | var supportInfo = document.getElementById('support-info'); 305 | 306 | document 307 | .getElementById('support') 308 | .addEventListener('click', function showSupportInfo() { 309 | addClassName(supportInfo, 'shown'); 310 | }); 311 | 312 | supportInfo.addEventListener('click', function hideSupportInfo(evt) { 313 | if (evt.target === evt.currentTarget) { 314 | removeClassName(supportInfo, 'shown'); 315 | } 316 | }); 317 | } 318 | 319 | function bindClickEvtListeners(elems, handleClick) { 320 | elems.forEach(function bindClickEvtListener(elem) { 321 | elem.addEventListener('click', handleClick); 322 | }); 323 | } 324 | 325 | function setHtml(elem, html) { 326 | elem.innerHTML = html; 327 | } 328 | 329 | function showBlocksContainer(container) { 330 | removeClassNames(blocksContainers, 'shown'); 331 | addClassName(container, 'shown'); 332 | } 333 | 334 | function activateItem(item, items) { 335 | removeClassNames(items, 'active'); 336 | addClassName(item, 'active'); 337 | } 338 | 339 | function focusItem(item, items) { 340 | removeClassNames(items, 'focused'); 341 | addClassName(item, 'focused'); 342 | } 343 | 344 | function removeClassNames(elems, className) { 345 | elems.forEach((elem) => { 346 | removeClassName(elem, className); 347 | }); 348 | } 349 | 350 | function addClassName(elem, className) { 351 | elem.classList.add(className); 352 | } 353 | 354 | function removeClassName(elem, className) { 355 | elem.classList.remove(className); 356 | } 357 | 358 | function loading() { 359 | addClassName(loadingSpinner, 'shown'); 360 | removeClassName(prompt, 'shown'); 361 | } 362 | 363 | function loaded(hasAnyBlocks = true) { 364 | removeClassName(loadingSpinner, 'shown'); 365 | 366 | if (hasAnyBlocks === true) { 367 | removeClassName(prompt, 'shown'); 368 | menu.show(); 369 | } else { 370 | addClassName(prompt, 'shown'); 371 | emptyBlocks.textContent = 372 | nav.state.tab === 'colored-texts' ? 'colored texts' : 'comments'; 373 | menu.hide(); 374 | } 375 | } 376 | 377 | function isLoading() { 378 | return loadingSpinner.classList.contains('shown'); 379 | } 380 | }); 381 | -------------------------------------------------------------------------------- /src/js/store/nav.js: -------------------------------------------------------------------------------- 1 | const state = { 2 | tab: '', 3 | }; 4 | 5 | function setTab(tab) { 6 | state.tab = tab; 7 | } 8 | 9 | export default { state, setTab }; 10 | -------------------------------------------------------------------------------- /src/js/utils/index.js: -------------------------------------------------------------------------------- 1 | export { getChromeStorage, setChromeStorage } from './storage.js'; 2 | export { sendMessageToContentscript } from './tabs.js'; 3 | 4 | export { removeFalsy }; 5 | 6 | function removeFalsy(value) { 7 | return value; 8 | } 9 | -------------------------------------------------------------------------------- /src/js/utils/storage.js: -------------------------------------------------------------------------------- 1 | export { getChromeStorage, setChromeStorage }; 2 | 3 | function getChromeStorage(keys) { 4 | return function thunk() { 5 | return new Promise((resolve) => { 6 | chrome.storage.sync.get(keys, function callback(result) { 7 | resolve(result); 8 | }); 9 | }); 10 | }; 11 | } 12 | 13 | function setChromeStorage(items = {}) { 14 | return new Promise((resolve) => { 15 | chrome.storage.sync.set(items, function callback() { 16 | resolve(undefined); 17 | }); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /src/js/utils/tabs.js: -------------------------------------------------------------------------------- 1 | export { sendMessageToContentscript }; 2 | 3 | function sendMessageToContentscript(message) { 4 | return function thunk() { 5 | return new Promise((resolve) => { 6 | chrome.tabs.query( 7 | { active: true, currentWindow: true }, 8 | function handleQueriedTabs(tabs) { 9 | chrome.tabs.sendMessage(tabs[0].id, message, function callback( 10 | response 11 | ) { 12 | resolve(response); 13 | }); 14 | } 15 | ); 16 | }); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/options.pug: -------------------------------------------------------------------------------- 1 | - var colors = ["gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"]; 2 | 3 | doctype html 4 | html(lang="en") 5 | head 6 | meta(charset="UTF-8") 7 | meta(name="viewport", content="width=device-width, initial-scale=1.0") 8 | title Notion+ Mark Manager Options 9 | link(rel="stylesheet", href="css/options.scss") 10 | 11 | body 12 | form#form 13 | fieldset 14 | legend.text-colors Choose the text colors you want to import: 15 | div 16 | h5 font color 17 | .options-wrapper.options-wrapper--text-colors 18 | each color in colors 19 | div 20 | label 21 | input(id=`font-${color}`, type="checkbox", name="color-name" value=`font-${color}`) 22 | div 23 | .checkbox 24 | svg.checked-icon(viewBox="0 0 14 14") 25 | polygon(points="5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039") 26 | svg.unchecked-icon(viewBox="0 0 16 16") 27 | path(d="M1.5,1.5 L1.5,14.5 L14.5,14.5 L14.5,1.5 L1.5,1.5 Z M0,0 L16,0 L16,16 L0,16 L0,0 Z") 28 | span= color 29 | div 30 | h5 background color 31 | .options-wrapper.options-wrapper--text-colors 32 | each color in colors 33 | div 34 | label 35 | input(id=`background-${color}`, type="checkbox", name="color-name" value=`background-${color}`) 36 | div 37 | .checkbox 38 | svg.checked-icon(viewBox="0 0 14 14") 39 | polygon(points="5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039") 40 | svg.unchecked-icon(viewBox="0 0 16 16") 41 | path(d="M1.5,1.5 L1.5,14.5 L14.5,14.5 L14.5,1.5 L1.5,1.5 Z M0,0 L16,0 L16,16 L0,16 L0,0 Z") 42 | span= color 43 | 44 | fieldset 45 | legend Choose the tab you want to show first: 46 | .options-wrapper.options-wrapper--either-or 47 | div 48 | label 49 | input#colored-texts(type="radio", name="tab", value="colored-texts") 50 | span Colored Texts 51 | div 52 | label 53 | input#comments(type="radio", name="tab", value="comments") 54 | span Comments 55 | 56 | fieldset 57 | legend If a block contains two or more text colors, display this block... 58 | .options-wrapper.options-wrapper--either-or 59 | div 60 | label 61 | input#once(type="radio", name="displayed-times", value="once") 62 | span only once 63 | div 64 | label 65 | input#more(type="radio", name="displayed-times", value="more") 66 | span two or more times 67 | .save-wrapper 68 | button.primary(type="submit") Save 69 | .form-status#form-status 70 | 71 | script(src="js/options.js") -------------------------------------------------------------------------------- /src/popup.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang="en") 3 | head 4 | meta(charset="UTF-8") 5 | meta(name="viewport", content="width=device-width, initial-scale=1.0") 6 | title Notion+ Mark Manager Popup 7 | link(rel="stylesheet", href="css/popup.scss") 8 | 9 | body 10 | nav#nav.shown 11 | ul 12 | li.tab(data-tab="colored-texts") Colored Texts 13 | li.tab(data-tab="comments") Comments 14 | 15 | section#blocks 16 | #colored-texts-container 17 | #comments-container 18 | img#loading-spinner(src='data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20data-ember-extension%3D%221%22%3E%3Cdefs%3E%3ClinearGradient%20x1%3D%2228.1542969%25%22%20y1%3D%2263.7402344%25%22%20x2%3D%2274.6289062%25%22%20y2%3D%2217.7832031%25%22%20id%3D%22linearGradient-1%22%3E%3Cstop%20stop-color%3D%22rgba(164%2C%20164%2C%20164%2C%201)%22%20offset%3D%220%25%22%2F%3E%3Cstop%20stop-color%3D%22rgba(164%2C%20164%2C%20164%2C%200)%22%20stop-opacity%3D%220%22%20offset%3D%22100%25%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20id%3D%22Page-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20%3E%3Cg%20transform%3D%22translate(-236.000000%2C%20-286.000000)%22%3E%3Cg%20transform%3D%22translate(238.000000%2C%20286.000000)%22%3E%3Ccircle%20id%3D%22Oval-2%22%20stroke%3D%22url(%23linearGradient-1)%22%20stroke-width%3D%224%22%20cx%3D%2210%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M10%2C2%20C4.4771525%2C2%200%2C6.4771525%200%2C12%22%20id%3D%22Oval-2%22%20stroke%3D%22rgba(164%2C%20164%2C%20164%2C%201)%22%20stroke-width%3D%224%22%2F%3E%3Crect%20id%3D%22Rectangle-1%22%20fill%3D%22rgba(164%2C%20164%2C%20164%2C%201)%22%20x%3D%228%22%20y%3D%220%22%20width%3D%224%22%20height%3D%224%22%20rx%3D%228%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E', alt='Loading...') 19 | #prompt This page has no colored texts. 20 | 21 | section#menu 22 | ul 23 | li.tab 24 | svg.exporter-icon(preserveaspectratio='xMidYMid meet', viewBox='0 0 24 24') 25 | path(d='M8.71 7.71L11 5.41V15a1 1 0 0 0 2 0V5.41l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42l-4-4a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-4 4a1 1 0 1 0 1.42 1.42zM21 14a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 0-2 0v4a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1z') 26 | p(data-i18n="export") Export 27 | .exporter-container 28 | .exporter-options 29 | label 30 | input#select-all(type="checkbox") 31 | div 32 | .checkbox 33 | svg.checked-icon(viewBox="0 0 14 14") 34 | polygon(points="5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039") 35 | svg.unchecked-icon(viewBox="0 0 16 16") 36 | path(d="M1.5,1.5 L1.5,14.5 L14.5,14.5 L14.5,1.5 L1.5,1.5 Z M0,0 L16,0 L16,16 L0,16 L0,0 Z") 37 | span(data-i18n="selectAll") Select All 38 | #status 39 | .exporter-btns 40 | button#cancel.secondary(type="button", data-i18n="cancel") Cancel 41 | #exporter-btns-wrapper 42 | button#copy.primary(type="button", data-i18n="copy") Copy 43 | button#download.primary(type="button", data-i18n="download") Download 44 | 45 | #support 46 | svg(preserveaspectratio='xMidYMid meet', viewBox='0 0 24 24') 47 | path(d='M5 9a1 1 0 0 1 1 1a6.97 6.97 0 0 1 4.33 1.5h2.17c1.332 0 2.53.579 3.353 1.499L19 13a5 5 0 0 1 4.516 2.851C21.151 18.972 17.322 21 13 21c-2.79 0-5.15-.603-7.06-1.658A.998.998 0 0 1 5 20H2a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3zm1.001 3L6 17.021l.045.033C7.84 18.314 10.178 19 13 19c3.004 0 5.799-1.156 7.835-3.13l.133-.133l-.12-.1a2.994 2.994 0 0 0-1.643-.63L19 15l-2.112-.001c.073.322.112.657.112 1.001v1H8v-2l6.79-.001l-.034-.078a2.501 2.501 0 0 0-2.092-1.416L12.5 13.5H9.57A4.985 4.985 0 0 0 6.002 12zM4 11H3v7h1v-7zm9.646-7.425L14 3.93l.354-.354a2.5 2.5 0 1 1 3.535 3.536L14 11l-3.89-3.89a2.5 2.5 0 1 1 3.536-3.535zm-2.12 1.415a.5.5 0 0 0-.06.637l.058.069L14 8.17l2.476-2.474a.5.5 0 0 0 .058-.638l-.058-.07a.5.5 0 0 0-.638-.057l-.07.058l-1.769 1.768l-1.767-1.77l-.068-.056a.5.5 0 0 0-.638.058z') 48 | #support-info 49 | .wrapper 50 | .intro 51 | img.me(src="./assets/me.jpg", alt="Yeefun Lin") 52 | div 53 | .text(data-i18n="intro") 👋 Hi, I'm Yeefun, the creator of Notion+ Mark Manager. 54 | div 55 | .text(data-i18n="support_1") To develop a free, open-source extension takes a lot of effort. Your support will encourage me to continue upgrading the product. There are a few things you can do: 56 | div 57 | .bulleted-list 58 | .bullet 59 | div • 60 | .text(data-i18n="support_2") Tell your friends about it 61 | div 62 | .bulleted-list 63 | .bullet 64 | div • 65 | .text(data-i18n="support_3") Leave a review on the Chrome or Firefox store 66 | div 67 | .bulleted-list 68 | .bullet 69 | div • 70 | .text(data-i18n="support_4") Give me a star on GitHub 71 | div 72 | .bulleted-list 73 | .bullet 74 | div • 75 | .text(data-i18n="support_5") Report bugs or request features via GitHub Issues or this form 76 | div 77 | .bulleted-list 78 | .bullet 79 | div • 80 | .text(data-i18n="support_6") Donate me 81 | div 82 | .text(data-i18n="support_7") Thank you! 🙌 83 | script(src="js/popup.js") -------------------------------------------------------------------------------- /static/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": { 3 | "message": "Notion+ Mark Manager" 4 | }, 5 | "shortName": { 6 | "message": "Manage Notion Marks" 7 | }, 8 | "description": { 9 | "message": "Manage your colored texts and comments efficiently in Notion." 10 | }, 11 | "export": { 12 | "message": "Export" 13 | }, 14 | "selectAll": { 15 | "message": "Select All" 16 | }, 17 | "cancel": { 18 | "message": "Cancel" 19 | }, 20 | "copy": { 21 | "message": "Copy" 22 | }, 23 | "download": { 24 | "message": "Download" 25 | }, 26 | "exportStatusCopy": { 27 | "message": "Successfully copied!" 28 | }, 29 | "exportStatusDownload": { 30 | "message": "Successfully downloaded!" 31 | }, 32 | "intro": { 33 | "message": "👋 Hi, I'm Yeefun, the creator of Notion+ Mark Manager." 34 | }, 35 | "support_1": { 36 | "message": "To develop a free, open-source extension takes a lot of effort. Your support will encourage me to continue upgrading the product. There are a few things you can do:" 37 | }, 38 | "support_2": { 39 | "message": "Tell your friends about it" 40 | }, 41 | "support_3": { 42 | "message": "Leave a review on the Chrome or Firefox store" 43 | }, 44 | "support_4": { 45 | "message": "Give me a star on GitHub" 46 | }, 47 | "support_5": { 48 | "message": "Report bugs or request features via GitHub Issues or this form" 49 | }, 50 | "support_6": { 51 | "message": "Donate me" 52 | }, 53 | "support_7": { 54 | "message": "Thank you! 🙌" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /static/_locales/zh_CN/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": { 3 | "message": "Notion+ 标记管理器" 4 | }, 5 | "shortName": { 6 | "message": "管理 Notion 标记" 7 | }, 8 | "description": { 9 | "message": "高效管理 Notion 的颜色文字与注解。" 10 | }, 11 | "export": { 12 | "message": "导出" 13 | }, 14 | "selectAll": { 15 | "message": "全选" 16 | }, 17 | "cancel": { 18 | "message": "取消" 19 | }, 20 | "copy": { 21 | "message": "复制" 22 | }, 23 | "download": { 24 | "message": "下载" 25 | }, 26 | "exportStatusCopy": { 27 | "message": "复制成功!" 28 | }, 29 | "exportStatusDownload": { 30 | "message": "下载成功!" 31 | }, 32 | "intro": { 33 | "message": "👋 嗨你好,我是 Yeefun,Notion+ 标记管理器的作者。" 34 | }, 35 | "support_1": { 36 | "message": "开发一个免费、开源的扩充套件需耗费许多时间与心力,你的支持,是我持续把产品变得更好的动力。如果你喜欢 Mark Manager,可以做以下几件事情:" 37 | }, 38 | "support_2": { 39 | "message": "推荐给你的朋友" 40 | }, 41 | "support_3": { 42 | "message": "在 ChromeFirefox 商店留下评论" 43 | }, 44 | "support_4": { 45 | "message": "帮我的 GitHub repo 打星星" 46 | }, 47 | "support_5": { 48 | "message": "透过 GitHub Issues表单回报错误、许愿新功能" 49 | }, 50 | "support_6": { 51 | "message": "赞助我" 52 | }, 53 | "support_7": { 54 | "message": "谢谢你!🙌" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /static/_locales/zh_TW/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": { 3 | "message": "Notion+ 標記管理器" 4 | }, 5 | "shortName": { 6 | "message": "管理 Notion 標記" 7 | }, 8 | "description": { 9 | "message": "高效管理 Notion 的顏色文字與註解。" 10 | }, 11 | "export": { 12 | "message": "導出" 13 | }, 14 | "selectAll": { 15 | "message": "全選" 16 | }, 17 | "cancel": { 18 | "message": "取消" 19 | }, 20 | "copy": { 21 | "message": "複製" 22 | }, 23 | "download": { 24 | "message": "下載" 25 | }, 26 | "exportStatusCopy": { 27 | "message": "複製成功!" 28 | }, 29 | "exportStatusDownload": { 30 | "message": "下載成功!" 31 | }, 32 | "intro": { 33 | "message": "👋 嗨你好,我是 Yeefun,Notion+ 標記管理器的作者。" 34 | }, 35 | "support_1": { 36 | "message": "開發一個免費、開源的擴充套件需耗費許多時間與心力,你的支持,是我持續把產品變得更好的動力。如果你喜歡 Mark Manager,可以做以下幾件事情:" 37 | }, 38 | "support_2": { 39 | "message": "推薦給你的朋友" 40 | }, 41 | "support_3": { 42 | "message": "在 ChromeFirefox 商店留下評論" 43 | }, 44 | "support_4": { 45 | "message": "幫我的 GitHub repo 打星星" 46 | }, 47 | "support_5": { 48 | "message": "透過 GitHub Issues表單回報錯誤、許願新功能" 49 | }, 50 | "support_6": { 51 | "message": "贊助我" 52 | }, 53 | "support_7": { 54 | "message": "謝謝你!🙌" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /static/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/static/icon128.png -------------------------------------------------------------------------------- /static/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/static/icon16.png -------------------------------------------------------------------------------- /static/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/static/icon32.png -------------------------------------------------------------------------------- /static/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yeefun/notion-mark-manager/6f157d57113eed5f42b68e3a897285ebb4b85ec8/static/icon48.png --------------------------------------------------------------------------------