Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Initial Git release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Doan committed Jan 11, 2014
1 parent 37b6fe7 commit f9ab1dd
Show file tree
Hide file tree
Showing 34 changed files with 2,926 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Autofill/chrome.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
content autofill chrome/content/
skin autofill classic/1.0 chrome/skin/
skin autofill classic/1.0 chrome/skin-linux/ os=Linux
locale autofill en-US chrome/locale/en-US/
locale autofill vi-VN chrome/locale/vi-VN/
overlay chrome://browser/content/browser.xul chrome://autofill/content/ff-overlay.xul
21 changes: 21 additions & 0 deletions Autofill/chrome/content/catdelete.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://autofill/skin/options.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://autofill/locale/translations.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&catdelete.title;"
buttons="accept,cancel"
ondialogaccept="return onAccept()">
<description width="310">&catdelete.desc;</description>
<checkbox id="content-confirm" label="&catdelete.confirm.label;" accesskey="&other.confirm.accesskey;" noinitialfocus="true" />
<script type="application/x-javascript">
//<![CDATA[
// Called once if and only if the user clicks OK
function onAccept() {
window.arguments[0].o = {
confirm: document.getElementById('content-confirm').checked
};
return true;
}
//]]>
</script>
</dialog>
55 changes: 55 additions & 0 deletions Autofill/chrome/content/catnew.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://autofill/skin/options.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://autofill/locale/translations.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&catnew.title;"
buttons="accept,cancel"
ondialogaccept="return onAccept()"
onload="init()">
<notificationbox id="status"></notificationbox>
<description>&catnew.desc;</description>
<textbox id="content-input" size="45" maxlength="30" />
<script type="application/x-javascript">
//<![CDATA[
var D = document,
oA = window.arguments[0],
oNB,
oTB;
// Initiate
function init() {
oNB = D.getElementById('status');
oTB = D.getElementById('content-input');
oNB.addEventListener('AlertActive', alertHandler, false);
}
// Handle notification alert
function alertHandler() {
clearInterval(oNB.t);
oNB.t = setInterval(function() {
if (!oNB.currentNotification) {
window.resizeBy(0, -24);
clearInterval(oNB.t);
}
}, 100);
}
// Called once if and only if the user clicks OK
function onAccept() {
var s = oTB.value.replace(/^\s+|\s+$/g, '');
if (s.toLowerCase()=='all' || s.toLowerCase()=='unfiled') return showError('"' + s + '" ' + oA.i.catReserved);
for (var i=0, imax=oA.i.cats.length; i<imax; i++) {
if (s.toLowerCase()==oA.i.cats[i].n.toLowerCase()) return showError('"' + s + '" ' + oA.i.catExists);
}
oA.o = {
value: s
};
return true;
}
// Show error notification
function showError(sMsg) {
if (oNB.currentNotification) oNB.removeAllNotifications();
else window.resizeBy(0, 24);
oNB.appendNotification(sMsg, '', '', oNB.PRIORITY_WARNING_LOW);
return false;
}
//]]>
</script>
</dialog>
59 changes: 59 additions & 0 deletions Autofill/chrome/content/catrename.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://autofill/skin/options.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://autofill/locale/translations.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&catrename.title;"
buttons="accept,cancel"
ondialogaccept="return onAccept()"
onload="init()">
<notificationbox id="status"></notificationbox>
<description>&catrename.desc;</description>
<textbox id="content-input" size="45" maxlength="30" />
<script type="application/x-javascript">
//<![CDATA[
var D = document,
oA = window.arguments[0],
oNB,
oTB;
// Initiate
function init() {
oNB = D.getElementById('status');
oTB = D.getElementById('content-input');
// Populate textbox with value passed from caller
oTB.value = oA.i.text;
oNB.addEventListener('AlertActive', alertHandler, false);
}
// Handle notification alert
function alertHandler() {
clearInterval(oNB.t);
oNB.t = setInterval(function() {
if (!oNB.currentNotification) {
window.resizeBy(0, -24);
clearInterval(oNB.t);
}
}, 100);
}
// Called once if and only if the user clicks OK
function onAccept() {
var s = oTB.value.replace(/^\s+|\s+$/g, '');
if (!s) return true;
if (s.toLowerCase()=='all' || s.toLowerCase()=='unfiled') return showError('"' + s + '" ' + oA.i.catReserved);
for (var i=0, imax=oA.i.cats.length; i<imax; i++) {
if (i!=oA.i.catnow-2 && s.toLowerCase()==oA.i.cats[i].n.toLowerCase()) return showError('"' + s + '" ' + oA.i.catExists);
}
oA.i.cats[oA.i.catnow-2].n = s;
oA.o = {
cats: oA.i.cats
};
return true;
}
// Show error notification
function showError(sMsg) {
if (oNB.currentNotification) oNB.removeAllNotifications();
else window.resizeBy(0, 24);
oNB.appendNotification(sMsg, '', '', oNB.PRIORITY_WARNING_LOW);
return false;
}
//]]>
</script>
</dialog>
33 changes: 33 additions & 0 deletions Autofill/chrome/content/confirm.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://autofill/skin/options.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://autofill/locale/translations.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="confirmation"
title="&confirm.title;"
buttons="accept,cancel"
buttonlabelaccept=""
ondialogaccept="return onAccept()"
onload="init()">
<description id="content-desc"></description>
<stringbundleset>
<stringbundle id="string-bundle" src="chrome://autofill/locale/translations.properties" />
</stringbundleset>
<script type="application/x-javascript">
//<![CDATA[
var oA = window.arguments[0];
// Initiate
function init() {
var D = document,
oWin = D.getElementById('confirmation'),
oD = D.getElementById('content-desc'),
oSB = D.getElementById('string-bundle');
oD.textContent = oSB.getString(oA.i.desc);
oWin.getButton('accept').setAttribute('label', oSB.getString(oA.i.type));
}
function onAccept() {
oA.o = true;
return true;
}
//]]>
</script>
</dialog>
39 changes: 39 additions & 0 deletions Autofill/chrome/content/editbox.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://autofill/skin/options.css" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://autofill/locale/translations.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&editbox.title;"
width="320"
height="240"
buttons="accept,cancel"
ondialogaccept="return onAccept()"
onload="init()">
<textbox id="content-editbox" multiline="true" flex="1" />
<script type="application/x-javascript">
//<![CDATA[
var oA = window.arguments[0],
oTB;
// Initiate
function init() {
oTB = document.getElementById('content-editbox');
// Populate textbox with value passed from caller
oTB.value = oA.i.value;
}
// Called once if and only if the user clicks OK
function onAccept() {
oA.o = {
value: oTB.value
};
if (oA.i.id.indexOf('v_')>-1) {
// Escape literal \n in Value to Autofill
oA.o.value = oA.o.value.replace(/\\n/g, '\\\n');
// Replace newlines with \n in Value to Autofill
oA.o.value = oA.o.value.replace(/\n/g, '\\n');
}
// Replace newlines with pipes in Site Filter
if (oA.i.id.indexOf('s_')>-1) oA.o.value = oA.o.value.replace(/^\s+|\s+$/g, '').replace(/\n+/g, '|');
return true;
}
//]]>
</script>
</dialog>
Loading

0 comments on commit f9ab1dd

Please sign in to comment.