kd-core
v0.1.3
Published
core module for kd
Downloads
27
Maintainers
Readme
core
Exposes:
KDController
KDCustomHTMLView
KDEventEmitter
KDObject
KDRouter
KDView
KDViewController
KDWindowController
## API
KDController
extends KDObject
KDCustomHTMLView(options, data)
extends KDView
Instance Methods
setDomElement(cssClass)
KDEventEmitter(options)
Instance Methods
emit(eventName, args...)
on(eventName, listener)
off(eventName, listener)
once(eventName, listener)
Static Methods
KDEventEmitter.registerStaticEmitter()
KDEventEmitter.emit()
KDEventEmitter.on(eventName, listener)
KDEventEmitter.off(eventName, listener)
KDEventEmitter.Wildcard(options)
extends KDEventEmitter
Instance Methods
setMaxListeners(n)
emit(eventName, rest...)
off(eventName, listener)
on(eventName, listener)
KDObject(options, data)
extends KDEventEmitter
Instance Methods
bound(method)
lazyBound(method, rest...)
forwardEvent(target, eventName, prefix)
forwardEvents(target, eventNames, prefix)
ready(listener)
getInstance(instanceId)
registerKDObjectInstance()
setData(@data)
getData()
setOptions(@options)
setOption(option, value)
unsetOption(option)
getOptions()
getOption(key)
changeId(id)
getId()
setDelegate(@delegate)
getDelegate()
destroy()
chainNames(options)
KDRouter(routes)
extends KDObject
Instance Methods
listen()
popState(event)
clear(route, replaceState)
back()
startListening()
stopListening()
getCurrentPath()
handleNotFound(route)
addRoute(route, listener)
addRoutes(routes)
handleRoute(userRoute, options)
handleQuery(query)
Static Methods
KDRouter.handleNotFound(route)
KDView(options, data)
extends KDObject
Instance Methods
appendToDomBody()
defaultInit()
getDomId()
setDomElement(cssClass)
setDomId(id)
setData(data)
setDataId()
getAttribute(attr)
setAttribute(attr, val)
setAttributes(attributes)
getDomElement()
getElement()
getTagName()
$(selector)
append(child, selector)
appendTo(parent, selector)
appendToSelector(selector)
prepend(child, selector)
prependTo(parent, selector)
prependToSelector(selector)
setPartial(partial, selector)
updatePartial(partial, selector)
clear()
setCss(property, value)
setStyle(properties)
setClass(cssClass)
unsetClass(cssClass)
toggleClass(cssClass)
hasClass(cssClass)
getBounds()
setRandomBG()
hide(duration)
show(duration)
setPosition()
getWidth()
setWidth(w, unit)
getHeight()
setHeight(h, unit)
setX(x)
setY(y)
getX()
getY()
getRelativeX()
getRelativeY()
destroyChild(prop)
attach(view)
detach()
orphanize()
destroy()
destroySubViews()
addSubView(subView, selector, shouldPrepend)
removeSubView(subView)
getSubViews()
setParent(parent)
unsetParent()
embedChild(placeholderId, child, isCustom)
render(fields)
addEventHandlers(options)
parentDidResize(parent, event)
setLazyLoader(threshold)
bindEvents($elm)
bindTransitionEnd()
bindEvent($elm, eventName)
handleEvent(event)
scroll(event)
load(event)
error(event)
keyUp(event)
keyDown(event)
keyPress(event)
dblClick(event)
click(event)
contextMenu(event)
mouseMove(event)
mouseEnter(event)
mouseLeave(event)
mouseUp(event)
mouseOver(event)
mouseWheel(event)
mouseDown(event)
paste(event)
dragEnter(e)
dragOver(e)
dragLeave(e)
drop(event)
submit(event)
setEmptyDragState(moveBacktoInitialPosition)
setDraggable(options)
drag(event, delta)
viewAppended()
childAppended(child)
setViewReady()
isViewReady()
observeMutations()
putOverlay(options)
removeOverlay()
unsetTooltip()
setTooltip(o)
getTooltip()
listenWindowResize(state)
setKeyView()
unsetKeyView()
activateKeyView()
Static Methods
KDView.appendToDOMBody(view)
KDView.setElementClass(el, addOrRemove, cssClass)
Private Methods
_windowDidResize()
KDViewController(options, data)
extends KDController
Instance Methods
loadView(mainView)
getView()
setView(aViewInstance)
KDWindowController(options, data)
extends KDController
Instance Methods
addLayer(layer)
removeLayer(layer)
bindEvents()
addUnloadListener(key, listener)
clearUnloadListeners(key)
isFocused()
addFocusListener(listener)
focusChange(event, state)
beforeUnload(event)
setDragInAction(@dragInAction)
setMainView(@mainView)
getMainView(view)
revertKeyView(view)
viewHasKeyCombos(view)
registerKeyCombos(view)
unregisterKeyCombos()
setKeyView(keyView)
setDragView(dragView)
unsetDragView(e)
redirectMouseMoveEvent(event)
getKeyView()
key(event)
registerWindowResizeListener(instance)
unregisterWindowResizeListener(instance)
notifyWindowResizeListeners(event)
License
The MIT License (MIT)
Copyright (c) 2014 Koding [email protected]
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.