diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2016-10-30 13:47:56 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2016-10-30 13:47:56 -0400 |
commit | d1d071462a0a1520d94a029886093b558b24267d (patch) | |
tree | 3c5544842289a2545386e1dd518dc64edf9faf88 /mdl | |
parent | 9c9a28b92f55a8dd302cd964c66498d95c1b5bd3 (diff) |
Support saving new actions
Diffstat (limited to 'mdl')
-rw-r--r-- | mdl/lib.urp | 2 | ||||
-rw-r--r-- | mdl/mdl.ur | 21 | ||||
-rw-r--r-- | mdl/mdlFfi.urs | 2 |
3 files changed, 18 insertions, 7 deletions
diff --git a/mdl/lib.urp b/mdl/lib.urp index 0853cbe..e4447db 100644 --- a/mdl/lib.urp +++ b/mdl/lib.urp @@ -1,8 +1,10 @@ benignEffectful MdlFfi.showSnackbar +benignEffectful MdlFfi.upgradeAllRegistered ffi mdlFfi file /zoBIS4V6.js mdlFfi.js html5 jsFunc MdlFfi.showSnackbar=UrWeb.MdlFfi.showSnackbar +jsFunc MdlFfi.upgradeAllRegistered=componentHandler.upgradeAllRegistered library mdlClasses script /zoBIS4V6.js @@ -15,15 +15,22 @@ specific language governing permissions and limitations under the License. *) structure Classes = MdlClasses open Classes +val upgradeAllRegistered = MdlFfi.upgradeAllRegistered + structure Textbox = struct - fun make (placeholder : string) : transaction xbody = + fun make (placeholder : string) : transaction {Source : source string, + Xml : xbody} = + contents <- source ""; id <- fresh; - return <xml> - <div class="mdl-textfield mdl-js-textfield"> - <ctextbox class="mdl-textfield__input" id={id} /> - <label class="mdl-textfield__label" for={id}>{[placeholder]}</label> - </div> - </xml> + return { + Source = contents, + Xml = <xml> + <div class="mdl-textfield mdl-js-textfield"> + <ctextbox class="mdl-textfield__input" id={id} source={contents} /> + <label class="mdl-textfield__label" for={id}>{[placeholder]}</label> + </div> + </xml> + } end structure Toast = struct diff --git a/mdl/mdlFfi.urs b/mdl/mdlFfi.urs index 74dd636..6e8188a 100644 --- a/mdl/mdlFfi.urs +++ b/mdl/mdlFfi.urs @@ -12,4 +12,6 @@ under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) +val upgradeAllRegistered : transaction unit + val showSnackbar : string (* id *) -> string (* text *) -> transaction unit |