├── .editorconfig ├── .gitattributes ├── .gitignore ├── Gruntfile.js ├── README.md ├── _locales ├── de │ └── messages.json ├── en │ └── messages.json ├── fr │ └── messages.json ├── pt_BR │ └── messages.json └── sr │ └── messages.json ├── archived ├── css │ └── printliminator.css ├── images │ ├── printliminator-bg.png │ ├── printliminator-close.png │ ├── printliminator-printstylize.png │ ├── printliminator-removeimages.png │ ├── printliminator-sendtoprinter.png │ └── printliminator.png └── js │ ├── printliminator-v1.js │ └── printliminator-v2.js ├── bookmark.html ├── demo ├── css │ └── style.css └── images │ ├── examples-logo.png │ └── screenshot.png ├── dist ├── bookmarklet │ └── printliminator.js ├── chrome.crx ├── chrome.zip ├── chrome │ ├── _locales │ │ ├── en │ │ │ └── messages.json │ │ └── fr │ │ │ └── messages.json │ ├── icon128.png │ ├── icon16.png │ ├── icon18.png │ ├── icon32.png │ ├── icon48.png │ ├── icon64.png │ ├── manifest.json │ ├── popup.css │ ├── popup.html │ ├── popup.js │ ├── printliminator.css │ ├── printliminator.js │ └── printliminator.png └── opera.nex ├── index.html ├── license.txt ├── package.json ├── printliminator.min.js ├── src ├── bookmarklet │ ├── bookmark.html │ ├── bookmarklet.js │ ├── iframe.html │ ├── iframe.scss │ └── index.html ├── chrome │ ├── manifest.json │ ├── popup.html │ ├── popup.js │ └── popup.scss ├── icons │ ├── favicon.ico │ ├── icon128.png │ ├── icon16.png │ ├── icon18.png │ ├── icon32.png │ ├── icon48.png │ ├── icon64.png │ └── printliminator.png ├── images │ ├── Chrome-1.png │ ├── Chrome-2.png │ ├── Chrome-3.png │ ├── Chrome-4.png │ ├── Chrome-5.png │ ├── Opera-1.png │ ├── Opera-2.png │ ├── Opera-3.png │ ├── icon.svg │ ├── logo.svg │ └── web-store-tile.png ├── options.json ├── printliminator.js └── printliminator.scss └── test ├── SpecRunner.html └── traversingSpec.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # Follow the guidelines. Use tabs, not spaces. 2 | root = true 3 | 4 | [src/*.{js,html}] 5 | indent_style = tab 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | end_of_line = lf 9 | charset = utf-8 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | *.md diss=astextplain -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *_test*.* 11 | *.tmp 12 | *.bak 13 | *.swp 14 | *~.nib 15 | local.properties 16 | .classpath 17 | .settings/ 18 | .loadpath 19 | 20 | # External tool builders 21 | .externalToolBuilders/ 22 | 23 | # Locally stored "Eclipse launch configurations" 24 | *.launch 25 | 26 | # CDT-specific 27 | .cproject 28 | 29 | # PDT-specific 30 | .buildpath 31 | 32 | 33 | ################# 34 | ## Visual Studio 35 | ################# 36 | 37 | ## Ignore Visual Studio temporary files, build results, and 38 | ## files generated by popular Visual Studio add-ons. 39 | 40 | # User-specific files 41 | *.suo 42 | *.user 43 | *.sln.docstates 44 | 45 | # Build results 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | node_modules/ 49 | *_i.c 50 | *_p.c 51 | *.ilk 52 | *.log 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.vspscc 66 | .builds 67 | *.dotCover 68 | 69 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 70 | #packages/ 71 | 72 | # Visual C++ cache files 73 | ipch/ 74 | *.aps 75 | *.ncb 76 | *.opensdf 77 | *.sdf 78 | 79 | # Visual Studio profiler 80 | *.psess 81 | *.vsp 82 | 83 | # ReSharper is a .NET coding add-in 84 | _ReSharper* 85 | 86 | # Installshield output folder 87 | [Ee]xpress 88 | 89 | # DocProject is a documentation generator add-in 90 | DocProject/buildhelp/ 91 | DocProject/Help/*.HxT 92 | DocProject/Help/*.HxC 93 | DocProject/Help/*.hhc 94 | DocProject/Help/*.hhk 95 | DocProject/Help/*.hhp 96 | DocProject/Help/Html2 97 | DocProject/Help/html 98 | 99 | # Click-Once directory 100 | publish 101 | 102 | # Others 103 | [Bb]in 104 | [Oo]bj 105 | sql 106 | TestResults 107 | *.Cache 108 | ClientBin 109 | stylecop.* 110 | ~$* 111 | *.dbmdl 112 | Generated_Code #added for RIA/Silverlight projects 113 | 114 | # Backup & report files from converting an old project file to a newer 115 | # Visual Studio version. Backup files are not needed, because we have git ;-) 116 | _UpgradeReport_Files/ 117 | Backup*/ 118 | UpgradeLog*.XML 119 | 120 | ############ 121 | ## Windows 122 | ############ 123 | 124 | # Windows image file caches 125 | Thumbs.db 126 | 127 | # Folder config file 128 | Desktop.ini 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | build 140 | eggs 141 | parts 142 | bin 143 | var 144 | sdist 145 | develop-eggs 146 | .installed.cfg 147 | 148 | # Installer logs 149 | pip-log.txt 150 | 151 | # Unit test / coverage reports 152 | .coverage 153 | .tox 154 | 155 | #Translations 156 | *.mo 157 | 158 | #Mr Developer 159 | .mr.developer.cfg 160 | 161 | # Mac crap 162 | .DS_Store 163 | 164 | ############ 165 | ## Chrome extension 166 | ############ 167 | # private key 168 | *.pem 169 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /*global module :false*/ 2 | module.exports = function( grunt ) { 3 | 'use strict'; 4 | 5 | var pkg = grunt.file.readJSON( 'package.json' ), 6 | 7 | config = { 8 | 9 | // key in root directory - **not shared publically** 10 | chromeKey : 'chrome.pem', 11 | 12 | settings : grunt.file.readJSON( 'src/options.json' ), 13 | 14 | // misc variables 15 | printliminatorJs : 'printliminator', 16 | printliminatorFunctionName : 'thePrintliminator', 17 | 18 | // temporary file 19 | bookmarkletJs : 'bookmarklet', 20 | 21 | // bookmarklet builder URLs 22 | indexHtml : 'index.html', 23 | bookmarkHtml : 'bookmark.html', 24 | production : { 25 | printliminator : '//css-tricks.github.io/The-Printliminator/printliminator.min.js' 26 | }, 27 | dev : { 28 | printliminator : 'dist/bookmarklet/printliminator.js' 29 | }, 30 | 31 | // note to add to dynamically created index.html in the root folder 32 | note : '' 38 | 39 | }; 40 | 41 | grunt.file.defaultEncoding = 'utf8'; 42 | grunt.file.preserveBOM = false; 43 | 44 | // Project configuration. 45 | grunt.initConfig({ 46 | pkg : pkg, 47 | config : config, 48 | 49 | jshint : { 50 | options : { 51 | globals : { 52 | '<%= config.printliminatorFunctionName %>' : false 53 | }, 54 | browser : true, 55 | undef : true, 56 | esnext : true 57 | }, 58 | files : { 59 | src : [ 60 | 'test/spec.js', 61 | 'dist/**/*.js' 62 | ] 63 | } 64 | }, 65 | 66 | uglify : { 67 | options : { 68 | report : 'gzip' 69 | }, 70 | main : { 71 | files : { 72 | '<%= config.printliminatorJs %>.min.js' : [ 'dist/bookmarklet/<%= config.printliminatorJs %>.js' ] 73 | } 74 | }, 75 | bookmarklet : { 76 | files : { 77 | '<%= config.bookmarkletJs %>.min.js' : [ 'src/bookmarklet/<%= config.bookmarkletJs %>.js' ] 78 | } 79 | } 80 | }, 81 | 82 | clean : { 83 | build : { 84 | src : [ 85 | 'dist/**/**/**/*', // locales 86 | 'dist/**/**/*', 87 | 'dist/**/*', 88 | config.indexHtml, 89 | '*.min.js' 90 | ] 91 | }, 92 | cleanup : { 93 | src : [ 94 | config.bookmarkletJs + '.min.js', 95 | 'src/printliminator.css', 96 | 'src/chrome/popup.css', 97 | 'src/*-temp.*', 98 | 'src/chrome/*-temp.*', 99 | 'src/bookmarklet/*-temp.*' 100 | ] 101 | } 102 | 103 | }, 104 | 105 | copy : { 106 | chrome : { 107 | files : [{ 108 | expand : true, 109 | dot : true, 110 | flatten : true, 111 | src : [ 112 | 'src/printliminator.css', 113 | 'src/icons/*.png', 114 | 'src/chrome/manifest.json' 115 | ], 116 | dest : 'dist/chrome/' 117 | }] 118 | }, 119 | chromeLocales : { 120 | expand : true, 121 | src : [ '_locales/**/*.json' ], 122 | dest : 'dist/chrome' 123 | }, 124 | // Opera can use chrome.crx; just renamed 125 | opera : { 126 | src : 'dist/chrome.crx', 127 | dest : 'dist/opera.nex' 128 | } 129 | }, 130 | 131 | sass : { 132 | dist : { 133 | options : { 134 | style : 'expanded', 135 | sourcemap : 'none', 136 | noCache : true 137 | }, 138 | files : { 139 | 'src/printliminator.css' : 'src/printliminator-temp.scss', 140 | 'src/bookmarklet/printliminator-temp.css' : 'src/bookmarklet/printliminator-temp.scss', 141 | 'dist/chrome/popup.css' : 'src/chrome/popup-temp.scss', 142 | 'src/bookmarklet/iframe-temp.css' : 'src/bookmarklet/iframe-temp.scss' 143 | } 144 | } 145 | }, 146 | 147 | preprocess : { 148 | extMainScss : { 149 | src : 'src/printliminator.scss', 150 | dest : 'src/printliminator-temp.scss', 151 | options : { 152 | context : { 153 | MODE : 'EXT', 154 | settings : '<%= config.settings %>' 155 | } 156 | } 157 | }, 158 | extBookmarkletScss : { 159 | src : 'src/printliminator.scss', 160 | dest : 'src/bookmarklet/printliminator-temp.scss', 161 | options : { 162 | context : { 163 | MODE : 'BOOKMARKLET', 164 | settings : '<%= config.settings %>' 165 | } 166 | } 167 | }, 168 | extPopupScss : { 169 | src : 'src/chrome/popup.scss', 170 | dest : 'src/chrome/popup-temp.scss', 171 | options : { 172 | context : '<%= config.settings %>' 173 | } 174 | }, 175 | bookmarkletPopupScss : { 176 | src : 'src/bookmarklet/iframe.scss', 177 | dest : 'src/bookmarklet/iframe-temp.scss', 178 | options : { 179 | context : '<%= config.settings %>' 180 | } 181 | }, 182 | extHtml : { 183 | src : 'src/chrome/popup.html', 184 | dest : 'dist/chrome/popup.html', 185 | options : { 186 | context : '<%= config.settings %>' 187 | } 188 | }, 189 | bookmarkletHtml : { 190 | src : 'src/bookmarklet/iframe.html', 191 | dest : 'src/bookmarklet/iframe-temp.html', 192 | options : { 193 | context : '<%= config.settings %>' 194 | } 195 | }, 196 | extPopupJs : { 197 | src : 'src/chrome/popup.js', 198 | dest : 'dist/chrome/popup.js', 199 | options : { 200 | context : '<%= config.settings %>' 201 | } 202 | }, 203 | extJs : { 204 | src : 'src/printliminator.js', 205 | dest : 'dist/chrome/printliminator.js', 206 | options : { 207 | // inline : true, 208 | context : { 209 | MODE : 'EXT', 210 | settings : '<%= config.settings %>' 211 | } 212 | } 213 | }, 214 | bookmarkletJs : { 215 | src : 'src/printliminator.js', 216 | dest : 'dist/bookmarklet/printliminator.js', 217 | options : { 218 | // inline : true, 219 | context : { 220 | MODE : 'BOOKMARKLET', 221 | settings : '<%= config.settings %>' 222 | } 223 | } 224 | } 225 | }, 226 | 227 | jasmine : { 228 | src : 'dist/chrome/printliminator.js', 229 | options : { 230 | specs : 'test/*Spec.js' 231 | } 232 | }, 233 | 234 | compress : { 235 | chrome : { 236 | options : { 237 | archive : 'dist/chrome.zip' 238 | }, 239 | files : [{ 240 | expand : true, 241 | cwd : 'dist/chrome/', 242 | src : ['**'], 243 | dest : '', 244 | filter : 'isFile' 245 | }] 246 | } 247 | }, 248 | 249 | crx : { 250 | chrome : { 251 | options : { 252 | privateKey : '<%= config.chromeKey %>', 253 | }, 254 | src : 'dist/chrome/*.*', 255 | dest : 'dist/chrome.crx', 256 | } 257 | } 258 | 259 | }); 260 | 261 | grunt.loadNpmTasks( 'grunt-contrib-clean' ); 262 | grunt.loadNpmTasks( 'grunt-contrib-compress' ); 263 | grunt.loadNpmTasks( 'grunt-contrib-copy' ); 264 | grunt.loadNpmTasks( 'grunt-contrib-jasmine' ); 265 | grunt.loadNpmTasks( 'grunt-contrib-jshint' ); 266 | grunt.loadNpmTasks( 'grunt-contrib-sass' ); 267 | grunt.loadNpmTasks( 'grunt-contrib-uglify' ); 268 | grunt.loadNpmTasks( 'grunt-crx' ); 269 | grunt.loadNpmTasks( 'grunt-preprocess' ); 270 | 271 | grunt.registerTask( 'update', 'update dist files', function() { 272 | grunt.task.run([ 273 | 'default', 274 | 'updateVersions', 275 | 'compress', 276 | // make Chrome extension 277 | 'crx', 278 | // Opera extension 279 | 'copy:opera', 280 | // Firefox extension will match Chrome files in v43+ 281 | // http://techcrunch.com/2015/08/21/chrome-extensions-are-coming-to-firefox/ 282 | ]); 283 | }); 284 | 285 | grunt.registerTask( 'default', 'Default build', function() { 286 | grunt.task.run([ 287 | 'clean:build', 288 | 'preprocess', 289 | 'sass', 290 | 'bookmarklet-addStyles', 291 | 'uglify', 292 | 'bookmarklet-create', 293 | 'copy:chrome', 294 | 'copy:chromeLocales', 295 | 'jshint', 296 | 'jasmine', 297 | 'clean:cleanup' 298 | ]); 299 | }); 300 | 301 | grunt.registerTask( 'bookmarklet-addStyles', function() { 302 | // string replace settings in css & html; add to bookmarklet 303 | var printliminator = grunt.file.read( 'dist/bookmarklet/printliminator.js' ), 304 | styles = grunt.file.read( 'src/bookmarklet/printliminator-temp.css' ).replace( /\s+/g, ' ' ), 305 | popupHTML = grunt.file.read( 'src/bookmarklet/iframe-temp.html' ).replace( /\s+/g, ' ' ), 306 | popupCSS = grunt.file.read( 'src/bookmarklet/iframe-temp.css' ).replace( /\s+/g, ' ' ), 307 | printliminator = printliminator 308 | .replace( /\{styles\}/, styles ) 309 | .replace( /\{popupHTML\}/, popupHTML ) 310 | .replace( /\{popupCSS\}/, popupCSS ); 311 | grunt.file.write( 'dist/bookmarklet/printliminator.js', printliminator ); 312 | }); 313 | 314 | grunt.registerTask( 'bookmarklet-create', function(){ 315 | // Add bookmarklet code for both production & development 316 | // load bookmarket min file 317 | var content = grunt.file.read( config.bookmarkletJs + '.min.js' ), 318 | // load index.html template 319 | baseHtml = grunt.file.read( 'src/bookmarklet/' + config.indexHtml ), 320 | bookmarkHtml = grunt.file.read( 'src/bookmarklet/' + config.bookmarkHtml ), 321 | 322 | modFile = function( mode ) { 323 | var regex = new RegExp('\\{' + mode + '\\}'), 324 | file = content 325 | .replace( /\{printliminator\}/, config[ mode ].printliminator ) 326 | .replace( /\"/g, "'" ) 327 | // not using encodeURI because it changes "{}" into "%7B%7D" 328 | // and just makes the bookmarklet bigger & harder to read 329 | .replace( /\x20/g, '%20' ); 330 | // add javascript to HTML 331 | baseHtml = baseHtml.replace( regex, file ); 332 | if ( mode === 'production' ) { 333 | bookmarkHtml = bookmarkHtml.replace( regex, file ); 334 | } 335 | }; 336 | 337 | // update production & dev bookmarklet href 338 | modFile( 'production' ); 339 | modFile( 'dev' ); 340 | 341 | // add note so we don't mistakingly update the wrong index.html 342 | // then lose all our changes when grunt is run! 343 | baseHtml = baseHtml.replace( '', config.note ); 344 | 345 | // write modified index.html 346 | grunt.file.write( config.indexHtml, baseHtml ); 347 | grunt.file.write( config.bookmarkHtml, bookmarkHtml ); 348 | }); 349 | 350 | // update version numbers to match the package.json version 351 | grunt.registerTask( 'updateVersions', function() { 352 | var i, project, result, 353 | projectFile = [ 354 | 'dist/chrome/manifest.json', 355 | 'dist/chrome/printliminator.js', 356 | 'dist/bookmarklet/printliminator.js' 357 | ], 358 | len = projectFile.length; 359 | for ( i = 0; i < len; i++ ) { 360 | if ( !grunt.file.exists( projectFile[ i ] ) ) { 361 | grunt.log.error( 'file ' + projectFile[ i ] + ' not found' ); 362 | return true; // return false to abort the execution 363 | } 364 | if ( /json$/i.test( projectFile[ i ] ) ) { 365 | project = grunt.file.readJSON( projectFile[ i ] ); // get file as json object 366 | project.version = pkg.version; 367 | result = JSON.stringify( project, null, 2 ); 368 | // write manifest back to src & dist folders 369 | grunt.file.write( projectFile[ i ], result ); 370 | grunt.file.write( projectFile[ i ].replace( /^dist/, 'src' ), result ); 371 | } else { 372 | project = grunt.file.read( projectFile[ i ] ); 373 | result = project.replace( /\{version\}/g, pkg.version ); 374 | grunt.file.write( projectFile[ i ], result ); 375 | } 376 | } 377 | }); 378 | 379 | }; 380 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Printliminator is a simple tool you can use to make websites print better. 2 | One click to activate, and then click to remove elements from the page, remove graphics, and apply 3 | better print styling. 4 | 5 | ![screenshot](https://cloud.githubusercontent.com/assets/136959/10418826/4ccd60c6-702b-11e5-8ed8-f4d4df66e6d5.png) 6 | 7 | Get the: 8 | * [Bookmarklet](//css-tricks.github.io/The-Printliminator/) 9 | * [Chrome Extension](//chrome.google.com/webstore/detail/the-printliminator/nklechikgnfoonbfmcalddjcpmcmgapf?hl=en-US&gl=US) 10 | * [Opera Extension](//addons.opera.com/en/extensions/details/the-printliminator/?display=en) 11 | 12 | ### Limitations 13 | 14 | * Bookmarklet: due to Content Security Policy directives on some sites, the Printliminator bookmarklet script is not able to load on some sites (e.g. GitHub). To get around this problem, use the Chrome or Opera extension. Hopefully, Firefox & Safari extensions/addons will quickly follow. 15 | * Chrome/Opera extension: if a popup window is opened for printing, like Yahoo mail does, then the extension will not work in the popup. [An issue](https://code.google.com/p/chromium/issues/detail?id=530658) was submitted and it sounds like they will be providing a fix. 16 | 17 | ### To Do 18 | 19 | * Support more languages: waiting for willing users to help! 20 | * Create Firefox & Safari extensions. 21 | 22 | ### Credits 23 | 24 | * By [Chris Coyier](http://chriscoyier.net) and [Devon Govett](http://devongovett.wordpress.com/). 25 | * Updates & extensions by [Rob Garrison](http://wowmotty.blogspot.com/). 26 | * Icons by [Function](http://wefunction.com/2008/07/function-free-icon-set/). 27 | * Print stylesheet based on [Hartija](http://code.google.com/p/hartija/). 28 | * Translations provided by [Transifex](https://www.transifex.com). 29 | 30 | ### Contributing 31 | 32 | * Pull requests are welcome! 33 | * Provide additional translations via [Transifex](https://www.transifex.com/css-tricks/the-printliminator/) or with a pull request. 34 | 35 | ### Recent Changes 36 | 37 | #### Version 4.0.5 (10/11/2015) 38 | 39 | * Readme: 40 | * Add link to Opera extension. 41 | * Fix link to Transifex. 42 | * Demo: Add video & repo link. 43 | * Locales: 44 | * Add French locale. See [pull #7](https://github.com/CSS-Tricks/The-Printliminator/pull/7); thanks [yukulele](https://github.com/yukulele)! 45 | * Update missing locale string & fix button overflow issues 46 | * Include non-numpad keys for font-resizing. Fixes [issue #8](https://github.com/CSS-Tricks/The-Printliminator/issues/8). 47 | * Fix extension messaging options. 48 | 49 | #### Version 4.0.4 (9/30/2015) 50 | 51 | * Add screenshots of Opera extesion. 52 | * Rename Chrome screenshots. 53 | * Version bump to resubmit Opera extension. 54 | 55 | #### Version 4.0.3 (9/28/2015) 56 | 57 | * Fix icon file name in Chrome manifest which was preventing the extension from working. 58 | * Added, then removed Chrome extension autoupdating code... no longer supported :( 59 | 60 | #### Version 4.0.1 (9/28/2015) 61 | 62 | * Update your Bookmarklets as the code to execute the loaded Printliminator code has changed! 63 | * Big lumped changes... 64 | * Created Chrome & Opera extensions (no change needed to support both). 65 | * Grunt build to include all code for the bookmarklet & extension code in one file. 66 | * Added English locale file which make it easy to add additional language support. 67 | * A main `src/options.json` file now contains settings & class names used across all files. 68 | * Converted all css to SCSS. 69 | * New The Printliminator logo designed by Chris! 70 | * Add some basic unit testing for DOM traversing. 71 | * All production files are now located in the `dist` folder; `printliminator.min.js` is still located in the root. 72 | * Added [wiki documentation](https://github.com/CSS-Tricks/The-Printliminator/wiki). 73 | -------------------------------------------------------------------------------- /_locales/de/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "printliminatorName" : { 3 | "message" : "The Printliminator", 4 | "description" : "Extension name" 5 | }, 6 | "printliminatorDescription" : { 7 | "message" : "Ein einfaches Tool um Websiten besser zu drucken.", 8 | "description" : "Extension Beschreibung" 9 | }, 10 | "commandButtons" : { 11 | "message" : "Andere nützliche Superpowers", 12 | "description" : "Command buttons: undo, stylize, remove graphics & drucken" 13 | }, 14 | "clickToRemove" : { 15 | "message" : "Klicke einfach auf Sachen um sie verschwinden zu lassen", 16 | "description" : "Klick um das Element verschwinden zu lassen" 17 | }, 18 | "altClickRemove" : { 19 | "message" : "Alt-click um das Gegenteil zu entfernen", 20 | "description" : "Alt-click um alles ausser das Element verschwinden zu lassen" 21 | }, 22 | "undoLast" : { 23 | "message" : "Undo
Last", 24 | "description" : "Letzte Änderung rückgängig machen" 25 | }, 26 | "addStylize" : { 27 | "message" : "Druck
Styles hinzufügen", 28 | "description" : "Druck-stylesheet hinzufügen" 29 | }, 30 | "removeGraphics" : { 31 | "message" : "Grafiken
entfernen", 32 | "description" : "Alle Bilder, iframes und videos von der Seite entfernen" 33 | }, 34 | "sendToPrint" : { 35 | "message" : "Drucken", 36 | "description" : "Diese Seite drucken" 37 | }, 38 | "viewKeyboardCommands" : { 39 | "message" : "Tastaturbefehle anzeigen", 40 | "description" : "Öffne die Liste mit den Tastaturbefehlen" 41 | }, 42 | "hideKeyboardCommands" : { 43 | "message" : "Tastaturbefehle verstecken", 44 | "description" : "Schliesse die Liste mit den Tastaturbefehlen" 45 | }, 46 | "keyColumn" : { 47 | "message" : "Taste", 48 | "description" : "Tastenname" 49 | }, 50 | "descriptionColumn" : { 51 | "message" : "Beschreibung", 52 | "description" : "Beschreibung der Aktion durch die Taste" 53 | }, 54 | "orText" : { 55 | "message" : "oder", 56 | "description" : "oder text" 57 | }, 58 | "keyPageUp" : { 59 | "message" : "PageUp", 60 | "description" : "Page up Taste" 61 | }, 62 | "keyUpArrow" : { 63 | "message" : "Pfeil nach oben", 64 | "description" : "Pfeil nach oben Taste Text zum Titel hinzugefügt" 65 | }, 66 | "upDescription" : { 67 | "message" : "Finde die Umhüllung der hervorgehobenen Box", 68 | "description" : "Finde die Umhüllung der hervorgehobenen Box" 69 | }, 70 | "keyPageDown" : { 71 | "message" : "PageDown", 72 | "description" : "Page down key" 73 | }, 74 | "keyDownArrow" : { 75 | "message" : "Pfeil nach unten", 76 | "description" : "Pfeil nach unten Text zum Titel hinzugefügt" 77 | }, 78 | "downDescription" : { 79 | "message" : "Find content of highlighted box", 80 | "description" : "Find first visible child element of highlight" 81 | }, 82 | "keyRightArrow" : { 83 | "message" : "Rechter Pfeil", 84 | "description" : "Rechter Pfeil Text zum Titel hinzugefügt" 85 | }, 86 | "rightDescription" : { 87 | "message" : "Find next box inside same wrapper", 88 | "description" : "Find next visible sibling element of highlight" 89 | }, 90 | "keyLeftArrow" : { 91 | "message" : "Linker Pfeil", 92 | "description" : "Linker Pfeil Text zum Titel hinzugefügt" 93 | }, 94 | "leftDescription" : { 95 | "message" : "Finde das nächst kleinere Element in dieser Box", 96 | "description" : "" 97 | }, 98 | "keyEnter" : { 99 | "message" : "Enter", 100 | "description" : "Drücke Enter um die Hervorhebung zu entfernen" 101 | }, 102 | "removeHighlight" : { 103 | "message" : "Die hervorgehobene Box löschen", 104 | "description" : "Lösche die hervorgehobene Box" 105 | }, 106 | "keyBackspace" : { 107 | "message" : "Backspace", 108 | "description" : "Drücke backspace um die letze Handlung rückgängig zu machen" 109 | }, 110 | "undoAction" : { 111 | "message" : "Letzte Handlung ungeschehen machen", 112 | "description" : "Letzte Handlung ungeschehen machen" 113 | }, 114 | "keyNumpad" : { 115 | "message" : "Numpad", 116 | "description" : "Numpad Taste Text Beschreibung" 117 | }, 118 | "keyNumpadPlus" : { 119 | "message" : "Numpad Plus", 120 | "description" : "Numpad+ Taste" 121 | }, 122 | "fontUp" : { 123 | "message" : "Schriftgrösse um 1 vergrössern", 124 | "description" : "Nutze keyNumpad+ um die Schriftgrösse zu vergrössern" 125 | }, 126 | "keyNumpadMinus" : { 127 | "message" : "Numpad Minus", 128 | "description" : "Numpad- Taste" 129 | }, 130 | "fontDown" : { 131 | "message" : "Schriftgrösse um 1 verkleinern", 132 | "description" : "Nutze keyNumpad- um die Schriftgrösse zu verkleinern" 133 | }, 134 | "keyNumpadAsterisk" : { 135 | "message" : "Numpad Asterisk (Multiply)", 136 | "description" : "" 137 | }, 138 | "fontReset" : { 139 | "message" : "Schriftgrösse zurücksetzen", 140 | "description" : "Schriftgrösse zurück auf Standard setzen" 141 | }, 142 | "mouseLeftClick" : { 143 | "message" : "linker Mausklick", 144 | "description" : "linker Mausklick" 145 | }, 146 | "keyAlt" : { 147 | "message" : "Alt", 148 | "description" : "Alt-Taste mit Mausklick" 149 | }, 150 | "removeOpposite" : { 151 | "message" : "Entferne alles ausser die hervorgehobene Box", 152 | "description" : "Entferne das Gegenteil vom Hervorgehobenen" 153 | }, 154 | "keyShift" : { 155 | "message" : "Shift", 156 | "description" : "Shift-taste mit Mausklick" 157 | }, 158 | "fullWidth" : { 159 | "message" : "Set box width to 100% & margins to zero (highlight turns blue)", 160 | "description" : "Make highlighted element full width & add blue outline" 161 | }, 162 | "keyF1" : { 163 | "message" : "F1", 164 | "description" : "F1 Taste" 165 | }, 166 | "keyF1Title" : { 167 | "message" : "Function One", 168 | "description" : "F1 Taste genutzt um Nachrichten ein/auszuschalten" 169 | }, 170 | "toggleMessages" : { 171 | "message" : "Toggle action messages", 172 | "description" : "Action message display is toggled by the F1 key" 173 | }, 174 | "keyPS" : { 175 | "message" : "PrtScn", 176 | "description" : "Print Screen key (abbreviation)" 177 | }, 178 | "keyPSTitle" : { 179 | "message" : "Print Screen", 180 | "description" : "Print Screen key full name added to title" 181 | }, 182 | "printPage" : { 183 | "message" : "Seite drucken", 184 | "description" : "Diese Seite ausdrucken" 185 | }, 186 | "keyEsc" : { 187 | "message" : "Esc", 188 | "description" : "Escapetaste um den Printliminator zu schliessen" 189 | }, 190 | "keyEscTitle" : { 191 | "message" : "Escape", 192 | "description" : "Escapetaste full name" 193 | }, 194 | "abort" : { 195 | "message" : "Printliminator deaktivieren, aber Verlauf sichern", 196 | "description" : "Printliminator deaktivieren, aber Verlauf sichern." 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "printliminatorName" : { 3 | "message" : "The Printliminator", 4 | "description" : "Extension name" 5 | }, 6 | "printliminatorDescription" : { 7 | "message" : "A simple tool to make websites print better.", 8 | "description" : "Extension Description" 9 | }, 10 | "commandButtons" : { 11 | "message" : "Other Useful Superpowers", 12 | "description" : "Command buttons: undo, stylize, remove graphics & print" 13 | }, 14 | "clickToRemove" : { 15 | "message" : "Just click stuff on page to remove", 16 | "description" : "Click highlight to remove item" 17 | }, 18 | "altClickRemove" : { 19 | "message" : "Alt-click to remove opposite", 20 | "description" : "Alt-click highlight to remove everything expect the item" 21 | }, 22 | "undoLast" : { 23 | "message" : "Undo
Last", 24 | "description" : "Undo the last action" 25 | }, 26 | "addStylize" : { 27 | "message" : "Add Print
Styles", 28 | "description" : "Add print stylesheet" 29 | }, 30 | "removeGraphics" : { 31 | "message" : "Remove
Graphics", 32 | "description" : "Removes all images, iframes and video from the page" 33 | }, 34 | "sendToPrint" : { 35 | "message" : "Send to
print", 36 | "description" : "Print the page" 37 | }, 38 | "viewKeyboardCommands" : { 39 | "message" : "View Keyboard Commands", 40 | "description" : "Open a list of keyboard commands" 41 | }, 42 | "hideKeyboardCommands" : { 43 | "message" : "Hide Keyboard Commands", 44 | "description" : "Close list of keyboard commands" 45 | }, 46 | "keyColumn" : { 47 | "message" : "Key", 48 | "description" : "Key name column" 49 | }, 50 | "descriptionColumn" : { 51 | "message" : "Description", 52 | "description" : "Description of key action" 53 | }, 54 | "orText" : { 55 | "message" : "or", 56 | "description" : "or text" 57 | }, 58 | "keyPageUp" : { 59 | "message" : "PageUp", 60 | "description" : "Page up key" 61 | }, 62 | "keyUpArrow" : { 63 | "message" : "Up Arrow", 64 | "description" : "Up arrow key text added to title" 65 | }, 66 | "upDescription" : { 67 | "message" : "Find wrapper of highlighted box", 68 | "description" : "Find parent element of current highlight" 69 | }, 70 | "keyPageDown" : { 71 | "message" : "PageDown", 72 | "description" : "Page down key" 73 | }, 74 | "keyDownArrow" : { 75 | "message" : "Down Arrow", 76 | "description" : "Down arrow key text added to title" 77 | }, 78 | "downDescription" : { 79 | "message" : "Find content of highlighted box", 80 | "description" : "Find first visible child element of highlight" 81 | }, 82 | "keyRightArrow" : { 83 | "message" : "Right Arrow", 84 | "description" : "Right arrow text added to title" 85 | }, 86 | "rightDescription" : { 87 | "message" : "Find next box inside same wrapper", 88 | "description" : "Find next visible sibling element of highlight" 89 | }, 90 | "keyLeftArrow" : { 91 | "message" : "Left Arrow", 92 | "description" : "Left arrow text added to title" 93 | }, 94 | "leftDescription" : { 95 | "message" : "Find previous box inside same wrapper", 96 | "description" : "" 97 | }, 98 | "keyEnter" : { 99 | "message" : "Enter", 100 | "description" : "Press enter to remove highlight" 101 | }, 102 | "removeHighlight" : { 103 | "message" : "Remove the highlighted box", 104 | "description" : "Remove highlighted box" 105 | }, 106 | "keyBackspace" : { 107 | "message" : "Backspace", 108 | "description" : "Press backspace to undo last action" 109 | }, 110 | "undoAction" : { 111 | "message" : "Undo last action", 112 | "description" : "Undo last action" 113 | }, 114 | "keyNumpad" : { 115 | "message" : "Numpad", 116 | "description" : "Numpad key text description" 117 | }, 118 | "keyNumpadPlus" : { 119 | "message" : "Numpad Plus", 120 | "description" : "Numpad+ key" 121 | }, 122 | "fontUp" : { 123 | "message" : "Increase font-size by 1", 124 | "description" : "Use keyNumpad+ to increase font size" 125 | }, 126 | "keyNumpadMinus" : { 127 | "message" : "Numpad Minus", 128 | "description" : "Numpad- key" 129 | }, 130 | "fontDown" : { 131 | "message" : "Decrease font-size by 1", 132 | "description" : "Use keyNumpad- to decrease font size" 133 | }, 134 | "keyNumpadAsterisk" : { 135 | "message" : "Numpad Asterisk (Multiply)", 136 | "description" : "" 137 | }, 138 | "fontReset" : { 139 | "message" : "Reset font-size", 140 | "description" : "Reset font size to original" 141 | }, 142 | "mouseLeftClick" : { 143 | "message" : "left-click on mouse", 144 | "description" : "left mouse click" 145 | }, 146 | "keyAlt" : { 147 | "message" : "Alt", 148 | "description" : "Alt-key used with mouse-click" 149 | }, 150 | "removeOpposite" : { 151 | "message" : "Remove everything but highlighted box", 152 | "description" : "Remove opposite of highlight" 153 | }, 154 | "keyShift" : { 155 | "message" : "Shift", 156 | "description" : "Shift-key used with mouse-click" 157 | }, 158 | "fullWidth" : { 159 | "message" : "Set box width to 100% & margins to zero (highlight turns blue)", 160 | "description" : "Make highlighted element full width & add blue outline" 161 | }, 162 | "keyF1" : { 163 | "message" : "F1", 164 | "description" : "F1 key name" 165 | }, 166 | "keyF1Title" : { 167 | "message" : "Function One", 168 | "description" : "F1 key used to toggle messages" 169 | }, 170 | "toggleMessages" : { 171 | "message" : "Toggle action messages", 172 | "description" : "Action message display is toggled by the F1 key" 173 | }, 174 | "keyPS" : { 175 | "message" : "PrtScn", 176 | "description" : "Print Screen key (abbreviation)" 177 | }, 178 | "keyPSTitle" : { 179 | "message" : "Print Screen", 180 | "description" : "Print Screen key full name added to title" 181 | }, 182 | "printPage" : { 183 | "message" : "Print Page", 184 | "description" : "Print the current page" 185 | }, 186 | "keyEsc" : { 187 | "message" : "Esc", 188 | "description" : "Escape key to close Printliminator" 189 | }, 190 | "keyEscTitle" : { 191 | "message" : "Escape", 192 | "description" : "Escape key full name" 193 | }, 194 | "abort" : { 195 | "message" : "Disable Printliminator, but save undo history", 196 | "description" : "Disable Printliminator, but save undo history." 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /_locales/fr/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "printliminatorName" : { 3 | "message" : "The Printliminator", 4 | "description" : "Extension name" 5 | }, 6 | "printliminatorDescription" : { 7 | "message" : "Un outil simple pour améliorer l’impression des sites web.", 8 | "description" : "Extension Description" 9 | }, 10 | "commandButtons" : { 11 | "message" : "Outils", 12 | "description" : "Command buttons: undo, stylize, remove graphics & print" 13 | }, 14 | "clickToRemove" : { 15 | "message" : "Cliquez sur les élément de la page pour les faire disparaitre", 16 | "description" : "Click highlight to remove item" 17 | }, 18 | "altClickRemove" : { 19 | "message" : "Alt-cliquez sur un élément pour ne garder que lui", 20 | "description" : "Alt-click highlight to remove everything expect the item" 21 | }, 22 | "undoLast" : { 23 | "message" : "Annuler", 24 | "description" : "Undo the last action" 25 | }, 26 | "addStylize" : { 27 | "message" : "Supprimer
les styles", 28 | "description" : "Add print stylesheet" 29 | }, 30 | "removeGraphics" : { 31 | "message" : "Supprimer
les images", 32 | "description" : "Removes all images, iframes and video from the page" 33 | }, 34 | "sendToPrint" : { 35 | "message" : "Lancer
l’impression", 36 | "description" : "Print the page" 37 | }, 38 | "viewKeyboardCommands" : { 39 | "message" : "Voir les raccourcis clavier", 40 | "description" : "Open a list of keyboard commands" 41 | }, 42 | "hideKeyboardCommands" : { 43 | "message" : "Masquer les raccourcis clavier", 44 | "description" : "Close list of keyboard commands" 45 | }, 46 | "keyColumn" : { 47 | "message" : "Touche", 48 | "description" : "Key name column" 49 | }, 50 | "descriptionColumn" : { 51 | "message" : "Description", 52 | "description" : "Description of key action" 53 | }, 54 | "orText" : { 55 | "message" : "ou", 56 | "description" : "or text" 57 | }, 58 | "keyPageUp" : { 59 | "message" : "PagePrec", 60 | "description" : "Page up key" 61 | }, 62 | "keyUpArrow" : { 63 | "message" : "Flèche haut", 64 | "description" : "Up arrow key text added to title" 65 | }, 66 | "upDescription" : { 67 | "message" : "Sélectionner l’élement parent", 68 | "description" : "Find parent element of current highlight" 69 | }, 70 | "keyPageDown" : { 71 | "message" : "PageSuiv", 72 | "description" : "Page down key" 73 | }, 74 | "keyDownArrow" : { 75 | "message" : "Flèche bas", 76 | "description" : "Down arrow key text added to title" 77 | }, 78 | "downDescription" : { 79 | "message" : "Sélectionner l’élément enfant", 80 | "description" : "Find first visible child element of highlight" 81 | }, 82 | "keyRightArrow" : { 83 | "message" : "Flèche droite", 84 | "description" : "Right arrow text added to title" 85 | }, 86 | "rightDescription" : { 87 | "message" : "Sélectionner l’élément suivant", 88 | "description" : "Find next visible sibling element of highlight" 89 | }, 90 | "keyLeftArrow" : { 91 | "message" : "Flèche Gauche", 92 | "description" : "Left arrow text added to title" 93 | }, 94 | "leftDescription" : { 95 | "message" : "Sélectionner l’élément précédent", 96 | "description" : "" 97 | }, 98 | "keyEnter" : { 99 | "message" : "Entrer", 100 | "description" : "Press enter to remove highlight" 101 | }, 102 | "removeHighlight" : { 103 | "message" : "Supprimer l’élément sélectionner", 104 | "description" : "Remove highlighted box" 105 | }, 106 | "keyBackspace" : { 107 | "message" : "Retour arrière", 108 | "description" : "Press backspace to undo last action" 109 | }, 110 | "undoAction" : { 111 | "message" : "Annuler", 112 | "description" : "Undo last action" 113 | }, 114 | "keyNumpad" : { 115 | "message" : "Pavé num.", 116 | "description" : "Numpad key text description" 117 | }, 118 | "keyNumpadPlus" : { 119 | "message" : "Plus (pavé numérique)", 120 | "description" : "Numpad+ key" 121 | }, 122 | "fontUp" : { 123 | "message" : "Augmenter la taille des caractères", 124 | "description" : "Use keyNumpad+ to increase font size" 125 | }, 126 | "keyNumpadMinus" : { 127 | "message" : "Moins Plus (pavé numérique)", 128 | "description" : "Numpad- key" 129 | }, 130 | "fontDown" : { 131 | "message" : "Réduire la taille des caractères", 132 | "description" : "Use keyNumpad- to decrease font size" 133 | }, 134 | "keyNumpadAsterisk" : { 135 | "message" : "Étoile (pavé numérique", 136 | "description" : "" 137 | }, 138 | "fontReset" : { 139 | "message" : "Réinitialiser la taille des caractères", 140 | "description" : "Reset font size to original" 141 | }, 142 | "mouseLeftClick" : { 143 | "message" : "click gauche", 144 | "description" : "left mouse click" 145 | }, 146 | "keyAlt" : { 147 | "message" : "Alt", 148 | "description" : "Alt-key used with mouse-click" 149 | }, 150 | "removeOpposite" : { 151 | "message" : "Ne garder que l’élément sélectionne", 152 | "description" : "Remove opposite of highlight" 153 | }, 154 | "keyShift" : { 155 | "message" : "Shift", 156 | "description" : "Shift-key used with mouse-click" 157 | }, 158 | "fullWidth" : { 159 | "message" : "Appliquer une largeur de 100% et supprimer les marges (le contour de sélection devient bleu)", 160 | "description" : "Make highlighted element full width & add blue outline" 161 | }, 162 | "keyF1" : { 163 | "message" : "F1", 164 | "description" : "F1 key name" 165 | }, 166 | "keyF1Title" : { 167 | "message" : "Touche F1", 168 | "description" : "F1 key used to toggle messages" 169 | }, 170 | "toggleMessages" : { 171 | "message" : "Afficher/masquer le message d'action", 172 | "description" : "Action message display is toggled by the F1 key" 173 | }, 174 | "keyPS" : { 175 | "message" : "ImprEcrn", 176 | "description" : "Print Screen key (abbreviation)" 177 | }, 178 | "keyPSTitle" : { 179 | "message" : "Imprime Écran", 180 | "description" : "Print Screen key full name added to title" 181 | }, 182 | "printPage" : { 183 | "message" : "Imprimer la page", 184 | "description" : "Print the current page" 185 | }, 186 | "keyEsc" : { 187 | "message" : "Esc", 188 | "description" : "Escape key to close Printliminator" 189 | }, 190 | "keyEscTitle" : { 191 | "message" : "Échap", 192 | "description" : "Escape key full name" 193 | }, 194 | "abort" : { 195 | "message" : "Désactiver Printliminator en conservant l’historique d'annulation", 196 | "description" : "Disable Printliminator, but save undo history." 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /_locales/pt_BR/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "printliminatorName" : { 3 | "message" : "The Printliminator", 4 | "description" : "Extension name" 5 | }, 6 | "printliminatorDescription" : { 7 | "message" : "Uma ferramenta simples para tornar a impressão de sites melhor", 8 | "description" : "Extension Description" 9 | }, 10 | "commandButtons" : { 11 | "message" : "Outros Superpoderes Úteis", 12 | "description" : "Command buttons: undo, stylize, remove graphics & print" 13 | }, 14 | "clickToRemove" : { 15 | "message" : "Apenas clique em algo na página para removê-la", 16 | "description" : "Click highlight to remove item" 17 | }, 18 | "altClickRemove" : { 19 | "message" : "Alt-clique para remover o oposto", 20 | "description" : "Alt-click highlight to remove everything expect the item" 21 | }, 22 | "undoLast" : { 23 | "message" : "Desfazer
Último", 24 | "description" : "Undo the last action" 25 | }, 26 | "addStylize" : { 27 | "message" : "Adicionar estilos
de impressão", 28 | "description" : "Add print stylesheet" 29 | }, 30 | "removeGraphics" : { 31 | "message" : "Remover
Gráficos", 32 | "description" : "Removes all images, iframes and video from the page" 33 | }, 34 | "sendToPrint" : { 35 | "message" : "Enviar para
impressão", 36 | "description" : "Print the page" 37 | }, 38 | "viewKeyboardCommands" : { 39 | "message" : "Ver atalhos de teclado", 40 | "description" : "Open a list of keyboard commands" 41 | }, 42 | "hideKeyboardCommands" : { 43 | "message" : "Esconder atalhos de teclado", 44 | "description" : "Close list of keyboard commands" 45 | }, 46 | "keyColumn" : { 47 | "message" : "Chave", 48 | "description" : "Key name column" 49 | }, 50 | "descriptionColumn" : { 51 | "message" : "Descrição", 52 | "description" : "Description of key action" 53 | }, 54 | "orText" : { 55 | "message" : "ou", 56 | "description" : "or text" 57 | }, 58 | "keyPageUp" : { 59 | "message" : "PageUp", 60 | "description" : "Page up key" 61 | }, 62 | "keyUpArrow" : { 63 | "message" : "Seta para cima", 64 | "description" : "Up arrow key text added to title" 65 | }, 66 | "upDescription" : { 67 | "message" : "Encontrar o elemento que envolve a caixa destacada", 68 | "description" : "Find parent element of current highlight" 69 | }, 70 | "keyPageDown" : { 71 | "message" : "PageDown", 72 | "description" : "Page down key" 73 | }, 74 | "keyDownArrow" : { 75 | "message" : "Seta para baixo", 76 | "description" : "Down arrow key text added to title" 77 | }, 78 | "downDescription" : { 79 | "message" : "Encontrar o conteúdo da caixa destacada", 80 | "description" : "Find first visible child element of highlight" 81 | }, 82 | "keyRightArrow" : { 83 | "message" : "Seta para Direita", 84 | "description" : "Right arrow text added to title" 85 | }, 86 | "rightDescription" : { 87 | "message" : "Encontrar o próximo elemento no mesmo container", 88 | "description" : "Find next visible sibling element of highlight" 89 | }, 90 | "keyLeftArrow" : { 91 | "message" : "Seta para Esquerda", 92 | "description" : "Left arrow text added to title" 93 | }, 94 | "leftDescription" : { 95 | "message" : "Encontrar o elemento anterior no mesmo container", 96 | "description" : "" 97 | }, 98 | "keyEnter" : { 99 | "message" : "Enter", 100 | "description" : "Press enter to remove highlight" 101 | }, 102 | "removeHighlight" : { 103 | "message" : "Remove a caixa selecionada", 104 | "description" : "Remove highlighted box" 105 | }, 106 | "keyBackspace" : { 107 | "message" : "Backspace", 108 | "description" : "Press backspace to undo last action" 109 | }, 110 | "undoAction" : { 111 | "message" : "Desfazer a última ação", 112 | "description" : "Undo last action" 113 | }, 114 | "keyNumpad" : { 115 | "message" : "Numpad", 116 | "description" : "Numpad key text description" 117 | }, 118 | "keyNumpadPlus" : { 119 | "message" : "+(mais) do teclado numérico", 120 | "description" : "Numpad+ key" 121 | }, 122 | "fontUp" : { 123 | "message" : "Aumenta o tamanho da fonte em 1", 124 | "description" : "Use keyNumpad+ to increase font size" 125 | }, 126 | "keyNumpadMinus" : { 127 | "message" : "-(menos) do teclado numério", 128 | "description" : "Numpad- key" 129 | }, 130 | "fontDown" : { 131 | "message" : "Diminui o tamanho da fonte em 1", 132 | "description" : "Use keyNumpad- to decrease font size" 133 | }, 134 | "keyNumpadAsterisk" : { 135 | "message" : "*(asterisco) do teclado numérico", 136 | "description" : "" 137 | }, 138 | "fontReset" : { 139 | "message" : "Resetar tamanho da fonte", 140 | "description" : "Reset font size to original" 141 | }, 142 | "mouseLeftClick" : { 143 | "message" : "Clique com o botão esquerdo do mouse", 144 | "description" : "left mouse click" 145 | }, 146 | "keyAlt" : { 147 | "message" : "Alt", 148 | "description" : "Alt-key used with mouse-click" 149 | }, 150 | "removeOpposite" : { 151 | "message" : "Remover tudo menos a caixa selecionada", 152 | "description" : "Remove opposite of highlight" 153 | }, 154 | "keyShift" : { 155 | "message" : "Shift", 156 | "description" : "Shift-key used with mouse-click" 157 | }, 158 | "fullWidth" : { 159 | "message" : "Muda a largura da caixa para 100% & margem para zero (destaque se torna azul)", 160 | "description" : "Make highlighted element full width & add blue outline" 161 | }, 162 | "keyF1" : { 163 | "message" : "F1", 164 | "description" : "F1 key name" 165 | }, 166 | "keyF1Title" : { 167 | "message" : "Função Um", 168 | "description" : "F1 key used to toggle messages" 169 | }, 170 | "toggleMessages" : { 171 | "message" : "Alternar mensagens de ação", 172 | "description" : "Action message display is toggled by the F1 key" 173 | }, 174 | "keyPS" : { 175 | "message" : "PrtScn", 176 | "description" : "Print Screen key (abbreviation)" 177 | }, 178 | "keyPSTitle" : { 179 | "message" : "Print Screen", 180 | "description" : "Print Screen key full name added to title" 181 | }, 182 | "printPage" : { 183 | "message" : "Imprimir Página", 184 | "description" : "Print the current page" 185 | }, 186 | "keyEsc" : { 187 | "message" : "Esc", 188 | "description" : "Escape key to close Printliminator" 189 | }, 190 | "keyEscTitle" : { 191 | "message" : "Escape", 192 | "description" : "Escape key full name" 193 | }, 194 | "abort" : { 195 | "message" : "Desabilita Printliminator, mas salva o histórico", 196 | "description" : "Disable Printliminator, but save undo history." 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /_locales/sr/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "printliminatorName" : { 3 | "message" : "The Printliminator", 4 | "description" : "Extension name" 5 | }, 6 | "printliminatorDescription" : { 7 | "message" : "Једноставан алат за боље штампање веб страница.", 8 | "description" : "Extension Description" 9 | }, 10 | "commandButtons" : { 11 | "message" : "Остале корисне могућности", 12 | "description" : "Command buttons: undo, stylize, remove graphics & print" 13 | }, 14 | "clickToRemove" : { 15 | "message" : "Кликни на елемент на страници за уклањање", 16 | "description" : "Click highlight to remove item" 17 | }, 18 | "altClickRemove" : { 19 | "message" : "Alt-клик за уклањање супротног", 20 | "description" : "Alt-click highlight to remove everything expect the item" 21 | }, 22 | "undoLast" : { 23 | "message" : "Опозови
последње", 24 | "description" : "Undo the last action" 25 | }, 26 | "addStylize" : { 27 | "message" : "Додај стилове
штампања", 28 | "description" : "Add print stylesheet" 29 | }, 30 | "removeGraphics" : { 31 | "message" : "Уклони
графику", 32 | "description" : "Removes all images, iframes and video from the page" 33 | }, 34 | "sendToPrint" : { 35 | "message" : "Одштампај
страницу", 36 | "description" : "Print the page" 37 | }, 38 | "viewKeyboardCommands" : { 39 | "message" : "Види тастерске пречице", 40 | "description" : "Open a list of keyboard commands" 41 | }, 42 | "hideKeyboardCommands" : { 43 | "message" : "Сакриј тастерске пречице", 44 | "description" : "Close list of keyboard commands" 45 | }, 46 | "keyColumn" : { 47 | "message" : "Тастер", 48 | "description" : "Key name column" 49 | }, 50 | "descriptionColumn" : { 51 | "message" : "Опис", 52 | "description" : "Description of key action" 53 | }, 54 | "orText" : { 55 | "message" : "или", 56 | "description" : "or text" 57 | }, 58 | "keyPageUp" : { 59 | "message" : "PageUp", 60 | "description" : "Page up key" 61 | }, 62 | "keyUpArrow" : { 63 | "message" : "Стрелица горе", 64 | "description" : "Up arrow key text added to title" 65 | }, 66 | "upDescription" : { 67 | "message" : "Нађи матични елемент који укључује истакнути оквир", 68 | "description" : "Find parent element of current highlight" 69 | }, 70 | "keyPageDown" : { 71 | "message" : "PageDown", 72 | "description" : "Page down key" 73 | }, 74 | "keyDownArrow" : { 75 | "message" : "Стрелица доле", 76 | "description" : "Down arrow key text added to title" 77 | }, 78 | "downDescription" : { 79 | "message" : "Нађи садржај истакнутог оквира", 80 | "description" : "Find first visible child element of highlight" 81 | }, 82 | "keyRightArrow" : { 83 | "message" : "Стрелица десно", 84 | "description" : "Right arrow text added to title" 85 | }, 86 | "rightDescription" : { 87 | "message" : "Нађи следећи оквир унутар истог матичног елемента", 88 | "description" : "Find next visible sibling element of highlight" 89 | }, 90 | "keyLeftArrow" : { 91 | "message" : "Стрелица лево", 92 | "description" : "Left arrow text added to title" 93 | }, 94 | "leftDescription" : { 95 | "message" : "Нађи претходни оквир унутар истог матичног елемента", 96 | "description" : "" 97 | }, 98 | "keyEnter" : { 99 | "message" : "Enter", 100 | "description" : "Press enter to remove highlight" 101 | }, 102 | "removeHighlight" : { 103 | "message" : "Уклони садржај оквира", 104 | "description" : "Remove highlighted box" 105 | }, 106 | "keyBackspace" : { 107 | "message" : "Backspace", 108 | "description" : "Press backspace to undo last action" 109 | }, 110 | "undoAction" : { 111 | "message" : "Опозови последњу радњу", 112 | "description" : "Undo last action" 113 | }, 114 | "keyNumpad" : { 115 | "message" : "Numpad", 116 | "description" : "Numpad key text description" 117 | }, 118 | "keyNumpadPlus" : { 119 | "message" : "Плус на нумеричкој тастатури", 120 | "description" : "Numpad+ key" 121 | }, 122 | "fontUp" : { 123 | "message" : "Повећај величину фонта за 1", 124 | "description" : "Use keyNumpad+ to increase font size" 125 | }, 126 | "keyNumpadMinus" : { 127 | "message" : "Минус на нумеричкој тастатури", 128 | "description" : "Numpad- key" 129 | }, 130 | "fontDown" : { 131 | "message" : "Смањи величину фонта за 1", 132 | "description" : "Use keyNumpad- to decrease font size" 133 | }, 134 | "keyNumpadAsterisk" : { 135 | "message" : "Звездица на нумеричкој тастатури (множење)", 136 | "description" : "" 137 | }, 138 | "fontReset" : { 139 | "message" : "Врати почетну величину фонта", 140 | "description" : "Reset font size to original" 141 | }, 142 | "mouseLeftClick" : { 143 | "message" : "клик левим тастером миша", 144 | "description" : "left mouse click" 145 | }, 146 | "keyAlt" : { 147 | "message" : "Alt", 148 | "description" : "Alt-key used with mouse-click" 149 | }, 150 | "removeOpposite" : { 151 | "message" : "Уклони све изван истакнутог оквира", 152 | "description" : "Remove opposite of highlight" 153 | }, 154 | "keyShift" : { 155 | "message" : "Shift", 156 | "description" : "Shift-key used with mouse-click" 157 | }, 158 | "fullWidth" : { 159 | "message" : "Постави ширину оквира на 100% и ивице на нула (истакнуто постаје плаво)", 160 | "description" : "Make highlighted element full width & add blue outline" 161 | }, 162 | "keyF1" : { 163 | "message" : "F1", 164 | "description" : "F1 key name" 165 | }, 166 | "keyF1Title" : { 167 | "message" : "Function One", 168 | "description" : "F1 key used to toggle messages" 169 | }, 170 | "toggleMessages" : { 171 | "message" : "Укључи/искључи информације о радњи", 172 | "description" : "Action message display is toggled by the F1 key" 173 | }, 174 | "keyPS" : { 175 | "message" : "PrtScn", 176 | "description" : "Print Screen key (abbreviation)" 177 | }, 178 | "keyPSTitle" : { 179 | "message" : "Print Screen", 180 | "description" : "Print Screen key full name added to title" 181 | }, 182 | "printPage" : { 183 | "message" : "Одштампај страницу", 184 | "description" : "Print the current page" 185 | }, 186 | "keyEsc" : { 187 | "message" : "Esc", 188 | "description" : "Escape key to close Printliminator" 189 | }, 190 | "keyEscTitle" : { 191 | "message" : "Escape", 192 | "description" : "Escape key full name" 193 | }, 194 | "abort" : { 195 | "message" : "Онемогући Printliminator али сачувај историју", 196 | "description" : "Disable Printliminator, but save undo history." 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /archived/css/printliminator.css: -------------------------------------------------------------------------------- 1 | @media print, screen { 2 | 3 | body { 4 | margin:0; 5 | padding:0; 6 | line-height: 1.4; 7 | word-spacing: 1.1pt; 8 | letter-spacing: 0.2pt; 9 | font-family: Garamond, "Times New Roman", serif; 10 | color: #000; 11 | background: none; 12 | font-size: 12pt; 13 | } 14 | 15 | /*Headings */ 16 | h1,h2,h3,h4,h5,h6 { font-family: Helvetica, Arial, sans-serif; } 17 | h1{font-size:19pt;} 18 | h2{font-size:17pt;} 19 | h3{font-size:15pt;} 20 | h4,h5,h6{font-size:12pt;} 21 | 22 | code { font: 10pt Courier, monospace; } 23 | blockquote { margin: 1.3em; padding: 1em; font-size: 10pt; } 24 | hr { background-color: #ccc; } 25 | 26 | /* Images */ 27 | img { float: left; margin: 1em 1.5em 1.5em 0; } 28 | a img { border: none; } 29 | 30 | /* Table */ 31 | table { margin: 1px; text-align:left; border-collapse: collapse; } 32 | th { border: 1px solid #333; font-weight: bold; } 33 | td { border: 1px solid #333; } 34 | th,td { padding: 4px 10px; } 35 | tfoot { font-style: italic; } 36 | caption { background: #fff; margin-bottom: 20px; text-align:left; } 37 | thead {display: table-header-group;} 38 | tr {page-break-inside: avoid;} 39 | 40 | } 41 | 42 | @media screen { 43 | body { padding: 20px; } 44 | } 45 | -------------------------------------------------------------------------------- /archived/images/printliminator-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator-bg.png -------------------------------------------------------------------------------- /archived/images/printliminator-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator-close.png -------------------------------------------------------------------------------- /archived/images/printliminator-printstylize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator-printstylize.png -------------------------------------------------------------------------------- /archived/images/printliminator-removeimages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator-removeimages.png -------------------------------------------------------------------------------- /archived/images/printliminator-sendtoprinter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator-sendtoprinter.png -------------------------------------------------------------------------------- /archived/images/printliminator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/archived/images/printliminator.png -------------------------------------------------------------------------------- /archived/js/printliminator-v1.js: -------------------------------------------------------------------------------- 1 | function printlimator() { 2 | //remove conflicts with other javascript libraries 3 | var $ = jQuery; 4 | var dont = false; 5 | $('body *:not(._print_controls, ._print_controls *)').live('click', function (e) { 6 | if (!dont) { 7 | e.preventDefault(); 8 | if(e.altKey) { 9 | $("body *").not("._print_controls, ._print_controls *") 10 | .not($(this).parents().andSelf()) 11 | .not($(this).find("*")) 12 | .remove(); 13 | } 14 | else $(this).remove() 15 | } 16 | }).live('mouseover', function () { 17 | if (!dont) $(this).css('outline', '3px solid red') 18 | }).live('mouseout', function () { 19 | if (!dont) $(this).css('outline', 'none') 20 | }); 21 | 22 | var controls = $('
').addClass('_print_controls').css({ 23 | position: 'fixed', 24 | top: 15, 25 | right: 15, 26 | width: 258, 27 | height: 101, 28 | background: 'url(http://css-tricks.com/examples/ThePrintliminator/images/printliminator.png) no-repeat', 29 | zIndex: 10000 30 | }).mouseover(function () { 31 | dont = true 32 | }).mouseout(function () { 33 | dont = false 34 | }).appendTo('body'); 35 | 36 | //fix IE6, which doesn't support position: fixed 37 | if (controls.css('position') != 'fixed') { 38 | controls.css('position', 'absolute'); 39 | } 40 | 41 | //Remove Graphics 42 | $('
').css({ 43 | background: 'url(http://css-tricks.com/examples/ThePrintliminator/images/printliminator.png) -68px -101px no-repeat', 44 | position: 'absolute', 45 | top: 12, 46 | left: 15, 47 | width: 68, 48 | height: 68 49 | }).click(function () { 50 | $('img,iframe,object,embed,input[type=image],ins').remove(); 51 | $('*:not(._print_controls, ._print_controls *)').css('background-image', 'none'); 52 | }).hover(function(){ 53 | $(this).css({ 54 | "background-position": "0 -101px" 55 | }) 56 | }, function(){ 57 | $(this).css({ 58 | "background-position": "-68px -101px" 59 | }) 60 | }).appendTo(controls); 61 | 62 | // Print Stylize 63 | $('
').css({ 64 | background: 'url(http://css-tricks.com/examples/ThePrintliminator/images/printliminator.png) no-repeat -68px -237px', 65 | position: 'absolute', 66 | top: 12, 67 | left: 96, 68 | width: 68, 69 | height: 68 70 | }).click(function () { 71 | $("link[rel='stylesheet'], style:not(#_print_control_styles)").remove(); 72 | $('body *:not(._print_controls, ._print_controls > *)').attr("style", ""); 73 | $("head").append(""); 74 | }).hover(function(){ 75 | $(this).css({ 76 | "background-position": "0 -237px" 77 | }) 78 | }, function(){ 79 | $(this).css({ 80 | "background-position": "-68px -237px" 81 | }) 82 | }).appendTo(controls); 83 | 84 | //Print 85 | $('
').css({ 86 | background: 'url(http://css-tricks.com/examples/ThePrintliminator/images/printliminator.png) -68px -169px no-repeat', 87 | position: 'absolute', 88 | top: 12, 89 | left: 176, 90 | width: 68, 91 | height: 68 92 | }).hover(function(){ 93 | $(this).css({ 94 | "background-position": "0 -169px" 95 | }) 96 | }, function(){ 97 | $(this).css({ 98 | "background-position": "-68px -169px" 99 | }) 100 | }).click(function () { 101 | window.print(); 102 | }).appendTo(controls); 103 | 104 | //Close 105 | $('
').css({ 106 | background: 'url(http://css-tricks.com/examples/ThePrintliminator/images/printliminator.png) -258px 0 no-repeat', 107 | position: 'absolute', 108 | top: -7, 109 | right: -7, 110 | width: 23, 111 | height: 23 112 | }).hover(function(){ 113 | $(this).css({ 114 | "background-position": "-281px 0" 115 | }) 116 | }, function(){ 117 | $(this).css({ 118 | "background-position": "-258px 0" 119 | }) 120 | }).click(function(){ 121 | $('._print_controls').remove(); 122 | }).appendTo(controls); 123 | 124 | //make sure that the controls don't get printed 125 | $(''),b.close(),a.addEvent(b.querySelector("."+a.css.noGraphics),"click",a.removeGraphics),a.addEvent(b.querySelector("."+a.css.print),"click",a.print),a.addEvent(b.querySelector("."+a.css.undo),"click",a.undo),a.addEvent(b.querySelector("."+a.css.stylize),"click",a.stylize),a.addEvent(b.querySelector("."+a.css.close),"click",a.abort),a.addEvent(b.querySelector("."+a.css.keyboard),"click",a.keyboard),a.addEvent(document.querySelector("."+a.css.drag),"mousedown",a.dragInit),a.addEvent(b,"mouseup",a.docMouseUp)},keyboard:function(){var b=document.querySelector("."+a.css.wrap),c=b.querySelector("iframe."+a.css.controls),d=c.contentWindow.document.body,e=d.querySelector("#"+a.css.keyboard),f=d.querySelector("."+a.css.keyboard),g=e.style.display,h="none"===g;f.innerHTML=h?"Hide Keyboard Commands":"View Keyboard Commands",e.style.display=h?"":"none",b.style.height=(h?a.keyboardOpen:a.keyboardClosed)+5+"px",c.style.height=(h?a.keyboardOpen:a.keyboardClosed)+5+"px",d.style.height=(h?a.keyboardOpen:a.keyboardClosed)+20+"px"},dragInit:function(){var b=a.drag;a.addClass(document.querySelector("."+a.css.drag),a.css.dragActive),b.el=document.querySelector("."+a.css.wrap),b.elm[0]=b.pos[0]-b.el.offsetLeft,b.elm[1]=b.pos[1]-b.el.offsetTop,a.toggleSelection(!0)},docMouseMove:function(b){var c=a.drag;c.pos[0]=document.all?window.event.clientX:b.pageX,c.pos[1]=document.all?window.event.clientY:b.pageY,null!==a.drag.el&&(c.el.style.left=c.pos[0]-c.elm[0]+"px",c.el.style.top=c.pos[1]-c.elm[1]+"px")},docMouseUp:function(){a.drag.el=null,a.removeClass(document.querySelector("."+a.css.drag),a.css.dragActive),a.toggleSelection()},stopSelection:function(){return!1},toggleSelection:function(b){var c=document.body;b?(a.savedUnsel=c.getAttribute("unselectable"),c.setAttribute("unselectable","on"),a.addClass(c,a.css.noSelection),a.addEvent(c,"onselectstart",a.stopSelection)):(a.savedUnsel&&c.setAttribute("unselectable",a.savedUnsel),a.removeClass(c,a.css.noSelection),a.removeEvent(c,"onselectstart",a.stopSelection)),a.clearSelection()},clearSelection:function(){var a=window.getSelection?window.getSelection():document.selection;a&&(a.removeAllRanges?a.removeAllRanges():a.empty&&a.empty())},hide:function(b){if(b){var c,d=b.length;if("undefined"!=typeof d)for(c=0;d>c;c++)a.addClass(b[c],a.css.hidden);else a.addClass(b,a.css.hidden)}},show:function(b){if(b){var c,d=b.length;if("undefined"!=typeof d)for(c=0;d>c;c++)a.removeClass(b[c],a.css.hidden);else a.removeClass(b,a.css.hidden)}},addClass:function(b,c){b&&(b.classList?b.classList.add(c):a.hasClass(b,c)||(b.className+=" "+c))},removeClass:function(a,b){a&&(a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("\\b"+b+"\\b","g"),""))},hasClass:function(a,b){return a?a.classList?a.classList.contains(b):new RegExp("\\b"+b+"\\b").test(a.className):!1},addEvent:function(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener(b,c)},removeEvent:function(a,b,c){a.detachEvent?a.detachEvent("on"+b,c):a.removeEventListener(b,c)}}}(); -------------------------------------------------------------------------------- /src/bookmarklet/bookmark.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | Bookmarks 4 |
5 |
The Printliminator
6 |
7 | -------------------------------------------------------------------------------- /src/bookmarklet/bookmarklet.js: -------------------------------------------------------------------------------- 1 | /* 2 | Don't wrap this code in a self-executing anonymous function, i.e. 3 | (function(){ CODE })(); 4 | because uglify changes it into 5 | !function(){ CODE }(); 6 | and Firefox does not work with that format! 7 | */ 8 | // uncompressed bookmarklet code 9 | function loadScript(url, callback) { 10 | var script = document.createElement('script'), 11 | head = document.getElementsByTagName('head')[0], 12 | done = false; 13 | script.type = 'text/javascript'; 14 | script.src = url; 15 | script.onload = script.onreadystatechange = function() { 16 | if ( !done && ( !this.readyState || this.readyState == 'loaded' || this.readyState == 'complete' ) ) { 17 | done = true; 18 | callback(); 19 | } 20 | }; 21 | head.appendChild(script); 22 | } 23 | // dev = src/printliminator.js 24 | // production = //css-tricks.github.io/The-Printliminator/printliminator.min.js 25 | loadScript('{printliminator}', function() { 26 | thePrintliminator.init(); 27 | }); 28 | -------------------------------------------------------------------------------- /src/bookmarklet/iframe.html: -------------------------------------------------------------------------------- 1 |
2 |
CLOSE
3 |
DRAG
4 |
5 |
6 | 7 |

Just click stuff on page to remove. Alt-click to remove opposite.

8 |
9 | -------------------------------------------------------------------------------- /src/bookmarklet/iframe.scss: -------------------------------------------------------------------------------- 1 | $keyboardClosed : /* @echo keyboardClosed */px; 2 | $icon : /* @echo icon */; 3 | $drag : /* @echo drag */; 4 | $print : /* @echo print */; 5 | $close : /* @echo close */; 6 | $undo : /* @echo undo */; 7 | $noGraphics : /* @echo noGraphics */; 8 | $stylize : /* @echo stylize */; 9 | $busy : /* @echo busy */; 10 | $leftClick : /* @echo leftClick */; 11 | $toggle : /* @echo toggle */; 12 | 13 | *, *:before, *:after { 14 | box-sizing: inherit; 15 | } 16 | html { 17 | box-sizing: border-box; 18 | height: 100%; 19 | } 20 | html, body { 21 | background: #eee; 22 | min-height: $keyboardClosed; 23 | font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif; 24 | font-size: 14px; 25 | margin: 0; 26 | padding: 0; 27 | cursor: default; 28 | overflow: hidden; 29 | -webkit-user-select: none; 30 | -moz-user-select: none; 31 | -ms-user-select: none; 32 | user-select: none; 33 | } 34 | .top { 35 | background: #fff; 36 | padding: 15px; 37 | 38 | h3 { 39 | color: #ccc; 40 | margin: 0; 41 | } 42 | h3 span { 43 | color: red; 44 | } 45 | } 46 | 47 | .header, li { 48 | background: #111; 49 | color: #fff; 50 | font-size: 11px; 51 | } 52 | .header, .header > div { 53 | height: 21px; 54 | font-size: 11px; 55 | } 56 | .header > div, li { 57 | display: inline-block; 58 | } 59 | .right { 60 | float: right; 61 | margin-right: 6px; 62 | } 63 | 64 | .footer { 65 | padding: 15px 15px 0 15px; 66 | 67 | ul { 68 | margin: 0 0 15px 0; 69 | padding: 0; 70 | list-style-type: none; 71 | } 72 | } 73 | .keyboard-area { 74 | margin: 0 -15px 0 -15px; 75 | /* extend keyboard background outside of popup - accomidate for different row heights in browsers */ 76 | padding: 15px 15px 50px 15px; 77 | background: #ccc; 78 | } 79 | .#{$toggle} { 80 | font-size: 12px; 81 | margin: 0 0 15px 0; 82 | cursor: pointer; 83 | } 84 | .pl_logo { 85 | width: 225px; 86 | height: 15px; 87 | margin: 0 0 5px 0; 88 | } 89 | h1, h3 { 90 | margin: 0 0 10px; 91 | font-weight: normal; 92 | text-transform: uppercase; 93 | } 94 | h3 { 95 | font-size: 10px; 96 | font-weight: bold; 97 | } 98 | .#{$close}, .#{$drag} { 99 | text-transform: uppercase; 100 | } 101 | 102 | .#{$icon} { 103 | display: inline-block; 104 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAAyCAMAAAC3W38jAAABBVBMVEUAAAD///88OjpmZmbc3Nx1dXXFxcUsJCQfHByUlJRQUFCPj4/AwMBvb2/7+/vhhyeZmZnhhyfhhydZWVnm5ua2trZ9fX329vbU1NSEhIThhyf9/f2Kiorhhyfz8/Pi4uK8vLxVAADQ0NDKysqysrLhhyfhhyevr6+jo6NJSUnx8fHf39/hhyfs7OzhhyfhhyeoqKjhhyf/AADhhyfkAADPAADhhydtAADhhyf5AADYAADFAABGAAC4AACmAACPAAD/////AADhhycAAAD8+/v/mpr/zc3/Hh719fX/1NT/ra32AADr6+v/UVH/39//urpvb2/h4eHLy8uwsLCMjIxKSkoeHh7ZAYxEAAAAQHRSTlMA6ydSyGKyFwqBPHutXOfuhbt3RtOiaeLBcBHpdkTfz6hAvLaeIt2bjzXdy5nYzKqVVetmz7qIVzPkw7Exo5F6MVTl7AAABPFJREFUWMPc1n9v0kAcx/GPRX4PS7tgYiMZXSjGBCEFxvi1rXcwEHE6Nfr8H4r3pV3vappetxn/8BUSkv7zzl37vRbP4Juc9zwoKgeWpYw8DFUFCTYX2lBcsUxL5FB7tZGCBhLalITCnbNM88s8yUBV1CQvmMbiycnZ0IPgiOIguuAAKI/Yg7svt+xo93W7k8lRGarXLxUNhAz14lkBR47JTR+CSFoQ7PD/hsVugyBs7oPgjknXUDUDxVtk6HNhCsDkfAg4FhfGwJJJ2yD4JNa4pbTiAqrKn8/mi3RF8KOBB9Gy0TY5sVBZMGm3p9iewqpJGVmCFJ/phtphxBxTcsqPej5WNJSJdW4om3BwoajVFe9Tkx9/ru9FEo7dC6P0I9YYgMsSaFNpjUluxr1MS35br3+JJBErjA3bQN5kYjJPm81qpFmtpSY3P+6/x5PS7ocr7XuATGo2ViZz38tNNJzR5pLeGKHVQf/4JO+lUVAYcfJD5yTUOVPOA69v8ljPdiCUJ/ohmRhQ1ION9CZOtvCgGiXlnop1DpTdXeqPguRcNkqKAoBOt9stJZLn77rdVg1WNJgzGhI/Wq4NXDPdgceuoFVLJBs4CiNTB5Skw4cMAXfENEbuY5NF+Z40/fiMle/NCdOY44lJDOi0k0k686YQLnXLvHlksh4nPTv8o6c1mhgnzwtzUcmVPC80QoWW9hWNFcvk4rlfBT4lHfxlRulEKp2mfm79S7OhZfUd/B9+11Z2u6kCQQCeYUVWrYQE5CeYamoTrcSkjzCNXPSil+f9n+XMwGF3QeB40+/GsHH5ZmdnhjiNNlsPnkfHUQotKlIBTPPhr1a+N1x8v4Y1UZ1Vew3PcUmI0AdhjUSv5wlpUCRZ8+pDod3tJRkWPrh8fY0X3AKJlds2YCQmiWEElTivViYO2W7B6AnlSf6Yi1FQSxQn9HljQ4TE3JLkRgz6nZEE1znrE7yQCFdgSZEXBteV4bsYcZkGvCPNkajctsGI5bj8Zzu0+bLKL+bOgIuq+fbApXqcIa8kXM1qIXFq2Y1iBJ2jBN7ET5W2iRWIuQ+VObgcp5QXMBSseAfQktZdez2YSi3IOTfWKNDQuWblAlwkS/GYEhd2+RMpi0Hx6k8AjM4jEDZdJbBvShnXTrWY69mOKQn3YECiAi7EHAIw7KVhQm9euaKxxJ5HlLjT/VycODohN06FxNT+XGLXm6xLvsFHDvQS674STSuaUBO4UkPl2TMK0bQyOEn4+KKhx1li/V54YMjoUECfguOCkBrQt1ciXKaVf4ipNzDE/ybmEwy3zwAs9pQVCWV3xfqEJHTh3R26eXwj5hpBn/RWSxHEYLBC9y6XcBwWVd6EoDolGe72PLvQ7HFroJQ5MwsS7aGQG2h3t58uLR2WwbRSOJOUHgxWljCJ7cs1fFxZqYBJw0XQbX75j1KN9qUP8/gl0ZF/d0iihrSUXmmfy3hSaadP9fBpiWGWtJuxwCp6VfzMVAGfXQbhhHJ+xm5hEu2pHE1jFE1DfVPDj5RdosE6rXE2sflsYvXbDzHYNcIGqcfBA3hw3h+/l8rNtBxhDVMENTHOKCpKR4pSRC6mKV0Wzfj86CK4hKbMx5VEeFhpcNhdO2PiwzPEIYkkbo1XM8Am0KnSMGC9Xx4wy8/bAJ4jOMloT01Ww9yDXydeLbshejlFCgb8Benk+XzCxsfpAAAAAElFTkSuQmCC) no-repeat; 105 | width: 25px; 106 | height: 25px; 107 | vertical-align: middle; 108 | } 109 | 110 | .#{$drag} .#{$icon} { background-position: 0 0; } 111 | .#{$print} .#{$icon} { background-position: -25px 0; } 112 | .#{$close} .#{$icon} { background-position: -75px 0; width: 40px; cursor: pointer; } 113 | .#{$undo} .#{$icon} { background-position: 0 -25px; } 114 | .#{$noGraphics} .#{$icon} { background-position: -25px -25px; } 115 | .#{$stylize} .#{$icon} { background-position: -75px -25px; width: 35px; } 116 | .#{$leftClick} { background-position: -50px -25px; } 117 | li.#{$busy} .#{$icon} { 118 | background-position: -50px 0; 119 | -webkit-animation:spin 1.5s linear infinite; 120 | -moz-animation:spin 1.5s linear infinite; 121 | animation:spin 1.5s linear infinite; 122 | } 123 | 124 | @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } 125 | @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } 126 | @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } 127 | 128 | li { 129 | padding: 4px 14px 4px 4px; 130 | line-height: 12px; 131 | font-size: 10px; 132 | text-transform: uppercase; 133 | text-align: left; 134 | white-space: nowrap; 135 | margin: 2px; 136 | cursor: pointer; 137 | display: inline-block; 138 | 139 | &:hover { 140 | background-color: #333; 141 | } 142 | span { 143 | float: left; 144 | margin: 0 10px 0 0; 145 | text-align: left; 146 | } 147 | } 148 | 149 | .key { 150 | width: 30%; 151 | } 152 | table { 153 | margin: 0 4px; 154 | border-spacing: 0; 155 | } 156 | th { 157 | text-align: left; 158 | padding: 0; 159 | } 160 | kbd { 161 | background: #fff; 162 | border: #000 1px solid; 163 | border-radius: 3px; 164 | padding: 1px 3px; 165 | } 166 | td { 167 | border-top: 1px solid #aaa; 168 | font-size: 12px; 169 | padding: 5px; 170 | /* make Firefox match Webkit */ 171 | line-height: 18px; 172 | } 173 | -------------------------------------------------------------------------------- /src/bookmarklet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | The Printliminator Demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

19 | CSS-Tricks Example 20 |

21 |
22 |
23 |
24 | 25 |
26 | 27 |

The Printliminator

28 | 29 |

The Printliminator (repo) is a bookmarklet with some simple tools you can use to makes websites print better. One click to activate, and then click to remove elements from the page, remove graphics, and apply better print styling.

30 | 31 |

Here is the bookmarklet:

32 | 33 |

34 | The Printliminator 35 | drag to your bookmarks bar 36 |

37 | 38 |

Video Demo

39 | 40 |
41 | 42 |
43 | 44 |

Credits

45 | 46 |

47 | By Chris Coyier and Devon Govett. 48 | Updates & extensions by Rob Garrison. 49 | Print stylesheet based on Hartija. 50 |

51 | 52 |
53 | 54 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/chrome/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_printliminatorName__", 3 | "version": "4.0.5", 4 | "manifest_version": 2, 5 | "author": "Chris Coyier", 6 | "description": "__MSG_printliminatorDescription__", 7 | "homepage_url": "https://github.com/CSS-Tricks/The-Printliminator", 8 | "default_locale": "en", 9 | "icons": { 10 | "16": "icon16.png", 11 | "32": "icon32.png", 12 | "48": "icon48.png", 13 | "64": "icon64.png", 14 | "128": "icon128.png" 15 | }, 16 | "browser_action": { 17 | "default_icon": "icon32.png", 18 | "default_title": "__MSG_printliminatorName__", 19 | "default_popup": "popup.html" 20 | }, 21 | "permissions": [ 22 | "activeTab" 23 | ], 24 | "web_accessible_resources": [ 25 | "printliminator.js", 26 | "printliminator.css" 27 | ] 28 | } -------------------------------------------------------------------------------- /src/chrome/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 50 |

51 |
52 |
53 |

54 |
    55 |
  • 56 | 57 |
  • 58 |
  • 59 | 60 |
  • 61 |
  • 62 | 63 |
  • 64 |
  • 65 | 66 |
  • 67 |
68 |
69 |

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 122 | 123 | 124 | 125 | 129 | 130 | 131 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |
148 |
149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /src/chrome/popup.js: -------------------------------------------------------------------------------- 1 | /*globals chrome */ 2 | // inject printliminator from popup & control from there. 3 | var commands = { 4 | remove : function() { 5 | chrome.tabs.executeScript( null, { 6 | code: 'thePrintliminator.removeGraphics();' 7 | }); 8 | }, 9 | print : function() { 10 | document.querySelector( 'li.print' ).classList.add( '/* @echo busy */' ); 11 | // ready state is delayed when a file on the page is not found 12 | chrome.tabs.executeScript( null, { 13 | code : 'document.readyState === "complete";' 14 | }, function( result ) { 15 | if ( result && result[ 0 ] === true ) { 16 | window.close(); 17 | chrome.tabs.executeScript( null, { 18 | code : 'thePrintliminator.print();' 19 | }); 20 | } else { 21 | // keep checking ready state for 20 seconds 22 | // if still not ready, abort, but still call print function 23 | var loopy = function( i ) { 24 | setTimeout(function () { 25 | chrome.tabs.executeScript( null, { 26 | code : 'document.readyState === "complete";' 27 | }, function( result ) { 28 | if ( result && result[ 0 ] === true || i === 1 ) { 29 | i = 0; 30 | window.close(); 31 | chrome.tabs.executeScript( null, { 32 | code : 'thePrintliminator.print();' 33 | }); 34 | } 35 | if ( --i > 0 ) { 36 | loopy(i); 37 | } 38 | }); 39 | }, 1000); 40 | }; 41 | // repeat 20 times (20 seconds), then just close the popup 42 | loopy( 20 ); 43 | } 44 | }); 45 | }, 46 | stylize : function() { 47 | chrome.tabs.executeScript( null, { 48 | code : 'thePrintliminator.stylize();' 49 | }); 50 | }, 51 | keyboard : function() { 52 | var indx, 53 | table = document.querySelector( '#/* @echo keyboard */' ), 54 | mode = table.style.display === 'none'; 55 | table.style.display = mode ? '' : 'none'; 56 | this.innerHTML = chrome.i18n.getMessage( mode ? 'hideKeyboardCommands' : 'viewKeyboardCommands' ); 57 | }, 58 | undo : function() { 59 | chrome.tabs.executeScript( null, { 60 | code : 'thePrintliminator.undo();' 61 | }); 62 | }, 63 | setLanguage : function(){ 64 | // update all text content 65 | commands.getMsg( document.querySelectorAll( '[i18n-text]' ), 'text' ); 66 | commands.getMsg( document.querySelectorAll( '[i18n-title]' ), 'title' ); 67 | }, 68 | getMsg : function( elms, target ) { 69 | var indx, msgKey, message, 70 | len = elms.length; 71 | for ( indx = 0; indx < len; indx++ ) { 72 | msgKey = elms[ indx ].getAttribute( 'i18n-' + target ); 73 | message = chrome.i18n.getMessage( msgKey ); 74 | if ( target === 'text' ) { 75 | elms[ indx ].innerHTML += message; 76 | } else { 77 | elms[ indx ].title = message.replace( '
', ' ' ); 78 | } 79 | } 80 | } 81 | }; 82 | 83 | chrome.windows.getCurrent( function( win ) { 84 | chrome.tabs.query({ 85 | windowId : win.id, 86 | active : true 87 | }, function( tabArray ) { 88 | 89 | // don't try to open a popup on chrome settings pages 90 | if ( tabArray && /^chrome/.test( tabArray[ 0 ].url || '' ) ) { 91 | return false; 92 | } 93 | 94 | // inject css & js only on initial click 95 | chrome.tabs.executeScript( null, { 96 | code : 'document.querySelector( "body" ).classList.contains( "/* @echo enabled */" );', 97 | matchAboutBlank : true 98 | }, function( result ) { 99 | if ( result && !result[ 0 ] ) { 100 | chrome.tabs.insertCSS( null, { 101 | file : 'printliminator.css', 102 | matchAboutBlank : true 103 | }); 104 | 105 | chrome.tabs.executeScript( null, { 106 | file: 'printliminator.js', 107 | matchAboutBlank : true 108 | }, function() { 109 | chrome.tabs.executeScript( null, { 110 | code : 'thePrintliminator.init();' 111 | }); 112 | }); 113 | } 114 | // update Language 115 | commands.setLanguage(); 116 | }); 117 | 118 | // Remove graphics 119 | var el = document.querySelector( './* @echo noGraphics */' ); 120 | el.removeEventListener( 'click', commands.remove ); 121 | el.addEventListener( 'click', commands.remove ); 122 | 123 | // Print 124 | el = document.querySelector( './* @echo print */' ); 125 | el.removeEventListener( 'click', commands.print ); 126 | el.addEventListener( 'click', commands.print ); 127 | 128 | // Add print stylesheet 129 | el = document.querySelector( './* @echo stylize */' ); 130 | el.removeEventListener( 'click', commands.stylize ); 131 | el.addEventListener( 'click', commands.stylize ); 132 | 133 | // Undo 134 | el = document.querySelector( './* @echo undo */' ); 135 | el.removeEventListener( 'click', commands.undo ); 136 | el.addEventListener( 'click', commands.undo ); 137 | 138 | // keyboard 139 | el = document.querySelector( './* @echo toggle */' ); 140 | el.removeEventListener( 'click', commands.keyboard ); 141 | el.addEventListener( 'click', commands.keyboard ); 142 | 143 | }); 144 | }); 145 | -------------------------------------------------------------------------------- /src/chrome/popup.scss: -------------------------------------------------------------------------------- 1 | $icon : /* @echo icon */; 2 | $print : /* @echo print */; 3 | $close : /* @echo close */; 4 | $undo : /* @echo undo */; 5 | $noGraphics : /* @echo noGraphics */; 6 | $stylize : /* @echo stylize */; 7 | $busy : /* @echo busy */; 8 | $leftClick : /* @echo leftClick */; 9 | $toggle : /* @echo toggle */; 10 | 11 | html { 12 | box-sizing: border-box; 13 | } 14 | *, *:before, *:after { 15 | box-sizing: inherit; 16 | } 17 | 18 | html, body { 19 | width: 450px; 20 | min-height: 160px; 21 | padding: 0; 22 | margin: 0; 23 | background: #eee; 24 | font-size: 14px; 25 | font-family: "Lucida Grande","Lucida Sans Unicode", Tahoma, sans-serif; 26 | overflow: hidden; 27 | } 28 | header { 29 | background-color: #fff; 30 | padding: 12px 10px 1px 10px; 31 | 32 | h3 { 33 | color: #ccc; 34 | margin: 0 0 10px; 35 | } 36 | h3 strong { 37 | color: red; 38 | margin: 0; 39 | } 40 | } 41 | 42 | header, section * { 43 | cursor: default; 44 | -moz-user-select: none; 45 | -webkit-user-select: none; 46 | -ms-user-select: none; 47 | } 48 | section { 49 | padding: 2px 0; 50 | } 51 | .logo { 52 | width: 225px; 53 | height: 15px; 54 | margin: 0; 55 | } 56 | 57 | h3 { 58 | text-transform: uppercase; 59 | font-size: 10px; 60 | font-weight: bold; 61 | color: #000; 62 | margin: 10px 12px; 63 | } 64 | 65 | ul { 66 | list-style-type: none; 67 | margin: 0; 68 | padding: 0; 69 | text-align: center; 70 | } 71 | li { 72 | background: #000; 73 | color: #fff; 74 | display: inline-block; 75 | font-size: 10px; 76 | line-height: 12px; 77 | text-align: left; 78 | text-transform: uppercase; 79 | vertical-align: middle; 80 | padding: 4px 16px 4px 4px; 81 | white-space: nowrap; 82 | cursor: pointer; 83 | max-width: 23%; 84 | overflow: hidden; 85 | 86 | &:hover { 87 | background: #444; 88 | } 89 | } 90 | 91 | .#{$icon} { 92 | background: url(printliminator.png) no-repeat; 93 | width: 25px; 94 | height: 25px; 95 | margin: 0 8px 0 0; 96 | vertical-align: middle; 97 | float: left; 98 | } 99 | 100 | .#{$print} .#{$icon} { background-position: -25px 0; } 101 | .#{$undo} .#{$icon} { background-position: 0 -25px; } 102 | .#{$noGraphics} .#{$icon} { background-position: -25px -25px; } 103 | .#{$stylize} .#{$icon} { background-position: -75px -25px; width: 35px; } 104 | .#{$leftClick} { background-position: -50px -25px; float: none; } 105 | li.#{$busy} .#{$icon} { 106 | background-position: -50px 0; 107 | -webkit-animation:spin 2s linear infinite; 108 | -moz-animation:spin 2s linear infinite; 109 | animation:spin 2s linear infinite; 110 | } 111 | 112 | @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } 113 | @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } 114 | @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } 115 | 116 | .hidden { 117 | display: none; 118 | } 119 | .commands-wrap { 120 | margin: 8px 0 0 0; 121 | padding: 12px; 122 | background: #ccc; 123 | } 124 | .#{$toggle} { 125 | font-size: 12px; 126 | margin: 0 0 5px 0; 127 | cursor: pointer; 128 | } 129 | /* keyboard table */ 130 | table { 131 | font-family: Optima, Segoe, 'Segoe UI', Candara, Calibri, Arial, sans-serif; 132 | font-size: 12px; 133 | text-transform: initial; 134 | margin-top: 4px 0 0 0; 135 | padding: 0; 136 | } 137 | tbody tr:hover td { 138 | background: #ddd; 139 | } 140 | tbody tr:hover kbd { 141 | background: #eee; 142 | } 143 | th { 144 | text-align: left; 145 | padding: 0 0 10px 0; 146 | } 147 | th.key { 148 | width: 30%; 149 | } 150 | td { 151 | text-align: left; 152 | font-size: 12px; 153 | vertical-align: top; 154 | border-top: #aaa 1px solid; 155 | padding: 5px; 156 | } 157 | td svg { 158 | vertical-align: middle; 159 | } 160 | kbd { 161 | background: #fff; 162 | border-radius: 3px; 163 | border: #333 1px solid; 164 | padding: 2px 4px; 165 | } 166 | span.lower { 167 | text-transform: lowercase; 168 | } 169 | span.small { 170 | font-size: 0.7em; 171 | } 172 | /* center asterisk vertically inside of kbd */ 173 | .asterisk { 174 | position: relative; 175 | top: 2px; 176 | } 177 | -------------------------------------------------------------------------------- /src/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/favicon.ico -------------------------------------------------------------------------------- /src/icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon128.png -------------------------------------------------------------------------------- /src/icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon16.png -------------------------------------------------------------------------------- /src/icons/icon18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon18.png -------------------------------------------------------------------------------- /src/icons/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon32.png -------------------------------------------------------------------------------- /src/icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon48.png -------------------------------------------------------------------------------- /src/icons/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/icon64.png -------------------------------------------------------------------------------- /src/icons/printliminator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/icons/printliminator.png -------------------------------------------------------------------------------- /src/images/Chrome-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Chrome-1.png -------------------------------------------------------------------------------- /src/images/Chrome-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Chrome-2.png -------------------------------------------------------------------------------- /src/images/Chrome-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Chrome-3.png -------------------------------------------------------------------------------- /src/images/Chrome-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Chrome-4.png -------------------------------------------------------------------------------- /src/images/Chrome-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Chrome-5.png -------------------------------------------------------------------------------- /src/images/Opera-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Opera-1.png -------------------------------------------------------------------------------- /src/images/Opera-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Opera-2.png -------------------------------------------------------------------------------- /src/images/Opera-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/Opera-3.png -------------------------------------------------------------------------------- /src/images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 22 | 23 | 24 | 26 | 27 | 28 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 39 | 44 | 45 | 46 | 47 | 50 | 51 | 52 | 53 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | 14 | 15 | 17 | 19 | 21 | 22 | 25 | 26 | 28 | 31 | 33 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/images/web-store-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Tricks/The-Printliminator/9e2dd81f073eeffa5becab4edda7a71de1725cf9/src/images/web-store-tile.png -------------------------------------------------------------------------------- /src/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled" : "_printliminator_enabled", 3 | "hilite" : "_printliminator_highlight", 4 | "fullWidth" : "_printliminator_full_width", 5 | "hidden" : "_printliminator_hidden", 6 | "stylized" : "_printliminator_stylized", 7 | "messages" : "_printliminator_messages", 8 | "noSelection" : "_printliminator_no_selection", 9 | "stylesheet" : "_printliminator_styles", 10 | "wrap" : "_printliminator_wrap", 11 | "controls" : "_printliminator_controls", 12 | "drag" : "_printliminator_drag_icon", 13 | "dragActive" : "_printliminator_drag_active", 14 | "icon" : "icon", 15 | "noGraphics" : "no_graphics", 16 | "stylize" : "stylize", 17 | "print" : "print", 18 | "close" : "close", 19 | "undo" : "undo", 20 | "busy" : "busy", 21 | "leftClick" : "left_click", 22 | "keyboard" : "keyboard", 23 | "toggle" : "toggle", 24 | "keyboardOpen" : 615, 25 | "keyboardClosed" : 220, 26 | "messageShow" : true, 27 | "messageLimit" : 6, 28 | "messageFade" : 300, 29 | "messageDuration" : 4000 30 | } -------------------------------------------------------------------------------- /src/printliminator.scss: -------------------------------------------------------------------------------- 1 | $stylized : /* @echo settings.stylized */; 2 | $hidden : /* @echo settings.hidden */; 3 | $fullWidth : /* @echo settings.fullWidth */; 4 | $enabled : /* @echo settings.enabled */; 5 | $highlight : /* @echo settings.hilite */; 6 | $messages : /* @echo settings.messages */; 7 | $wrap : /* @echo settings.wrap */; 8 | $kbClosed : /* @echo settings.keyboardClosed */px; 9 | $drag : /* @echo settings.drag */; 10 | $dragActive : /* @echo settings.dragActive */; 11 | $noSelect : /* @echo settings.noSelection */; 12 | 13 | $printFontSize : 12pt; 14 | $outlineStyle : 3px solid red; 15 | $outlineFullWidth : blue; 16 | 17 | $messageFont : "Lucida Grande","Lucida Sans Unicode", Tahoma, sans-serif; 18 | $messageFontSize : 16px; 19 | $messageBackground : rgba(0, 0, 0, 0.8); 20 | $messageTextColor : #ddd; 21 | 22 | @media print, screen { 23 | 24 | body.#{$stylized} { 25 | margin: 0 !important; 26 | padding: 0 !important; 27 | line-height: 1.4 !important; 28 | word-spacing: 1.1pt !important; 29 | letter-spacing: 0.2pt !important; 30 | font-family: Garamond, "Times New Roman", serif !important; 31 | color: #000 !important; 32 | background: none !important; 33 | font-size: $printFontSize !important; 34 | 35 | /*Headings */ 36 | h1, h2, h3, h4, h5, h6 { 37 | font-family: Helvetica, Arial, sans-serif !important; 38 | } 39 | h1 { font-size: $printFontSize + 7 !important; } 40 | h2 { font-size: $printFontSize + 5 !important; } 41 | h3 { font-size: $printFontSize + 3 !important; } 42 | h4, h5, h6 { font-size: $printFontSize !important; } 43 | 44 | code { font: $printFontSize - 2 Courier, monospace !important; } 45 | blockquote { margin: 1.3em !important; padding: 1em !important; font-size: $printFontSize - 2 !important; } 46 | hr { background-color: #ccc !important; } 47 | 48 | /* Images */ 49 | img { float: left !important; margin: 1em 1.5em 1.5em 0 !important; } 50 | a img { border: none !important; } 51 | 52 | /* Table */ 53 | table { margin: 1px !important; text-align:left !important; border-collapse: collapse !important; } 54 | th { border: 1px solid #333 !important; font-weight: bold !important; } 55 | td { border: 1px solid #333 !important; } 56 | th, 57 | td { padding: 4px 10px !important; } 58 | tfoot { font-style: italic !important; } 59 | caption { background: #fff !important; margin-bottom: 20px !important; text-align:left !important; } 60 | thead { display: table-header-group !important; } 61 | tr { page-break-inside: avoid !important; } 62 | 63 | } 64 | 65 | .#{$hidden} { display: none !important; } 66 | .#{$fullWidth} { 67 | width: 100% !important; 68 | min-width: 100% !important; 69 | max-width: 100% !important; 70 | margin: 0 !important; 71 | } 72 | 73 | } 74 | @media print { 75 | .#{$wrap} { 76 | display: none !important; 77 | } 78 | } 79 | 80 | @media screen { 81 | body.#{$stylized} { 82 | padding: 20px !important; 83 | } 84 | 85 | /* @if MODE='EXT' */ 86 | .#{$highlight} { 87 | outline: $outlineStyle !important; 88 | 89 | &.#{$fullWidth} { 90 | outline-color: $outlineFullWidth !important; 91 | } 92 | &, .#{$messages} { 93 | cursor: default !important; 94 | -webkit-user-select: none !important; 95 | -moz-user-select: none !important; 96 | -ms-user-select: none !important; 97 | user-select: none !important; 98 | } 99 | 100 | } 101 | 102 | /* ul & li have same class to make it easier to ignore 103 | and reset all possible settings 104 | */ 105 | .#{$messages} { 106 | font: $messageFont !important; 107 | font-size: $messageFontSize !important; 108 | min-width: none !important; 109 | max-height: none !important; 110 | min-height: none !important; 111 | width: auto !important; 112 | height: auto !important; 113 | border: 0 !important; 114 | margin: 0 !important; 115 | padding: 0 !important; 116 | vertical-align: baseline !important; 117 | display: block !important; 118 | 119 | &:before, &:after { 120 | display: none !important; 121 | } 122 | } 123 | 124 | ul.#{$messages} { 125 | background: transparent !important; 126 | list-style-type: none !important; 127 | position: fixed !important; 128 | top: 0 !important; 129 | right: 0 !important; 130 | z-index: 999999 !important; 131 | max-width: 400px !important; 132 | } 133 | li.#{$messages} { 134 | background: $messageBackground !important; 135 | color: $messageTextColor !important; 136 | padding: 20px !important; 137 | margin: 5px !important; 138 | max-width: none !important; 139 | } 140 | /* @endif */ 141 | /* @if MODE='BOOKMARKLET' */ 142 | .#{$highlight} { 143 | outline: $outlineStyle !important; 144 | cursor: default !important; 145 | 146 | &.#{$fullWidth} { 147 | outline-color: $outlineFullWidth !important; 148 | } 149 | } 150 | 151 | .#{$wrap} { 152 | width: 450px !important; 153 | height: $kbClosed; 154 | position: fixed !important; 155 | top: 20px; 156 | right: 20px; 157 | z-index: 999999 !important; 158 | box-shadow: 0 0 80px black !important; 159 | 160 | iframe { 161 | width: 450px !important; 162 | height: $kbClosed; 163 | border: 0 !important; 164 | overflow-x: hidden !important; 165 | margin: 0 !important; 166 | padding: 0 !important; 167 | } 168 | } 169 | .#{$drag} { 170 | width: 28px !important; 171 | height: 20px !important; 172 | position: absolute !important; 173 | top: 0 !important; 174 | left: 0 !important; 175 | cursor: move !important; 176 | 177 | &.#{$dragActive} { 178 | width: 120px !important; 179 | height: 100px !important; 180 | top: -40px !important; 181 | left: -40px !important; 182 | } 183 | } 184 | 185 | body.#{$noSelect}, .#{$highlight}, .#{$wrap}, .#{$drag}, .#{$wrap} iframe { 186 | -webkit-user-select: none !important; 187 | -moz-user-select: none !important; 188 | -ms-user-select: none !important; 189 | user-select: none !important; 190 | } 191 | /* @endif */ 192 | } 193 | -------------------------------------------------------------------------------- /test/SpecRunner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Jasmine Spec Runner v2.3.4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/traversingSpec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Testing printliminator basic DOM traversing scripts 4 | describe( 'Traversing', function() { 5 | var div; 6 | 7 | beforeEach(function() { 8 | if ( !div ) { 9 | div = document.createElement( 'body' ); 10 | div.id = 'container'; 11 | } 12 | div.innerHTML = 13 | '
' + 14 | '
' + 15 | '
' + 16 | '' + 17 | '' + 18 | '' + 19 | '' + 20 | '
' + 21 | '' + 22 | '

' + 23 | '
' + 24 | '
' + 25 | '' + 26 | '' + 27 | '' + 28 | '' + 29 | '
' + 30 | '' + 31 | 'test' + 32 | '' + 33 | '' + 34 | '
' + 35 | '' + 36 | '' + 37 | '
' + 38 | '

' + 39 | '' + 40 | '' + 41 | 'test2' + 42 | '
'; 43 | return div; 44 | }); 45 | 46 | describe( 'Siblings', function() { 47 | function getSibs() { 48 | var el = div.querySelector( 'svg' ); 49 | return thePrintliminator.getSiblings( el ); 50 | } 51 | 52 | it( 'finds the correct number of siblings', function() { 53 | var len = getSibs().length; 54 | // style, script, link, br and meta are ignored 55 | expect( len ).toEqual( 11 ); 56 | }); 57 | 58 | it( 'finds the correct siblings using `filterElements`', function() { 59 | var i, 60 | ignoredElm = window.thePrintliminator.ignoredElm, 61 | valid = true, 62 | sibs = getSibs(), 63 | len = sibs.length; 64 | for ( i = 0; i < len; i++ ) { 65 | expect( ignoredElm.test( sibs[ i ].nodeName ) ).not.toBe( true ); 66 | } 67 | }); 68 | }); 69 | 70 | describe( 'Opposite', function() { 71 | it( 'finds opposites of selected element', function() { 72 | var el = div.querySelector( '#opposite' ), 73 | opposites = thePrintliminator.getOpposite( el ), 74 | len = opposites.length; 75 | 76 | // getOpposite traverses up to the BODY element 77 | expect( len ).toEqual( 2 ); 78 | 79 | expect( opposites[ 0 ].id ).toBe( 'opposite2' ); 80 | expect( opposites[ 1 ].id ).toBe( 'graphics' ); 81 | }); 82 | }); 83 | 84 | describe( 'Next', function() { 85 | function getNext( el ) { 86 | return thePrintliminator.getNext( el ); 87 | }; 88 | it( 'finds the correct first element', function() { 89 | var elm = getNext( div.querySelector( '#opposite' ) ); 90 | // style, script, link, br and meta are ignored 91 | expect( elm.id ).toBe( 'opposite2' ); 92 | }); 93 | it( 'finds the correct second element', function() { 94 | var elm = getNext( div.querySelector( '#item1' ) ); 95 | // style, script, link, br and meta are ignored 96 | expect( elm.id ).toBe( 'item2' ); 97 | }); 98 | it( 'finds the correct third element', function() { 99 | var elm = getNext( div.querySelector( '#item2' ) ); 100 | // style, script, link, br and meta are ignored 101 | expect( elm.id ).toBe( 'item3' ); 102 | }); 103 | }); 104 | 105 | describe( 'Prev', function() { 106 | function getPrev( el ) { 107 | return thePrintliminator.getPrev( el ); 108 | }; 109 | it( 'finds the correct first element', function() { 110 | var elm = getPrev( div.querySelector( '#opposite2' ) ); 111 | // style, script, link, br and meta are ignored 112 | expect( elm.id ).toBe( 'opposite' ); 113 | }); 114 | it( 'finds the correct second element', function() { 115 | var elm = getPrev( div.querySelector( '#item3' ) ); 116 | // style, script, link, br and meta are ignored 117 | expect( elm.id ).toBe( 'item2' ); 118 | }); 119 | it( 'finds the correct third element', function() { 120 | var elm = getPrev( div.querySelector( '#item2' ) ); 121 | // style, script, link, br and meta are ignored 122 | expect( elm.id ).toBe( 'item1' ); 123 | }); 124 | }); 125 | 126 | describe( 'First Child', function() { 127 | function getChild( el ) { 128 | return thePrintliminator.getFirstChild( el ); 129 | }; 130 | it( 'finds the correct first child', function() { 131 | var elm = getChild( div.querySelector( '#opposite2' ) ); 132 | expect( elm.id ).toBe( 'item1' ); 133 | }); 134 | it( 'finds the correct second element', function() { 135 | var elm = getChild( div.querySelector( '#graphics' ) ); 136 | expect( elm.nodeName ).toBe( 'AUDIO' ); 137 | }); 138 | }); 139 | 140 | describe( 'Remove Graphics', function() { 141 | // test printliminator without initializing 142 | window.thePrintliminator.messageOptions = false; 143 | window.thePrintliminatorVars = { 144 | init : true, 145 | history : [], 146 | messageCache : [], 147 | flags : { 148 | removeGraphics: false 149 | } 150 | }; 151 | it( 'correctly removes all graphic elements', function() { 152 | thePrintliminator.removeGraphics( null, div ); 153 | var i, 154 | // elements ignored while traversing 155 | ignoredElm = window.thePrintliminator.ignoredElm, 156 | // detecting phantomJS 157 | isPhantom = navigator.userAgent.toLowerCase().indexOf( 'phantom' ) !== -1, 158 | items = div.querySelectorAll( '.' + window.thePrintliminator.css.hidden ), 159 | len = items.length; 160 | 161 | /* 162 | CHEATING HERE!! 163 | PhantomJS doesn't appear to want to add the hidden class to the SVG element 164 | correctly. It might be related to this issue: 165 | https://github.com/ariya/phantomjs/issues/11281 166 | - When the SpecRunner.html is run, it finds 9 elements with SVG being the last 167 | - When grunt jasmine is run, it finds 8 elements with IMG being the last 168 | */ 169 | expect( len ).toEqual( isPhantom ? 8 : 9 ); 170 | for ( i = 0; i < len; i++ ) { 171 | expect( ignoredElm.test( items[ i ].nodeName ) ).not.toBe( true ); 172 | } 173 | }); 174 | }); 175 | 176 | }); 177 | --------------------------------------------------------------------------------