Make new calendar wizard initialize calendar name from filename.

Bug 181312, patch by jminta and gekacheka, r=mvl


git-svn-id: svn://10.0.0.236/trunk@179981 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mvl%exedo.nl 2005-09-11 09:29:50 +00:00
parent 60f17b30c1
commit 8f39da2e1d
2 changed files with 14 additions and 1 deletions

View File

@ -112,6 +112,19 @@ function doCreateCalendar()
return true;
}
function initNameFromURI() {
var path = document.getElementById("calendar-uri").value;
var nameField = document.getElementById("calendar-name");
if (!path || nameField.value)
return;
var fullPathRegex = new RegExp("([^/:]+)[.]ics$");
var captures = path.match(fullPathRegex);
if (captures && captures.length >= 1) {
nameField.value = captures[1];
}
}
//Don't let the wizard advance if the URL isn't valid, since the calendar
//creation will fail.
function checkURL() {

View File

@ -113,7 +113,7 @@
description="&custompage.shortdescription;"
label="&wizard.label;"
next="finishPage"
onpageshow="checkRequired();"
onpageshow="initNameFromURI(); checkRequired();"
onpageadvanced="doCreateCalendar();">
<description>&custompage.longdescription;</description>
<grid>