jotform / css.js

A lightweight, battle tested, fast, CSS parser in JavaScript
https://medium.com/jotform-form-builder/writing-a-css-parser-in-javascript-3ecaa1719a43
MIT License
426 stars 63 forks source link

Removed unused $ parameter from outer closure and injected global con… #8

Closed guioconnor closed 9 years ago

guioconnor commented 9 years ago

…text to allow for it to run server side

The strict reliance on the window object makes it impossible to run the parser in a context other than the browser where the window is made available automatically. By adding the context as an injected dependency, variable global will be assigned the window object on a browser and the module.exports object on node.

kemaldaggen commented 9 years ago

Thanks for the pull request. We heavily used this in browser side, so this part is kind of forgotten. Thanks anyway for your help.