InstaSynchP Core

Base to load all the Plugins, also includes some mandatory plugins

目前为 2014-10-25 提交的版本。查看 最新版本

作者
Zod-
评分
0 0 0
版本
1.1.1
创建于
2014-10-11
更新于
2014-10-25
大小
8.0 KB
许可证
GPL-3.0
适用于

InstaSynchP-Core

Base to load all the Plugins, also includes some mandatory plugins

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:

  • core.listeners all the listeners bound in events

  • core.connected are we connected to the room?

Events

See InstaSynchP Event Hooks

Settings

The core will look for settings in 'plugin.setting'
See InstaSynchP Settings

CSSLoader

See InstaSynchP CSSLoader

License

Copyright (C) 2013 InstaSynch

Copyright (C) 2014 Zod-

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

http://opensource.org/licenses/GPL-3.0

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址