dem classes.

This commit is contained in:
Zixaphir 2013-05-30 13:15:33 -07:00
parent 82299ce9cf
commit f2766c55a4
6 changed files with 212 additions and 56 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -504,36 +504,32 @@ Settings =
div.innerHTML = "<div class=option><label><input type=checkbox name='#{key}'>#{key}</label></div><span style='display:none;'>#{description}</span>" div.innerHTML = "<div class=option><label><input type=checkbox name='#{key}'>#{key}</label></div><span style='display:none;'>#{description}</span>"
input = $ 'input', div input = $ 'input', div
input.bool = true
items[key] = Conf[key] items[key] = Conf[key]
inputs[key] = input inputs[key] = input
$.on $('.option', div), 'mouseover', Settings.mouseover $.on $('.option', div), 'mouseover', Settings.mouseover
$.on input, 'change', Settings.change
$.add fs, div $.add fs, div
$.add nodes, fs $.add nodes, fs
$.get items, (items) -> $.get items, (items) ->
cb = Settings.cb
for key, val of items for key, val of items
input = inputs[key] input = inputs[key]
if input.bool if input.type is 'checkbox'
input.checked = val input.checked = val
Rice.checkbox input $.on input, 'change', cb.style.checked
else if input.nodeName is 'SELECT'
input.value = val
$.on input, 'change', cb.style.select
else else
input.value = val input.value = val
if input.nodeName is 'SELECT' $.on input, 'change', cb.style.value
Rice.select input
Rice.nodes nodes
$.add section, nodes $.add section, nodes
change: ->
$.cb[if @bool then 'checked' else 'value'].call @
Style.addStyle()
themes: (section, mode) -> themes: (section, mode) ->
if typeof mode isnt 'string' if typeof mode isnt 'string'
mode = 'default' mode = 'default'
@ -689,7 +685,7 @@ Settings =
for name in MascotTools.categories for name in MascotTools.categories
nodes[name] = [] nodes[name] = []
categories[name] = $.el "div", categories[name] = $.el "div",
className: "mascots" className: "mascots-container"
id: name id: name
innerHTML: "<h3 class=mascotHeader>#{name}</h3>" innerHTML: "<h3 class=mascotHeader>#{name}</h3>"
@ -801,6 +797,20 @@ Settings =
$.add section, [suboptions, batchmascots, mascotHide] $.add section, [suboptions, batchmascots, mascotHide]
cb: cb:
style:
checked: ->
$.cb.checked.call @
hyphenated = @name.toLowerCase().replace /\s+/g, '-'
(if @checked then $.addClass else $.rmClass) doc, hyphenated
value: ->
$.cb.value.call @
Style.addStyle()
select: ->
$.cb.value.call @
for option in @options
hyphenated = "#{@name} {option.value}".toLowerCase().replace /\s+/g, '-'
(if option.value is @value then $.addClass else $.rmClass) doc, hyphenated
mascot: mascot:
category: -> category: ->
if $.id(@name).hidden = @checked if $.id(@name).hidden = @checked

View File

@ -1735,7 +1735,7 @@ article li {
clear: both; clear: both;
text-decoration: none; text-decoration: none;
} }
.mascots { .mascots-container {
padding: 0; padding: 0;
text-align: center; text-align: center;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}

View File

@ -15,6 +15,17 @@ Style =
<% } %> <% } %>
$.addClass doc, 'appchan-x' $.addClass doc, 'appchan-x'
for title, cat of Config.style
for name, setting of cat
if setting[2]
continue if setting[2] is 'text'
hyphenated = "#{name} #{Conf[name]}".toLowerCase().replace /\s+/g, '-'
$.addClass doc, hyphenated
else
continue unless Conf[name]
hyphenated = "#{name}".toLowerCase().replace /\s+/g, '-'
$.addClass doc, hyphenated
MascotTools.init() MascotTools.init()
if g.VIEW is 'index' if g.VIEW is 'index'