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:
parent
60f17b30c1
commit
8f39da2e1d
@ -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() {
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
description="&custompage.shortdescription;"
|
||||
label="&wizard.label;"
|
||||
next="finishPage"
|
||||
onpageshow="checkRequired();"
|
||||
onpageshow="initNameFromURI(); checkRequired();"
|
||||
onpageadvanced="doCreateCalendar();">
|
||||
<description>&custompage.longdescription;</description>
|
||||
<grid>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user