Giter Site home page Giter Site logo

tom-siegel / jswindow Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 523 KB

Draggable and sizeable window javascript library and css

License: MIT License

JavaScript 86.68% CSS 6.72% HTML 6.60%
javasript css tosihyper tosi window windows jswindow js draggable sizeable

jswindow's Introduction

jsWindow

Draggable and sizeable window javascript library and css

This library contributes dynamic creation of fully customizeable and event based windows.

  • no predefined HTML needed
  • custom themes for windows
  • custom settings for windows
  • free draggable and resizeable (can be disabled)
  • window/task bar integrated
  • tooltips integrated
  • minimize, maximize and close windows (reuseable)
  • event based
  • class based
  • typed properties

window

window image

var wnd = new jsWindow();
	
wnd.title = "my Window"
wnd.container.setPosition(250, 50);
wnd.container.setSize(400, 150);
		
wnd.content = '<label>A dynamically created window.</label>';
		
wnd.show();

messagebox

messagebox image

jsMessager.alert("A dynamically created messagebox.", "messagebox");

confirm

confirm image

jsMessager.confirm("A dynamically created confirm. Press {Yes} to execute callback.", "confirm", function() {
	jsMessager.alert("callback executed!", "confirmed");
});

Examples

Login - window via jsMessager

login window image

var wnd_login = new jsMessager();
			
wnd_login.title = "login";
wnd_login.addButton("login", "login", false);
wnd_login.addButton("cancel", "cancel", true);
wnd_login.textContainer.innerHTML = '<div style="display: block; padding: 10px;"><p style="margin-bottom: 0;">Username</p><input class="form-control" id="inp_user" /><p style="margin-bottom: 0;">Password</p><input class="form-control" type="password" id="inp_password" /></div>'
		
		
wnd_login.addEventListener("js.return", function(ev) {
	var value = ev.parameter;

	if (value === "login") {
		var user = wnd_login.body.container.querySelector("#inp_user").value;
		var password = wnd_login.body.container.querySelector("#inp_password").value;
			
		jsMessager.alert('user: ' + user + " | password: " + password);
			
		if (user === "user1234" && password === "jsWindow") { wnd_login.close(); } else {
			jsMessager.alert("credentials are incorrect!");
		}
	} else { wnd_login.close(); }
});
		
wnd_login.show();

jswindow's People

Contributors

tom-siegel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.