InstaSynchP-Core
The core for a modular plugin system for InstaSynch.
Simply install other plugins through the plugin manager (Plugins button) at the top of the page or from greasyfork.
Includes
Framework
Everything is based on events that plugins can listen to for the information they need.
Plugins should run at document-start so they can put themself into the window.plugins
object before the core loads.
When the document has loaded the core will automatically look and bind some functions in the plugins
- executeOnce: Execute this code only once
- preConnect: Execute this everytime a room gets loaded
- postConnect: Same as preConnect but after the connection has been established
- resetVariables: When getting reconnected or loading a new room variables can be reset here.
Events can be bound or fired using the events
object
events.on
events.on(this, 'Event1,Event2', callbackFunction, true/false)
- reference to this object
- name of the events (split by ,)
- callback function
- true/false for before or after the old function (e.g. before or after message get's parsed in addMessage)
events.unbind
events.unbind('Event1,Event2', callbackFunction)
- name of the events (split by ,)
- callback function
events.once
events.once(this, 'Event1,Event2', callbackFunction, true/false)
- same as .on but uses .unbind first
events.fire
events.fire('EventName', [arg1, arg2], true/false)
- name of the event
- array of arguments
- true/false for before or after the old function
Loading priorities soon
Public Variables
Public variables can be accessed through window.plugins.plugin.variable
:
Events
See InstaSynchP Event Hooks
Commands
The core will look for commands in plugin.commands
See InstaSynchP Commands
Settings
The core will look for settings in plugin.settings
See InstaSynchP Settings
CSSLoader
The core will look for styles in plugin.styles
See InstaSynchP CSSLoader
License
The MIT License (MIT)
<InstaSynch - Watch Videos with friends.>
Copyright (c) 2014 InstaSynch
<Bibbytube - Modified InstaSynch client code>
Copyright (C) 2014 Zod-
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.