{"id":875,"date":"2014-09-02T16:09:15","date_gmt":"2014-09-02T04:09:15","guid":{"rendered":"http:\/\/www.davidbrebner.com\/?p=875"},"modified":"2014-09-02T16:28:42","modified_gmt":"2014-09-02T04:28:42","slug":"custom-scripts-in-umajin-app-creator","status":"publish","type":"post","link":"https:\/\/www.davidbrebner.com\/?p=875","title":{"rendered":"Custom Scripts in Umajin App Creator"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script1.jpg\" alt=\"umajin_script\" width=\"900\" height=\"300\" class=\"alignnone size-full wp-image-881\" srcset=\"https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script1.jpg 900w, https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script1-150x50.jpg 150w, https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script1-300x100.jpg 300w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>This example shows how a custom script is integrated into the Umajin App Creator experience.  The aim is to give developers plenty of power, but to make it super easy for the designers who are using the editor.<\/p>\n<p>Here is an example Lua script which a developer has created.  This first registers the currency function and labels it &#8220;Currency Convert&#8221;.  The register function also specifies the parameters, the type of the parameters and the labels to display inside the editor.<\/p>\n<p>The function itself retrieves values from the specified components and calls a yahoo financial web service to retrieve an exchange rate.  Once that exchange rate is returned it then updates a text field on the page.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script.png\" alt=\"umajin_script\" width=\"821\" height=\"379\" class=\"alignnone size-full wp-image-878\" srcset=\"https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script.png 821w, https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script-150x69.png 150w, https:\/\/www.davidbrebner.com\/wp-content\/uploads\/2014\/09\/umajin_script-300x138.png 300w\" sizes=\"(max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>This video shows the experience from the Umajin editor perspective.<\/p>\n<p><iframe width=\"853\" height=\"480\" src=\"\/\/www.youtube.com\/embed\/TgjX8CZ32KI\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This example shows how a custom script is integrated into the Umajin App Creator experience. The aim is to give [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-875","post","type-post","status-publish","format-image","hentry","category-umaijn","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/posts\/875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=875"}],"version-history":[{"count":5,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":883,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions\/883"}],"wp:attachment":[{"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.davidbrebner.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}