CanvasAPI.html 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Interface: CanvasAPI</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Interface: CanvasAPI</h1>
  17. <section>
  18. <header>
  19. <h2>CanvasAPI</h2>
  20. <div class="class-description">API class that is used to control the content and behavior of a dashboard canvas.</div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <dl class="details">
  25. </dl>
  26. <h3>Example</h3>
  27. <pre class="prettyprint"><code>dashboard.getFeature('Canvas')</code></pre>
  28. </div>
  29. <h3 class="subsection-title">Methods</h3>
  30. <h4 class="name" id="addContent"><span class="type-signature"></span>addContent<span class="signature">(options, transactionToken)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="ContentAPI.html">ContentAPI</a>>}</span></h4>
  31. <div class="description">
  32. Adds content options to the canvas.
  33. </div>
  34. <h5>Parameters:</h5>
  35. <table class="params">
  36. <thead>
  37. <tr>
  38. <th>Name</th>
  39. <th>Type</th>
  40. <th class="last">Description</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <tr>
  45. <td class="name"><code>options</code></td>
  46. <td class="type">
  47. <span class="param-type">Object</span>
  48. </td>
  49. <td class="description last">Contains the options for adding content to the canvas.
  50. <h6>Properties</h6>
  51. <table class="params">
  52. <thead>
  53. <tr>
  54. <th>Name</th>
  55. <th>Type</th>
  56. <th class="last">Description</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <tr>
  61. <td class="name"><code>containerId</code></td>
  62. <td class="type">
  63. <span class="param-type">String</span>
  64. </td>
  65. <td class="description last">Container ID specifying where to add the content. By default, the system selects the position.</td>
  66. </tr>
  67. <tr>
  68. <td class="name"><code>position</code></td>
  69. <td class="type">
  70. <span class="param-type">Number</span>
  71. </td>
  72. <td class="description last">Index specifying where to add the content. By default, the system selects the position.</td>
  73. </tr>
  74. <tr>
  75. <td class="name"><code>properties</code></td>
  76. <td class="type">
  77. <span class="param-type">Object</span>
  78. </td>
  79. <td class="description last">An object of property names and values to apply to the content.</td>
  80. </tr>
  81. <tr>
  82. <td class="name"><code>type</code></td>
  83. <td class="type">
  84. <span class="param-type">String</span>
  85. </td>
  86. <td class="description last">Content provider type to use. Must provide a spec or content, if not defined.</td>
  87. </tr>
  88. <tr>
  89. <td class="name"><code>spec</code></td>
  90. <td class="type">
  91. <span class="param-type">Object</span>
  92. </td>
  93. <td class="description last">Layout, widget, or fragment spec.</td>
  94. </tr>
  95. <tr>
  96. <td class="name"><code>content</code></td>
  97. <td class="type">
  98. <span class="param-type"><a href="ContentAPI.html">ContentAPI</a></span>
  99. </td>
  100. <td class="description last">ContentAPI object to be added to the canvas.</td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td class="name"><code>transactionToken</code></td>
  108. <td class="type">
  109. <span class="param-type">TransactionToken</span>
  110. </td>
  111. <td class="description last"></td>
  112. </tr>
  113. </tbody>
  114. </table>
  115. <dl class="details">
  116. </dl>
  117. <h5>Returns:</h5>
  118. <div class="param-desc">
  119. new content
  120. </div>
  121. <dl>
  122. <dt>
  123. Type
  124. </dt>
  125. <dd>
  126. <span class="param-type">Promise.&lt;<a href="ContentAPI.html">ContentAPI</a>></span>
  127. </dd>
  128. </dl>
  129. <h4 class="name" id="deselectContent"><span class="type-signature"></span>deselectContent<span class="signature">(idList-)</span><span class="type-signature"></span></h4>
  130. <div class="description">
  131. Deselects the content that matches the specified IDs.
  132. </div>
  133. <h5>Parameters:</h5>
  134. <table class="params">
  135. <thead>
  136. <tr>
  137. <th>Name</th>
  138. <th>Type</th>
  139. <th class="last">Description</th>
  140. </tr>
  141. </thead>
  142. <tbody>
  143. <tr>
  144. <td class="name"><code>idList-</code></td>
  145. <td class="type">
  146. <span class="param-type">Array.&lt;String></span>
  147. </td>
  148. <td class="description last">Array of IDs to deselect</td>
  149. </tr>
  150. </tbody>
  151. </table>
  152. <dl class="details">
  153. </dl>
  154. <h4 class="name" id="findContent"><span class="type-signature"></span>findContent<span class="signature">(selector)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ContentAPI.html">ContentAPI</a>>}</span></h4>
  155. <div class="description">
  156. Returns a list of content that matches the specified selector.
  157. </div>
  158. <h5>Parameters:</h5>
  159. <table class="params">
  160. <thead>
  161. <tr>
  162. <th>Name</th>
  163. <th>Type</th>
  164. <th class="last">Description</th>
  165. </tr>
  166. </thead>
  167. <tbody>
  168. <tr>
  169. <td class="name"><code>selector</code></td>
  170. <td class="type">
  171. <span class="param-type">Object</span>
  172. </td>
  173. <td class="description last">Selector object; returns all widgets if undefined.
  174. <h6>Properties</h6>
  175. <table class="params">
  176. <thead>
  177. <tr>
  178. <th>Name</th>
  179. <th>Type</th>
  180. <th class="last">Description</th>
  181. </tr>
  182. </thead>
  183. <tbody>
  184. <tr>
  185. <td class="name"><code>type</code></td>
  186. <td class="type">
  187. <span class="param-type">String</span>
  188. </td>
  189. <td class="description last">Selector type</td>
  190. </tr>
  191. <tr>
  192. <td class="name"><code>properties</code></td>
  193. <td class="type">
  194. <span class="param-type">Object</span>
  195. </td>
  196. <td class="description last"></td>
  197. </tr>
  198. </tbody>
  199. </table>
  200. </td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <dl class="details">
  205. </dl>
  206. <h5>Returns:</h5>
  207. <div class="param-desc">
  208. Array of content
  209. </div>
  210. <dl>
  211. <dt>
  212. Type
  213. </dt>
  214. <dd>
  215. <span class="param-type">Array.&lt;<a href="ContentAPI.html">ContentAPI</a>></span>
  216. </dd>
  217. </dl>
  218. <h5>Example</h5>
  219. <pre class="prettyprint"><code>canvas.findContent({
  220. properties: {
  221. title: 'My page'
  222. }
  223. });
  224. canvas.findContent({
  225. type: 'page'
  226. });</code></pre>
  227. <h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">(id)</span><span class="type-signature"> &rarr; {<a href="ContentAPI.html">ContentAPI</a>}</span></h4>
  228. <div class="description">
  229. Returns the content that matches the specified ID.
  230. </div>
  231. <h5>Parameters:</h5>
  232. <table class="params">
  233. <thead>
  234. <tr>
  235. <th>Name</th>
  236. <th>Type</th>
  237. <th class="last">Description</th>
  238. </tr>
  239. </thead>
  240. <tbody>
  241. <tr>
  242. <td class="name"><code>id</code></td>
  243. <td class="type">
  244. <span class="param-type">String</span>
  245. </td>
  246. <td class="description last">ID of the content</td>
  247. </tr>
  248. </tbody>
  249. </table>
  250. <dl class="details">
  251. </dl>
  252. <h5>Returns:</h5>
  253. <dl>
  254. <dt>
  255. Type
  256. </dt>
  257. <dd>
  258. <span class="param-type"><a href="ContentAPI.html">ContentAPI</a></span>
  259. </dd>
  260. </dl>
  261. <h4 class="name" id="getContentActionList"><span class="type-signature"></span>getContentActionList<span class="signature">(idList)</span><span class="type-signature"> &rarr; {Array.&lt;Object>}</span></h4>
  262. <div class="description">
  263. Returns a list of toolbar actions.
  264. </div>
  265. <h5>Parameters:</h5>
  266. <table class="params">
  267. <thead>
  268. <tr>
  269. <th>Name</th>
  270. <th>Type</th>
  271. <th class="last">Description</th>
  272. </tr>
  273. </thead>
  274. <tbody>
  275. <tr>
  276. <td class="name"><code>idList</code></td>
  277. <td class="type">
  278. <span class="param-type">Array.&lt;String></span>
  279. </td>
  280. <td class="description last"></td>
  281. </tr>
  282. </tbody>
  283. </table>
  284. <dl class="details">
  285. </dl>
  286. <h5>Returns:</h5>
  287. <div class="param-desc">
  288. Array of actions
  289. </div>
  290. <dl>
  291. <dt>
  292. Type
  293. </dt>
  294. <dd>
  295. <span class="param-type">Array.&lt;Object></span>
  296. </dd>
  297. </dl>
  298. <h5>Example</h5>
  299. <pre class="prettyprint"><code>{
  300. name: 'group',
  301. label: stringResources.get('toolbarActionGroup'),
  302. icon: 'dashboard-group',
  303. type: 'Button',
  304. action: () => {}
  305. }</code></pre>
  306. <h4 class="name" id="getPropertiesNameList"><span class="type-signature"></span>getPropertiesNameList<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;String>}</span></h4>
  307. <div class="description">
  308. Returns an object of property objects.
  309. </div>
  310. <dl class="details">
  311. </dl>
  312. <h5>Returns:</h5>
  313. <div class="param-desc">
  314. Array of property objects
  315. </div>
  316. <dl>
  317. <dt>
  318. Type
  319. </dt>
  320. <dd>
  321. <span class="param-type">Array.&lt;String></span>
  322. </dd>
  323. </dl>
  324. <h4 class="name" id="getPropertyLayoutList"><span class="type-signature"></span>getPropertyLayoutList<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;Object>}</span></h4>
  325. <dl class="details">
  326. </dl>
  327. <h5>Returns:</h5>
  328. <div class="param-desc">
  329. Array of layout and properties used to render the properties UI.
  330. </div>
  331. <dl>
  332. <dt>
  333. Type
  334. </dt>
  335. <dd>
  336. <span class="param-type">Array.&lt;Object></span>
  337. </dd>
  338. </dl>
  339. <h4 class="name" id="getPropertyValue"><span class="type-signature"></span>getPropertyValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {Object}</span></h4>
  340. <div class="description">
  341. Gets the value for a property.
  342. </div>
  343. <h5>Parameters:</h5>
  344. <table class="params">
  345. <thead>
  346. <tr>
  347. <th>Name</th>
  348. <th>Type</th>
  349. <th class="last">Description</th>
  350. </tr>
  351. </thead>
  352. <tbody>
  353. <tr>
  354. <td class="name"><code>name</code></td>
  355. <td class="type">
  356. <span class="param-type">String</span>
  357. </td>
  358. <td class="description last">Name of the property</td>
  359. </tr>
  360. </tbody>
  361. </table>
  362. <dl class="details">
  363. </dl>
  364. <h5>Returns:</h5>
  365. <div class="param-desc">
  366. Value of the property
  367. </div>
  368. <dl>
  369. <dt>
  370. Type
  371. </dt>
  372. <dd>
  373. <span class="param-type">Object</span>
  374. </dd>
  375. </dl>
  376. <h4 class="name" id="getSelectedContentList"><span class="type-signature"></span>getSelectedContentList<span class="signature">(selector)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ContentAPI.html">ContentAPI</a>>}</span></h4>
  377. <div class="description">
  378. Returns the list of content that is selected.
  379. </div>
  380. <h5>Parameters:</h5>
  381. <table class="params">
  382. <thead>
  383. <tr>
  384. <th>Name</th>
  385. <th>Type</th>
  386. <th class="last">Description</th>
  387. </tr>
  388. </thead>
  389. <tbody>
  390. <tr>
  391. <td class="name"><code>selector</code></td>
  392. <td class="type">
  393. <span class="param-type">Object</span>
  394. </td>
  395. <td class="description last">Optional, returns groups and widgets by default.
  396. <h6>Properties</h6>
  397. <table class="params">
  398. <thead>
  399. <tr>
  400. <th>Name</th>
  401. <th>Type</th>
  402. <th class="last">Description</th>
  403. </tr>
  404. </thead>
  405. <tbody>
  406. <tr>
  407. <td class="name"><code>type</code></td>
  408. <td class="type">
  409. <span class="param-type">String</span>
  410. </td>
  411. <td class="description last">Selector string</td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. </td>
  416. </tr>
  417. </tbody>
  418. </table>
  419. <dl class="details">
  420. </dl>
  421. <h5>Returns:</h5>
  422. <div class="param-desc">
  423. contentList - Array of content
  424. </div>
  425. <dl>
  426. <dt>
  427. Type
  428. </dt>
  429. <dd>
  430. <span class="param-type">Array.&lt;<a href="ContentAPI.html">ContentAPI</a>></span>
  431. </dd>
  432. </dl>
  433. <h4 class="name" id="moveContent"><span class="type-signature"></span>moveContent<span class="signature">(containerId, contentIdList, transactionToken)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ContentAPI.html">ContentAPI</a>>}</span></h4>
  434. <div class="description">
  435. Moves the contents specified in @contentIdList to new container @containerId.
  436. </div>
  437. <h5>Parameters:</h5>
  438. <table class="params">
  439. <thead>
  440. <tr>
  441. <th>Name</th>
  442. <th>Type</th>
  443. <th class="last">Description</th>
  444. </tr>
  445. </thead>
  446. <tbody>
  447. <tr>
  448. <td class="name"><code>containerId</code></td>
  449. <td class="type">
  450. <span class="param-type">String</span>
  451. </td>
  452. <td class="description last">Specifies the container ID.</td>
  453. </tr>
  454. <tr>
  455. <td class="name"><code>contentIdList</code></td>
  456. <td class="type">
  457. <span class="param-type">*</span>
  458. </td>
  459. <td class="description last">Contains the content ID list.</td>
  460. </tr>
  461. <tr>
  462. <td class="name"><code>transactionToken</code></td>
  463. <td class="type">
  464. <span class="param-type">*</span>
  465. </td>
  466. <td class="description last">Transaction token for this action.</td>
  467. </tr>
  468. </tbody>
  469. </table>
  470. <dl class="details">
  471. </dl>
  472. <h5>Returns:</h5>
  473. <div class="param-desc">
  474. the list of contentAPIs correnponding to @contentIdList
  475. </div>
  476. <dl>
  477. <dt>
  478. Type
  479. </dt>
  480. <dd>
  481. <span class="param-type">Array.&lt;<a href="ContentAPI.html">ContentAPI</a>></span>
  482. </dd>
  483. </dl>
  484. <h4 class="name" id="off"><span class="type-signature"></span>off<span class="signature">(name, name)</span><span class="type-signature"></span></h4>
  485. <div class="description">
  486. Deregisters a canvas event handler.
  487. </div>
  488. <h5>Parameters:</h5>
  489. <table class="params">
  490. <thead>
  491. <tr>
  492. <th>Name</th>
  493. <th>Type</th>
  494. <th class="last">Description</th>
  495. </tr>
  496. </thead>
  497. <tbody>
  498. <tr>
  499. <td class="name"><code>name</code></td>
  500. <td class="type">
  501. <span class="param-type">String</span>
  502. </td>
  503. <td class="description last">Event name</td>
  504. </tr>
  505. <tr>
  506. <td class="name"><code>name</code></td>
  507. <td class="type">
  508. <span class="param-type">function</span>
  509. </td>
  510. <td class="description last">Event handler</td>
  511. </tr>
  512. </tbody>
  513. </table>
  514. <dl class="details">
  515. </dl>
  516. <h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(name, handler)</span><span class="type-signature"> &rarr; {Object}</span></h4>
  517. <div class="description">
  518. Registers a canvas event handler.
  519. </div>
  520. <h5>Parameters:</h5>
  521. <table class="params">
  522. <thead>
  523. <tr>
  524. <th>Name</th>
  525. <th>Type</th>
  526. <th class="last">Description</th>
  527. </tr>
  528. </thead>
  529. <tbody>
  530. <tr>
  531. <td class="name"><code>name</code></td>
  532. <td class="type">
  533. <span class="param-type">String</span>
  534. </td>
  535. <td class="description last">Event name</td>
  536. </tr>
  537. <tr>
  538. <td class="name"><code>handler</code></td>
  539. <td class="type">
  540. <span class="param-type">function</span>
  541. </td>
  542. <td class="description last">Event handler</td>
  543. </tr>
  544. </tbody>
  545. </table>
  546. <dl class="details">
  547. </dl>
  548. <h5>Returns:</h5>
  549. <div class="param-desc">
  550. Object that has a remove function to remove the event handler.
  551. </div>
  552. <dl>
  553. <dt>
  554. Type
  555. </dt>
  556. <dd>
  557. <span class="param-type">Object</span>
  558. </dd>
  559. </dl>
  560. <h5>Example</h5>
  561. <pre class="prettyprint"><code>canvas.on('all', (event) => { console.log(event); });
  562. canvas.on('change:content:selections', (event) => { console.log(event.info.events); });
  563. canvas.on('change:content:selections:clearAll', (event) => { console.log(event); });</code></pre>
  564. <h4 class="name" id="removeContent"><span class="type-signature"></span>removeContent<span class="signature">(id, transactionToken)</span><span class="type-signature"></span></h4>
  565. <div class="description">
  566. Removes the content with the specified ID.
  567. </div>
  568. <h5>Parameters:</h5>
  569. <table class="params">
  570. <thead>
  571. <tr>
  572. <th>Name</th>
  573. <th>Type</th>
  574. <th class="last">Description</th>
  575. </tr>
  576. </thead>
  577. <tbody>
  578. <tr>
  579. <td class="name"><code>id</code></td>
  580. <td class="type">
  581. <span class="param-type">String</span>
  582. </td>
  583. <td class="description last">ID of the content</td>
  584. </tr>
  585. <tr>
  586. <td class="name"><code>transactionToken</code></td>
  587. <td class="type">
  588. <span class="param-type">TransactionToken</span>
  589. </td>
  590. <td class="description last">Transaction token for this action</td>
  591. </tr>
  592. </tbody>
  593. </table>
  594. <dl class="details">
  595. </dl>
  596. <h4 class="name" id="selectContent"><span class="type-signature"></span>selectContent<span class="signature">(idList-)</span><span class="type-signature"></span></h4>
  597. <div class="description">
  598. Selects the content that matches the specified IDs.
  599. </div>
  600. <h5>Parameters:</h5>
  601. <table class="params">
  602. <thead>
  603. <tr>
  604. <th>Name</th>
  605. <th>Type</th>
  606. <th class="last">Description</th>
  607. </tr>
  608. </thead>
  609. <tbody>
  610. <tr>
  611. <td class="name"><code>idList-</code></td>
  612. <td class="type">
  613. <span class="param-type">Array.&lt;String></span>
  614. </td>
  615. <td class="description last">Array of IDs to select</td>
  616. </tr>
  617. </tbody>
  618. </table>
  619. <dl class="details">
  620. </dl>
  621. <h4 class="name" id="setPropertyValue"><span class="type-signature"></span>setPropertyValue<span class="signature">(name, value, transactionToken)</span><span class="type-signature"></span></h4>
  622. <div class="description">
  623. Sets the value for a property.
  624. </div>
  625. <h5>Parameters:</h5>
  626. <table class="params">
  627. <thead>
  628. <tr>
  629. <th>Name</th>
  630. <th>Type</th>
  631. <th class="last">Description</th>
  632. </tr>
  633. </thead>
  634. <tbody>
  635. <tr>
  636. <td class="name"><code>name</code></td>
  637. <td class="type">
  638. <span class="param-type">String</span>
  639. </td>
  640. <td class="description last">Name of the property to set</td>
  641. </tr>
  642. <tr>
  643. <td class="name"><code>value</code></td>
  644. <td class="type">
  645. <span class="param-type">Object</span>
  646. </td>
  647. <td class="description last">Value to set</td>
  648. </tr>
  649. <tr>
  650. <td class="name"><code>transactionToken</code></td>
  651. <td class="type">
  652. <span class="param-type">TransactionToken</span>
  653. </td>
  654. <td class="description last"></td>
  655. </tr>
  656. </tbody>
  657. </table>
  658. <dl class="details">
  659. </dl>
  660. </article>
  661. </section>
  662. </div>
  663. <nav>
  664. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AppFactory.html">AppFactory</a></li></ul><h3>Interfaces</h3><ul><li><a href="CanvasAPI.html">CanvasAPI</a></li><li><a href="ContentAPI.html">ContentAPI</a></li><li><a href="ContentStoreAPI.html">ContentStoreAPI</a></li><li><a href="DashboardCoreAPI.html">DashboardCoreAPI</a></li><li><a href="DashboardPreferencesAPI.html">DashboardPreferencesAPI</a></li><li><a href="DashboardSettingsAPI.html">DashboardSettingsAPI</a></li><li><a href="PropertiesAPI.html">PropertiesAPI</a></li><li><a href="RendererAPI.html">RendererAPI</a></li><li><a href="SaveAPI.html">SaveAPI</a></li><li><a href="SerializerAPI.html">SerializerAPI</a></li><li><a href="StateAPI.html">StateAPI</a></li><li><a href="TransactionAPI.html">TransactionAPI</a></li><li><a href="UserProfileAPI.html">UserProfileAPI</a></li></ul>
  665. </nav>
  666. <br class="clear">
  667. <footer>
  668. Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Thu May 05 2022 17:56:07 GMT+0000 (UTC)
  669. </footer>
  670. <script> prettyPrint(); </script>
  671. <script src="scripts/linenumber.js"> </script>
  672. </body>
  673. </html>