Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

New "print" command #200

Closed bob2517 closed 2 years ago

bob2517 commented 2 years ago

I need this for work and it would make a nice command rather than using "run: {= do the printing in JS here =};", so I'm squeezing it into the new release.

Syntax will be:

print: (window|iframe selector);

It will basically do a JavaScript print() on the window referenced.

bob2517 commented 2 years ago

This is done on the branch. It works with the window and iframe selectors. And it works in body:init if you want to really irritate your users with a printer dialog box on page load, or if you validly need to print the contents of an iframe when it gets drawn.

bob2517 commented 2 years ago

Added "print: parent;" so that printing can target the parent window of an iframe. "window" prints the iframe contents if used from inside an iframe.

bob2517 commented 2 years ago

"print: parent" now checked in on 2.9.0

bob2517 commented 2 years ago

Closing in preparation for release.