|
/
Zope
/
gocept svn checkins
/
Archive
/
2009
/
2009-02
/
SVN: r29239 - gocept.webmail-buildout/trunk/profiles gocept.webmail/trunk gocept.webmail/trunk/gocept/webmail/browser/tests
[
SVN: r29203 - in gocept.infrastructure/feature_vm_... ]
[
SVN: r29254 - in ATCountryWidget/trunk: . ... ]
SVN: r29239 - gocept.webmail-buildout/trunk/profiles gocept.webmail/trunk gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-19 08:34:12 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 19 08:34:10 2009
New Revision: 29239
Log:
added example selenium test. Closes #4601.
Added:
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml
Modified:
gocept.webmail-buildout/trunk/profiles/dev.cfg
gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
gocept.webmail/trunk/setup.py
Modified: gocept.webmail-buildout/trunk/profiles/dev.cfg
==============================================================================
--- gocept.webmail-buildout/trunk/profiles/dev.cfg (original)
+++ gocept.webmail-buildout/trunk/profiles/dev.cfg Thu Feb 19 08:34:10 2009
(at)(at) -9,6 +9,8 (at)(at)
zopepy
dovecot
test
+ instance-selenium
+ selenium
# Add additional egg download sources here.
find-links =
(at)(at) -22,6 +24,7 (at)(at)
${packages:names}
lxml
zc.testbrowser
+ zc.selenium
versions = versions
(at)(at) -29,6 +32,7 (at)(at)
lovely.recipe = 0.3.1b5
lxml = 2.1.2
zc.testbrowser = 1.0.0a5dev-r91664
+zc.selenium = 1.3.0dev-r96720
[packages]
names =
(at)(at) -68,7 +72,6 (at)(at)
zcml =
gocept.restmail
gocept.webmail
-
products = ${productdistros:location}
[zopepy]
(at)(at) -141,3 +144,25 (at)(at)
packages = ${packages:names}
extra-paths = .
zope2part = instance
+
+[instance-selenium]
+recipe = plone.recipe.zope2instance
+# DemoStorage is the only difference to [instance]
+demo-storage = on
+zope2-location = ${zope2:location}
+user = ${instance:user}
+debug-mode = on
+verbose-security = on
+eggs = ${buildout:eggs}
+zcml = ${instance:zcml}
+products = ${productdistros:location}
+
+[selenium]
+recipe = zc.recipe.egg:scripts
+eggs = ${instance:eggs}
+extra-paths = ${zope2:location}/lib/python
+ ${zope2:location}/lib/python/AccessControl
+scripts = selenium
+entry-points = selenium=zc.selenium.selenium:main
+initialization =
+ sys.argv[1:1] = ['${instance-selenium:location}/etc/zope.conf', '-r',
'-z', 'zope2']
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml Thu Feb 19
08:34:10 2009
(at)(at) -20,4 +20,6 (at)(at)
permission="zope2.View"
/>
+ <include file="selenium.zcml" />
+
</configure>
Added: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- (empty file)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Thu Feb 19
08:34:10 2009
(at)(at) -0,0 +1,31 (at)(at)
+# Copyright (c) 2009 gocept gmbh & co. kg
+# See also LICENSE.txt
+
+import subprocess
+import sys
+import webbrowser
+import xml.sax.saxutils
+import zc.selenium.pytest
+
+
+if sys.platform == 'darwin':
+ # Register a Firefox browser for Mac OS X.
+ class MacOSXFirefox(webbrowser.BaseBrowser):
+ def open(self, url, new=0, autoraise=1):
+ proc = subprocess.Popen(
+ ['/usr/bin/open', '-a', 'Firefox', url])
+ proc.communicate()
+ webbrowser.register('Firefox', MacOSXFirefox, None, -1)
+
+
+class SimpleTest(zc.selenium.pytest.Test):
+ """pacify zope2."""
+
+ def test_webmailer_loads(self):
+ s = self.selenium
+
+ s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
+
+ s.open('/cmf/webmail/admin')
+ s.waitForElementPresent('id=ygtvlabelel1')
+ s.verifyText('id=ygtvlabelel1', 'Drafts')
Added: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml
==============================================================================
--- (empty file)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml Thu Feb 19
08:34:10 2009
(at)(at) -0,0 +1,14 (at)(at)
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml">
+
+ <include package="zc.selenium" />
+
+ <adapter
+ name="gocept.webmail.browser.tests.SimpleTest"
+ factory=".selenium.SimpleTest"
+ provides="zc.selenium.pytest.ISeleniumTest"
+ permission="zope2.View"
+ />
+</configure>
\ No newline at end of file
Modified: gocept.webmail/trunk/setup.py
==============================================================================
--- gocept.webmail/trunk/setup.py (original)
+++ gocept.webmail/trunk/setup.py Thu Feb 19 08:34:10 2009
(at)(at) -19,5 +19,6 (at)(at)
'gocept.restmail',
'setuptools',
'zc.testbrowser>1.0.0a4',
+ 'zc.selenium',
],
)
|
SVN: r29240 - gocept.webmail/trunk/gocept/webmail/browser/tests
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-19 09:54:36 |
[ FULL ]
|
Author: sweh
Date: Thu Feb 19 09:54:34 2009
New Revision: 29240
Log:
- Remove force to load Firefox as testbrowser
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Thu Feb 19
09:54:34 2009
(at)(at) -1,23 +1,9 (at)(at)
# Copyright (c) 2009 gocept gmbh & co. kg
# See also LICENSE.txt
-import subprocess
-import sys
-import webbrowser
-import xml.sax.saxutils
import zc.selenium.pytest
-if sys.platform == 'darwin':
- # Register a Firefox browser for Mac OS X.
- class MacOSXFirefox(webbrowser.BaseBrowser):
- def open(self, url, new=0, autoraise=1):
- proc = subprocess.Popen(
- ['/usr/bin/open', '-a', 'Firefox', url])
- proc.communicate()
- webbrowser.register('Firefox', MacOSXFirefox, None, -1)
-
-
class SimpleTest(zc.selenium.pytest.Test):
"""pacify zope2."""
|
SVN: r29242 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-19 11:53:23 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 19 11:53:21 2009
New Revision: 29242
Log:
Re #4701: automatically register all views named
"gocept.webmail.browser.tests.yui.*" to be included in the YUI test suite.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml
gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml Thu Feb 19
11:53:21 2009
(at)(at) -3,13 +3,13 (at)(at)
<browser:pages
permission="zope2.View"
- class="gocept.webmail.browser.webmailer.Module"
+ class="gocept.webmail.browser.tests.yui.YUITestSuite"
for="*">
<browser:page name="gocept.webmail.browser.tests.yui.index"
template="index.pt"/>
- <browser:page name="dummy.html"
+ <browser:page name="gocept.webmail.browser.tests.yui.dummy"
template="dummy.pt"/>
- <browser:page name="connection.html"
+ <browser:page name="gocept.webmail.browser.tests.yui.connection"
template="connection.pt"/>
</browser:pages>
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt Thu Feb 19
11:53:21 2009
(at)(at) -14,11 +14,9 (at)(at)
<script type="text/javascript" tal:attributes="src
string:${yui_base_url}/json/json.js"></script>
<script type="text/javascript" tal:attributes="src
string:${yui_base_url}/yuitest/yuitest.js"></script>
- <style>
- #out {
- }
- </style>
-
+ <script type="text/javascript" tal:content="string:
+ var PAGES = ${view/pages};
+ "></script>
</head>
<body class="yui-skin-sam">
<h1>YUI Library Master Test Page</h1>
(at)(at) -35,10 +33,7 (at)(at)
var TM = YAHOO.tool.TestManager;
YAHOO.util.Event.onDOMReady(function (){
- YAHOO.tool.TestManager.setPages([
- 'connection.html',
- 'dummy.html',
- ]);
+ YAHOO.tool.TestManager.setPages(PAGES);
TM.subscribe(TM.TEST_MANAGER_COMPLETE_EVENT, function(o) {
var div = document.createElement('div');
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Thu Feb 19
11:53:21 2009
(at)(at) -15,3 +15,18 (at)(at)
s.open('/cmf/webmail/admin')
s.waitForElementPresent('id=ygtvlabelel1')
s.verifyText('id=ygtvlabelel1', 'Drafts')
+
+
+class YUITestRunner(zc.selenium.pytest.Test):
+ """YUITestRunner."""
+
+ def test_webmailer_loads(self):
+ s = self.selenium
+ s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
+
+
s.open('/cmf/webmail/admin/(at)(at)gocept.webmail.browser.tests.yui.index')
+ s.waitForElementPresent('id=log-output')
+ s.comment('At least one test should be run')
+ s.verifyNotText('id=tests-passed', '0')
+ s.comment('No tests should fail')
+ s.verifyNotText('id=tests-failed', '0')
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml Thu Feb 19
11:53:21 2009
(at)(at) -13,8 +13,8 (at)(at)
/>
<adapter
- name="gocept.webmail.browser.tests.yui.YUITestRunner"
- factory=".yui.YUITestRunner"
+ name="gocept.webmail.browser.tests.selenium.YUITestRunner"
+ factory=".selenium.YUITestRunner"
provides="zc.selenium.pytest.ISeleniumTest"
permission="zope2.View"
/>
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py Thu Feb 19
11:53:21 2009
(at)(at) -1,19 +1,24 (at)(at)
# Copyright (c) 2009 gocept gmbh & co. kg
# See also LICENSE.txt
+import gocept.webmail.browser.webmailer
import zc.selenium.pytest
+import zope.component
+import zope.interface
-class YUITestRunner(zc.selenium.pytest.Test):
- """YUITestRunner."""
+class YUITestSuite(gocept.webmail.browser.webmailer.Module):
+ """YUITestSuite"""
- def test_webmailer_loads(self):
- s = self.selenium
- s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
-
-
s.open('/cmf/webmail/admin/(at)(at)gocept.webmail.browser.tests.yui.index')
- s.waitForElementPresent('id=log-output')
- s.comment('At least one test should be run')
- s.verifyNotText('id=tests-passed', '0')
- s.comment('No tests should fail')
- s.verifyNotText('id=tests-failed', '0')
+ def pages(self):
+ result = []
+ # XXX: can't use zope.component.getAdapters() because some stuff
+ # registered as adapters is not callable, see e. g.
+ # <https://bugs.launchpad.net/zope3/+bug/260379>
+ for name, factory in
zope.component.getSiteManager().adapters.lookupAll(
+ map(zope.interface.providedBy, (self.context, self.request)),
+ zope.interface.Interface):
+ if name.startswith(__name__) and not name.endswith('.index'):
+ result.append(name)
+ # XXX: might want to use cjson here
+ return repr(['(at)(at)%s' % name.encode('us-ascii') for name in
result])
|
SVN: r29245 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-19 15:24:43 |
[ FULL ]
|
Author: sweh
Date: Thu Feb 19 15:24:40 2009
New Revision: 29245
Log:
- New management UI.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 19 15:24:40 2009
(at)(at) -24,40 +24,46 (at)(at)
// Initialize DOM nodes first, as the business models
// rely on them.
app.domNodes.menu = app.layout.getUnitByPosition('top').body;
- app.domNodes.identity_edit_form =
app.layout.getUnitByPosition('bottom').body;
- app.domNodes.identity_list =
app.layout.getUnitByPosition('center').body;
+ app.layout.getUnitByPosition('bottom').body.innerHTML =
'<table><tr><td id="accountEditForm"></td><td
id="identityEditForm></td></tr></table>';
+ app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
+ app.domNodes.identity_add_form =
document.getElementById('identityEditForm');
+ app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
app.menu = new YAHOO.gocept.webmailer.ManagementMenu();
- app.identity_list = new YAHOO.gocept.webmailer.IdentityList();
+ app.account_list = new YAHOO.gocept.webmailer.AccountList();
});
app.layout.render();
},
- loadIdentityEditForm: function() {
- document.App.identity_edit_form = new
YAHOO.gocept.webmailer.IdentityEditForm();
+ loadAccountEditForm: function() {
+ document.App.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
},
- fillIdentityEditForm: function(identity) {
- form = document.App.identity_edit_form;
- form.getControl("identId").value = identity.ident_id;
- form.getControl("accountHost").value = identity.host;
- form.getControl("accountPort").value = identity.port;
- if (identity.ssl == true) {
+ fillAccountEditForm: function(account) {
+ form = document.App.account_edit_form;
+ form.getControl("accountHost").value = account.host;
+ form.getControl("accountPort").value = account.port;
+ if (account.ssl == true) {
form.getControl("accountSSL").checked = "checked";
}
- form.getControl("accountUsername").value = identity.user;
- form.getControl("accountPassword").value = identity.password;
- form.getControl("accountURL").value = identity.url;
- form.getControl("identityName").value = identity.name;
- form.getControl("identityAddress").value = identity.address;
- form.getControl("identitySentfolder").value =
identity.sent_folder;
- form.getControl("identitySMTPServer").value =
identity.smtp_server;
+ form.getControl("accountUsername").value = account.user;
+ form.getControl("accountPassword").value = account.password;
+ form.getControl("accountURL").value = account.url;
+ default_form = form.getControl("defaultIdentity");
+ for (i = 0; i < default_form.length; ++i)
+ if (default_form.options[i].value == account.ident_id)
+ default_form.options[i].selected = "selecyed";
+ },
+
+ loadIdentityAddForm: function() {
+ document.App.identity_add_form = new
YAHOO.gocept.webmailer.IdentityAddForm();
},
reset: function() {
- document.App.domNodes.identity_edit_form.innerHTML = "";
+ document.App.domNodes.account_edit_form.innerHTML = "";
+ document.App.domNodes.identity_add_form.innerHTML = "";
document.App.menu.delete_button.cfg.setProperty('disabled', true);
- document.App.selected_identity = null;
+ document.App.selected_account = null;
}
});
(at)(at) -70,11 +76,11 (at)(at)
var menu = this;
menu.menubar = new YAHOO.widget.MenuBar("top");
menu.menubar.render(document.App.domNodes.menu);
- menu.addMenuItem('New', document.App.loadIdentityEditForm);
+ menu.addMenuItem('New', document.App.loadAccountEditForm);
menu.delete_button = menu.addMenuItem('Delete', function() {
- var url = document.App.selected_identity.url +
'/(at)(at)delete';
+ var url = document.App.selected_account.url +
'/(at)(at)delete';
document.Connection.post(url, null, function(result) {
- document.App.identity_list = new
YAHOO.gocept.webmailer.IdentityList();
+ document.App.account_list = new
YAHOO.gocept.webmailer.AccountList();
// reload the tree in the main window
var parent = window.opener;
(at)(at) -99,24 +105,24 (at)(at)
Def(function() {
- YAHOO.gocept.webmailer.IdentityList = Class({
+ YAHOO.gocept.webmailer.AccountList = Class({
constructor: function() {
- var identity_list = this;
- identity_list.load();
+ var account_list = this;
+ account_list.load();
document.App.reset();
},
load: function() {
- var identity_list = this;
+ var account_list = this;
var columns = [
{key:"status", label:"Status", sortable:true},
- {key:"name", label:"Name", sortable:true},
- {key:"address", label:"Address", sortable:true},
{key:"host", label:"Hostname", sortable:true},
{key:"port", label:"Port", sortable:true},
- {key:"user", label:"Username", sortable:true}];
+ {key:"user", label:"Username", sortable:true},
+ {key:"name", label:"Name", sortable:true},
+ {key:"address", label:"Address", sortable:true}];
var responseSchema = {resultsList: "",
- fields: [{ key: "status"},
+ fields: [{key: "status"},
{key: "url"},
{key: "host"},
{key: "port"},
(at)(at) -125,6 +131,7 (at)(at)
{key: "password"},
{key: "name"},
{key: "address"},
+ {key: "ident_id"},
{key: "sent_folder"},
{key: "smtp_server"},
{key: "fixed"}
(at)(at) -145,7 +152,7 (at)(at)
};
data_source.responseSchema.resultsList = 'result';
table = new YAHOO.widget.DataTable(
- document.App.domNodes.identity_list,
+ document.App.domNodes.account_list,
columns,
data_source,
{scrollable: true, height:"200px"});
(at)(at) -154,16 +161,18 (at)(at)
table.subscribe("rowSelectEvent", function(event) {
document.App.menu.delete_button.cfg.setProperty('disabled',
false);
- var identity = new Object();
+ var account = new Object();
var data = event.record.getData();
for (var key in data) {
- identity[key] = data[key];
+ account[key] = data[key];
}
if (!data['fixed']) {
- document.App.selected_identity = identity;
- document.App.loadIdentityEditForm();
-
document.App.fillIdentityEditForm(document.App.selected_identity);
+ document.App.selected_account = account;
+ document.App.loadAccountEditForm();
+
document.App.account_edit_form.onLoadFinished.subscribe(function () {
+
document.App.fillAccountEditForm(document.App.selected_account);
+ });
} else {
document.App.reset();
}
(at)(at) -172,7 +181,7 (at)(at)
document.App.reset();
});
table.render()
- identity_list.table = table;
+ account_list.table = table;
}
});
(at)(at) -183,14 +192,62 (at)(at)
// An HTML "template" for the edit form content.
// XXX: Internet Explorer doesn't know about raw strings
// find a way to better implement the HTML "template"
- var editform_html = "<div id=\"accountEditForm\"
class=\"floatLeft\"> <div class=\"accountHost\"> <label
for=\"accountHost\">Host:</label> <input type=\"text\"
name=\"accountHost\" id=\"accountHost\" /> </div> <div
class=\"accountPort\"> <label for=\"accountPort\">Port:</label>
<input type=\"text\" name=\"accountPort\" id=\"accountPort\" value=\"143\"
/> </div> <div class=\"accountSSL\"> <label
for=\"accountSSL\">Use SSL?</label> <input type=\"checkbox\"
name=\"accountSSL\" id=\"accountSSL\" /> </div> <div
class=\"accountUsername\"> <label
for=\"accountUsername\">Username:</label> <input type=\"text\"
name=\"accountUsername\" id=\"accountUsername\" /> </div> <div
class=\"accountPassword\"> <label
for=\"accountPassword\">Password:</label> <input type=\"password\"
name=\"accountPassword\" id=\"accountPassword\" /> </div> </div>
<div id=\"identityEditForm\"> <input type=\"hidden\" name=\"identId\"
id=\"identId\" value=\"\" /> <div class=\"identityName\"> <label
for=\"identi
tyName\">Name:</label> <input type=\"text\" name=\"identityName\"
id=\"identityName\" /> </div> <div class=\"identityAddress\">
<label for=\"identityAddress\">Email Address:</label> <input
type=\"text\" name=\"identityAddress\" id=\"identityAddress\" />
</div> <div class=\"identitySentfolder\"> <label
for=\"identitySentfolder\">Sentfolder:</label> <input type=\"text\"
name=\"identitySentfolder\" id=\"identitySentfolder\" /> </div>
<div class=\"identitySMTPServer\"> <label
for=\"identitySMTPServer\">SMTP Server:</label> <input
type=\"text\" name=\"identitySMTPServer\" id=\"identitySMTPServer\" />
</div> </div> <input type=\"hidden\" id=\"accountURL\"
name=\"accountURL\" /> <input type=\"button\" id=\"identitySave\"
name=\"identitySave\" value=\"Save\" />";
+ var account_editform_html =
+ "<input type=\"hidden\" id=\"accountURL\" name=\"accountURL\" />"
+
+ "<table cellpadding=\"5\">" +
+ "<tr>" +
+ "<td><label
for=\"accountHost\">Host:</label></td>" +
+ "<td><input type=\"text\" name=\"accountHost\"
id=\"accountHost\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label
for=\"accountPort\">Port:</label></td>" +
+ "<td><input type=\"text\" name=\"accountPort\"
id=\"accountPort\" value=\"143\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label for=\"accountSSL\">Use
SSL?</label></td>" +
+ "<td><input type=\"checkbox\" name=\"accountSSL\"
id=\"accountSSL\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label
for=\"accountUsername\">Username:</label></td>" +
+ "<td><input type=\"text\" name=\"accountUsername\"
id=\"accountUsername\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label
for=\"accountPassword\">Password:</label></td>" +
+ "<td><input type=\"password\" name=\"accountPassword\"
id=\"accountPassword\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label
for=\"defaultIdentity\">Identity:</label></td>" +
+ "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"></select></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td></td>" +
+ "<td><input type=\"button\" id=\"accountSave\"
name=\"accountSave\" value=\"Add account\" /> " +
+ "<input type=\"button\" value=\"Add identity\"
id=\"loadIdentityAddForm\" /></td>" +
+ "</tr>" +
+ "</table>";
- YAHOO.gocept.webmailer.IdentityEditForm = Class({
+ YAHOO.gocept.webmailer.AccountEditForm= Class({
constructor: function() {
var editform = this;
- document.App.domNodes.identity_edit_form.innerHTML =
editform_html;
+ editform.onLoadFinished = new YAHOO.util.CustomEvent(
+ "onLoadFinished", editform);
+ document.App.domNodes.account_edit_form.innerHTML =
account_editform_html;
+
+ document.Connection.get(profile_url+'/(at)(at)identities',
function(result) {
+ var identities = YAHOO.lang.JSON.parse(result.responseText);
+ for (i=0;i<identities.length;i++) {
+ var identity = document.createElement('option');
+ identity.value = identities[i]['id'];
+ identity.innerHTML = identities[i]['from'];
+
editform.getControl('defaultIdentity').appendChild(identity);
+ };
+ editform.onLoadFinished.fire();
+ });
+
+ YAHOO.util.Event.addListener(
+ editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
YAHOO.util.Event.addListener(
- editform.getControl('identitySave'), 'click',
editform.save_identity, editform, true);
+ editform.getControl('loadIdentityAddForm'), 'click',
document.App.loadIdentityAddForm, editform, true);
},
get: function(key) {
(at)(at) -201,10 +258,7 (at)(at)
_prepare_data: function() {
var editform = this;
var data = {
- identity: {name: editform.get('identityName'),
- address: editform.get('identityAddress'),
- sent_folder: editform.get('identitySentfolder')},
- smtp_server: editform.get('identitySMTPServer'),
+ default_identity: editform.get('defaultIdentity'),
imap_server: {host: editform.get('accountHost'),
port: new Number(editform.get('accountPort')),
ssl:
document.getElementById('accountSSL').checked,
(at)(at) -213,7 +267,7 (at)(at)
return data;
},
- save_identity: function(ev) {
+ save_account: function(ev) {
var editform = this;
if (editform.get('accountURL')) {
var url = editform.get('accountURL') + '/(at)(at)edit';
(at)(at) -223,7 +277,7 (at)(at)
document.Connection.post(url, editform._prepare_data(),
function(result) {
- document.App.identity_list = new
YAHOO.gocept.webmailer.IdentityList();
+ document.App.account_list = new
YAHOO.gocept.webmailer.AccountList();
// reload the tree in the main window
var parent = window.opener;
(at)(at) -231,6 +285,88 (at)(at)
});
},
+ add_identity: function(ev) {
+ var addform = this;
+ var url = '(at)(at)add-identity?';
+
+ document.Connection.post(url, addform._prepare_data(),
+ function(result) {
+ var identity = YAHOO.lang.JSON.parse(result.responseText);
+ var editform = document.App.account_edit_form
+ var identity_option = document.createElement('option');
+ identity_option.value = identity['id'];
+ identity_option.innerHTML = identity['from'];
+
editform.getControl('defaultIdentity').appendChild(identity_option);
+ editform.getControl('defaultIdentity').selectedIndex =
editform.getControl('defaultIdentity').options.length - 1
+ });
+ },
+
+ getControl: function(name) {
+ return document.getElementById(name);
+ }
+ });
+});
+
+
+Def(function() {
+
+ // An HTML "template" for the edit form content.
+ // XXX: Internet Explorer doesn't know about raw strings
+ // find a way to better implement the HTML "template"
+ var identity_addform_html =
+ "<table cellpadding=\"5\" style=\"margin-left:20px;\">" +
+ "<tr>" +
+ "<td><label
for=\"identityName\">Name:</label></td>" +
+ "<td><input type=\"text\" name=\"identityName\"
id=\"identityName\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label for=\"identityAddress\">Email
Address:</label></td>" +
+ "<td><input type=\"text\" name=\"identityAddress\"
id=\"identityAddress\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label
for=\"identitySentfolder\">Sentfolder:</label></td>" +
+ "<td><input type=\"text\" name=\"identitySentfolder\"
id=\"identitySentfolder\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td><label for=\"identitySMTPServer\">SMTP
Server:</label></td>" +
+ "<td><input type=\"text\" name=\"identitySMTPServer\"
id=\"identitySMTPServer\" /></td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td></td>" +
+ "<td><input type=\"button\" id=\"identitySave\"
name=\"identitySave\" value=\"Add\" /></td>" +
+ "</tr>" +
+ "</table>";
+
+ YAHOO.gocept.webmailer.IdentityAddForm= Class({
+ constructor: function() {
+ var addform = this;
+ addform.onLoadFinished = new YAHOO.util.CustomEvent(
+ "onLoadFinished", addform);
+ document.App.domNodes.identity_add_form.innerHTML =
identity_addform_html;
+
+ addform.onLoadFinished.fire();
+
+ YAHOO.util.Event.addListener(
+ addform.getControl('identitySave'), 'click',
document.App.account_edit_form.add_identity, addform, true);
+
+ },
+
+ _prepare_data: function() {
+ var addform = this;
+ var data = {
+ account_id: 'foo',
+ smtp_server: addform.get('identitySMTPServer'),
+ identity: {name: addform.get('identityName'),
+ address: addform.get('identityAddress'),
+ sent_folder: addform.get('identitySentfolder')}};
+ return data;
+ },
+
+ get: function(key) {
+ var addform = this;
+ return addform.getControl(key).value;
+ },
+
getControl: function(name) {
return document.getElementById(name);
}
|
SVN: r29246 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-20 09:01:32 |
[ FULL ]
|
Author: wosc
Date: Fri Feb 20 09:01:30 2009
New Revision: 29246
Log:
typo
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Fri
Feb 20 09:01:30 2009
(at)(at) -52,7 +52,7 (at)(at)
default_form = form.getControl("defaultIdentity");
for (i = 0; i < default_form.length; ++i)
if (default_form.options[i].value == account.ident_id)
- default_form.options[i].selected = "selecyed";
+ default_form.options[i].selected = "selected";
},
loadIdentityAddForm: function() {
|
SVN: r29247 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-20 09:12:25 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 20 09:12:24 2009
New Revision: 29247
Log:
- Check if all fields are filled before adding accounts or identities.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Fri
Feb 20 09:12:24 2009
(at)(at) -255,6 +255,32 (at)(at)
return editform.getControl(key).value;
},
+ _check_data: function() {
+ var editform = this;
+ if (editform.get('accountHost') == "") {
+ alert('Please enter the host.');
+ return false;
+ }
+ if (editform.get('accountPort') == "") {
+ alert('Please enter the port.');
+ return false
+ }
+ if (editform.get('accountUsername') == "") {
+ alert('Please enter the username.');
+ return false
+ }
+ if (editform.get('accountPassword') == "") {
+ alert('Please enter the password.');
+ return false
+ }
+ if (editform.get('defaultIdentity') == "") {
+ alert('Please check the default identity.');
+ return false
+ }
+ return true
+
+ },
+
_prepare_data: function() {
var editform = this;
var data = {
(at)(at) -269,6 +295,8 (at)(at)
save_account: function(ev) {
var editform = this;
+ if (!editform._check_data())
+ return
if (editform.get('accountURL')) {
var url = editform.get('accountURL') + '/(at)(at)edit';
} else {
(at)(at) -289,6 +317,9 (at)(at)
var addform = this;
var url = '(at)(at)add-identity?';
+ if (!addform._check_data())
+ return
+
document.Connection.post(url, addform._prepare_data(),
function(result) {
var identity = YAHOO.lang.JSON.parse(result.responseText);
(at)(at) -325,7 +356,8 (at)(at)
"</tr>" +
"<tr>" +
"<td><label
for=\"identitySentfolder\">Sentfolder:</label></td>" +
- "<td><input type=\"text\" name=\"identitySentfolder\"
id=\"identitySentfolder\" /></td>" +
+ "<td><select name=\"accountId\" id=\"accountId\"
size=\"1\"></select>" +
+ " <input type=\"text\" name=\"identitySentfolder\"
id=\"identitySentfolder\" style=\"width:60px;\" /></td>" +
"</tr>" +
"<tr>" +
"<td><label for=\"identitySMTPServer\">SMTP
Server:</label></td>" +
(at)(at) -344,17 +376,48 (at)(at)
"onLoadFinished", addform);
document.App.domNodes.identity_add_form.innerHTML =
identity_addform_html;
- addform.onLoadFinished.fire();
+ document.Connection.get(profile_url+'/(at)(at)accounts',
function(result) {
+ var accounts = YAHOO.lang.JSON.parse(result.responseText);
+ for (i=0;i<accounts.length;i++) {
+ var account = document.createElement('option');
+ account.value =
accounts[i]['user']+'-'+accounts[i]['host'];
+ account.innerHTML =
accounts[i]['user']+'(at)'+accounts[i]['host'];
+ addform.getControl('accountId').appendChild(account);
+ };
+ addform.onLoadFinished.fire();
+ });
YAHOO.util.Event.addListener(
addform.getControl('identitySave'), 'click',
document.App.account_edit_form.add_identity, addform, true);
},
+ _check_data: function() {
+ var addform = this;
+ if (addform.get('identityName') == "") {
+ alert('Please enter your name.');
+ return false;
+ }
+ if (addform.get('identityAddress') == "") {
+ alert('Please enter your email address.');
+ return false
+ }
+ if (addform.get('identitySentfolder') == "") {
+ alert('Please enter a sent folder.');
+ return false
+ }
+ if (addform.get('identitySMTPServer') == "") {
+ alert('Please enter your mailhost.');
+ return false
+ }
+ return true
+
+ },
+
_prepare_data: function() {
var addform = this;
var data = {
- account_id: 'foo',
+ account_id: addform.get('accountId'),
smtp_server: addform.get('identitySMTPServer'),
identity: {name: addform.get('identityName'),
address: addform.get('identityAddress'),
|
SVN: r29250 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-20 10:54:26 |
[ FULL ]
|
Author: wosc
Date: Fri Feb 20 10:54:24 2009
New Revision: 29250
Log:
integrated selenium configuration in one file
Removed:
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.zcml
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml Fri Feb 20
10:54:24 2009
(at)(at) -1,6 +1,27 (at)(at)
-<configure xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:zcml="http://namespaces.zope.org/zcml"
+ zcml:condition="installed zc.selenium"
+ >
+ <include package="zc.selenium" />
+
+ <adapter
+ name="gocept.webmail.browser.tests.selenium.SimpleTest"
+ factory=".selenium.SimpleTest"
+ provides="zc.selenium.pytest.ISeleniumTest"
+ permission="zope2.View"
+ />
+
+ <adapter
+ name="gocept.webmail.browser.tests.selenium.YUITestRunner"
+ factory=".selenium.YUITestRunner"
+ provides="zc.selenium.pytest.ISeleniumTest"
+ permission="zope2.View"
+ />
+
+ <!-- YUI tests -->
<browser:pages
permission="zope2.View"
class="gocept.webmail.browser.tests.yui.YUITestSuite"
(at)(at) -13,13 +34,11 (at)(at)
template="connection.pt"/>
</browser:pages>
+ <!-- helper for tests.yui.connection -->
<browser:page
for="*"
name="echo.html"
class=".echo.Echo"
permission="zope2.View"
/>
-
- <include file="selenium.zcml" />
-
</configure>
|
SVN: r29252 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-20 14:17:33 |
[ FULL ]
|
Author: wosc
Date: Fri Feb 20 14:17:32 2009
New Revision: 29252
Log:
Re #4601: added common setup for selenium tests: create webmailer instance
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml Fri Feb 20
14:17:32 2009
(at)(at) -7,7 +7,15 (at)(at)
<include package="zc.selenium" />
+ <!-- setup must be executed first (name prefix makes it sort first)
-->
<adapter
+ name="AAA_gocept.webmail.browser.tests.selenium.Setup"
+ factory=".selenium.Setup"
+ provides="zc.selenium.pytest.ISeleniumTest"
+ permission="zope2.View"
+ />
+
+ <adapter
name="gocept.webmail.browser.tests.selenium.SimpleTest"
factory=".selenium.SimpleTest"
provides="zc.selenium.pytest.ISeleniumTest"
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Fri Feb 20
14:17:32 2009
(at)(at) -1,18 +1,49 (at)(at)
# Copyright (c) 2009 gocept gmbh & co. kg
# See also LICENSE.txt
+import gocept.webmail.webmailer
import zc.selenium.pytest
+class Setup(zc.selenium.pytest.Test):
+ """Setup"""
+
+ def sharedSetUp(self):
+ # don't call super so we don't push another DemoStorage
+
+ # log in
+ s = self.selenium
+ s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
+
+ # create CMF Site
+ # XXX: I wish we had some ids to go on...
+ s.select('//form[(at)method="get"]/select[(at)name=":action"]', 'CMF
Site')
+ s.type('name=id', 'selenium')
+ s.click('//input[(at)value=" Add "]')
+ s.waitForFrameToLoad('index=2', 1000)
+
+ # create Webmailer
+ s.open('/selenium/manage')
+ s.select('//form[(at)method="get"]/select[(at)name=":action"]',
'Webmailer')
+ s.type('name=id', 'webmail')
+ s.click('//input[(at)value=" Add "]')
+ s.waitForFrameToLoad('index=2', 1000)
+
+ # cause /selenium/webmail/admin profile to be created
+ s.open('/selenium/webmail')
+
+ def sharedTearDown(self):
+ # don't call super so we don't pop a DemoStorage
+ # and our setup persists for the remaining test suite
+ pass
+
+
class SimpleTest(zc.selenium.pytest.Test):
"""Example Selenium Test."""
def test_webmailer_loads(self):
s = self.selenium
-
- s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
-
- s.open('/cmf/webmail/admin')
+ s.open('/selenium/webmail/admin')
s.waitForElementPresent('id=ygtvlabelel1')
s.verifyText('id=ygtvlabelel1', 'Drafts')
(at)(at) -22,9 +53,7 (at)(at)
def test_webmailer_loads(self):
s = self.selenium
- s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
-
-
s.open('/cmf/webmail/admin/(at)(at)gocept.webmail.browser.tests.yui.index')
+
s.open('/selenium/webmail/admin/(at)(at)gocept.webmail.browser.tests.yui.index')
s.waitForElementPresent('id=log-output')
s.comment('At least one test should be run')
s.verifyNotText('id=tests-passed', '0')
|
SVN: r29262 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-23 10:11:01 |
[ FULL ]
|
Author: wosc
Date: Mon Feb 23 10:10:59 2009
New Revision: 29262
Log:
Re #4601: work around frameset problems with the ZMI by not using the frameset.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Mon Feb 23
10:10:59 2009
(at)(at) -16,18 +16,16 (at)(at)
s.open('http://admin:admin(at)%s/manage' %
self.selenium.server)
# create CMF Site
- # XXX: I wish we had some ids to go on...
- s.select('//form[(at)method="get"]/select[(at)name=":action"]', 'CMF
Site')
+ s.open('http://admin:admin(at)%s/manage_main' %
self.selenium.server)
+ s.select('name=:action', 'CMF Site')
s.type('name=id', 'selenium')
s.click('//input[(at)value=" Add "]')
- s.waitForFrameToLoad('index=2', 1000)
# create Webmailer
- s.open('/selenium/manage')
- s.select('//form[(at)method="get"]/select[(at)name=":action"]',
'Webmailer')
+ s.open('/selenium/manage_main')
+ s.select('name=:action', 'Webmailer')
s.type('name=id', 'webmail')
s.click('//input[(at)value=" Add "]')
- s.waitForFrameToLoad('index=2', 1000)
# cause /selenium/webmail/admin profile to be created
s.open('/selenium/webmail')
|
SVN: r29263 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-23 10:31:02 |
[ FULL ]
|
Author: wosc
Date: Mon Feb 23 10:31:01 2009
New Revision: 29263
Log:
use non-minified YUI-version for development
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js Mon Feb 23
10:31:01 2009
(at)(at) -21,6 +21,7 (at)(at)
base: yui_base_url+'/',
loadOptional: true,
allowRollup: false,
+ filter: 'RAW',
onSuccess: function() {
generic_init();
},
|
SVN: r29264 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-23 10:44:34 |
[ FULL ]
|
Author: sweh
Date: Mon Feb 23 10:44:33 2009
New Revision: 29264
Log:
- Bugfix when clicking on account names.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Mon Feb 23
10:44:33 2009
(at)(at) -62,8 +62,14 (at)(at)
list_type = folder.list_type;
document.App.preview_pane.reset();
-
- config = YAHOO.gocept.webmailer['list-'+list_type](url);
+
+ try {
+ config = YAHOO.gocept.webmailer['list-'+list_type](url);
+ }
+ catch(err) {
+ return
+ }
+
init_sort = document.App.preferences.data['sort'];
if (!init_sort) {
|
SVN: r29269 - gocept.webmail/trunk/gocept/webmail/browser
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-23 11:22:19 |
[ FULL ]
|
Author: wosc
Date: Mon Feb 23 11:22:17 2009
New Revision: 29269
Log:
Re #4678: implemented o-wrap using metal
Added:
gocept.webmail/trunk/gocept/webmail/browser/layout.pt
- copied, changed from r29259,
gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt
gocept.webmail/trunk/gocept/webmail/browser/layout.py
Modified:
gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt
Modified: gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/configure.zcml Mon Feb 23
11:22:17 2009
(at)(at) -36,7 +36,29 (at)(at)
name="gocept.webmail"
directory="resources"/>
- <include package=".tests"/>
+ <!-- layout -->
+ <browser:skin
+ interface=".layout.IWebmailSkin"
+ name="webmail"
+ />
+ <browser:defaultSkin name="webmail"/>
+
+ <browser:page
+ for="*"
+ name="standard_macros"
+ class=".layout.StandardMacros"
+ layer=".layout.IWebmailSkin"
+ permission="zope2.View"
+ />
+ <browser:page
+ for="*"
+ name="layout_macros"
+ template="layout.pt"
+ permission="zope2.View"
+ />
+
+ <!-- XXX tests should not be here, see #4708 -->
+ <include package=".tests"/>
</configure>
Copied: gocept.webmail/trunk/gocept/webmail/browser/layout.pt (from r29259,
gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt)
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/layout.pt Mon Feb 23 11:22:17
2009
(at)(at) -1,12 +1,14 (at)(at)
+<html xmlns="http://www.w3.org/1999/xhtml">
+<metal:macro define-macro="page"><?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="webmailer">
- <head
+ <head
tal:define="
webmailer nocall:context/(at)(at)webmailer;
profile nocall:context/(at)(at)profile;
resources view/resources;
yui_base_url string:$resources/yui/build">
- <title tal:content="view/title">Portal</title>
+ <title metal:define-slot="title"
tal:content="view/title">Portal</title>
<script type="text/javascript" tal:content="string:
var yui_base_url = '$yui_base_url';
(at)(at) -22,20 +24,22 (at)(at)
</script>
<script type="text/javascript" src="utilities.js"
tal:attributes="src string:$resources/utilities.js">
- </script>
+ </script>
<script type="text/javascript" src="runner.js"
tal:attributes="src string:$resources/runner.js">
- </script>
+ </script>
<script type="text/javascript" src="main.js"
tal:attributes="src string:$resources/${view/main_file}">
- </script>
+ </script>
<link rel="stylesheet" type="text/css"
tal:attributes="href string:$resources/styles/webmail.css"/>
+ <metal:block define-slot="headers" />
</head>
- <body class="yui-skin-sam">
+ <body metal:define-slot="body">
</body>
</html>
+</metal:macro></html>
Added: gocept.webmail/trunk/gocept/webmail/browser/layout.py
==============================================================================
--- (empty file)
+++ gocept.webmail/trunk/gocept/webmail/browser/layout.py Mon Feb 23 11:22:17
2009
(at)(at) -0,0 +1,13 (at)(at)
+# Copyright (c) 2009 gocept gmbh & co. kg
+# See also LICENSE.txt
+
+import zope.app.basicskin.standardmacros
+import zope.publisher.interfaces.browser
+
+
+class StandardMacros(zope.app.basicskin.standardmacros.StandardMacros):
+ macro_pages = ['layout_macros']
+
+
+class IWebmailSkin(zope.publisher.interfaces.browser.IDefaultBrowserLayer):
+ pass
Modified: gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt Mon Feb 23
11:22:17 2009
(at)(at) -1,41 +1,8 (at)(at)
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html class="webmailer">
- <head
- tal:define="
- webmailer nocall:context/(at)(at)webmailer;
- profile nocall:context/(at)(at)profile;
- resources view/resources;
- yui_base_url string:$resources/yui/build">
- <title tal:content="view/title">Portal</title>
-
- <script type="text/javascript" tal:content="string:
- var yui_base_url = '$yui_base_url';
- var app_base_url = '$resources';
- var profile_url = '${profile/absolute_url}';
- var banner_url = '${webmailer/banner_url}';
- ${view/declarations}
- ">
- </script>
-
- <script type="text/javascript"
- tal:attributes="src string:$yui_base_url/yuiloader/yuiloader-min.js">
- </script>
- <script type="text/javascript" src="utilities.js"
- tal:attributes="src string:$resources/utilities.js">
- </script>
- <script type="text/javascript" src="runner.js"
- tal:attributes="src string:$resources/runner.js">
- </script>
- <script type="text/javascript" src="main.js"
- tal:attributes="src string:$resources/${view/main_file}">
- </script>
-
- <link rel="stylesheet" type="text/css"
- tal:attributes="href string:$resources/styles/webmail.css"/>
-
- </head>
-
- <body class="yui-skin-sam">
- </body>
-
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="context/(at)(at)standard_macros/page"
+>
+<body class="yui-skin-sam" metal:fill-slot="body">
+</body>
</html>
|
SVN: r29271 - gocept.webmail/trunk/gocept/webmail/browser
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-23 13:55:27 |
[ FULL ]
|
Author: sweh
Date: Mon Feb 23 13:55:26 2009
New Revision: 29271
Log:
- Fix tests.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
Modified: gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt Mon Feb 23
13:55:26 2009
(at)(at) -24,5 +24,6 (at)(at)
>>> browser.url
'http://localhost/webmail/mail/mgr'
>>> print browser.contents
+<?xml version="1.0" ?>
<!DOCTYPE...
<html class="webmailer">...
|
SVN: r29282 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-23 16:05:44 |
[ FULL ]
|
Author: sweh
Date: Mon Feb 23 16:05:42 2009
New Revision: 29282
Log:
-improve management ui.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Mon
Feb 23 16:05:42 2009
(at)(at) -53,12 +53,35 (at)(at)
for (i = 0; i < default_form.length; ++i)
if (default_form.options[i].value == account.ident_id)
default_form.options[i].selected = "selected";
+ document.App.fillIdentityAddForm();
},
loadIdentityAddForm: function() {
document.App.identity_add_form = new
YAHOO.gocept.webmailer.IdentityAddForm();
},
+ fillIdentityAddForm: function() {
+ document.App.loadIdentityAddForm();
+ form = document.App.identity_add_form;
+ select =
document.App.account_edit_form.getControl("defaultIdentity");
+ identity = select.options[select.selectedIndex]
+ if (identity.value == '') {
+ return
+ }
+ document.Connection.get(identity.url + '/(at)(at)get',
function(result) {
+ var identity = YAHOO.lang.JSON.parse(result.responseText);
+ form.getControl('identityName').value = identity['name'];
+ form.getControl('identityAddress').value =
identity['address'];
+ form.getControl('identitySentfolder').value =
identity['sent_folder'];
+ form.getControl('identitySMTPServer').value =
identity['smtp_server'];
+ account_select = form.getControl("accountId");
+ for (i = 0; i < account_select.length; ++i)
+ if (account_select.options[i].value ==
identity['account_id'])
+ account_select.options[i].selected = "selected";
+
+ })
+ },
+
reset: function() {
document.App.domNodes.account_edit_form.innerHTML = "";
document.App.domNodes.identity_add_form.innerHTML = "";
(at)(at) -217,12 +240,11 (at)(at)
"</tr>" +
"<tr>" +
"<td><label
for=\"defaultIdentity\">Identity:</label></td>" +
- "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"></select></td>" +
+ "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"
onchange=\"document.App.fillIdentityAddForm();\"><option
value=\"\">New...</option></select></td>" +
"</tr>" +
"<tr>" +
"<td></td>" +
- "<td><input type=\"button\" id=\"accountSave\"
name=\"accountSave\" value=\"Add account\" /> " +
- "<input type=\"button\" value=\"Add identity\"
id=\"loadIdentityAddForm\" /></td>" +
+ "<td><input type=\"button\" id=\"accountSave\"
name=\"accountSave\" value=\"Save account\" /></td>" +
"</tr>" +
"</table>";
(at)(at) -238,6 +260,7 (at)(at)
for (i=0;i<identities.length;i++) {
var identity = document.createElement('option');
identity.value = identities[i]['id'];
+ identity.url = identities[i]['url'];
identity.innerHTML = identities[i]['from'];
editform.getControl('defaultIdentity').appendChild(identity);
};
(at)(at) -274,7 +297,7 (at)(at)
return false
}
if (editform.get('defaultIdentity') == "") {
- alert('Please check the default identity.');
+ alert('Please save the new identity or select an existing
one.');
return false
}
return true
(at)(at) -315,20 +338,27 (at)(at)
add_identity: function(ev) {
var addform = this;
- var url = '(at)(at)add-identity?';
+ var editform = document.App.account_edit_form
+ var editurl =
editform.getControl("defaultIdentity").options[editform.getControl("defaultIdentity").selectedIndex].url;
+ if (!editurl) {
+ var url = '(at)(at)add-identity?';
+ } else {
+ var url = editurl + '/(at)(at)edit';
+ }
if (!addform._check_data())
return
document.Connection.post(url, addform._prepare_data(),
function(result) {
- var identity = YAHOO.lang.JSON.parse(result.responseText);
- var editform = document.App.account_edit_form
- var identity_option = document.createElement('option');
- identity_option.value = identity['id'];
- identity_option.innerHTML = identity['from'];
-
editform.getControl('defaultIdentity').appendChild(identity_option);
- editform.getControl('defaultIdentity').selectedIndex =
editform.getControl('defaultIdentity').options.length - 1
+ if (!editurl) {
+ var identity =
YAHOO.lang.JSON.parse(result.responseText);
+ var identity_option =
document.createElement('option');
+ identity_option.value = identity['id'];
+ identity_option.innerHTML = identity['from'];
+
editform.getControl('defaultIdentity').appendChild(identity_option);
+ editform.getControl('defaultIdentity').selectedIndex =
editform.getControl('defaultIdentity').options.length - 1
+ }
});
},
(at)(at) -365,7 +395,7 (at)(at)
"</tr>" +
"<tr>" +
"<td></td>" +
- "<td><input type=\"button\" id=\"identitySave\"
name=\"identitySave\" value=\"Add\" /></td>" +
+ "<td><input type=\"button\" id=\"identitySave\"
name=\"identitySave\" value=\"Save identity\" /></td>" +
"</tr>" +
"</table>";
|
SVN: r29283 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-23 18:11:47 |
[ FULL ]
|
Author: thomas
Date: Mon Feb 23 18:11:45 2009
New Revision: 29283
Log:
consistent naming, initialization of the identity edit form
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Mon
Feb 23 18:11:45 2009
(at)(at) -26,7 +26,7 (at)(at)
app.domNodes.menu = app.layout.getUnitByPosition('top').body;
app.layout.getUnitByPosition('bottom').body.innerHTML =
'<table><tr><td id="accountEditForm"></td><td
id="identityEditForm></td></tr></table>';
app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
- app.domNodes.identity_add_form =
document.getElementById('identityEditForm');
+ app.domNodes.identity_edit_form =
document.getElementById('identityEditForm');
app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
app.menu = new YAHOO.gocept.webmailer.ManagementMenu();
(at)(at) -37,6 +37,7 (at)(at)
loadAccountEditForm: function() {
document.App.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
+ document.App.loadIdentityEditForm();
},
fillAccountEditForm: function(account) {
(at)(at) -53,16 +54,16 (at)(at)
for (i = 0; i < default_form.length; ++i)
if (default_form.options[i].value == account.ident_id)
default_form.options[i].selected = "selected";
- document.App.fillIdentityAddForm();
+ document.App.fillIdentityEditForm();
},
- loadIdentityAddForm: function() {
- document.App.identity_add_form = new
YAHOO.gocept.webmailer.IdentityAddForm();
+ loadIdentityEditForm: function() {
+ document.App.identity_edit_form = new
YAHOO.gocept.webmailer.IdentityEditForm();
},
- fillIdentityAddForm: function() {
- document.App.loadIdentityAddForm();
- form = document.App.identity_add_form;
+ fillIdentityEditForm: function() {
+ document.App.loadIdentityEditForm();
+ form = document.App.identity_edit_form;
select =
document.App.account_edit_form.getControl("defaultIdentity");
identity = select.options[select.selectedIndex]
if (identity.value == '') {
(at)(at) -84,7 +85,7 (at)(at)
reset: function() {
document.App.domNodes.account_edit_form.innerHTML = "";
- document.App.domNodes.identity_add_form.innerHTML = "";
+ document.App.domNodes.identity_edit_form.innerHTML = "";
document.App.menu.delete_button.cfg.setProperty('disabled', true);
document.App.selected_account = null;
}
(at)(at) -240,7 +241,7 (at)(at)
"</tr>" +
"<tr>" +
"<td><label
for=\"defaultIdentity\">Identity:</label></td>" +
- "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"
onchange=\"document.App.fillIdentityAddForm();\"><option
value=\"\">New...</option></select></td>" +
+ "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"
onchange=\"document.App.fillIdentityEditForm();\"><option
value=\"\">New...</option></select></td>" +
"</tr>" +
"<tr>" +
"<td></td>" +
(at)(at) -270,7 +271,7 (at)(at)
YAHOO.util.Event.addListener(
editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
YAHOO.util.Event.addListener(
- editform.getControl('loadIdentityAddForm'), 'click',
document.App.loadIdentityAddForm, editform, true);
+ editform.getControl('loadIdentityEditForm'), 'click',
document.App.loadIdentityEditForm, editform, true);
},
get: function(key) {
(at)(at) -399,13 +400,12 (at)(at)
"</tr>" +
"</table>";
- YAHOO.gocept.webmailer.IdentityAddForm= Class({
+ YAHOO.gocept.webmailer.IdentityEditForm = Class({
constructor: function() {
var addform = this;
addform.onLoadFinished = new YAHOO.util.CustomEvent(
"onLoadFinished", addform);
- document.App.domNodes.identity_add_form.innerHTML =
identity_addform_html;
-
+ document.App.domNodes.identity_edit_form.innerHTML =
identity_addform_html;
document.Connection.get(profile_url+'/(at)(at)accounts',
function(result) {
var accounts = YAHOO.lang.JSON.parse(result.responseText);
for (i=0;i<accounts.length;i++) {
|
SVN: r29284 - gocept.webmail/trunk/gocept/webmail/browser
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 08:15:52 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 08:15:51 2009
New Revision: 29284
Log:
re-indent
Modified:
gocept.webmail/trunk/gocept/webmail/browser/composer.pt
Modified: gocept.webmail/trunk/gocept/webmail/browser/composer.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/composer.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/composer.pt Tue Feb 24 08:15:51
2009
(at)(at) -36,42 +36,42 (at)(at)
<body class="yui-skin-sam">
- <div id="yui-layout-loading">loading...</div>
+ <div id="yui-layout-loading">loading...</div>
- <div id="composer-center" class="yui-layout-content">
+ <div id="composer-center" class="yui-layout-content">
- <div id="composeBarWrap">
- <div id="composeBar"></div>
- <div id="composeIdentity">
- <label for="composeFrom">From:</label>
- <select id="composeFrom" name="composeFrom">
- </select>
- </div>
- <div id="composeAddr">
- <div>
- <label for="composeTo">To:</label>
- <input type="text" name="composeTo" id="composeTo"/>
- </div>
- <div>
- <label for="composeSubject">Subject:</label>
- <input type="text" name="composeSubject" id="composeSubject"/>
+ <div id="composeBarWrap">
+ <div id="composeBar"></div>
+ <div id="composeIdentity">
+ <label for="composeFrom">From:</label>
+ <select id="composeFrom" name="composeFrom">
+ </select>
+ </div>
+ <div id="composeAddr">
+ <div>
+ <label for="composeTo">To:</label>
+ <input type="text" name="composeTo" id="composeTo"/>
+ </div>
+ <div>
+ <label for="composeSubject">Subject:</label>
+ <input type="text" name="composeSubject"
id="composeSubject"/>
+ </div>
+ </div>
</div>
- </div>
- </div>
- <textarea id="composeBody" name="composeBody" cols="100"
rows="20"></textarea>
- </div>
+ <textarea id="composeBody" name="composeBody" cols="100"
rows="20"></textarea>
+ </div>
- <div id="composer-bottom" class="yui-layout-content">
- <form id="composeAttachments" method="post"
enctype="multipart/form-data">
- <input type="file" name="file" id="composeAttachmentsFile"/>
- <input type="button" id="composeAttachmentsAttach"
value="Attach"/>
- <span id="composeAttachmentsUploading" style="display:
none">uploading...</span>
-
- <ul id="composeAttachmentsList">
- </ul>
- </form>
- </div>
+ <div id="composer-bottom" class="yui-layout-content">
+ <form id="composeAttachments" method="post"
enctype="multipart/form-data">
+ <input type="file" name="file" id="composeAttachmentsFile"/>
+ <input type="button" id="composeAttachmentsAttach"
value="Attach"/>
+ <span id="composeAttachmentsUploading" style="display:
none">uploading...</span>
+
+ <ul id="composeAttachmentsList">
+ </ul>
+ </form>
+ </div>
</body>
</html>
|
SVN: r29286 - gocept.webmail/trunk/gocept/webmail/browser
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 08:19:35 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 08:19:34 2009
New Revision: 29286
Log:
Re #4678: module-loader.pt has been replaced by layout.pt
Removed:
gocept.webmail/trunk/gocept/webmail/browser/module-loader.pt
Modified:
gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
Modified: gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/configure.zcml Tue Feb 24
08:19:34 2009
(at)(at) -12,7 +12,7 (at)(at)
for="gocept.restmail.interfaces.IProfile"
name="index_html"
class=".webmailer.Webmailer"
- template="module-loader.pt"
+ template="layout.pt"
permission="gocept.restmail.Access"
/>
(at)(at) -20,7 +20,7 (at)(at)
for="gocept.restmail.interfaces.IProfile"
name="management"
class=".webmailer.Management"
- template="module-loader.pt"
+ template="layout.pt"
permission="gocept.restmail.Access"
/>
|
SVN: r29287 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 08:28:43 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 08:28:41 2009
New Revision: 29287
Log:
whitespace
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Tue
Feb 24 08:28:41 2009
(at)(at) -79,7 +79,7 (at)(at)
for (i = 0; i < account_select.length; ++i)
if (account_select.options[i].value ==
identity['account_id'])
account_select.options[i].selected = "selected";
-
+
})
},
(at)(at) -117,7 +117,7 (at)(at)
addMenuItem: function(label, callback) {
new_item = this.menubar.addItem({
- text: label,
+ text: label,
onclick: { fn: callback }
});
this.menubar.render(document.App.domNodes.menu);
(at)(at) -216,7 +216,7 (at)(at)
// An HTML "template" for the edit form content.
// XXX: Internet Explorer doesn't know about raw strings
// find a way to better implement the HTML "template"
- var account_editform_html =
+ var account_editform_html =
"<input type=\"hidden\" id=\"accountURL\" name=\"accountURL\" />"
+
"<table cellpadding=\"5\">" +
"<tr>" +
(at)(at) -255,7 +255,7 (at)(at)
editform.onLoadFinished = new YAHOO.util.CustomEvent(
"onLoadFinished", editform);
document.App.domNodes.account_edit_form.innerHTML =
account_editform_html;
-
+
document.Connection.get(profile_url+'/(at)(at)identities',
function(result) {
var identities = YAHOO.lang.JSON.parse(result.responseText);
for (i=0;i<identities.length;i++) {
(at)(at) -326,7 +326,7 (at)(at)
} else {
var url = '(at)(at)add-account?';
};
-
+
document.Connection.post(url, editform._prepare_data(),
function(result) {
document.App.account_list = new
YAHOO.gocept.webmailer.AccountList();
(at)(at) -346,7 +346,7 (at)(at)
} else {
var url = editurl + '/(at)(at)edit';
}
-
+
if (!addform._check_data())
return
(at)(at) -375,7 +375,7 (at)(at)
// An HTML "template" for the edit form content.
// XXX: Internet Explorer doesn't know about raw strings
// find a way to better implement the HTML "template"
- var identity_addform_html =
+ var identity_addform_html =
"<table cellpadding=\"5\" style=\"margin-left:20px;\">" +
"<tr>" +
"<td><label
for=\"identityName\">Name:</label></td>" +
|
SVN: r29288 - in gocept.webmail/trunk/gocept/webmail/browser/resources: . styles
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 08:38:32 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 08:38:31 2009
New Revision: 29288
Log:
Re #4678: added show/hide utility method
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
gocept.webmail/trunk/gocept/webmail/browser/resources/utilities.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css Tue
Feb 24 08:38:31 2009
(at)(at) -103,3 +103,7 (at)(at)
.novisclear {
clear: both;
}
+
+.invisible {
+ display: none;
+}
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/utilities.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/utilities.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/utilities.js Tue Feb
24 08:38:31 2009
(at)(at) -4,6 +4,8 (at)(at)
// Define our namespace
YAHOO.namespace('gocept.webmailer');
+YAHOO.namespace('gocept.webmailer.util');
+
function Class(body) {
//
(at)(at) -28,6 +30,7 (at)(at)
return generated_class;
};
+
function Def(scope) {
//
// Call a method. This is used to create syntactic sugar for the following
(at)(at) -63,5 +66,15 (at)(at)
};
return data_source;
};
+
+
+ YAHOO.gocept.webmailer.util.show = function(element) {
+ YAHOO.util.Dom.removeClass(element, 'invisible');
+ };
+
+
+ YAHOO.gocept.webmailer.util.hide = function(element) {
+ YAHOO.util.Dom.addClass(element, 'invisible');
+ };
});
|
SVN: r29289 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 09:04:13 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 09:04:10 2009
New Revision: 29289
Log:
Re #4678: converted management from innerHTML to layout o-wrap
Added:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
Modified:
gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/configure.zcml Tue Feb 24
09:04:10 2009
(at)(at) -20,7 +20,7 (at)(at)
for="gocept.restmail.interfaces.IProfile"
name="management"
class=".webmailer.Management"
- template="layout.pt"
+ template="management.pt"
permission="gocept.restmail.Access"
/>
Added: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- (empty file)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Tue Feb 24
09:04:10 2009
(at)(at) -0,0 +1,83 (at)(at)
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="context/(at)(at)standard_macros/page"
+ >
+ <body>
+ <div metal:fill-slot="layout">
+
+ <div id="yui-layout-bottom">
+ <table>
+ <tr>
+ <td id="accountEditForm">
+
+ <input type="hidden" id="accountURL" name="accountURL" />
+ <table cellpadding="5">
+ <tr>
+ <td><label
for="accountHost">Host:</label></td>
+ <td><input type="text" name="accountHost"
id="accountHost" /></td>
+ </tr>
+ <tr>
+ <td><label
for="accountPort">Port:</label></td>
+ <td><input type="text" name="accountPort"
id="accountPort" value="143" /></td>
+ </tr>
+ <tr>
+ <td><label for="accountSSL">Use
SSL?</label></td>
+ <td><input type="checkbox" name="accountSSL"
id="accountSSL" /></td>
+ </tr>
+ <tr>
+ <td><label
for="accountUsername">Username:</label></td>
+ <td><input type="text" name="accountUsername"
id="accountUsername" /></td>
+ </tr>
+ <tr>
+ <td><label
for="accountPassword">Password:</label></td>
+ <td><input type="password" name="accountPassword"
id="accountPassword" /></td>
+ </tr>
+ <tr>
+ <td><label
for="defaultIdentity">Identity:</label></td>
+ <td><select name="defaultIdentity"
id="defaultIdentity" size="1"
onchange="document.App.fillIdentityEditForm();"><option
value="">New...</option></select></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input type="button" id="accountSave"
name="accountSave" value="Save account" /></td>
+ </tr>
+ </table>
+
+ </td>
+
+ <td id="identityEditForm">
+
+ <table cellpadding="5" style="margin-left:20px;">
+ <tr>
+ <td><label
for="identityName">Name:</label></td>
+ <td><input type="text" name="identityName"
id="identityName" /></td>
+ </tr>
+ <tr>
+ <td><label for="identityAddress">Email
Address:</label></td>
+ <td><input type="text" name="identityAddress"
id="identityAddress" /></td>
+ </tr>
+ <tr>
+ <td><label
for="identitySentfolder">Sentfolder:</label></td>
+ <td><select name="accountId" id="accountId"
size="1"></select>
+ <input type="text" name="identitySentfolder"
id="identitySentfolder" style="width:60px;" /></td>
+ </tr>
+ <tr>
+ <td><label for="identitySMTPServer">SMTP
Server:</label></td>
+ <td><input type="text" name="identitySMTPServer"
id="identitySMTPServer" /></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input type="button" id="identitySave"
name="identitySave" value="Save identity" /></td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </div> <!-- fill-slot=layout -->
+ </body>
+</html>
+
+
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Tue
Feb 24 09:04:10 2009
(at)(at) -15,16 +15,20 (at)(at)
app.layout = new YAHOO.widget.Layout({
units: [
{ position: 'top',
- height: 23, body: ''},
+ height: 23,
+ body: ''},
{ position: 'center',
- body: ''},
+ body: ''},
{ position: 'bottom',
- height: 250, resize: true, body: ''}]});
+ height: 250,
+ resize: true,
+ body: 'yui-layout-bottom'}
+ ]});
app.layout.on('render', function() {
+ YAHOO.gocept.webmailer.util.hide('yui-layout-loading');
// Initialize DOM nodes first, as the business models
// rely on them.
app.domNodes.menu = app.layout.getUnitByPosition('top').body;
- app.layout.getUnitByPosition('bottom').body.innerHTML =
'<table><tr><td id="accountEditForm"></td><td
id="identityEditForm></td></tr></table>';
app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
app.domNodes.identity_edit_form =
document.getElementById('identityEditForm');
app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
(at)(at) -41,7 +45,7 (at)(at)
},
fillAccountEditForm: function(account) {
- form = document.App.account_edit_form;
+ var form = document.App.account_edit_form;
form.getControl("accountHost").value = account.host;
form.getControl("accountPort").value = account.port;
if (account.ssl == true) {
(at)(at) -50,11 +54,12 (at)(at)
form.getControl("accountUsername").value = account.user;
form.getControl("accountPassword").value = account.password;
form.getControl("accountURL").value = account.url;
- default_form = form.getControl("defaultIdentity");
+ var default_form = form.getControl("defaultIdentity");
for (i = 0; i < default_form.length; ++i)
if (default_form.options[i].value == account.ident_id)
default_form.options[i].selected = "selected";
document.App.fillIdentityEditForm();
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
loadIdentityEditForm: function() {
(at)(at) -63,9 +68,9 (at)(at)
fillIdentityEditForm: function() {
document.App.loadIdentityEditForm();
- form = document.App.identity_edit_form;
- select =
document.App.account_edit_form.getControl("defaultIdentity");
- identity = select.options[select.selectedIndex]
+ var form = document.App.identity_edit_form;
+ var select =
document.App.account_edit_form.getControl("defaultIdentity");
+ var identity = select.options[select.selectedIndex]
if (identity.value == '') {
return
}
(at)(at) -75,17 +80,18 (at)(at)
form.getControl('identityAddress').value =
identity['address'];
form.getControl('identitySentfolder').value =
identity['sent_folder'];
form.getControl('identitySMTPServer').value =
identity['smtp_server'];
- account_select = form.getControl("accountId");
+ var account_select = form.getControl("accountId");
for (i = 0; i < account_select.length; ++i)
if (account_select.options[i].value ==
identity['account_id'])
account_select.options[i].selected = "selected";
})
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.identity_edit_form);
},
reset: function() {
- document.App.domNodes.account_edit_form.innerHTML = "";
- document.App.domNodes.identity_edit_form.innerHTML = "";
+
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.account_edit_form);
+
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.identity_edit_form);
document.App.menu.delete_button.cfg.setProperty('disabled', true);
document.App.selected_account = null;
}
(at)(at) -213,48 +219,11 (at)(at)
Def(function() {
- // An HTML "template" for the edit form content.
- // XXX: Internet Explorer doesn't know about raw strings
- // find a way to better implement the HTML "template"
- var account_editform_html =
- "<input type=\"hidden\" id=\"accountURL\" name=\"accountURL\" />"
+
- "<table cellpadding=\"5\">" +
- "<tr>" +
- "<td><label
for=\"accountHost\">Host:</label></td>" +
- "<td><input type=\"text\" name=\"accountHost\"
id=\"accountHost\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label
for=\"accountPort\">Port:</label></td>" +
- "<td><input type=\"text\" name=\"accountPort\"
id=\"accountPort\" value=\"143\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label for=\"accountSSL\">Use
SSL?</label></td>" +
- "<td><input type=\"checkbox\" name=\"accountSSL\"
id=\"accountSSL\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label
for=\"accountUsername\">Username:</label></td>" +
- "<td><input type=\"text\" name=\"accountUsername\"
id=\"accountUsername\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label
for=\"accountPassword\">Password:</label></td>" +
- "<td><input type=\"password\" name=\"accountPassword\"
id=\"accountPassword\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label
for=\"defaultIdentity\">Identity:</label></td>" +
- "<td><select name=\"defaultIdentity\"
id=\"defaultIdentity\" size=\"1\"
onchange=\"document.App.fillIdentityEditForm();\"><option
value=\"\">New...</option></select></td>" +
- "</tr>" +
- "<tr>" +
- "<td></td>" +
- "<td><input type=\"button\" id=\"accountSave\"
name=\"accountSave\" value=\"Save account\" /></td>" +
- "</tr>" +
- "</table>";
-
YAHOO.gocept.webmailer.AccountEditForm= Class({
constructor: function() {
var editform = this;
editform.onLoadFinished = new YAHOO.util.CustomEvent(
"onLoadFinished", editform);
- document.App.domNodes.account_edit_form.innerHTML =
account_editform_html;
document.Connection.get(profile_url+'/(at)(at)identities',
function(result) {
var identities = YAHOO.lang.JSON.parse(result.responseText);
(at)(at) -339,7 +308,7 (at)(at)
add_identity: function(ev) {
var addform = this;
- var editform = document.App.account_edit_form
+ var editform = document.App.account_edit_form;
var editurl =
editform.getControl("defaultIdentity").options[editform.getControl("defaultIdentity").selectedIndex].url;
if (!editurl) {
var url = '(at)(at)add-identity?';
(at)(at) -372,40 +341,11 (at)(at)
Def(function() {
- // An HTML "template" for the edit form content.
- // XXX: Internet Explorer doesn't know about raw strings
- // find a way to better implement the HTML "template"
- var identity_addform_html =
- "<table cellpadding=\"5\" style=\"margin-left:20px;\">" +
- "<tr>" +
- "<td><label
for=\"identityName\">Name:</label></td>" +
- "<td><input type=\"text\" name=\"identityName\"
id=\"identityName\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label for=\"identityAddress\">Email
Address:</label></td>" +
- "<td><input type=\"text\" name=\"identityAddress\"
id=\"identityAddress\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label
for=\"identitySentfolder\">Sentfolder:</label></td>" +
- "<td><select name=\"accountId\" id=\"accountId\"
size=\"1\"></select>" +
- " <input type=\"text\" name=\"identitySentfolder\"
id=\"identitySentfolder\" style=\"width:60px;\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td><label for=\"identitySMTPServer\">SMTP
Server:</label></td>" +
- "<td><input type=\"text\" name=\"identitySMTPServer\"
id=\"identitySMTPServer\" /></td>" +
- "</tr>" +
- "<tr>" +
- "<td></td>" +
- "<td><input type=\"button\" id=\"identitySave\"
name=\"identitySave\" value=\"Save identity\" /></td>" +
- "</tr>" +
- "</table>";
-
YAHOO.gocept.webmailer.IdentityEditForm = Class({
constructor: function() {
var addform = this;
addform.onLoadFinished = new YAHOO.util.CustomEvent(
"onLoadFinished", addform);
- document.App.domNodes.identity_edit_form.innerHTML =
identity_addform_html;
document.Connection.get(profile_url+'/(at)(at)accounts',
function(result) {
var accounts = YAHOO.lang.JSON.parse(result.responseText);
for (i=0;i<accounts.length;i++) {
|
SVN: r29291 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 10:44:45 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 10:44:43 2009
New Revision: 29291
Log:
Re #4601: try if clickAndWait has more luck with the ZMI
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Tue Feb 24
10:44:43 2009
(at)(at) -9,7 +9,7 (at)(at)
"""Setup"""
def sharedSetUp(self):
- # don't call super so we don't push another DemoStorage
+ super(Setup, self).sharedSetUp()
# log in
s = self.selenium
(at)(at) -19,13 +19,13 (at)(at)
s.open('http://admin:admin(at)%s/manage_main' %
self.selenium.server)
s.select('name=:action', 'CMF Site')
s.type('name=id', 'selenium')
- s.click('//input[(at)value=" Add "]')
+ s.clickAndWait('//input[(at)value=" Add "]')
# create Webmailer
s.open('/selenium/manage_main')
s.select('name=:action', 'Webmailer')
s.type('name=id', 'webmail')
- s.click('//input[(at)value=" Add "]')
+ s.clickAndWait('//input[(at)value=" Add "]')
# cause /selenium/webmail/admin profile to be created
s.open('/selenium/webmail')
|
SVN: r29292 - in gocept.webmail/trunk/gocept/webmail/browser: . resources tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 10:45:41 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 10:45:39 2009
New Revision: 29292
Log:
Close #4679: restructured yui tests to use o-wrap.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/layout.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js
gocept.webmail/trunk/gocept/webmail/browser/tests/connection.pt
gocept.webmail/trunk/gocept/webmail/browser/tests/dummy.pt
gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt
gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/layout.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/layout.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/layout.pt Tue Feb 24 10:45:39
2009
(at)(at) -8,7 +8,7 (at)(at)
profile nocall:context/(at)(at)profile;
resources view/resources;
yui_base_url string:$resources/yui/build">
- <title metal:define-slot="title"
tal:content="view/title">Portal</title>
+ <title metal:define-slot="title"
tal:content="view/title|default">Portal</title>
<script type="text/javascript" tal:content="string:
var yui_base_url = '$yui_base_url';
(at)(at) -19,6 +19,8 (at)(at)
">
</script>
+ <metal:block define-slot="header" />
+
<script type="text/javascript"
tal:attributes="src string:$yui_base_url/yuiloader/yuiloader-min.js">
</script>
(at)(at) -34,8 +36,6 (at)(at)
<link rel="stylesheet" type="text/css"
tal:attributes="href string:$resources/styles/webmail.css"/>
-
- <metal:block define-slot="headers" />
</head>
<body class="yui-skin-sam" metal:define-slot="body">
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/runner.js Tue Feb 24
10:45:39 2009
(at)(at) -42,6 +42,12 (at)(at)
'datatable', 'menu', 'editor', 'json', 'dragdrop',
'uploader');
+ if (typeof(additional_modules) != "undefined") {
+ for (i = 0; i < additional_modules.length; i++) {
+ modules.push(additional_modules[i]);
+ }
+ }
+
var webmail_modules = new Array('connection', 'composer', 'message',
'draft', 'webmailer', 'management',
'preferences');
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js Tue
Feb 24 10:45:39 2009
(at)(at) -1,13 +1,13 (at)(at)
// gocept test utility code for the webmailer
-// Define our namespace
-YAHOO.namespace('gocept.webmailer');
-
-Assert = YAHOO.util.Assert;
-
function TestCase(test_case) {
- Suite = new YAHOO.tool.TestSuite('yuisuite');
- Suite.add(new YAHOO.tool.TestCase(test_case));
- YAHOO.tool.TestRunner.add(Suite);
- YAHOO.tool.TestManager.load();
+
+ YAHOO.gocept.webmailer.App = Class({
+ constructor: function() {
+ Suite = new YAHOO.tool.TestSuite('yuisuite');
+ Suite.add(new YAHOO.tool.TestCase(test_case));
+ YAHOO.tool.TestRunner.add(Suite);
+ YAHOO.tool.TestManager.load();
+ }
+ });
};
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/connection.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/connection.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/connection.pt Tue Feb 24
10:45:39 2009
(at)(at) -1,43 +1,14 (at)(at)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head
- tal:define="resources view/resources;
- yui_base_url string:${resources}/yui/build;
- profile nocall:context/(at)(at)profile">
-
- <title>Connection Test Suite</title>
-
- <script type="text/javascript" tal:content="string:
- var profile_url = '${profile/absolute_url}';
- ">
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="context/(at)(at)standard_macros/page"
+ >
+ <head>
+ <script type="text/javascript" metal:fill-slot="header">
+ var additional_modules = ['yuitest'];
</script>
-
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/reset-fonts-grids/reset-fonts-grids.css"/>
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/logger/assets/logger.css"/>
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/yuitest/assets/testlogger.css"/>
-
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/container/assets/skins/sam/container.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/menu/assets/skins/sam/menu.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/button/assets/skins/sam/button.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/resize/assets/skins/sam/resize.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/editor/assets/skins/sam/editor.css"/>
-
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/utilities/utilities.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/logger/logger-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/json/json-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/container/container_core-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/menu/menu-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/button/button-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/resize/resize-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/treeview/treeview.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/datasource/datasource.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/yuitest/yuitest.js"></script>
-
- <script type="text/javascript" tal:attributes="src
string:${resources}/utilities.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${resources}/testutilities.js"></script>
-
- <script type="text/javascript" tal:attributes="src
string:${resources}/connection.js"></script>
-
+ </head>
+ <body class="yui-skin-sam" metal:fill-slot="body">
<script type="text/javascript">
TestCase({
test_json_request: function() {
(at)(at) -47,7 +18,7 (at)(at)
function(o) {
var result = YAHOO.lang.JSON.parse(o.responseText)
testrunner.resume(function() {
- Assert.areEqual(
+ YAHOO.util.Assert.areEqual(
0, result['content-type'].indexOf('text/json'));
})
});
(at)(at) -64,7 +35,7 (at)(at)
var result = o.responseText.replace(/<\/?pre>/g, '')
result = YAHOO.lang.JSON.parse(result)
testrunner.resume(function() {
- Assert.areEqual(
+ YAHOO.util.Assert.areEqual(
0,
result['content-type'].indexOf('multipart/form-data'));
})
});
(at)(at) -72,11 +43,9 (at)(at)
},
});
</script>
- </head>
- <body class="yui-skin-sam">
-<form id="testform" method="post" enctype="multipart/form-data">
-<input type="file" name="file"/>
-</form>
+ <form id="testform" method="post" enctype="multipart/form-data">
+ <input type="file" name="file"/>
+ </form>
</body>
</html>
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/dummy.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/dummy.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/dummy.pt Tue Feb 24
10:45:39 2009
(at)(at) -1,52 +1,24 (at)(at)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head
- tal:define="resources view/resources;
- yui_base_url string:${resources}/yui/build;
- profile nocall:context/(at)(at)profile">
-
- <title>Editor Test Suite</title>
-
- <script type="text/javascript" tal:content="string:
- var profile_url = '${profile/absolute_url}';
- ">
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="context/(at)(at)standard_macros/page"
+ >
+ <head>
+ <script type="text/javascript" metal:fill-slot="header">
+ var additional_modules = ['yuitest'];
</script>
-
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/reset-fonts-grids/reset-fonts-grids.css"/>
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/logger/assets/logger.css"/>
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/yuitest/assets/testlogger.css"/>
-
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/container/assets/skins/sam/container.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/menu/assets/skins/sam/menu.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/button/assets/skins/sam/button.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/resize/assets/skins/sam/resize.css"/>
- <link rel="stylesheet" type="text/css" tal:attributes="href
string:${yui_base_url}/editor/assets/skins/sam/editor.css"/>
-
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/utilities/utilities.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/logger/logger-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/container/container_core-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/menu/menu-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/button/button-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/resize/resize-min.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/treeview/treeview.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/datasource/datasource.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/yuitest/yuitest.js"></script>
-
- <script type="text/javascript" tal:attributes="src
string:${resources}/utilities.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${resources}/testutilities.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${resources}/webmailer.js"></script>
-
+ </head>
+ <body class="yui-skin-sam" metal:fill-slot="body">
<script type="text/javascript">
TestCase({
test_tree_init: function() {
var tree = new YAHOO.gocept.webmailer.Tree(
document.getElementById('treebody'));
- Assert.areEqual('', tree.selected_node.foldersUrl);
+ YAHOO.util.Assert.areEqual('', tree.selected_node.foldersUrl);
}
});
</script>
- </head>
- <body class="yui-skin-sam">
+
<div id="treebody">
</div>
</body>
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/index.pt Tue Feb 24
10:45:39 2009
(at)(at) -1,58 +1,57 (at)(at)
-<html>
- <head
- tal:define="resources view/resources;
- yui_base_url string:${resources}/yui/build">
- <title>YUI Library Master Test Page</title>
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/fonts/fonts.css" />
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/logger/assets/logger.css" />
- <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/yuitest/assets/testlogger.css" />
-
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/yahoo/yahoo.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/dom/dom.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/event/event.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/logger/logger.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/json/json.js"></script>
- <script type="text/javascript" tal:attributes="src
string:${yui_base_url}/yuitest/yuitest.js"></script>
+<html
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="context/(at)(at)standard_macros/page"
+ >
+ <head>
+ <metal:block fill-slot="header">
+ <script type="text/javascript">
+ var additional_modules = ['yuitest'];
+ </script>
- <script type="text/javascript" tal:content="string:
- var PAGES = ${view/pages};
- "></script>
+ <link type="text/css" rel="stylesheet" tal:attributes="href
string:${yui_base_url}/yuitest/assets/testlogger.css" />
+
+ <style type="text/css">
+ body { text-align: left !important };
+ </style>
+ </metal:block>
</head>
- <body class="yui-skin-sam">
+ <body class="yui-skin-sam" metal:fill-slot="body">
<h1>YUI Library Master Test Page</h1>
+ <script type="text/javascript" tal:content="string:
+ var test_pages = ${view/pages};
+ "></script>
<script type="text/javascript">
-
- (function() {
- function log(msg) {
- var log = document.getElementById('log-output');
- var n = document.createElement('div');
- n.appendChild(document.createTextNode(msg));
- log.appendChild(n);
- }
-
- var TM = YAHOO.tool.TestManager;
-
- YAHOO.util.Event.onDOMReady(function (){
- YAHOO.tool.TestManager.setPages(PAGES);
-
- TM.subscribe(TM.TEST_MANAGER_COMPLETE_EVENT, function(o) {
- var div = document.createElement('div');
- div.setAttribute('id', 'log-output');
- document.getElementsByTagName('body')[0].appendChild(div);
- log('# of pages passed: ' + o.passedPages.length);
- log('# of pages failed: ' + o.failedPages.length + ': ' +
o.failedPages.join(', '));
- log('# of tests passed: ' + o.passed);
- div.lastChild.setAttribute('id', 'tests-passed');
- log('# of tests failed: ' + o.failed);
- div.lastChild.setAttribute('id', 'tests-failed');
- });
-
- TM.start();
- });
-
- })();
-
+ YAHOO.gocept.webmailer.App = Class({
+ constructor: function() {
+ var self = this;
+ var TM = YAHOO.tool.TestManager;
+
+ YAHOO.tool.TestManager.setPages(test_pages);
+
+ TM.subscribe(TM.TEST_MANAGER_COMPLETE_EVENT, function(o) {
+ var div = document.createElement('div');
+ div.setAttribute('id', 'log-output');
+ document.getElementsByTagName('body')[0].appendChild(div);
+ self.log('# of pages passed: ' + o.passedPages.length);
+ self.log('# of pages failed: ' + o.failedPages.length + ':
' + o.failedPages.join(', '));
+ self.log('# of tests passed: ' + o.passed);
+ div.lastChild.setAttribute('id', 'tests-passed');
+ self.log('# of tests failed: ' + o.failed);
+ div.lastChild.setAttribute('id', 'tests-failed');
+ });
+
+ TM.start();
+ },
+
+ log: function (msg) {
+ var log = document.getElementById('log-output');
+ var n = document.createElement('div');
+ n.appendChild(document.createTextNode(msg));
+ log.appendChild(n);
+ }
+ });
</script>
-
</body>
+
</html>
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/yui.py Tue Feb 24
10:45:39 2009
(at)(at) -10,6 +10,8 (at)(at)
class YUITestSuite(gocept.webmail.browser.webmailer.Module):
"""YUITestSuite"""
+ main_file = 'testutilities.js'
+
def pages(self):
result = []
# XXX: can't use zope.component.getAdapters() because some stuff
|
SVN: r29293 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 10:50:28 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 10:50:27 2009
New Revision: 29293
Log:
we used to have an abbreviation for Assert, but somehow that doesn't play nice
with the yuiloader structure. need to investigate later.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/testutilities.js Tue
Feb 24 10:50:27 2009
(at)(at) -1,5 +1,8 (at)(at)
// gocept test utility code for the webmailer
+// XXX this does not work. why?
+Assert = YAHOO.util.Assert;
+
function TestCase(test_case) {
YAHOO.gocept.webmailer.App = Class({
|
SVN: r29294 - gocept.webmail/trunk/gocept/webmail/browser
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-24 11:04:27 |
[ FULL ]
|
Author: sweh
Date: Tue Feb 24 11:04:25 2009
New Revision: 29294
Log:
- Fix tests.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
Modified: gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt Tue Feb 24
11:04:25 2009
(at)(at) -24,6 +24,7 (at)(at)
>>> browser.url
'http://localhost/webmail/mail/mgr'
>>> print browser.contents
+<html xmlns="http://www.w3.org/1999/xhtml">
<?xml version="1.0" ?>
<!DOCTYPE...
<html class="webmailer">...
|
SVN: r29296 - gocept.webmail/trunk/gocept/webmail/browser
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 11:15:43 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 11:15:42 2009
New Revision: 29296
Log:
remove superfluous html-tag outside the page macro
Modified:
gocept.webmail/trunk/gocept/webmail/browser/layout.pt
Modified: gocept.webmail/trunk/gocept/webmail/browser/layout.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/layout.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/layout.pt Tue Feb 24 11:15:42
2009
(at)(at) -1,4 +1,3 (at)(at)
-<html xmlns="http://www.w3.org/1999/xhtml">
<metal:macro define-macro="page"><?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="webmailer">
(at)(at) -47,4 +46,4 (at)(at)
</body>
</html>
-</metal:macro></html>
+</metal:macro>
|
SVN: r29297 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-24 11:37:52 |
[ FULL ]
|
Author: wosc
Date: Tue Feb 24 11:37:50 2009
New Revision: 29297
Log:
fix display of account+identity form. The forms should not only be displayed
when editing an account, but also when adding a new one.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Tue
Feb 24 11:37:50 2009
(at)(at) -42,6 +42,7 (at)(at)
loadAccountEditForm: function() {
document.App.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
document.App.loadIdentityEditForm();
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
fillAccountEditForm: function(account) {
(at)(at) -59,11 +60,11 (at)(at)
if (default_form.options[i].value == account.ident_id)
default_form.options[i].selected = "selected";
document.App.fillIdentityEditForm();
-
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
loadIdentityEditForm: function() {
document.App.identity_edit_form = new
YAHOO.gocept.webmailer.IdentityEditForm();
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.identity_edit_form);
},
fillIdentityEditForm: function() {
(at)(at) -86,7 +87,6 (at)(at)
account_select.options[i].selected = "selected";
})
-
YAHOO.gocept.webmailer.util.show(document.App.domNodes.identity_edit_form);
},
reset: function() {
|
SVN: r29298 - gocept.webmail/trunk/gocept/webmail/browser
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-24 16:02:18 |
[ FULL ]
|
Author: sweh
Date: Tue Feb 24 16:01:33 2009
New Revision: 29298
Log:
- Fix tests.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
Modified: gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/webmailer.txt Tue Feb 24
16:01:33 2009
(at)(at) -24,7 +24,6 (at)(at)
>>> browser.url
'http://localhost/webmail/mail/mgr'
>>> print browser.contents
-<html xmlns="http://www.w3.org/1999/xhtml">
<?xml version="1.0" ?>
<!DOCTYPE...
<html class="webmailer">...
|
SVN: r29301 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-24 18:56:04 |
[ FULL ]
|
Author: thomas
Date: Tue Feb 24 18:56:02 2009
New Revision: 29301
Log:
simplified account management, determine and store Sent folder in a meaningful
way; needs some refactoring, though
Modified:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/management.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Tue Feb 24
18:56:02 2009
(at)(at) -7,12 +7,10 (at)(at)
<div metal:fill-slot="layout">
<div id="yui-layout-bottom">
- <table>
- <tr>
- <td id="accountEditForm">
-
- <input type="hidden" id="accountURL" name="accountURL" />
- <table cellpadding="5">
+ <div id="accountEditForm">
+ <input type="hidden" id="accountURL" name="accountURL" />
+ <table cellpadding="5">
+ <tbody>
<tr>
<td><label
for="accountHost">Host:</label></td>
<td><input type="text" name="accountHost"
id="accountHost" /></td>
(at)(at) -34,21 +32,11 (at)(at)
<td><input type="password" name="accountPassword"
id="accountPassword" /></td>
</tr>
<tr>
- <td><label
for="defaultIdentity">Identity:</label></td>
- <td><select name="defaultIdentity"
id="defaultIdentity" size="1"
onchange="document.App.fillIdentityEditForm();"><option
value="">New...</option></select></td>
+ <td><label for="accountSentFolderDisplay">"Sent"
folder:</label></td>
+ <td><input type="text"
name="accountSentFolderDisplay" id="accountSentFolderDisplay"
disabled="disabled" />
+ <input type="hidden" name="accountSentFolder"
id="accountSentFolder" /></td>
</tr>
<tr>
- <td></td>
- <td><input type="button" id="accountSave"
name="accountSave" value="Save account" /></td>
- </tr>
- </table>
-
- </td>
-
- <td id="identityEditForm">
-
- <table cellpadding="5" style="margin-left:20px;">
- <tr>
<td><label
for="identityName">Name:</label></td>
<td><input type="text" name="identityName"
id="identityName" /></td>
</tr>
(at)(at) -57,23 +45,15 (at)(at)
<td><input type="text" name="identityAddress"
id="identityAddress" /></td>
</tr>
<tr>
- <td><label
for="identitySentfolder">Sentfolder:</label></td>
- <td><select name="accountId" id="accountId"
size="1"></select>
- <input type="text" name="identitySentfolder"
id="identitySentfolder" style="width:60px;" /></td>
- </tr>
- <tr>
- <td><label for="identitySMTPServer">SMTP
Server:</label></td>
- <td><input type="text" name="identitySMTPServer"
id="identitySMTPServer" /></td>
- </tr>
- <tr>
<td></td>
- <td><input type="button" id="identitySave"
name="identitySave" value="Save identity" /></td>
+ <td><input type="button" id="accountSave"
name="accountSave" value="Save" /></td>
</tr>
- </table>
+ </tbody>
+ </table>
+ </div>
- </td>
- </tr>
- </table>
+ <div id="sentFolderTree">
+ </div>
</div>
</div> <!-- fill-slot=layout -->
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Tue
Feb 24 18:56:02 2009
(at)(at) -30,7 +30,7 (at)(at)
// rely on them.
app.domNodes.menu = app.layout.getUnitByPosition('top').body;
app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
- app.domNodes.identity_edit_form =
document.getElementById('identityEditForm');
+ app.domNodes.sent_folder_tree =
document.getElementById('sentFolderTree');
app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
app.menu = new YAHOO.gocept.webmailer.ManagementMenu();
(at)(at) -41,7 +41,6 (at)(at)
loadAccountEditForm: function() {
document.App.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
- document.App.loadIdentityEditForm();
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
(at)(at) -54,44 +53,18 (at)(at)
}
form.getControl("accountUsername").value = account.user;
form.getControl("accountPassword").value = account.password;
+ form.getControl("accountSentFolderDisplay").value =
account.sent_folder[account.sent_folder.length-1];
+ form.getControl("accountSentFolder").value =
account.sent_folder.join('\n');
form.getControl("accountURL").value = account.url;
- var default_form = form.getControl("defaultIdentity");
- for (i = 0; i < default_form.length; ++i)
- if (default_form.options[i].value == account.ident_id)
- default_form.options[i].selected = "selected";
- document.App.fillIdentityEditForm();
- },
-
- loadIdentityEditForm: function() {
- document.App.identity_edit_form = new
YAHOO.gocept.webmailer.IdentityEditForm();
-
YAHOO.gocept.webmailer.util.show(document.App.domNodes.identity_edit_form);
- },
-
- fillIdentityEditForm: function() {
- document.App.loadIdentityEditForm();
- var form = document.App.identity_edit_form;
- var select =
document.App.account_edit_form.getControl("defaultIdentity");
- var identity = select.options[select.selectedIndex]
- if (identity.value == '') {
- return
- }
- document.Connection.get(identity.url + '/(at)(at)get',
function(result) {
- var identity = YAHOO.lang.JSON.parse(result.responseText);
- form.getControl('identityName').value = identity['name'];
- form.getControl('identityAddress').value =
identity['address'];
- form.getControl('identitySentfolder').value =
identity['sent_folder'];
- form.getControl('identitySMTPServer').value =
identity['smtp_server'];
- var account_select = form.getControl("accountId");
- for (i = 0; i < account_select.length; ++i)
- if (account_select.options[i].value ==
identity['account_id'])
- account_select.options[i].selected = "selected";
-
- })
+ form.getControl("identityName").value = account.name;
+ form.getControl("identityAddress").value = account.address;
+ new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_tree);
},
reset: function() {
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.account_edit_form);
-
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.identity_edit_form);
+
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.sent_folder_tree);
document.App.menu.delete_button.cfg.setProperty('disabled', true);
document.App.selected_account = null;
}
(at)(at) -200,9 +173,7 (at)(at)
if (!data['fixed']) {
document.App.selected_account = account;
document.App.loadAccountEditForm();
-
document.App.account_edit_form.onLoadFinished.subscribe(function () {
-
document.App.fillAccountEditForm(document.App.selected_account);
- });
+
document.App.fillAccountEditForm(document.App.selected_account);
} else {
document.App.reset();
}
(at)(at) -222,25 +193,8 (at)(at)
YAHOO.gocept.webmailer.AccountEditForm= Class({
constructor: function() {
var editform = this;
- editform.onLoadFinished = new YAHOO.util.CustomEvent(
- "onLoadFinished", editform);
-
- document.Connection.get(profile_url+'/(at)(at)identities',
function(result) {
- var identities = YAHOO.lang.JSON.parse(result.responseText);
- for (i=0;i<identities.length;i++) {
- var identity = document.createElement('option');
- identity.value = identities[i]['id'];
- identity.url = identities[i]['url'];
- identity.innerHTML = identities[i]['from'];
-
editform.getControl('defaultIdentity').appendChild(identity);
- };
- editform.onLoadFinished.fire();
- });
-
YAHOO.util.Event.addListener(
editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
- YAHOO.util.Event.addListener(
- editform.getControl('loadIdentityEditForm'), 'click',
document.App.loadIdentityEditForm, editform, true);
},
get: function(key) {
(at)(at) -266,10 +220,6 (at)(at)
alert('Please enter the password.');
return false
}
- if (editform.get('defaultIdentity') == "") {
- alert('Please save the new identity or select an existing
one.');
- return false
- }
return true
},
(at)(at) -277,12 +227,14 (at)(at)
_prepare_data: function() {
var editform = this;
var data = {
- default_identity: editform.get('defaultIdentity'),
- imap_server: {host: editform.get('accountHost'),
- port: new Number(editform.get('accountPort')),
- ssl:
document.getElementById('accountSSL').checked,
- user: editform.get('accountUsername'),
- password: editform.get('accountPassword')}};
+ host: editform.get('accountHost'),
+ port: new Number(editform.get('accountPort')),
+ ssl: document.getElementById('accountSSL').checked,
+ user: editform.get('accountUsername'),
+ password: editform.get('accountPassword'),
+ sent_folder: editform.get('accountSentFolder').split('\n'),
+ name: editform.get('identityName'),
+ address: editform.get('identityAddress')};
return data;
},
(at)(at) -306,102 +258,99 (at)(at)
});
},
- add_identity: function(ev) {
- var addform = this;
- var editform = document.App.account_edit_form;
- var editurl =
editform.getControl("defaultIdentity").options[editform.getControl("defaultIdentity").selectedIndex].url;
- if (!editurl) {
- var url = '(at)(at)add-identity?';
- } else {
- var url = editurl + '/(at)(at)edit';
- }
-
- if (!addform._check_data())
- return
-
- document.Connection.post(url, addform._prepare_data(),
- function(result) {
- if (!editurl) {
- var identity =
YAHOO.lang.JSON.parse(result.responseText);
- var identity_option =
document.createElement('option');
- identity_option.value = identity['id'];
- identity_option.innerHTML = identity['from'];
-
editform.getControl('defaultIdentity').appendChild(identity_option);
- editform.getControl('defaultIdentity').selectedIndex =
editform.getControl('defaultIdentity').options.length - 1
- }
- });
- },
-
getControl: function(name) {
return document.getElementById(name);
}
});
});
-
+//
+// The `Sent' folder selection tree
+//
Def(function() {
- YAHOO.gocept.webmailer.IdentityEditForm = Class({
- constructor: function() {
- var addform = this;
- addform.onLoadFinished = new YAHOO.util.CustomEvent(
- "onLoadFinished", addform);
- document.Connection.get(profile_url+'/(at)(at)accounts',
function(result) {
- var accounts = YAHOO.lang.JSON.parse(result.responseText);
- for (i=0;i<accounts.length;i++) {
- var account = document.createElement('option');
- account.value =
accounts[i]['user']+'-'+accounts[i]['host'];
- account.innerHTML =
accounts[i]['user']+'(at)'+accounts[i]['host'];
- addform.getControl('accountId').appendChild(account);
- };
- addform.onLoadFinished.fire();
+ var responseSchema = {
+ resultsList: "result",
+ fields: [{key: "url"},
+ {key: "name"},
+ {key: "names"},
+ {key: "children"},
+ {key: "type"}]
+ };
+
+ YAHOO.gocept.webmailer.SentFolderTree = Class({
+ constructor: function(treebody) {
+ var tree = this;
+ tree.treeview = new YAHOO.widget.TreeView(treebody);
+ tree.treeview.setDynamicLoad(function(node)
{tree.loadNodeData(node);});
+ var root = tree.treeview.getRoot();
+ tree.selected_node = root;
+
+ // Load dynamic tree entries
+ var account = document.App.selected_account
+ root.url = account.url;
+ tree.loadNodeData(root);
+ tree.treeview.subscribe('clickEvent', function(event) {
+ // do not expand the node
+ if (event.node.list_type == "inbox") {
+ return false;
+ }
+ return true;
+ });
+ tree.treeview.subscribe('labelClick', function(node) {
+ document.getElementById('accountSentFolderDisplay').value =
node.data.label;
+ document.getElementById('accountSentFolder').value =
node.names.join('\n');
});
-
- YAHOO.util.Event.addListener(
- addform.getControl('identitySave'), 'click',
document.App.account_edit_form.add_identity, addform, true);
-
- },
-
- _check_data: function() {
- var addform = this;
- if (addform.get('identityName') == "") {
- alert('Please enter your name.');
- return false;
- }
- if (addform.get('identityAddress') == "") {
- alert('Please enter your email address.');
- return false
- }
- if (addform.get('identitySentfolder') == "") {
- alert('Please enter a sent folder.');
- return false
- }
- if (addform.get('identitySMTPServer') == "") {
- alert('Please enter your mailhost.');
- return false
- }
- return true
-
},
- _prepare_data: function() {
- var addform = this;
- var data = {
- account_id: addform.get('accountId'),
- smtp_server: addform.get('identitySMTPServer'),
- identity: {name: addform.get('identityName'),
- address: addform.get('identityAddress'),
- sent_folder: addform.get('identitySentfolder')}};
- return data;
- },
+ loadNodeData: function (node) {
+ var callback = {
+ success: function(request, response, args) {
+ var subfolders = [];
+ for (var i=0, j=response.results.length; i<j; i++) {
+ subfolders[subfolders.length] = {
+ 'name': response.results[i].name,
+ 'names': response.results[i].names,
+ 'children': response.results[i].children,
+ 'url': response.results[i].url,
+ 'type': response.results[i].type
+ };
+ }
+ this.fillFolders(node, subfolders);
+ node.loadComplete();
+ },
+ failure: function(request, response, args) {
+ // Log an error
+ this.fillFolders(node, []);
+ node.loadComplete();
+ },
+ scope: this,
+ argument: encodeURI(node.label)
+ };
+ var url = node.url + "/(at)(at)folders";
- get: function(key) {
- var addform = this;
- return addform.getControl(key).value;
+ data_source = new YAHOO.util.XHRDataSource(url);
+ data_source.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
+ data_source.responseSchema = responseSchema;
+ // Workaround for YUI bug # 214964
+ data_source.doBeforeParseData = function (oRequest, oFullResponse,
oCallback) {
+ return {result:oFullResponse};
+ };
+ data_source.responseSchema = responseSchema;
+ data_source.sendRequest('', callback);
},
- getControl: function(name) {
- return document.getElementById(name);
+ fillFolders: function(node, children) {
+ for (var i=0, j=children.length; i<j; i++) {
+ var tempNode = new YAHOO.widget.TextNode(children[i]['name'],
+ node, false);
+ tempNode.names = children[i]['names'];
+ tempNode.url = children[i]['url'];
+ tempNode.list_type = children[i]['type'];
+ if (children[i]["children"] == "0")
+ tempNode.isLeaf = true;
+ }
+ node.tree.draw();
}
});
});
|
SVN: r29306 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-25 11:11:05 |
[ FULL ]
|
Author: thomas
Date: Wed Feb 25 11:11:04 2009
New Revision: 29306
Log:
cleaned up when to instantiate and reset the account edit form
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Wed
Feb 25 11:11:04 2009
(at)(at) -31,16 +31,18 (at)(at)
app.domNodes.menu = app.layout.getUnitByPosition('top').body;
app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
app.domNodes.sent_folder_tree =
document.getElementById('sentFolderTree');
+ app.domNodes.sent_folder_selection =
document.getElementById('sentFolderSelection')
app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
app.menu = new YAHOO.gocept.webmailer.ManagementMenu();
app.account_list = new YAHOO.gocept.webmailer.AccountList();
+ app.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
});
app.layout.render();
},
loadAccountEditForm: function() {
- document.App.account_edit_form = new
YAHOO.gocept.webmailer.AccountEditForm();
+ document.App.account_edit_form.reset();
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
(at)(at) -59,12 +61,12 (at)(at)
form.getControl("identityName").value = account.name;
form.getControl("identityAddress").value = account.address;
new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
-
YAHOO.gocept.webmailer.util.show(document.getElementById('sentFolderSelection'));
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_selection);
},
reset: function() {
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.account_edit_form);
-
YAHOO.gocept.webmailer.util.hide(document.getElementById('sentFolderSelection'));
+
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.sent_folder_selection);
document.App.menu.delete_button.cfg.setProperty('disabled', true);
document.App.selected_account = null;
}
(at)(at) -79,7 +81,10 (at)(at)
var menu = this;
menu.menubar = new YAHOO.widget.MenuBar("top");
menu.menubar.render(document.App.domNodes.menu);
- menu.addMenuItem('New', document.App.loadAccountEditForm);
+ menu.addMenuItem('New', function() {
+ document.App.reset();
+ document.App.loadAccountEditForm();
+ });
menu.delete_button = menu.addMenuItem('Delete', function() {
var url = document.App.selected_account.url +
'/(at)(at)delete';
document.Connection.post(url, null, function(result) {
(at)(at) -193,6 +198,12 (at)(at)
YAHOO.gocept.webmailer.AccountEditForm= Class({
constructor: function() {
var editform = this;
+ editform.originalHTML =
document.App.domNodes.account_edit_form.innerHTML;
+ },
+
+ reset: function() {
+ var editform = this;
+ document.App.domNodes.account_edit_form.innerHTML =
editform.originalHTML;
YAHOO.util.Event.addListener(
editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
},
|
SVN: r29309 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-25 12:50:17 |
[ FULL ]
|
Author: thomas
Date: Wed Feb 25 12:50:16 2009
New Revision: 29309
Log:
allow for saving an account before all data is complete
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Wed
Feb 25 12:50:16 2009
(at)(at) -213,28 +213,6 (at)(at)
return editform.getControl(key).value;
},
- _check_data: function() {
- var editform = this;
- if (editform.get('accountHost') == "") {
- alert('Please enter the host.');
- return false;
- }
- if (editform.get('accountPort') == "") {
- alert('Please enter the port.');
- return false
- }
- if (editform.get('accountUsername') == "") {
- alert('Please enter the username.');
- return false
- }
- if (editform.get('accountPassword') == "") {
- alert('Please enter the password.');
- return false
- }
- return true
-
- },
-
_prepare_data: function() {
var editform = this;
var data = {
(at)(at) -251,8 +229,6 (at)(at)
save_account: function(ev) {
var editform = this;
- if (!editform._check_data())
- return
if (editform.get('accountURL')) {
var url = editform.get('accountURL') + '/(at)(at)edit';
} else {
|
SVN: r29310 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-25 12:55:05 |
[ FULL ]
|
Author: thomas
Date: Wed Feb 25 12:55:04 2009
New Revision: 29310
Log:
don't try to show a Sent folder selection tree for a broken account
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Wed
Feb 25 12:55:04 2009
(at)(at) -60,8 +60,10 (at)(at)
form.getControl("accountURL").value = account.url;
form.getControl("identityName").value = account.name;
form.getControl("identityAddress").value = account.address;
- new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
-
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_selection);
+ if (account.status == "ok") {
+ new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
+
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_selection);
+ };
},
reset: function() {
(at)(at) -175,12 +177,11 (at)(at)
account[key] = data[key];
}
+ document.App.reset();
if (!data['fixed']) {
document.App.selected_account = account;
document.App.loadAccountEditForm();
document.App.fillAccountEditForm(document.App.selected_account);
- } else {
- document.App.reset();
}
});
table.subscribe("rowUnselectEvent", function(event) {
|
SVN: r29311 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-25 13:19:22 |
[ FULL ]
|
Author: thomas
Date: Wed Feb 25 13:19:21 2009
New Revision: 29311
Log:
fixed disabling of the 'Delete' button that was broken by the previous revision
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Wed
Feb 25 13:19:21 2009
(at)(at) -169,7 +169,7 (at)(at)
table.set("selectionMode", "standard");
table.subscribe("rowClickEvent", table.onEventSelectRow);
table.subscribe("rowSelectEvent", function(event) {
- document.App.menu.delete_button.cfg.setProperty('disabled',
false);
+ document.App.reset();
var account = new Object();
var data = event.record.getData();
(at)(at) -177,11 +177,11 (at)(at)
account[key] = data[key];
}
- document.App.reset();
if (!data['fixed']) {
document.App.selected_account = account;
document.App.loadAccountEditForm();
document.App.fillAccountEditForm(document.App.selected_account);
+
document.App.menu.delete_button.cfg.setProperty('disabled', false);
}
});
table.subscribe("rowUnselectEvent", function(event) {
|
SVN: r29315 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-25 15:38:31 |
[ FULL ]
|
Author: sweh
Date: Wed Feb 25 15:38:30 2009
New Revision: 29315
Log:
- Reset the sent folder when switching between editable accounts.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Wed
Feb 25 15:38:30 2009
(at)(at) -205,6 +205,8 (at)(at)
reset: function() {
var editform = this;
document.App.domNodes.account_edit_form.innerHTML =
editform.originalHTML;
+ document.getElementById('accountSentFolderDisplay').value = ''
+ document.getElementById('accountSentFolder').value = ''
YAHOO.util.Event.addListener(
editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
},
|
SVN: r29320 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 09:30:41 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 09:30:39 2009
New Revision: 29320
Log:
manage SMTP access data
Modified:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
gocept.webmail/trunk/gocept/webmail/browser/webmailer.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/management.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Thu Feb 26
09:30:39 2009
(at)(at) -40,6 +40,22 (at)(at)
<td><input type="text" name="identityAddress"
id="identityAddress" /></td>
</tr>
<tr>
+ <td><label for="smtpHost">SMTP
host:</label></td>
+ <td><input type="text" name="smtpHost" id="smtpHost"
/></td>
+ </tr>
+ <tr>
+ <td><label for="smtpPort">SMTP
port:</label></td>
+ <td><input type="text" name="smtpPort" id="smtpPort"
value="25" /></td>
+ </tr>
+ <tr>
+ <td><label for="smtpUser">SMTP
user:</label></td>
+ <td><input type="text" name="smtpUser" id="smtpUser"
/></td>
+ </tr>
+ <tr>
+ <td><label for="smtpPassword">SMTP
password:</label></td>
+ <td><input type="password" name="smtpPassword"
id="smtpPassword" /></td>
+ </tr>
+ <tr>
<td></td>
<td><input type="button" id="accountSave"
name="accountSave" value="Save" /></td>
</tr>
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 09:30:39 2009
(at)(at) -60,6 +60,10 (at)(at)
form.getControl("accountURL").value = account.url;
form.getControl("identityName").value = account.name;
form.getControl("identityAddress").value = account.address;
+ form.getControl("smtpHost").value = account.smtp_host;
+ form.getControl("smtpPort").value = account.smtp_port;
+ form.getControl("smtpUser").value = account.smtp_user;
+ form.getControl("smtpPassword").value = account.smtp_password;
if (account.status == "ok") {
new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_selection);
(at)(at) -141,9 +145,11 (at)(at)
{key: "password"},
{key: "name"},
{key: "address"},
- {key: "ident_id"},
{key: "sent_folder"},
- {key: "smtp_server"},
+ {key: "smtp_host"},
+ {key: "smtp_port"},
+ {key: "smtp_user"},
+ {key: "smtp_password"},
{key: "fixed"}
]
};
(at)(at) -226,7 +232,11 (at)(at)
password: editform.get('accountPassword'),
sent_folder: editform.get('accountSentFolder').split('\n'),
name: editform.get('identityName'),
- address: editform.get('identityAddress')};
+ address: editform.get('identityAddress'),
+ smtp_host: editform.get('smtpHost'),
+ smtp_port: editform.get('smtpPort'),
+ smtp_user: editform.get('smtpUser'),
+ smtp_password: editform.get('smtpPassword')};
return data;
},
Modified: gocept.webmail/trunk/gocept/webmail/browser/webmailer.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/webmailer.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/webmailer.py Thu Feb 26
09:30:39 2009
(at)(at) -27,8 +27,6 (at)(at)
profile = gocept.restmail.profile.Profile(user)
self.context._setObject(user, profile)
profile = self.context.aq_inner[user]
- profile.manage_addProduct['MailHost'].manage_addMailHost(
- 'default-smtp') #XXX this is the wrong place for this
return profile
|
SVN: r29322 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 09:34:41 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 09:34:40 2009
New Revision: 29322
Log:
no longer send the password to the UI when editing an account, fixes #4714
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 09:34:40 2009
(at)(at) -54,7 +54,9 (at)(at)
form.getControl("accountSSL").checked = "checked";
}
form.getControl("accountUsername").value = account.user;
- form.getControl("accountPassword").value = account.password;
+ if (account.password) {
+ form.getControl("accountPassword").value = "XXXXXXXX";
+ };
form.getControl("accountSentFolderDisplay").value =
account.sent_folder[account.sent_folder.length-1];
form.getControl("accountSentFolder").value =
account.sent_folder.join('\n');
form.getControl("accountURL").value = account.url;
(at)(at) -63,7 +65,9 (at)(at)
form.getControl("smtpHost").value = account.smtp_host;
form.getControl("smtpPort").value = account.smtp_port;
form.getControl("smtpUser").value = account.smtp_user;
- form.getControl("smtpPassword").value = account.smtp_password;
+ if (account.smtp_password) {
+ form.getControl("smtpPassword").value = "XXXXXXXX";
+ };
if (account.status == "ok") {
new
YAHOO.gocept.webmailer.SentFolderTree(document.App.domNodes.sent_folder_tree);
YAHOO.gocept.webmailer.util.show(document.App.domNodes.sent_folder_selection);
(at)(at) -213,8 +217,18 (at)(at)
document.App.domNodes.account_edit_form.innerHTML =
editform.originalHTML;
document.getElementById('accountSentFolderDisplay').value = ''
document.getElementById('accountSentFolder').value = ''
+ editform.account_password_changed = false;
+ editform.smtp_password_changed = false;
YAHOO.util.Event.addListener(
editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
+ YAHOO.util.Event.addListener(
+ editform.getControl('accountPassword'), 'change', function ()
{
+ editform.account_password_changed=true;
+ });
+ YAHOO.util.Event.addListener(
+ editform.getControl('smtpPassword'), 'change', function () {
+ editform.smtp_password_changed=true;
+ });
},
get: function(key) {
(at)(at) -229,14 +243,18 (at)(at)
port: new Number(editform.get('accountPort')),
ssl: document.getElementById('accountSSL').checked,
user: editform.get('accountUsername'),
- password: editform.get('accountPassword'),
sent_folder: editform.get('accountSentFolder').split('\n'),
name: editform.get('identityName'),
address: editform.get('identityAddress'),
smtp_host: editform.get('smtpHost'),
smtp_port: editform.get('smtpPort'),
- smtp_user: editform.get('smtpUser'),
- smtp_password: editform.get('smtpPassword')};
+ smtp_user: editform.get('smtpUser')}
+ if (editform.account_password_changed) {
+ data['password'] = editform.get('accountPassword');
+ };
+ if (editform.smtp_password_changed) {
+ data['smtp_password'] = editform.get('smtpPassword');
+ };
return data;
},
|
SVN: r29324 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 10:11:20 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 10:11:18 2009
New Revision: 29324
Log:
- improved layout of the management UI
- temporarily moved menu bar to the bottom, we have a bug about moving those
menu buttons anyway
Modified:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/management.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Thu Feb 26
10:11:18 2009
(at)(at) -6,39 +6,41 (at)(at)
<body>
<div metal:fill-slot="layout">
- <div id="yui-layout-bottom">
+ <div id="yui-layout-center">
<div id="accountEditForm">
<input type="hidden" id="accountURL" name="accountURL" />
<table cellpadding="5">
<tbody>
<tr>
- <td><label
for="accountHost">Host:</label></td>
- <td><input type="text" name="accountHost"
id="accountHost" /></td>
+ <td><label
for="identityName">Name:</label></td>
+ <td><input type="text" name="identityName"
id="identityName" /></td>
</tr>
<tr>
- <td><label
for="accountPort">Port:</label></td>
- <td><input type="text" name="accountPort"
id="accountPort" value="143" /></td>
+ <td><label for="identityAddress">Email
Address:</label></td>
+ <td><input type="text" name="identityAddress"
id="identityAddress" /></td>
</tr>
+ <tr><td colspan="2"><hr
/></td></tr>
<tr>
- <td><label for="accountSSL">Use
SSL?</label></td>
- <td><input type="checkbox" name="accountSSL"
id="accountSSL" /></td>
+ <td><label for="accountHost">IMAP
host:</label></td>
+ <td><input type="text" name="accountHost"
id="accountHost" /></td>
</tr>
<tr>
- <td><label
for="accountUsername">Username:</label></td>
- <td><input type="text" name="accountUsername"
id="accountUsername" /></td>
+ <td><label for="accountPort">IMAP
port:</label></td>
+ <td><input type="text" name="accountPort"
id="accountPort" value="143" /></td>
</tr>
<tr>
- <td><label
for="accountPassword">Password:</label></td>
- <td><input type="password" name="accountPassword"
id="accountPassword" /></td>
+ <td><label for="accountUsername">IMAP
user:</label></td>
+ <td><input type="text" name="accountUsername"
id="accountUsername" /></td>
</tr>
<tr>
- <td><label
for="identityName">Name:</label></td>
- <td><input type="text" name="identityName"
id="identityName" /></td>
+ <td><label for="accountPassword">IMAP
password:</label></td>
+ <td><input type="password" name="accountPassword"
id="accountPassword" /></td>
</tr>
<tr>
- <td><label for="identityAddress">Email
Address:</label></td>
- <td><input type="text" name="identityAddress"
id="identityAddress" /></td>
+ <td><label for="accountSSL">IMAP: use
SSL?</label></td>
+ <td><input type="checkbox" name="accountSSL"
id="accountSSL" /></td>
</tr>
+ <tr><td colspan="2"><hr
/></td></tr>
<tr>
<td><label for="smtpHost">SMTP
host:</label></td>
<td><input type="text" name="smtpHost" id="smtpHost"
/></td>
(at)(at) -55,10 +57,6 (at)(at)
<td><label for="smtpPassword">SMTP
password:</label></td>
<td><input type="password" name="smtpPassword"
id="smtpPassword" /></td>
</tr>
- <tr>
- <td></td>
- <td><input type="button" id="accountSave"
name="accountSave" value="Save" /></td>
- </tr>
</tbody>
</table>
</div>
(at)(at) -77,5 +75,3 (at)(at)
</div> <!-- fill-slot=layout -->
</body>
</html>
-
-
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 10:11:18 2009
(at)(at) -15,24 +15,25 (at)(at)
app.layout = new YAHOO.widget.Layout({
units: [
{ position: 'top',
- height: 23,
+ height: 150,
+ resize: true,
body: ''},
{ position: 'center',
- body: ''},
+ scroll: true,
+ body: 'yui-layout-center'},
{ position: 'bottom',
- height: 250,
- resize: true,
- body: 'yui-layout-bottom'}
+ height: 25,
+ body: ''}
]});
app.layout.on('render', function() {
YAHOO.gocept.webmailer.util.hide('yui-layout-loading');
// Initialize DOM nodes first, as the business models
// rely on them.
- app.domNodes.menu = app.layout.getUnitByPosition('top').body;
+ app.domNodes.account_list =
app.layout.getUnitByPosition('top').body;
app.domNodes.account_edit_form =
document.getElementById('accountEditForm');
app.domNodes.sent_folder_tree =
document.getElementById('sentFolderTree');
app.domNodes.sent_folder_selection =
document.getElementById('sentFolderSelection')
- app.domNodes.account_list =
app.layout.getUnitByPosition('center').body;
+ app.domNodes.menu =
app.layout.getUnitByPosition('bottom').body;
app.menu = new YAHOO.gocept.webmailer.ManagementMenu();
app.account_list = new YAHOO.gocept.webmailer.AccountList();
(at)(at) -43,6 +44,7 (at)(at)
loadAccountEditForm: function() {
document.App.account_edit_form.reset();
+ document.App.menu.save_button.cfg.setProperty('disabled', false);
YAHOO.gocept.webmailer.util.show(document.App.domNodes.account_edit_form);
},
(at)(at) -78,6 +80,7 (at)(at)
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.account_edit_form);
YAHOO.gocept.webmailer.util.hide(document.App.domNodes.sent_folder_selection);
document.App.menu.delete_button.cfg.setProperty('disabled', true);
+ document.App.menu.save_button.cfg.setProperty('disabled', true);
document.App.selected_account = null;
}
});
(at)(at) -106,6 +109,10 (at)(at)
})
});
menu.delete_button.cfg.setProperty('disabled', true);
+ menu.save_button = menu.addMenuItem('Save', function () {
+ document.App.account_edit_form.save_account();
+ });
+ menu.save_button.cfg.setProperty('disabled', true);
menu.menubar.show();
},
(at)(at) -175,7 +182,7 (at)(at)
document.App.domNodes.account_list,
columns,
data_source,
- {scrollable: true, height:"200px"});
+ {scrollable: true});
table.set("selectionMode", "standard");
table.subscribe("rowClickEvent", table.onEventSelectRow);
table.subscribe("rowSelectEvent", function(event) {
(at)(at) -220,8 +227,6 (at)(at)
editform.account_password_changed = false;
editform.smtp_password_changed = false;
YAHOO.util.Event.addListener(
- editform.getControl('accountSave'), 'click',
editform.save_account, editform, true);
- YAHOO.util.Event.addListener(
editform.getControl('accountPassword'), 'change', function ()
{
editform.account_password_changed=true;
});
|
SVN: r29325 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-26 10:13:10 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 26 10:13:09 2009
New Revision: 29325
Log:
whitespace
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Thu Feb 26
10:13:09 2009
(at)(at) -1,10 +1,10 (at)(at)
//
-// PATCH: Added to ensure only tasks with non-zero iterations are added
+// PATCH: Added to ensure only tasks with non-zero iterations are added
// refer to http://yuilibrary.com/projects/yui2/ticket/2286608
//
YAHOO.util.Chain.prototype.add = function(c) {
- if (c.iterations !== 0) {
+ if (c.iterations !== 0) {
this.q.push(c);
return this;
};
(at)(at) -62,14 +62,14 (at)(at)
list_type = folder.list_type;
document.App.preview_pane.reset();
-
+
try {
config = YAHOO.gocept.webmailer['list-'+list_type](url);
}
catch(err) {
return
}
-
+
init_sort = document.App.preferences.data['sort'];
if (!init_sort) {
|
SVN: r29329 - gocept.webmail/trunk/gocept/webmail/browser/tests
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-26 11:19:49 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 26 11:19:47 2009
New Revision: 29329
Log:
Re #4713: wrote selenium test to reproduce draft folder error
Added:
gocept.webmail/trunk/gocept/webmail/browser/tests/draft.py
Modified:
gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/configure.zcml Thu Feb 26
11:19:47 2009
(at)(at) -15,16 +15,16 (at)(at)
permission="zope2.View"
/>
- <adapter
- name="gocept.webmail.browser.tests.selenium.SimpleTest"
- factory=".selenium.SimpleTest"
+ <adapter
+ name="gocept.webmail.browser.tests.selenium.YUITestRunner"
+ factory=".selenium.YUITestRunner"
provides="zc.selenium.pytest.ISeleniumTest"
permission="zope2.View"
/>
<adapter
- name="gocept.webmail.browser.tests.selenium.YUITestRunner"
- factory=".selenium.YUITestRunner"
+ name="gocept.webmail.browser.tests.draft.DraftFolderTest"
+ factory=".draft.DraftFolderTest"
provides="zc.selenium.pytest.ISeleniumTest"
permission="zope2.View"
/>
Added: gocept.webmail/trunk/gocept/webmail/browser/tests/draft.py
==============================================================================
--- (empty file)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/draft.py Thu Feb 26
11:19:47 2009
(at)(at) -0,0 +1,17 (at)(at)
+# Copyright (c) 2009 gocept gmbh & co. kg
+# See also LICENSE.txt
+
+import zc.selenium.pytest
+
+
+class DraftFolderTest(zc.selenium.pytest.Test):
+ """DraftFolderTest"""
+
+ def test_empty_drafts_folder(self):
+ s = self.selenium
+ s.open('/selenium/webmail/admin')
+ drafts = '//*[text() = "Drafts"]'
+ s.waitForElementPresent(drafts)
+ s.click(drafts)
+ s.waitForElementPresent('//div[(at)class = "yui-dt"]')
+ s.verifyTextPresent('No records found.')
Modified: gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/tests/selenium.py Thu Feb 26
11:19:47 2009
(at)(at) -36,18 +36,8 (at)(at)
pass
-class SimpleTest(zc.selenium.pytest.Test):
- """Example Selenium Test."""
-
- def test_webmailer_loads(self):
- s = self.selenium
- s.open('/selenium/webmail/admin')
- s.waitForElementPresent('id=ygtvlabelel1')
- s.verifyText('id=ygtvlabelel1', 'Drafts')
-
-
class YUITestRunner(zc.selenium.pytest.Test):
- """YUITestRunner."""
+ """YUITestRunner"""
def test_webmailer_loads(self):
s = self.selenium
|
SVN: r29330 - gocept.webmail/trunk/gocept/webmail/browser/resources
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-26 11:21:04 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 26 11:21:03 2009
New Revision: 29330
Log:
Re #4713: retrieve draft listing in batch-compatible format
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Thu Feb 26
11:21:03 2009
(at)(at) -228,12 +228,18 (at)(at)
{key:"subject", label:"Betreff", sortable:true},
{key:"date", label:"Datum", sortable:true}];
- var responseSchema = {resultsList: "messages",
+ var responseSchema = {resultsList: "result.messages",
+ metaFields: {totalRecords: "result.total",
+ pageSize: "result.batch_size",
+ startIndex: "result.batch_start",
+ recordsReturned: "result.returned",
+ sort: "result.sort_key",
+ dir: "result.sort_dir"},
fields: [{key: "url"},
{key: "flags"},
{key: "to"},
{key: "subject"},
- {key: "date", parser:"date"}]};
+ {key: "date", parser: "date"}]};
YAHOO.gocept.webmailer['list-drafts'] = function(url) {
data_source = YAHOO.gocept.webmailer.get_data_source(
|
SVN: r29332 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 11:22:18 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 11:22:17 2009
New Revision: 29332
Log:
show sender and smtp info in account list
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 11:22:17 2009
(at)(at) -141,13 +141,12 (at)(at)
var account_list = this;
var columns = [
{key:"status", label:"Status", sortable:true},
- {key:"host", label:"Hostname", sortable:true},
- {key:"port", label:"Port", sortable:true},
- {key:"user", label:"Username", sortable:true},
- {key:"name", label:"Name", sortable:true},
- {key:"address", label:"Address", sortable:true}];
+ {key:"from", label:"Sender", sortable:true},
+ {key:"imap", label:"IMAP account", sortable:true},
+ {key:"smtp", label:"SMTP account", sortable:true}]
var responseSchema = {resultsList: "",
fields: [{key: "status"},
+ {key: "from"},
{key: "url"},
{key: "host"},
{key: "port"},
(at)(at) -204,8 +203,30 (at)(at)
table.subscribe("rowUnselectEvent", function(event) {
document.App.reset();
});
- table.render()
+ table.doBeforeLoadData = account_list.prepare_data;
+ table.render();
account_list.table = table;
+ },
+
+ prepare_data: function (request, response, payload) {
+ for (i=0; i<response.results.length; i++) {
+ var row = response.results[i];
+ row.imap = row.host;
+ if (row.user) {
+ row.imap = row.user + "(at)" + row.imap;
+ };
+ if (row.port) {
+ row.imap += ":" + row.port;
+ };
+ row.smtp = row.smtp_host;
+ if (row.smtp_user) {
+ row.smtp_imap = row.smtp_user + "(at)" + row.smtp;
+ };
+ if (row.smtp_port) {
+ row.smtp += ":" + row.smtp_port;
+ };
+ };
+ return true;
}
});
|
SVN: r29338 - gocept.webmail-buildout/trunk/profiles gocept.webmail/trunk/gocept/webmail/browser
Wolfgang Schnerring <ws(at)gocept.com> |
2009-02-26 12:42:25 |
[ FULL ]
|
Author: wosc
Date: Thu Feb 26 12:42:23 2009
New Revision: 29338
Log:
Close #4708: don't include tests.zcml unconditionally, but only in the
selenium-instance.
Modified:
gocept.webmail-buildout/trunk/profiles/dev.cfg
gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
Modified: gocept.webmail-buildout/trunk/profiles/dev.cfg
==============================================================================
--- gocept.webmail-buildout/trunk/profiles/dev.cfg (original)
+++ gocept.webmail-buildout/trunk/profiles/dev.cfg Thu Feb 26 12:42:23 2009
(at)(at) -161,6 +161,7 (at)(at)
debug-mode = on
verbose-security = on
zcml = ${instance:zcml}
+ gocept.webmail.browser.tests
products = ${productdistros:location}
[selenium]
Modified: gocept.webmail/trunk/gocept/webmail/browser/configure.zcml
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/configure.zcml (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/configure.zcml Thu Feb 26
12:42:23 2009
(at)(at) -57,8 +57,5 (at)(at)
template="layout.pt"
permission="zope2.View"
/>
-
- <!-- XXX tests should not be here, see #4708 -->
- <include package=".tests"/>
</configure>
|
SVN: r29339 - in gocept.webmail/trunk/gocept/webmail/browser/resources: . styles
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-26 13:19:22 |
[ FULL ]
|
Author: sweh
Date: Thu Feb 26 13:19:20 2009
New Revision: 29339
Log:
- Resize datatables to a width of 100%.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
gocept.webmail/trunk/gocept/webmail/browser/resources/webmailer-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css Thu
Feb 26 13:19:20 2009
(at)(at) -116,6 +116,10 (at)(at)
display: none;
}
+.yui-skin-sam .yui-dt table {
+ width:100%;
+}
+
/* Helpers */
.novisclear {
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/webmailer-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/webmailer-main.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/webmailer-main.js Thu
Feb 26 13:19:20 2009
(at)(at) -21,7 +21,8 (at)(at)
app.outer_layout.on('render', function() {
app.layout = new YAHOO.widget.Layout(
app.outer_layout.getUnitByPosition('center').body,
- {units: [
+ {parent: app.outer_layout,
+ units: [
{ position: 'top',
height: 30, body: ''},
{ position: 'left',
|
SVN: r29345 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 14:33:13 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 14:33:12 2009
New Revision: 29345
Log:
made account title editable, fixes bug #4568
Modified:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/management.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Thu Feb 26
14:33:12 2009
(at)(at) -12,6 +12,10 (at)(at)
<table cellpadding="5">
<tbody>
<tr>
+ <td><label for="accountTitle">Account
title:</label></td>
+ <td><input type="text" name="accountTitle"
id="accountTitle" /></td>
+ </tr>
+ <tr>
<td><label
for="identityName">Name:</label></td>
<td><input type="text" name="identityName"
id="identityName" /></td>
</tr>
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 14:33:12 2009
(at)(at) -50,6 +50,7 (at)(at)
fillAccountEditForm: function(account) {
var form = document.App.account_edit_form;
+ form.getControl("accountTitle").value = account.title;
form.getControl("accountHost").value = account.host;
form.getControl("accountPort").value = account.port;
if (account.ssl == true) {
(at)(at) -140,6 +141,7 (at)(at)
load: function() {
var account_list = this;
var columns = [
+ {key:"title", label:"Account", sortable:true},
{key:"status", label:"Status", sortable:true},
{key:"from", label:"Sender", sortable:true},
{key:"imap", label:"IMAP account", sortable:true},
(at)(at) -160,7 +162,8 (at)(at)
{key: "smtp_port"},
{key: "smtp_user"},
{key: "smtp_password"},
- {key: "fixed"}
+ {key: "fixed"},
+ {key: "title"}
]
};
(at)(at) -265,6 +268,7 (at)(at)
_prepare_data: function() {
var editform = this;
var data = {
+ title: editform.get('accountTitle'),
host: editform.get('accountHost'),
port: new Number(editform.get('accountPort')),
ssl: document.getElementById('accountSSL').checked,
|
SVN: r29347 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-26 16:51:48 |
[ FULL ]
|
Author: sweh
Date: Thu Feb 26 16:51:47 2009
New Revision: 29347
Log:
- Add a resize behaviour to the editor.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/composer-main.js
gocept.webmail/trunk/gocept/webmail/browser/resources/composer.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/composer-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/composer-main.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/composer-main.js Thu
Feb 26 16:51:47 2009
(at)(at) -20,7 +20,8 (at)(at)
{ position: 'top', height: 23,
body: '' },
{ position: 'center',
- body: 'yui-layout-center'},
+ body: 'yui-layout-center',
+ scroll: true},
{ position: 'bottom', height: 70,
scroll: true,
body: 'yui-layout-bottom'}]});
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/composer.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/composer.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/composer.js Thu Feb
26 16:51:47 2009
(at)(at) -73,8 +73,6 (at)(at)
// Initialize the rich text editor for the body.
composer.editor = new YAHOO.widget.SimpleEditor(
composer.getControl('Body').id, {
- height: '400px',
- width: '100%',
css: '(at)import url(' + editor_style_url + ');'});
composer.editor._defaultToolbar.titlebar = false;
composer.editor.autosave_counter = 0;
(at)(at) -83,8 +81,14 (at)(at)
// Load content from server.
composer.load_draft();
});
+ composer.editor.on('afterRender', composer.resize_editor,
+ composer.editor, true);
+
composer.editor.render();
+ document.App.layout.on("resize", composer.resize_editor,
+ composer.editor, true);
+
// Initialize attachment widgets
YAHOO.util.Event.addListener(
composer.getControl('AttachmentsAttach'), 'click',
(at)(at) -97,6 +101,17 (at)(at)
composer._enable_attachment_button();
},
+ resize_editor: function() {
+ // XXX: This works very well but depends on the styling of the
+ // composeBarWrap (e.g. breaks an additional margin the
+ // calculation of the editors height).
+ var m = YAHOO.util.Dom.get('composeBarWrap').clientHeight +
YAHOO.util.Dom.getElementsByClassName('yui-toolbar-subcont')[0].clientHeight;
+ var h = YAHOO.util.Dom.get('yui-gen3').clientHeight - m - 5;
+ var w = YAHOO.util.Dom.get('yui-gen3').clientWidth - 4;
+ this.set('height', h + 'px');
+ this.set('width', w + 'px');
+ },
+
handleEditorKey: function(event) {
// Handle key events relevant for the editor.
if (event.ev.keyCode == 13) {
|
SVN: r29349 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 19:16:23 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 19:16:21 2009
New Revision: 29349
Log:
query account status asynchronously, fixes #4617
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 19:16:21 2009
(at)(at) -142,14 +142,13 (at)(at)
var account_list = this;
var columns = [
{key:"title", label:"Account", sortable:true},
- {key:"status", label:"Status", sortable:true},
+ {key:"status", label:"Status", sortable:true,
formatter:account_list.format_status},
{key:"from", label:"Sender", sortable:true},
{key:"imap", label:"IMAP account", sortable:true},
{key:"smtp", label:"SMTP account", sortable:true}]
var responseSchema = {resultsList: "",
- fields: [{key: "status"},
+ fields: [{key: "url"},
{key: "from"},
- {key: "url"},
{key: "host"},
{key: "port"},
{key: "ssl"},
(at)(at) -230,6 +229,16 (at)(at)
};
};
return true;
+ },
+
+ format_status: function (el, oRecord, oColumn, oData) {
+ account_url = oRecord.getData('url');
+ document.Connection.post(account_url + '/(at)(at)status', {},
+ function(result) {
+ var status = YAHOO.lang.JSON.parse(result.responseText);
+ el.innerHTML = status;
+ });
+ el.innerHTML = 'trying...'
}
});
|
SVN: r29351 - gocept.webmail/trunk/gocept/webmail/browser/resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 19:29:55 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 19:29:54 2009
New Revision: 29351
Log:
store the result of an asynchronous status check as whether to show the folder
tree depends on it
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 19:29:54 2009
(at)(at) -237,6 +237,7 (at)(at)
function(result) {
var status = YAHOO.lang.JSON.parse(result.responseText);
el.innerHTML = status;
+ oRecord.setData('status', status)
});
el.innerHTML = 'trying...'
}
|
SVN: r29352 - in gocept.webmail/trunk/gocept/webmail/browser: . resources
Thomas Lotze <tl(at)gocept.com> |
2009-02-26 19:35:00 |
[ FULL ]
|
Author: thomas
Date: Thu Feb 26 19:34:58 2009
New Revision: 29352
Log:
- no longer use hidden form fields for storing JS data
- this does away with the hack of converting a list of names to a multiline
string and back
- while at it, fixed resetting the account URL to post to when creating a new
account
Modified:
gocept.webmail/trunk/gocept/webmail/browser/management.pt
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/management.pt
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/management.pt (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/management.pt Thu Feb 26
19:34:58 2009
(at)(at) -8,7 +8,6 (at)(at)
<div id="yui-layout-center">
<div id="accountEditForm">
- <input type="hidden" id="accountURL" name="accountURL" />
<table cellpadding="5">
<tbody>
<tr>
(at)(at) -69,8 +68,7 (at)(at)
<p>
<label for="accountSentFolderDisplay">"Sent"
folder:</label>
<input type="text" name="accountSentFolderDisplay"
id="accountSentFolderDisplay" readonly="readonly" />
- <input type="hidden" name="accountSentFolder"
id="accountSentFolder" />
- </p >
+ </p>
<div id="sentFolderTree">
</div>
</div>
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Thu
Feb 26 19:34:58 2009
(at)(at) -50,6 +50,8 (at)(at)
fillAccountEditForm: function(account) {
var form = document.App.account_edit_form;
+ form.account_url = account.url;
+ form.sent_folder = account.sent_folder;
form.getControl("accountTitle").value = account.title;
form.getControl("accountHost").value = account.host;
form.getControl("accountPort").value = account.port;
(at)(at) -61,8 +63,6 (at)(at)
form.getControl("accountPassword").value = "XXXXXXXX";
};
form.getControl("accountSentFolderDisplay").value =
account.sent_folder[account.sent_folder.length-1];
- form.getControl("accountSentFolder").value =
account.sent_folder.join('\n');
- form.getControl("accountURL").value = account.url;
form.getControl("identityName").value = account.name;
form.getControl("identityAddress").value = account.address;
form.getControl("smtpHost").value = account.smtp_host;
(at)(at) -257,7 +257,8 (at)(at)
var editform = this;
document.App.domNodes.account_edit_form.innerHTML =
editform.originalHTML;
document.getElementById('accountSentFolderDisplay').value = ''
- document.getElementById('accountSentFolder').value = ''
+ editform.account_url = undefined;
+ editform.sent_folder = undefined;
editform.account_password_changed = false;
editform.smtp_password_changed = false;
YAHOO.util.Event.addListener(
(at)(at) -283,7 +284,7 (at)(at)
port: new Number(editform.get('accountPort')),
ssl: document.getElementById('accountSSL').checked,
user: editform.get('accountUsername'),
- sent_folder: editform.get('accountSentFolder').split('\n'),
+ sent_folder: editform.sent_folder,
name: editform.get('identityName'),
address: editform.get('identityAddress'),
smtp_host: editform.get('smtpHost'),
(at)(at) -300,8 +301,8 (at)(at)
save_account: function(ev) {
var editform = this;
- if (editform.get('accountURL')) {
- var url = editform.get('accountURL') + '/(at)(at)edit';
+ if (editform.account_url) {
+ var url = editform.account_url + '/(at)(at)edit';
} else {
var url = '(at)(at)add-account?';
};
(at)(at) -357,7 +358,7 (at)(at)
});
tree.treeview.subscribe('labelClick', function(node) {
document.getElementById('accountSentFolderDisplay').value =
node.data.label;
- document.getElementById('accountSentFolder').value =
node.names.join('\n');
+ document.App.account_edit_form.sent_folder = node.names;
});
},
|
SVN: r29354 - in gocept.webmail/trunk/gocept/webmail/browser/resources: . styles
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-27 10:05:52 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 27 10:05:51 2009
New Revision: 29354
Log:
- Make the layout scrollable, not the table itself.
The table doesn't care about rendering itself with a minimum of width, if it
is set to scrollable. This patch fixes it.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/management-main.js Fri
Feb 27 10:05:51 2009
(at)(at) -17,6 +17,7 (at)(at)
{ position: 'top',
height: 150,
resize: true,
+ scroll: true,
body: ''},
{ position: 'center',
scroll: true,
(at)(at) -144,8 +145,8 (at)(at)
{key:"title", label:"Account", sortable:true},
{key:"status", label:"Status", sortable:true,
formatter:account_list.format_status},
{key:"from", label:"Sender", sortable:true},
- {key:"imap", label:"IMAP account", sortable:true},
- {key:"smtp", label:"SMTP account", sortable:true}]
+ {key:"imap", label:"IMAP", sortable:true},
+ {key:"smtp", label:"SMTP", sortable:true}]
var responseSchema = {resultsList: "",
fields: [{key: "url"},
{key: "from"},
(at)(at) -182,8 +183,7 (at)(at)
table = new YAHOO.widget.DataTable(
document.App.domNodes.account_list,
columns,
- data_source,
- {scrollable: true});
+ data_source);
table.set("selectionMode", "standard");
table.subscribe("rowClickEvent", table.onEventSelectRow);
table.subscribe("rowSelectEvent", function(event) {
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css Fri
Feb 27 10:05:51 2009
(at)(at) -116,6 +116,7 (at)(at)
display: none;
}
+.yui-skin-sam .yui-dt-hd table,
.yui-skin-sam .yui-dt table {
width:100%;
}
|
SVN: r29355 - in gocept.webmail/trunk/gocept/webmail/browser/resources: . images
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-27 11:14:55 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 27 11:14:53 2009
New Revision: 29355
Log:
- Remove unnessecary icons.
- Add new icons for message flags.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-forward.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-loading.gif
(props changed)
- copied unchanged from r29352,
gocept.webmail/trunk/gocept/webmail/browser/resources/images/loading.gif
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-mark-junk.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-mark-not-junk.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-message-new.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-reply-all.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-reply-sender.png
(contents, props changed)
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-send-receive.png
(contents, props changed)
Removed:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/loading.gif
gocept.webmail/trunk/gocept/webmail/browser/resources/images/sprite.png
gocept.webmail/trunk/gocept/webmail/browser/resources/images/transparent.gif
gocept.webmail/trunk/gocept/webmail/browser/resources/images/treeview-loading.gif
gocept.webmail/trunk/gocept/webmail/browser/resources/images/treeview-sprite.gif
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-forward.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-mark-junk.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-mark-not-junk.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-message-new.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-reply-all.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-reply-sender.png
==============================================================================
Binary file. No diff available.
Added:
gocept.webmail/trunk/gocept/webmail/browser/resources/images/mail-send-receive.png
==============================================================================
Binary file. No diff available.
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Fri Feb 27
11:14:53 2009
(at)(at) -343,7 +343,7 (at)(at)
loading: function() {
var preview_pane = this;
- document.App.domNodes.preview_pane.innerHTML = '<img
src="++resource++gocept.webmail/images/loading.gif" style="position: relative;
left: 48%; top: 40%;" />';
+ document.App.domNodes.preview_pane.innerHTML = '<img
src="++resource++gocept.webmail/images/mail-loading.gif" style="position:
relative; left: 48%; top: 40%;" />';
},
reset: function() {
|
SVN: r29359 - in gocept.webmail/trunk/gocept/webmail/browser/resources: . styles
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-27 12:58:09 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 27 12:58:07 2009
New Revision: 29359
Log:
- Add icons instead of css styles to display message flags.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Fri Feb 27
12:58:07 2009
(at)(at) -29,7 +29,7 (at)(at)
function(type, arg){ message_list.load(arg[0]); });
},
- rowFormatter: function(elTr, oRecord) {
+ format_flags: function (el, oRecord, oColumn, oData) {
var flags = oRecord.getData('flags');
if (!flags) {
return true;
(at)(at) -38,20 +38,28 (at)(at)
for (i=0; i<flags.length; i++) {
if (flags[i] == '\\Seen') {
seen = true;
- } else if (flags[i] == '\\Recent') {
- YAHOO.util.Dom.addClass(elTr, 'recent');
- } else if (flags[i] == '\\Answered') {
- YAHOO.util.Dom.addClass(elTr, 'answered');
- } else if (flags[i] == '\\Flagged') {
- YAHOO.util.Dom.addClass(elTr, 'flagged');
+ }
+ if (flags[i] == '\\Recent') {
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-message-new.png"
class="message_new" />';
+ seen = true;
+ }
+ if (flags[i] == '\\Answered') {
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-reply-sender.png"
class="message_reply" />';
+ }
+ if (flags[i] == '\\Flagged') {
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-flagged.png"
class="message_flagged" />';
};
};
if (!seen) {
- YAHOO.util.Dom.addClass(elTr, 'unseen');
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-message-new.png"
class="message_new" />';
};
return true;
},
-
+
load: function(folder) {
// XXX: This is messy. Creating many datatables that are still
// referenced from the event system will make the memory usage of
(at)(at) -80,8 +88,7 (at)(at)
document.App.domNodes.message_list,
config.columns,
config.source,
- {formatRow: this.rowFormatter,
- initialRequest:
'batch_start=0&batch_size=10&sort_key=' + init_sort[0] +
'&sort_dir=' + init_sort[1],
+ {initialRequest:
'batch_start=0&batch_size=10&sort_key=' + init_sort[0] +
'&sort_dir=' + init_sort[1],
sortedBy: {key: init_sort[0], dir: init_sort[1]},
generateRequest: function(oState, oSelf) {
sort_dir =
message_list.sortDirClassToString(oState.sortedBy.dir);
(at)(at) -112,10 +119,10 (at)(at)
message.canEdit = config.canEdit;
message.canDelete = config.canDelete;
message.canBeRaw = config.canBeRaw;
- var classnames = event.el.className.split(" ");
- for (i=0; i<classnames.length; i++) {
- if (classnames[i] == 'unseen') {
- YAHOO.util.Dom.removeClass(event.el, 'unseen');
+ var flags_el = event.el.firstChild.firstChild
+ for (i=0; i<flags_el.childNodes.length; i++) {
+ if (flags_el.childNodes[i].className == 'message_new') {
+ flags_el.removeChild(flags_el.childNodes[i]);
};
};
return document.App.preview_pane.load(message);
(at)(at) -185,7 +192,11 (at)(at)
//
Def(function() {
- var columns = [{key:"from", label:"Absender", sortable:true},
+ var columns = [{key:"flags", label:"",
+ formatter: function (el, oRecord, oColumn, oData) {
+ document.App.message_list.format_flags(el, oRecord,
oColumn, oData);
+ }},
+ {key:"from", label:"Absender", sortable:true},
{key:"subject", label:"Betreff", sortable:true},
{key:"date", label:"Datum", sortable:true}];
(at)(at) -225,7 +236,11 (at)(at)
Def(function() {
// XXX this is an almost exact copy of list-inbox
- var columns = [{key:"to", label:"Empfänger", sortable:true},
+ var columns = [{key:"flags", label:"",
+ formatter: function (el, oRecord, oColumn, oData) {
+ document.App.message_list.format_flags(el, oRecord,
oColumn, oData);
+ }},
+ {key:"to", label:"Empfänger", sortable:true},
{key:"subject", label:"Betreff", sortable:true},
{key:"date", label:"Datum", sortable:true}];
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css
==============================================================================
---
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css (original)
+++
gocept.webmail/trunk/gocept/webmail/browser/resources/styles/webmail.css Fri
Feb 27 12:58:07 2009
(at)(at) -116,6 +116,15 (at)(at)
display: none;
}
+.yui-dt-first {
+ width: 50px;
+}
+
+.yui-dt-first div img {
+ height: 14px;
+ width: 14px;
+}
+
.yui-skin-sam .yui-dt-hd table,
.yui-skin-sam .yui-dt table {
width:100%;
|
SVN: r29360 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-27 14:00:41 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 27 14:00:40 2009
New Revision: 29360
Log:
- Reset the message preview when switching between folders.
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Fri Feb 27
14:00:40 2009
(at)(at) -322,7 +322,7 (at)(at)
message_parts['body'] +
message_parts['footer']);
preview_pane.raw_button.cfg.setProperty('text', 'View raw');
- document.App.preview_pane.raw_button.cfg.setProperty(
+ preview_pane.raw_button.cfg.setProperty(
'onclick', {fn: function() {
document.App.preview_pane.load_raw(message); }}
);
});
(at)(at) -364,6 +364,7 (at)(at)
reset: function() {
var preview_pane = this;
preview_pane.message = null;
+ document.App.domNodes.preview_pane.innerHTML = '';
// Deactivate message-context menu items.
preview_pane.reply_button.cfg.setProperty('disabled', true);
|
SVN: r29361 - gocept.webmail/trunk/gocept/webmail/browser/resources
Sebastian Wehrmann <sw(at)gocept.com> |
2009-02-27 16:14:13 |
[ FULL ]
|
Author: sweh
Date: Fri Feb 27 16:14:12 2009
New Revision: 29361
Log:
- Remove unused Recent flag.
- Add flag for (custom) Junk and NotJunk flag. (as used by AppleMail and
probably many other cliens)
Modified:
gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
Modified: gocept.webmail/trunk/gocept/webmail/browser/resources/message.js
==============================================================================
--- gocept.webmail/trunk/gocept/webmail/browser/resources/message.js (original)
+++ gocept.webmail/trunk/gocept/webmail/browser/resources/message.js Fri Feb 27
16:14:12 2009
(at)(at) -39,11 +39,6 (at)(at)
if (flags[i] == '\\Seen') {
seen = true;
}
- if (flags[i] == '\\Recent') {
- el.innerHTML = el.innerHTML +
- '<img
src="++resource++gocept.webmail/images/mail-message-new.png"
class="message_new" />';
- seen = true;
- }
if (flags[i] == '\\Answered') {
el.innerHTML = el.innerHTML +
'<img
src="++resource++gocept.webmail/images/mail-reply-sender.png"
class="message_reply" />';
(at)(at) -52,6 +47,14 (at)(at)
el.innerHTML = el.innerHTML +
'<img
src="++resource++gocept.webmail/images/mail-flagged.png"
class="message_flagged" />';
};
+ if (flags[i] == '$Junk') {
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-mark-junk.png"
class="message_flagged" />';
+ };
+ if (flags[i] == '$NotJunk') {
+ el.innerHTML = el.innerHTML +
+ '<img
src="++resource++gocept.webmail/images/mail-mark-not-junk.png"
class="message_flagged" />';
+ };
};
if (!seen) {
el.innerHTML = el.innerHTML +
|
|