ouija-io / ouija

Communicating with ghosts
http://ouija.io
BSD 3-Clause "New" or "Revised" License
128 stars 14 forks source link

Pass ouija options as an object #36

Closed colinmacdonald closed 8 years ago

colinmacdonald commented 10 years ago

Ouija options are building up fast:

ouija_identifier
ouija_connect_url
ouija_article_content
ouija_section_elements
ouija_hide_controls // soon

Should be able to set these options as an object instead of individual vars on the window.

jonwgeorge commented 10 years ago

Would it not be easier to do this instead?

var Options = {"array":[
    {"identifier": ""},
    {"connect_url": ""},
    {"article_content": ""},
    {"section_elements": ""},
    {"hide_controls": ""}
]};
halfdan commented 10 years ago

@jonwgeorge Not like that.

More like:

new Ouija({
  identifier: 12,
  connect_url: 'url',
  article_content: '.article_class',
  section_elements: '.section_elements',
  hide_controls: true
});
jonwgeorge commented 10 years ago

@halfdan Yeah, that looks better. I suck at Javascript haha.

jonwgeorge commented 10 years ago

Also, now that you guys have added the ability to comment on images, which is a nice feature, how do I go about disabling it? No need to comment on images for me at least.

colinmacdonald commented 10 years ago

@jonwgeorge Using the section elements option: window.ouija_section_elements = 'p, ol';. The default is: 'p, ol, :has(img)'