File tree Expand file tree Collapse file tree 10 files changed +158
-4
lines changed Expand file tree Collapse file tree 10 files changed +158
-4
lines changed Original file line number Diff line number Diff line change 3
3
! /.eslintrc.json
4
4
! /.travis.yml
5
5
package-lock.json
6
+ yarn.lock
6
7
/bower_components /
7
8
/node_modules /
8
9
/output /
Original file line number Diff line number Diff line change 13
13
" output" ,
14
14
" bower.json" ,
15
15
" package.json"
16
- ]
16
+ ],
17
+ "dependencies" : {
18
+ "purescript-web-dom" : " ^1.0.0"
19
+ }
17
20
}
Original file line number Diff line number Diff line change 5
5
"build" : " eslint src && pulp build -- --censor-lib --strict"
6
6
},
7
7
"devDependencies" : {
8
- "eslint" : " ^4.19.1 " ,
9
- "pulp" : " ^12.2 .0" ,
10
- "purescript-psa" : " ^0.6.0 " ,
8
+ "eslint" : " ^5.2.0 " ,
9
+ "pulp" : " ^12.3 .0" ,
10
+ "purescript-psa" : " ^0.7.2 " ,
11
11
"rimraf" : " ^2.6.2"
12
+ },
13
+ "dependencies" : {
14
+ "purescript" : " ^0.12.0"
12
15
}
13
16
}
Original file line number Diff line number Diff line change
1
+ // Web.CSSOM
2
+ "use strict" ;
3
+
4
+ exports . getStyleSheets = function ( doc ) {
5
+ return function ( ) {
6
+ return doc . styleSheets ;
7
+ } ;
8
+ } ;
Original file line number Diff line number Diff line change
1
+ module Web.CSSOM
2
+ ( getStyleSheets
3
+ ) where
4
+
5
+ import Effect (Effect )
6
+ import Web.CSSOM.Internal.Types (StyleSheetList )
7
+ import Web.DOM.Document (Document )
8
+
9
+ foreign import getStyleSheets :: Document -> Effect StyleSheetList
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ var getProp = function ( name ) {
4
+ return function ( sheet ) {
5
+ return sheet [ name ] ;
6
+ } ;
7
+ } ;
8
+
9
+ exports . disabled = getProp ( "disabled" ) ;
10
+ exports . _href = getProp ( "href" ) ;
11
+ exports . _ownerNode = getProp ( "ownerNode" ) ;
12
+ exports . _parentStyleSheet = getProp ( "parentStyleSheet" ) ;
13
+ exports . _title = getProp ( "title" ) ;
14
+ exports . _type = getProp ( "type" ) ;
15
+
16
+ exports . setDisabled = function ( bool ) {
17
+ return function ( sheet ) {
18
+ return function ( ) {
19
+ sheet . disabled = bool ;
20
+ return { } ;
21
+ } ;
22
+ } ;
23
+ } ;
24
+
25
+ exports . toggleDisabled = function ( sheet ) {
26
+ return function ( ) {
27
+ var bool = ! sheet . disabled ;
28
+ sheet . disabled = bool ;
29
+ return bool ;
30
+ } ;
31
+ } ;
Original file line number Diff line number Diff line change
1
+ module Web.DOM.CSSStyleSheet
2
+ ( module Exports
3
+ , disabled
4
+ , setDisabled
5
+ , toggleDisabled
6
+ , href
7
+ , ownerNode
8
+ , parentStyleSheet
9
+ , title
10
+ , typeString
11
+ ) where
12
+
13
+ import Prelude
14
+
15
+ import Data.Maybe (Maybe )
16
+ import Data.Nullable (Nullable , toMaybe )
17
+ import Effect (Effect )
18
+ import Web.CSSOM.Internal.Types (CSSStyleSheet ) as Exports
19
+ import Web.CSSOM.Internal.Types (CSSStyleSheet )
20
+ import Web.DOM.Internal.Types (Element )
21
+
22
+ foreign import disabled :: CSSStyleSheet -> Boolean
23
+
24
+ foreign import setDisabled :: Boolean -> CSSStyleSheet -> Effect Unit
25
+
26
+ foreign import toggleDisabled :: CSSStyleSheet -> Effect Boolean
27
+
28
+ href :: CSSStyleSheet -> Maybe String
29
+ href = toMaybe <<< _href
30
+
31
+ ownerNode :: CSSStyleSheet -> Maybe Element
32
+ ownerNode = toMaybe <<< _ownerNode
33
+
34
+ parentStyleSheet :: CSSStyleSheet -> Maybe CSSStyleSheet
35
+ parentStyleSheet = toMaybe <<< _parentStyleSheet
36
+
37
+ title :: CSSStyleSheet -> Maybe String
38
+ title = toMaybe <<< _title
39
+
40
+ typeString :: CSSStyleSheet -> Maybe String
41
+ typeString = toMaybe <<< _type
42
+
43
+ foreign import _href :: CSSStyleSheet -> Nullable String
44
+ foreign import _ownerNode :: CSSStyleSheet -> Nullable Element
45
+ foreign import _parentStyleSheet :: CSSStyleSheet -> Nullable CSSStyleSheet
46
+ foreign import _title :: CSSStyleSheet -> Nullable String
47
+ foreign import _type :: CSSStyleSheet -> Nullable String
Original file line number Diff line number Diff line change
1
+ module Web.CSSOM.Internal.Types where
2
+
3
+ foreign import data CSSStyleSheet :: Type
4
+ foreign import data StyleSheetList :: Type
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ exports . length = function ( list ) {
4
+ return function ( ) {
5
+ return list . length ;
6
+ } ;
7
+ } ;
8
+
9
+ exports . toArray = function ( list ) {
10
+ return function ( ) {
11
+ return Array . prototype . slice . call ( list ) ;
12
+ } ;
13
+ } ;
14
+
15
+ exports . _item = function ( index ) {
16
+ return function ( list ) {
17
+ return function ( ) {
18
+ return list . item ( index ) ;
19
+ } ;
20
+ } ;
21
+ } ;
Original file line number Diff line number Diff line change
1
+ module Web.DOM.StyleSheetList
2
+ ( module Exports
3
+ , length
4
+ , item
5
+ , toArray
6
+ ) where
7
+
8
+ import Prelude
9
+
10
+ import Data.Maybe (Maybe )
11
+ import Data.Nullable (Nullable , toMaybe )
12
+ import Effect (Effect )
13
+ import Web.CSSOM.Internal.Types (CSSStyleSheet , StyleSheetList ) as Exports
14
+ import Web.CSSOM.Internal.Types (CSSStyleSheet , StyleSheetList )
15
+
16
+ -- | The number of items in a StyleSheetList.
17
+ foreign import length :: StyleSheetList -> Effect Int
18
+
19
+ -- | The elements of a NodeList represented in an array.
20
+ foreign import toArray :: StyleSheetList -> Effect (Array CSSStyleSheet )
21
+
22
+ -- | The item in a StyleSheetList at the specified index, or Nothing if no such
23
+ -- | node exists.
24
+ item :: Int -> StyleSheetList -> Effect (Maybe CSSStyleSheet )
25
+ item i = map toMaybe <<< _item i
26
+
27
+ foreign import _item :: Int -> StyleSheetList -> Effect (Nullable CSSStyleSheet )
You can’t perform that action at this time.
0 commit comments