MCPcopy Create free account
hub / github.com/textAngular/textAngular / registerTextAngularTool

Function registerTextAngularTool

src/textAngularSetup.js:56–64  ·  view source on GitHub ↗
(name, toolDefinition)

Source from the content-addressed store, hash-verified

54*/
55// name and toolDefinition to add into the tools available to be added on the toolbar
56function registerTextAngularTool(name, toolDefinition){
57 if(!name || name === '' || taTools.hasOwnProperty(name)) throw('textAngular Error: A unique name is required for a Tool Definition');
58 if(
59 (toolDefinition.display && (toolDefinition.display === '' || !validElementString(toolDefinition.display))) ||
60 (!toolDefinition.display && !toolDefinition.buttontext && !toolDefinition.iconclass)
61 )
62 throw('textAngular Error: Tool Definition for "' + name + '" does not have a valid display/iconclass/buttontext value');
63 taTools[name] = toolDefinition;
64}
65
66angular.module('textAngularSetup', [])
67.constant('taRegisterTool', registerTextAngularTool)

Callers

nothing calls this directly

Calls 1

validElementStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…