first cut at a message filter edito

git-svn-id: svn://10.0.0.236/trunk@32185 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alecf%netscape.com
1999-05-19 00:21:55 +00:00
parent 31183b200b
commit a0fd39c794
2 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
function updateRule(boxnode) {
var ruleid=boxnode.getAttribute("id");
var selectNode = document.getElementById(ruleid + "-attribute");
if (!selectNode) return;
var option = selectNode.options[selectNode.selectedIndex];
if (!option) return;
if (!option.value) return;
var destBox = document.getElementById(ruleid + "-verb");
var destParent = destBox.parentNode;
dump("Looking for " + option.value + "-template\n");
var verbTemplate = document.getElementById(option.value + "-template");
var newVerb = verbTemplate.cloneNode(true);
dump("I will dump " + option.value + " into " + destParent.nodeName + "\n");
destParent.replaceChild(newVerb, destBox);
}
function updateFilterObject(node) {
selectbox=document.getElementById("rule1");
updateRule(selectbox);
}

View File

@@ -0,0 +1,102 @@
<?xml version="1.0"?>
<?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<!DOCTYPE window>
<window
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script language="JavaScript" src="FilterEditor.js"/>
<!--
<box id="subject-template" align="horizontal" style="display: none;">
<html:select name="criteria">
<html:option>contains</html:option>
<html:option>doesn't contain</html:option>
</html:select>
</box>
<box id="sender-template" align="horizontal" style="display: none;">
<html:select name="criteria">
<html:option>contains</html:option>
<html:option>doesn't contain</html:option>
</html:select>
</box>
<box id="date-template" align="horizontal" style="display: none;">
<html:select name="criteria">
<html:option>contains</html:option>
<html:option>doesn't contain</html:option>
</html:select>
</box>
-->
<box align="vertical" style="width: 100%;" flex="100%">
<box align="horizontal" class="padded">
<html:div>Filter Name:</html:div>
<html:input type="text" flex="100%"/>
</box>
<box align="vertical" class="cleanborder" flex="100%">
<html:div>
<html:input type="radio" name="andor" value="and"/>
Match all of the following
</html:div>
<html:div>
<html:input type="radio" name="andor" value="or"/>
Match any of the following
</html:div>
<spring class="spacer"/>
<box id="rulebox" alignment="vertical" flex="100%">
<box id="rule1" alignment="horizontal" flex="100%">
<html:select id="rule1-attribute"
onchange="updateRule(this.parentNode);">
<html:option value="subject">subject</html:option>
<html:option value="sender">sender</html:option>
<html:option value="date">date</html:option>
<html:option value="any">any text</html:option>
<html:option value="keyword">keyword</html:option>
<html:option value="age">age in days</html:option>
</html:select>
<box align="horizontal" id="rule1-verb">
<spring name="preverb" class="spacer"/>
<html:select>
<html:option>contains</html:option>
<html:option>doesn't contain</html:option>
</html:select>
<spring class="spacer"/>
<html:input type="text" flex="100%"/>
</box>
</box>
</box>
<spring class="spacer"/>
<box alignment="horizontal">
<titledbutton class="push" value="More"/>
<titledbutton class="push" value="Less"/>
</box>
</box>
<html:div>Filter Action:</html:div>
<box alignment="horizontal" class="cleanborder">
<html:select>
<html:option>Move to folder</html:option>
<html:option>Change Priority</html:option>
<html:option>Delete</html:option>
<html:option>Mark read</html:option>
<html:option>Ignore thread</html:option>
<html:option>Watch thread</html:option>
</html:select>
<spring class="spacer"/>
<html:select flex="100%">
<html:option>Server1</html:option>
<html:option> Folder 1</html:option>
</html:select>
<spring class="spacer"/>
<titledbutton class="push" value="New Folder..."/>
</box>
<box alignment="vertical" class="cleanborder">
<html:div>Description:</html:div>
<html:textarea flex="100%"/>
</box>
</box>
</window>