Primitives
Wins
- Time-tested isolation from browser bugs, differences, & evolution.
- Unprecedented scope covering JS, DOM, XSLT, and other browser APIs.
- Fully integrated with configuration, logging, and TIBET
raise()
. - Extensively documented and reviewable via
apropos
andreflect
. - Leveraged throughout TIBET, serving as the underlying "VM".
Contents
Concepts
Cookbook
The TP Object
Primitive Documentation
Primitive Categories
- Query Primitives
- DOM Primitives
- Event Primitives
- Serialization Primitives
- Markup Primitives
- Communication Primitives
- URI Primitives
- Testing Primitives
- Branching (Ternary) Primitives
- Object Primitives
- Construct() Primitives
- Conversion Primitives
- Definition Primitives
- Access Primitives
- Signaling Primitives
- Logging Primitives
- Matrix Primitives
- Utility Primitives
Code
Concepts
TIBET is a layered system whose functionality builds from the bottom up with increasing levels of abstraction as you go higher in the stack.
At one of the lowest levels are TIBET's primitives, functions that provide core functionality as well as a low-level interface to, and encapsulation of, native browser APIs.
TIBET's primitive layer is similar to common shim libraries in that its goal is to provide common APIs and browser isolation however, TIBET's primitives cover a much broader spectrum including DOM, Event, Query, URI, XML, and XSLT among others.
Thanks to primitives, TIBET has been able to support browsers and their evolution since 1999, that's over two decades of evolution in the browser market without the need for anything but maintain the primitive layer across browsers and browser versions.

All of TIBET's primitives are rooted on the TP
global object. Most primitives
fall into clearly delineated groups such as DOM primitives, Event primitives,
URI primitives, and so on. Naming conventions are very common in TIBET's
primitive layer. For example, TP.element*
, TP.uri*
refer to TIBET's
element-specific and URI-specific groups respectively.
Becoming familiar with the TIBET primitive layer is central to becoming effective with TIBET and avoiding long-term maintenance issues.
Your best tools for learning about TIBET's primitives are tibet apropos
and
tibet reflect
which provide runtime access to TIBET docs.
Cookbook
The TP Object
All of TIBET's library functionality is rooted on a single global, the TP
object. Application functionality in TIBET is typically rooted on an APP
global to keep your code separate.
The primary content of the TP
object centers around three things:
- constants,
- namespaces, and
- primitives.
TP Constants
TIBET is a comprehensive system and we don't like magic numbers or strings. As a result there are a significant number of constants defined on the TP object.
You can get a complete list for your version of TIBET using the following code:
Object.keys(TP).filter(function(key) {
return key === key.toUpperCase();
}).sort().unique().join('\n');
It's always a good idea to check the TP
object's list of constants before you
create one of your own. There are roughly 600 of them defined as of this
writing.
Most TP
constants are used internally and aren't necessary for authoring. When
a TP
constant is needed you'll find it covered in task-specific documentation.
TP Namespaces
Functionality in TIBET is organized around namespaces in more ways than one.
XML Namespaces
As a XML-friendly platform TIBET supports a number of XML namespaces whose
canonical prefixes are also used as JavaScript namespaces. The TP
object
includes several of these including: ev
, html
, svg
, xmpp
, and xsl
.
JavaScript Namespaces
TIBET also divides functionality into JavaScript namespaces to help organize the
types found in the TIBET OO layer. Examples of these include core
, extern
,
gui
, lang
, log
, meta
, regex
, sig
, test
, tibet
, and tsh
.
Below is a simple code snippet you can use to list TIBET's TP
namespaces:
Object.keys(TP).filter(function(key) {
return TP.isNamespace(TP[key]);
}).sort().unique().join('\n')
The most commonly used ones in TIBET application code are:
TP.core // Core types
TP.lang // Language extensions
TP.log // TIBET's logging infrastructure
TP.regex // RegExp constants
TP.sig // Signal types
TP.test // TIBET's test harness
The TIBET "VM"
A portion of TIBET's primitive layer forms a kind of TIBET virtual machine in the sense that porting these primitives from browser to browser over the years has allowed TIBET to run on browsers from IE5 and Nav4 through today's modern HTML5 browsers.
You can think of these primitives as shims or polyfills, but that's only one small segment of the whole. TIBET encapsulates native browser APIs to protect from inevitable bugs in the underlying platforms, thereby protecting your code and improving maintainability.
You can get a complete list of TIBET primitives using:
Object.keys(TP).filter(function(key) {
return TP.isFunction(TP[key]);
}).sort().unique().join('\n');
Note that TIBET uses a naming convention of a leading $$
for "internal"
properties, $
for "private" properties, and _
for "protected" properties.
These conventions aren't strictly enforced but you should respect them and avoid
using internal or private features.
Primitive Documentation
For API documentation TIBET leverages its runtime system and the tibet reflect
and tibet apropos
commands. This approach lets you query your version of TIBET
for the specific documentation for any function in the system.
tibet apropos
When you know a word or phrase you're interested in but are unsure about what
functions, types, etc. to use you can try tibet apropos
which scans TIBET for
related content and rank orders the results.
For example, here's a scan of TIBET for primitives mentioning json
:
$ tibet apropos json
# Loading TIBET platform at 2019-11-09T17:43:17.668Z
# TIBET reflection suite loaded and active in 5219ms
...snipped...
TP_Primitive_$jsonObj2xml
TP_Primitive_$xml2jsonObj
TP_Primitive_eventAsJSONSource
TP_Primitive_getJSONPIFrame
TP_Primitive_isJSONString
TP_Primitive_js2json
TP_Primitive_json
TP_Primitive_json2js
TP_Primitive_json2xml
TP_Primitive_json2xmlrpc
TP_Primitive_jsoncc
TP_Primitive_jsonpCall
TP_Primitive_jsonsrc
TP_Primitive_objectJSONSource
TP_Primitive_reformatJSToJSON
TP_Primitive_windowAsJSONSource
TP_Primitive_xml2json
The apropos
command searches method names by default. You can get it to search
method comment text by adding --comments
to the command line:
$ tibet apropos json --comments
...snipped...
- by comment
TP.core.JSONPURLHandler_Type_load (3)
TP.core.JSONPath_Type_asXPath (3)
TP.core.ElementNode_Inst_$deleteRepeatRowAt (2)
TP.core.ElementNode_Inst_$insertRepeatRowAt (2)
TP.core.JSONContent_Inst_defineTypes (2)
TP.core.JSONPURLHandler_Type_nuke (2)
TP.core.JSONPath_Inst_$setupXMLPath (2)
TP.json.JSONSchemaType_Type_setSchema (2)
TP_Primitive_jpc (2)
The number behind each line is a count of matches to the search term.
tibet reflect
When you know the name of a method, perhaps thanks to using tibet apropos
, you
can use tibet reflect
to view documentation and location information.
Here's an example of using tibet reflect
to learn more about TP.js2json
:
$ tibet reflect TP.js2json
# Loading TIBET platform at 2019-11-09T17:43:17.668Z
# TIBET reflection suite loaded and active in 5219ms
function json(anObject)
/**
* @method js2json
* @alias json
* @summary Transforms an object into a representation in JSON.
* @description Since JSON is a limited subset of JavaScript this
* representation may not be a complete copy of the object (in
* particular, since these primitives use the open source JSON
* serializer found at: http://www.json.org, Function objects
* will not be serialized).
* @param {Object} anObject The object to transform.
* @returns {String} A JavaScript String containing the JSON data.
* @exception TP.sig.JSONSerializationException
*/
~lib_src/tibet/kernel/TIBETContentPrimitives.js
As you can see here the tibet reflect
command will output any method
documentation along with a reference to the file in which the method is defined,
allowing you to "use the source" if you want even more detail on a particular
method's operation.
Primitive Categories
Query Primitives
Somewhat analogous to $
from jquery, but supporting not only CSS but XPath,
JSONPath, and TIBET object identifier (OID) searches:
byCSSPath
byContent
byId
byPath
bySystemId
DOM Primitives
From HTML to XHTML you can operate on any aspect of the DOM or related Window objects including full support for namespace-qualified XML operations:
attributeGetCanonicalName
attributeGetFullName
attributeGetLocalName
attributeGetOwnerElement
attributeStringAsHash
attributeStringFromHash
cssLinkElementFlattenImports
cssStyleElementGetContent
cssStyleElementSetContent
documentAddCSSElement
documentAddCSSLinkElement
documentAddCSSStyleElement
documentAddContent
documentClearSelection
documentCollapseSelection
documentCopyCSSElements
documentCopyCSSLinkElement
documentCopyCSSStyleElement
documentConstructElement
documentConstructEvent
documentConstructFragment
documentConstructIFrameElement
documentConstructScriptElement
documentConstructSelectionMarker
documentEnsureHeadElement
documentFocusAutofocusedElement
documentFromNode
documentFromString
documentGetAllIFrames
documentGetBody
documentGetBodyContent
documentGetDoctypeInfo
documentGetFocusedElement
documentGetHead
documentGetHeadContent
documentGetHeight
documentGetLinkFileNames
documentGetLocation
documentGetMIMEType
documentGetNativeCSSElements
documentGetNativeStyleRules
documentGetPixelsForFontSize
documentGetRouteName
documentGetScriptFileNames
documentGetScriptNodes
documentGetScrollX
documentGetScrollY
documentGetSelectionElement
documentGetSelectionParent
documentGetSelectionText
documentGetSelectionType
documentGetStyleRules
documentGetTheme
documentGetTitleContent
documentGetViewableHeight
documentGetViewableWidth
documentGetVisibility
documentGetWidth
documentInsertAfterSelection
documentInsertBeforeSelection
documentInsertContent
documentIsSelectionCollapsed
documentIsVisible
documentMoveSelectionToMarker
documentPathContainsNode
documentReloadCSSLinkElementHref
documentRemoveSelection
documentReplaceSelection
documentRewriteHacks
documentScrollBy
documentScrollTo
documentSetContent
documentSetLocation
documentSetTheme
documentSetTitleContent
documentTransformFile
documentTransformNode
elementAddAttributeValue
elementAddClass
elementAddContent
elementAddNamespace
elementAddStyleValue
elementBecome
elementBubbleXMLNSAttributes
elementClearStyleProperty
elementComputeBoxSizeOfMarkup
elementComputeCornerUsing
elementComputeOnScreenXY
elementComputeXMLBaseFrom
elementContainsPoint
elementContentIsScrolled
elementConvertUnitLengthToPixels
elementCopyAttributes
elementCopyXMLNSAttributes
elementDefaultDisplay
elementDisableUserSelect
elementEnableUserSelect
elementFlagChange
elementFromString
elementGetAppliedNativeStyleRules
elementGetAttribute
elementGetAttributeNames
elementGetAttributeNode
elementGetAttributeNodes
elementGetAttributeNodesInNS
elementGetAttributes
elementGetAttributesAsNumbers
elementGetBorderBox
elementGetBorderInPixels
elementGetCanonicalName
elementGetChangeAction
elementGetClass
elementGetClipRect
elementGetComputedStyleObj
elementGetComputedStyleProperty
elementGetComputedStyleString
elementGetComputedTransformMatrix
elementGetContentHeight
elementGetContentWidth
elementGetDocumentIndex
elementGetEffectiveBackgroundColor
elementGetElementAtPoint
elementGetEventIds
elementGetEventOrigins
elementGetFirstEnabledWith
elementGetFullName
elementGetGlobalBox
elementGetGlobalX
elementGetGlobalXY
elementGetGlobalY
elementGetHeight
elementGetIFrameDocument
elementGetIFrameWindow
elementGetInnerContent
elementGetLocalName
elementGetMarginInPixels
elementGetNumericValueFromPercentage
elementGetOffsetBox
elementGetOffsetFromContainer
elementGetOffsetParent
elementGetOffsetX
elementGetOffsetXY
elementGetOffsetY
elementGetOpacity
elementGetOuterContent
elementGetPaddingInPixels
elementGetPageBox
elementGetPageX
elementGetPageXY
elementGetPageY
elementGetPixelValue
elementGetPropertyValueAsNumber
elementGetPseudoInlineStyleObj
elementGetScrollOffsetFromAncestor
elementGetScrollOffsetFromContainer
elementGetScrollXY
elementGetSideClosestTo
elementGetStyleObj
elementGetStyleProperty
elementGetStyleString
elementGetStyleValueInPixels
elementGetStyleValuesInPixels
elementGetTransformMatrix
elementGetTransformValues
elementGetWidth
elementGetXMLNSAttributes
elementGlobalToLocalXY
elementHasAttribute
elementHasAttributeValue
elementHasClass
elementHasFocus
elementHasStyleString
elementHide
elementHideBusyMessage
elementInsertContent
elementIsDisabled
elementIsDisplayed
elementIsNested
elementIsTransformed
elementIsVisible
elementLocalToGlobalXY
elementMakeAbsolute
elementMakePositioned
elementMakeRelative
elementMatchesCSS
elementMergeAttributes
elementMoveBy
elementMoveTo
elementOrderOver
elementOrderUnder
elementPlaceNearElement
elementPopStyleProperty
elementPreserveStyle
elementPushAndSetStyleProperty
elementPushStyleProperty
elementRemoveAttribute
elementRemoveAttributeValue
elementRemoveClass
elementRemoveNamespace
elementRemoveStyleProperty
elementRemoveStyleValue
elementReplaceAttributeValue
elementReplaceClass
elementReplaceStyleValue
elementReplaceWith
elementResolveXMLBase
elementRestoreStyle
elementScrollBy
elementScrollTo
elementSelectContent
elementSetAttribute
elementSetAttributeInNS
elementSetAttributes
elementSetBusyMessage
elementSetClass
elementSetClipRect
elementSetContent
elementSetHeight
elementSetOpacity
elementSetStyleProperty
elementSetStyleString
elementSetTransform
elementSetTransformOrigin
elementSetWidth
elementShow
elementShowBusyMessage
elementStripChangeFlags
elementSumAncestorValues
elementSumAttributeValue
elementTransformCSSPixelValue
elementWrapToContent
nodeAddContent
nodeAddDefaultXMLNS
nodeAncestorsPerform
nodeAppendChild
nodeAsHTMLNode
nodeAsHTMLString
nodeAsString
nodeAsXMLNode
nodeAsXMLString
nodeAwakenChildNodesFromTo
nodeAwakenContent
nodeBreadthTraversal
nodeChildElementsPerform
nodeChildNodesPerform
nodeCloneNode
nodeComparePosition
nodeContainsNode
nodeCopyChildNodesTo
nodeCopyTIBETExpandos
nodeDepthTraversal
nodeDescendantElementsPerform
nodeDescendantsPerform
nodeDetach
nodeDetectAncestor
nodeDetectChildElement
nodeDetectChildNode
nodeDetectDescendant
nodeDetectDescendantElement
nodeDetectSibling
nodeEmptyContent
nodeEqualsNode
nodeEvaluateBarename
nodeEvaluateCSS
nodeEvaluateElementScheme
nodeEvaluatePath
nodeEvaluateXPath
nodeEvaluateXPointer
nodeEvaluateXTension
nodeFromString
nodeGetAncestorPositions
nodeGetAncestors
nodeGetBestNode
nodeGetChildElementAt
nodeGetChildElements
nodeGetChildIndex
nodeGetChildNodes
nodeGetChildNodesByType
nodeGetChildTextContent
nodeGetControlElement
nodeGetControlId
nodeGetDescendantElements
nodeGetDescendantElementsByAttribute
nodeGetDescendantElementsByAttributePrefix
nodeGetDescendantElementsByIdOrName
nodeGetDescendantElementsByName
nodeGetDescendants
nodeGetDescendantsByType
nodeGetDocument
nodeGetDocumentPosition
nodeGetElementById
nodeGetElementsByClassName
nodeGetElementsByTagName
nodeGetFirstAncestorByAttribute
nodeGetFirstAncestorByTagName
nodeGetFirstChildByType
nodeGetFirstChildContentNode
nodeGetFirstChildElement
nodeGetFirstDescendantByType
nodeGetFirstElementByAttribute
nodeGetFirstElementByTagName
nodeGetFirstElementChildByAttribute
nodeGetFirstElementChildByTagName
nodeGetFirstSiblingElement
nodeGetIndexInParent
nodeGetNSPrefixes
nodeGetNSURI
nodeGetNSURIs
nodeGetNextNonChild
nodeGetSiblings
nodeGetStartPhase
nodeGetTargetPhase
nodeGetTextContent
nodeGetTopAncestor
nodeGetWindow
nodeHasReachedPhase
nodeHasWindow
nodeImportNode
nodeInsertBefore
nodeInsertContent
nodeIsDetached
nodeListAsDocument
nodeListAsFragment
nodeMoveChildNodesTo
nodeNormalize
nodeNormalizePhase
nodeRemoveChild
nodeReplaceChild
nodeReplaceTextWithEditor
nodeSelectAncestors
nodeSelectChain
nodeSelectChildElements
nodeSelectChildNodes
nodeSelectDescendantElements
nodeSelectDescendants
nodeSelectSiblings
nodeSetChildTextContent
nodeSetContent
nodeSetTextContent
nodeSiblingsPerform
nodeSwapNode
styleRuleGetSourceInfo
styleRuleGetStyleSheet
styleSheetGetImportSheets
styleSheetGetStyleRules
styleSheetGetStyleRulesMatching
styleSheetInsertRule
styleSheetRemoveRule
styleStringAsHash
styleStringFromHash
windowArmEvents
windowArmListeners
windowArmNode
windowAsHTMLString
windowAsJSONSource
windowAsPrettyString
windowAsString
windowAsXMLString
windowAssignACLKeys
windowAssignCommonIds
windowBuildFunctionFor
windowComputeTransformationMatrix
windowComputeWindowOffsets
windowConstructObject
windowDisarmEvents
windowDisarmNode
windowGetInnerHeight
windowGetInnerWidth
windowGetOuterHeight
windowGetOuterWidth
windowGetParentNames
windowGetScreenWidthAndHeight
windowGetX
windowGetY
windowInstallBackspaceHook
windowInstallDocumentVisibilityHook
windowInstallFocusHook
windowInstallOnBeforeUnloadHook
windowInstallOnlineOfflineHook
windowIsInstrumented
windowMatchesCSSMedia
windowMoveBy
windowMoveTo
windowQueryCSSMedia
windowRefreshContentFrom
windowResetLocation
windowStopLoading
Event Primitives
Events are normalized by TIBET across browsers to ensure consistency and can be queried, manipulated, or created to meet your needs:
eventAsHTMLString
eventAsJSONSource
eventAsPrettyString
eventAsSource
eventAsString
eventAsXMLString
eventGetAltKey
eventGetButton
eventGetClientXY
eventGetCtrlKey
eventGetKeyCode
eventGetMetaKey
eventGetOffsetXY
eventGetPageXY
eventGetPropertyKeys
eventGetRelatedTarget
eventGetResolvedTarget
eventGetShiftKey
eventGetTarget
eventGetTargetDocument
eventGetTime
eventGetType
eventGetUnicodeCharCode
eventGetWheelDelta
eventGetWindow
eventIsDuplicate
eventNormalize
eventPreventDefault
eventResolveTarget
eventSetType
eventStopPropagation
Serialization Primitives
Conversions to/from JSON or XMLRPC strings:
js2json
js2xml
js2xmlrpc
json
json2js
json2xml
json2xmlrpc
jsonsrc
Markup Primitives
Working with HTML, XHTML, and XML from a node or string perspective:
htmlnode
htmlstr
htmlDocumentAddContent
htmlDocumentInsertContent
htmlDocumentSetContent
htmlElementAddContent
htmlElementAsXHTMLString
htmlElementInsertContent
htmlElementReplaceWith
htmlElementSetContent
htmlEntitiesToLiterals
htmlEntitiesToXMLEntities
htmlLiteralsToEntities
htmlNodeAsXHTMLNode
htmlNodeAsXHTMLString
xhtmlnode
xhtmlstr
xmlDocumentAddContent
xmlDocumentInsertContent
xmlDocumentSetContent
xmlElementAddContent
xmlElementInsertContent
xmlElementReplaceWith
xmlElementSetContent
xmlEntitiesToHTMLEntities
xmlEntitiesToLiterals
xmlLiteralsToEntities
xmlnode
xmlstr
xml2js
xml2json
Communication Primitives
Support functionality for HTTP, WebDAV, and WebSocket communication:
httpAbort
httpCall
httpConstruct
httpDelete
httpDidRedirect
httpDidSucceed
httpEncode
httpEncodeRequestBody
httpError
httpGet
httpGetDefaultHeaders
httpHead
httpOptions
httpPost
httpPut
httpSetHeaders
httpTrace
jsonpCall
webSocketAbort
webSocketCall
webSocketClose
webSocketConstruct
webSocketError
webdavCall
webdavCheckin
webdavCheckout
webdavCopy
webdavGetACL
webdavGetACLPrincipalPropSetReport
webdavGetAllIncludedProperties
webdavGetAllProperties
webdavGetCurrentUserPrivilegeSet
webdavGetDAVPropertyValues
webdavGetExpandPropertyReport
webdavGetPrincipalMatchReport
webdavGetPrincipalSearchPropertySetReport
webdavGetProperty
webdavGetPropertyNames
webdavGetVersionTreeReport
webdavLock
webdavMkCol
webdavMove
webdavPropFind
webdavPropPatch
webdavRemoveProperty
webdavReport
webdavSetProperty
webdavUnlock
webdavVersionControl
URI Primitives
Processing both URI strings and TIBET's URI instances:
uriCollapsePath
uriCollectionPath
uriExpandPath
uriExtension
uriGetLoadConfig
uriGetLoadNode
uriGetLoadPackage
uriGetRouteName
uriGetXPointerData
uriInLocalFormat
uriInWebFormat
uriIsAbsolute
uriIsVirtual
uriJoinFragments
uriJoinPaths
uriJoinQuery
uriMinusFileScheme
uriName
uriNeedsPrivileges
uriPlusFileScheme
uriRelativeToPath
uriResolvePaths
uriResolveVirtualPath
uriResult
uriResultType
uriTempFileName
uriTransformFile
uriTransformNode
uriWithRoot
Testing Primitives
Type checks, content checks, and other focused object testing:
isAnnotation
isArgArray
isArray
isAttributeNode
isBlank
isBoolean
isCDATASectionNode
isCallable
isClosed
isCollection
isCollectionNode
isCommentNode
isDNU
isDate
isDefined
isDocument
isElement
isEmpty
isEnhanced
isError
isEvent
isFalse
isFalsey
isFragment
isFunction
isGlobal
isGlobalMethod
isHTMLDocument
isHTMLNode
isIFrameWindow
isInstMethod
isInvalidDate
isJSONString
isKindOf
isLocalMethod
isMediaQueryList
isMemberOf
isMethod
isMutable
isNaN
isNamedNodeMap
isNamespace
isNativeFunction
isNativeType
isNode
isNodeList
isNonFunctionConstructor
isNull
isNumber
isOwnProperty
isPINode
isPair
isPlainObject
isProperty
isPrototype
isReferenceType
isRegExp
isSVGNode
isString
isStyleDeclaration
isStyleRule
isStyleSheet
isSubtypeOf
isTextNode
isTrue
isTruthy
isType
isTypeMethod
isTypeName
isURI
isValid
isWindow
isXHR
isXHTMLDocument
isXHTMLNode
isXMLDocument
isXMLNode
notBlank
notDefined
notEmpty
notFalse
notNaN
notNull
notTrue
notValid
Branching (Ternary) Primitives
Utility functions which replace or support low-level ternary operations:
ifBlank
ifDebug
ifEmpty
ifError
ifFatal
ifInfo
ifInvalid
ifKeyInvalid
ifKeyNull
ifKeyUndefined
ifNaN
ifNull
ifSevere
ifSystem
ifTrace
ifUndefined
ifWarn
Object Primitives
Fun with objects of any type. These utilities let you convert to string form, query for ID, type, or keys, and perform numerous other useful operations on objects of unknown (generic) type:
objectCopy
objectGetLoadCollectionPath
objectGetLoadConfig
objectGetLoadNode
objectGetLoadPackage
objectGetLoadPath
objectGetMetadata
objectGetMetadataName
objectGetSourceCollectionPath
objectGetSourcePath
objectGetXY
objectGlobalID
objectHTMLNode
objectHTMLString
objectID
objectJSONSource
objectKeys
objectLocalID
objectLocation
objectName
objectSetLoadNode
objectSetValue
objectSize
objectSourceValue
objectStringValue
objectSupertype
objectSupertypeNames
objectSupertypes
objectToString
objectType
objectTypeName
objectUnwrap
objectValue
objectWrap
objectXHTMLNode
objectXHTMLString
objectXMLNode
objectXMLString
Construct() Primitives
Shortcuts for TIBET's construct calls for common types:
ac
apc
annotate
bc
button
cc
coord
cpc
dc
doc
ec
elem
event
fc
frag
hash
hc
job
jpc
llc
nc
node
oc
pc
phc
rc
rtc
sc
tpc
uc
uri
win
wrap
xpc
Conversion Primitives
Format conversions of various forms:
args
atob
btoa
colorStringAsArray
colorStringAsHex
colorStringAsLongNumber
colorValuesInterpolate
cssDimensionValuesFromString
domkeysigname
errorAsString
fragmentFromString
longNumberAsColorString
rgbValuesAsHue
rgbaValuesAsHue
unicode2utf8
utf82unicode
utf8decode
utf8encode
Definition Primitives
Metadata definition support. NOTE that some of these are actually direct methods on TP but most support TIBET`s OO layer:
defineAttribute
defineAttributeSlot
defineBinding
defineCommonMethod
defineConstant
defineConstantSlot
defineGlobalMethod
defineMetaInstMethod
defineMetaTypeMethod
defineMethod
defineMethodAlias
defineMethodSlot
defineNamespace
definePrimitive
defineSlot
Access Primitives
Getters designed to work with generic object types:
getAttr
getClass
getContent
getDefaultLogger
getFunctionName
getID
getJSONPIFrame
getLogLevel
getLogger
getMarkupPathType
getName
getNextWindowName
getNonFunctionConstructorName
getParsedPrimitiveValue
getPixelsPerPoint
getPluginInfo
getPointerScheme
getQNameRegex
getStackInfo
getStyle
getTestFixture
getTestSuites
getTypeNames
Signaling Primitives
Support for general signaling. Most signaling can and should be done directly
from the object originating the signal but you can also use a TP
primitive:
arm
changed
disarm
dispatch
handle
ignore
observe
queue
raise
resume
signal
suspend
Logging Primitives
Support methods for quickly logging from the library. NOTE that most of these
methods have corrolary functions on the APP
object for logging
application activity.
debug
error
fatal
info
severe
system
trace
warn
stderr
stdin
stdout
Matrix Primitives
A few matrix operation support primitives can come in handy some times :)
matrixAs2DMatrix
matrixAs3DMatrix
matrixFromCSSString
matrixTransformPoint
matrixTransformRect
matrixMultiply
matrixTranslate
Utility Primitives
And the inevitable "miscellaneous bucket":
addAttr
addClass
addContent
addStyle
alert
animate
backstop
canInvoke
canonical
chain
collapse
compact
compare
computeAngleFromCenter
computeAngleFromEnds
computeCommonSizes
computeCompassCorner
computeDistance
computeVector
confirm
contains
context
contractSignalName
copy
cssElementGetStyleSheet
decryptStorageValue
deprecated
describe
destroyBinding
dump
effect
elemGenID
elemget
elemset
encryptStorageValue
equal
escapeMethodName
escapeTypeName
executePrivileged
expandSignalName
focus
format
formatUnquotedJSON
genID
genUUID
generateRandomValue
gid
go2
hasAttr
hasClass
hasStyle
hmac
id
idcall
identical
iframeAddContent
iframeSetContent
insertContent
interface
jid
join
keyname
keys
kill
lid
lname
loc
match
method
methods
name
nsuri
open
override
owns
parse
parseCSSSelector
prefix
prefixAssignmentStatements
preserveStyle
pretty
process
processAndExecuteWith
profile
prompt
qname
recursion
regExpConstruct
regExpEscape
register
removeAttr
removeClass
removeContent
removeElem
removeStyle
replaceAttr
replaceClass
replaceElem
replaceStyle
request
reset
restoreStyle
runConditionalFunction
runTestSuites
schedule
select
selectorIsNative
setAttr
setClass
setContent
setDefaultLogger
setLogLevel
setStyle
setval
shell
shouldSignalChange
size
src
status
stnames
stop
str
stringAsHTMLAttribute
stringAsHTMLNode
stringAsHTMLString
stringFindDelimiterIndex
stringMatchRecursive
stringTokenizeUsingDelimiters
stringUntokenizeUsingDelimiters
stripPropertyPrefix
stype
stypes
submit
textElementInsertContent
textElementReplaceSelection
tname
todo
toggleAttr
toggleClass
tostr
trim
type
unbound
unescapeMethodName
unescapeTypeName
unregister
unstop
unwrap
val
validate
wheel
Code
TIBET's primitives are all found in the TIBET "kernel"
(~lib/src/tibet/kernel
).
Here's a brief list of files specific to TIBET primitives:
TIBETCSSPrimitivesBase.js
TIBETCSSPrimitivesPlatform.js
TIBETCSSPrimitivesPost.js
TIBETCSSPrimitivesPre.js
TIBETContentPrimitives.js
TIBETDHTMLPrimitivesBase.js
TIBETDHTMLPrimitivesPlatform.js
TIBETDHTMLPrimitivesPost.js
TIBETDHTMLPrimitivesPre.js
TIBETDOMPrimitivesBase.js
TIBETDOMPrimitivesPlatform.js
TIBETDOMPrimitivesPost.js
TIBETDOMPrimitivesPre.js
TIBETDevicePrimitivesBase.js
TIBETDevicePrimitivesPlatform.js
TIBETDevicePrimitivesPost.js
TIBETDevicePrimitivesPre.js
TIBETHTTPPrimitivesBase.js
TIBETHTTPPrimitivesPlatform.js
TIBETHTTPPrimitivesPost.js
TIBETHTTPPrimitivesPre.js
TIBETPrimitivesBase.js
TIBETPrimitivesPlatform.js
TIBETPrimitivesPost.js
TIBETPrimitivesPre.js
TIBETPrimitivesShortcuts.js
TIBETStringPrimitivesPost.js
TIBETURIPrimitivesBase.js
TIBETURIPrimitivesPlatform.js
TIBETURIPrimitivesPost.js
TIBETURIPrimitivesPre.js
TIBETXSLTPrimitivesBase.js
TIBETXSLTPrimitivesPlatform.js
TIBETXSLTPrimitivesPost.js