Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1421 → Rev 1422

/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/dialog.css
0,0 → 1,2
@import url("chrome://communicator/skin/");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Confirm.js
0,0 → 1,18
// =====================================================================================================================
NoModal.Dialog_Alert = function()
{
NoModal.Dialog.call(this);
}
NoModal.Dialog_Alert.prototype = {
// -----------------------------------------------------------------------------------------------------------------
onLoad: function()
{
NoModal.Dialog.prototype.onLoad.call(this);
 
return true;
},
}
NoModal.inherit(NoModal.Dialog_Alert, NoModal.Dialog);
 
// == REGISTER =========================================================================================================
NoModal.DialogClass = NoModal.Dialog_Alert;
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Dialog.js
0,0 → 1,77
// =====================================================================================================================
NoModal.onDialogLoad = function()
{
var dialogController = new NoModal.DialogClass();
 
dialogController.paramsRaw = window.arguments[0];
dialogController.params = {};
NoModal_DialogParams.decode(dialogController.paramsRaw, dialogController.params);
 
if(!dialogController.onLoad()) {
window.close();
}
 
window.addEventListener('dialogaccept', function(aEvent)
{
if(!dialogController.onDialogAccept()) {
aEvent.preventDefault();
aEvent.stopPropagation();
}
return true;
 
}, false);
window.addEventListener('dialogcancel', function(aEvent)
{
if(!dialogController.onDialogCancel()) {
aEvent.preventDefault();
aEvent.stopPropagation();
}
 
return true;
}, false);
}
 
// =====================================================================================================================
NoModal.Dialog = function()
{
}
NoModal.Dialog.prototype = {
// -----------------------------------------------------------------------------------------------------------------
onLoad: function()
{
// title
var dialogs = document.getElementsByTagName("dialog");
if(dialogs && dialogs.length > 0) {
dialogs[0].setAttribute('title', this.params.title);
}
 
// text
document.getElementById("text").value = this.params.text;
 
return true;
},
 
// -----------------------------------------------------------------------------------------------------------------
onDialogAccept: function()
{
this.setDialogResult(true);
return true;
},
 
// -----------------------------------------------------------------------------------------------------------------
onDialogCancel: function()
{
this.setDialogResult(false);
return true;
},
 
// -----------------------------------------------------------------------------------------------------------------
setDialogResult: function(result)
{
this.params.result = result;
NoModal_DialogParams.encode(this.params, this.paramsRaw);
},
}
 
// == BOOTSTRAP ========================================================================================================
window.addEventListener('load', NoModal.onDialogLoad, false);
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/browser.xul
0,0 → 1,13
<?xml version="1.0"?>
 
<overlay id="movelayer"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
<script type="application/x-javascript" src="chrome://nomodal/content/browser.js" />
 
<menupopup id="menu_EditPopup">
<menuseparator/>
<menuitem id="context-nomodal" label="NoModal" oncommand="NoModal.onCommand(this)" />
</menupopup>
 
</overlay>
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Alert.xul
0,0 → 1,16
<?xml version="1.0"?>
 
<?xml-stylesheet href="chrome://nomodal/content/dialog.css" type="text/css"?>
 
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Alert"
buttons="accept"
>
 
<script type="application/x-javascript" src="chrome://nomodal/content/Common.js" />
<script type="application/x-javascript" src="chrome://nomodal/content/Dialog.js" />
<script type="application/x-javascript" src="chrome://nomodal/content/Alert.js" />
 
<label id="text" />
</dialog>
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/browser.js
0,0 → 1,16
// =====================================================================================================================
var NoModal = {
// -----------------------------------------------------------------------------------------------------------------
init: function()
{
},
 
// -----------------------------------------------------------------------------------------------------------------
onCommand: function(menuitem)
{
alert("NoModal.onCommand");
},
};
 
// == BOOTSTRAP ========================================================================================================
window.addEventListener('load', NoModal.init, false);
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Alert.js
0,0 → 1,18
// =====================================================================================================================
NoModal.Dialog_Alert = function()
{
NoModal.Dialog.call(this);
}
NoModal.Dialog_Alert.prototype = {
// -----------------------------------------------------------------------------------------------------------------
onLoad: function()
{
NoModal.Dialog.prototype.onLoad.call(this);
 
return true;
},
}
NoModal.inherit(NoModal.Dialog_Alert, NoModal.Dialog);
 
// == REGISTER =========================================================================================================
NoModal.DialogClass = NoModal.Dialog_Alert;
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Common.js
0,0 → 1,17
// =====================================================================================================================
var NoModal = {
// -----------------------------------------------------------------------------------------------------------------
inherit: function(child, supertype)
{
child.prototype.__proto__ = supertype.prototype;
},
 
// -----------------------------------------------------------------------------------------------------------------
startup: function()
{
Components.utils.import("resource://nomodal_modules/DialogParams.jsm");
},
}
 
// == BOOTSTRAP ========================================================================================================
NoModal.startup();
/mozilla/nomodal/branch/001_own_dialogs/src/chrome/content/Confirm.xul
0,0 → 1,16
<?xml version="1.0"?>
 
<?xml-stylesheet href="chrome://nomodal/content/dialog.css" type="text/css"?>
 
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Confirm"
buttons="accept,cancel"
>
 
<script type="application/x-javascript" src="chrome://nomodal/content/Common.js" />
<script type="application/x-javascript" src="chrome://nomodal/content/Dialog.js" />
<script type="application/x-javascript" src="chrome://nomodal/content/Confirm.js" />
 
<label id="text" />
</dialog>