Class: Sol::CSSStyleSheet

Inherits:
Object
  • Object
show all
Defined in:
lib/jx/jsstyle_sheet.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ CSSStyleSheet





116
117
118
119
120
121
# File 'lib/jx/jsstyle_sheet.rb', line 116

def initialize(index)
  @jsvar = "css_style_sheet_#{SecureRandom.hex(8)}"
  p "init"
  B.eval("console.log(__style_sheets__[1].cssRules)")
  B.eval("var #{@jsvar} = __style_sheets__[#{index}]")
end

Instance Attribute Details

#jsvarObject (readonly)

Returns the value of attribute jsvar.



110
111
112
# File 'lib/jx/jsstyle_sheet.rb', line 110

def jsvar
  @jsvar
end

Instance Method Details

#disabled?Boolean


Is a Boolean representing whether the current stylesheet has been applied or not.


Returns:

  • (Boolean)


127
128
129
# File 'lib/jx/jsstyle_sheet.rb', line 127

def disabled?
  B.eval("#{@jsvar}.disabled")
end

#hrefObject


Returns a DOMString representing the location of the stylesheet.




135
136
137
# File 'lib/jx/jsstyle_sheet.rb', line 135

def href
  B.eval("#{@jsvar}.href")
end

#mediaObject


Returns a MediaList representing the intended destination medium for style information.




144
145
146
# File 'lib/jx/jsstyle_sheet.rb', line 144

def media
  B.eval("#{@jsvar}.media")
end

#owner_nodeObject





152
153
154
# File 'lib/jx/jsstyle_sheet.rb', line 152

def owner_node
  B.eval("#{@jsvar}.ownerNode")
end

#parent_style_sheetObject





160
161
162
# File 'lib/jx/jsstyle_sheet.rb', line 160

def parent_style_sheet
  B.eval("#{@jsvar}.parentStyleSheet")
end

#rulesObject





184
185
186
187
# File 'lib/jx/jsstyle_sheet.rb', line 184

def rules
  B.eval("#{@jsvar}.rules")
  # CSSRules.new(@jsvar)
end

#style_sheet?Boolean



Returns:

  • (Boolean)


193
194
195
# File 'lib/jx/jsstyle_sheet.rb', line 193

def style_sheet?
  true
end

#titleObject





168
169
170
# File 'lib/jx/jsstyle_sheet.rb', line 168

def title
  B.eval("#{@jsvar}.title")
end

#typeObject





176
177
178
# File 'lib/jx/jsstyle_sheet.rb', line 176

def type
  B.eval("#{@jsvar}.type")
end