JavaScript DHTML/SmartClient/Dialog
Содержание
Ask for value dialog
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Calendar.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.Button.create({
title: "Confirm", click : function () { isc.confirm("Proceed with Operation get AJAX?", "answer.setContents(value ? "OK" : "Cancel")"); }
}); isc.Button.create({
title: "Ask", left: 150, click : function () { isc.ask("Are you going to stop writing great code?", "answer.setContents(value ? "Yes" : "No")"); }
}); isc.Button.create({
title: "Ask For Value", left: 300, click : function () { isc.askForValue("What is your name?", "answer.setContents("Your name is " + value)"); }
}); isc.Label.create({
ID: "answer", contents: "Your answer here...", top: 50, width: 300
}); </SCRIPT> </BODY> </HTML>
</source>
Ask for Yes/No dialog
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Calendar.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.Button.create({
title: "Confirm", click : function () { isc.confirm("Proceed with Operation get AJAX?", "answer.setContents(value ? "OK" : "Cancel")"); }
}); isc.Button.create({
title: "Ask", left: 150, click : function () { isc.ask("Are you going to stop writing great code?", "answer.setContents(value ? "Yes" : "No")"); }
}); isc.Button.create({
title: "Ask For Value", left: 300, click : function () { isc.askForValue("What is your name?", "answer.setContents("Your name is " + value)"); }
}); isc.Label.create({
ID: "answer", contents: "Your answer here...", top: 50, width: 300
}); </SCRIPT> </BODY> </HTML>
</source>
Confirmation dialog
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Calendar.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.Button.create({
title: "Confirm", click : function () { isc.confirm("Proceed with Operation get AJAX?", "answer.setContents(value ? "OK" : "Cancel")"); }
}); isc.Button.create({
title: "Ask", left: 150, click : function () { isc.ask("Are you going to stop writing great code?", "answer.setContents(value ? "Yes" : "No")"); }
}); isc.Button.create({
title: "Ask For Value", left: 300, click : function () { isc.askForValue("What is your name?", "answer.setContents("Your name is " + value)"); }
}); isc.Label.create({
ID: "answer", contents: "Your answer here...", top: 50, width: 300
}); </SCRIPT> </BODY> </HTML>
</source>
Prompt message dialog after dropping
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.Img.create({
ID:"bluePiece", left:50, top:50, width:48, height:48, src:"http://www.wbex.ru/style/logo.png", canDrag: true, canDrop: true, dragAppearance: "tracker", setDragTracker: "isc.Event.setDragTracker("Blue Piece")"
}) isc.Img.create({
ID:"greenPiece", left:150, top:50, width:48, height:48, src:"http://www.wbex.ru/style/logo.png", canDrag: true, canDrop: true, dragAppearance: "tracker", setDragTracker: "isc.Event.setDragTracker(isc.Canvas.imgHTML("http://www.wbex.ru/style/logo.png",24,24))"
}) isc.Label.create({
left:250, top:50, showEdges:true, contents: "Drop Here", align:"center", canAcceptDrop: true, dropOver: "this.setBackgroundColor("#ffff80")", dropOut: "this.setBackgroundColor("#ffffff")", drop: "isc.say("You dropped the "+isc.Event.getDragTarget().getID())"
}) </SCRIPT> </BODY> </HTML>
</source>
Show login Dialog
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.Button.create({
title: "Login", click : function () { isc.showLoginDialog(function (credentials, dialogCallback) { // In a real application, we would obviously contact the server here to validate // the user"s credentials. For this demo, there is only one valid user/password // and it is hard-coded here if (credentials.username == "barney" && credentials.password == "rubble") { var loginOK = true; } else { loginOK = false; } dialogCallback(loginOK); }); }
});
</SCRIPT> </BODY> </HTML>
</source>
Show smartclient dialog after clicking the Button
<source lang="html4strict">
<HTML><HEAD>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT> <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD><BODY BGCOLOR="silver"> <SCRIPT> isc.IButton.create({
title: "Hello", icon: "http://www.wbex.ru/style/logo.png", iconOrientation: "right", click: "isc.say("Hello world!")"
})
</SCRIPT> </BODY> </HTML>
</source>