GithubHelp home page GithubHelp logo

jqmtemplate's Introduction

jqmTemplate

Provides a mechanism for creating jqModal dialogs using templates.

Written by Jason den Dulk.

Requires

jQuery (http://jquery.com/)
jqModal (http://jquery.iceburg.net/jqModal/)

Documentation

jqmtMakeButton(label,id,className)

Creates a button element and returns a jQuery object containing it. If id or className are defined they are added to the button as 'id' and 'class' attributes respectively.

jqmTemplate(htmlTemplate)

Constructs an instance of the jqmTemplate class containing the template HTML.

jqmTemplate.dialog(dlgId, parms)

Creates a jqModal dialog using the template. dlgId is the ID attribute. parms are parameters passed to jqm().

The dialog is added to the DOM and any existing element of the same ID is removed.

jqmTemplate.messageBox(title, text, icon, buttons)

Create and show a message dialog. Title, text and icon are added if provided. Buttons are added if provided. Otherwise a a single "OK" button is added.

jqmTemplate.inputBox(title, text, widget, callback, validate = null)

Creates and shows a dialog for receiving a single value of input. Title and text are added if provided. The widget is displayed and the user can input the value.

Two buttons, OK and Cancel, are added.

If the callback validate is provided, it will be called upon if OK is pressed. validate of the format function(value). If validate returns a non empty string it will be displayed in a message and the dialog will remain open. If validate returns false, the validation is considered passed and the dialog will succeed.

Upon closing, callback will be called. (format function(success, value)). success is true if OK was pressed, false is Cancel was pressed. value is the value of the widget.

License

Copyright (C) 2016-17 Jaypha.
Distributed under the Boost Software License, Version 1.0.
See http://www.boost.org/LICENSE_1_0.txt

jqmtemplate's People

Contributors

jaypha avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.