Support for arbitrary preferences

This commit is contained in:
mkaply%us.ibm.com 2005-08-31 21:22:50 +00:00
Родитель f30a332d7f
Коммит 6adf2a6195
2 изменённых файлов: 57 добавлений и 0 удалений

Просмотреть файл

@ -787,6 +787,7 @@ function CCKWriteDefaultJS(destdir)
fos.write(useragent2end, useragent2end.length);
}
// For these guys Idid something a little clever - the preference name is stored in the XUL
var proxystringlist = ["HTTPproxyname","SSLproxyname","FTPproxyname","Gopherproxyname","NoProxyname","autoproxyurl" ];
@ -813,6 +814,22 @@ function CCKWriteDefaultJS(destdir)
var line = 'pref("' + proxyitem.getAttribute("preference") + '", ' + proxyitem.value + ');\n';
fos.write(line, line.length);
// Preferences
for (var i=1; i <= 5; i++) {
var prefname = document.getElementById("PreferenceName" + i).value;
if (prefname && prefname.length) {
var prefvalue = document.getElementById("PreferenceValue" + i).value;
if (prefvalue && prefvalue.length) {
var line = 'pref("' + prefname + '", ' + prefvalue + ');\n';
fos.write(line, line.length);
}
}
}
fos.close();
}

Просмотреть файл

@ -523,6 +523,46 @@
</groupbox>
</wizardpage>
<wizardpage>
<groupbox>
<caption label="Preferences"/>
<description>
You can add up to five custom preferences. Note these preferences are stored exactly as written, so put quotes around string preferences.
</description>
<hbox>
<label>Preference Name1:</label>
<textbox id="PreferenceName1"/>
<label>Value:</label>
<textbox id="PreferenceValue1"/>
</hbox>
<hbox>
<label>Preference Name2:</label>
<textbox id="PreferenceName2"/>
<label>Value:</label>
<textbox id="PreferenceValue2"/>
</hbox>
<hbox>
<label>Preference Name3:</label>
<textbox id="PreferenceName3"/>
<label>Value:</label>
<textbox id="PreferenceValue3"/>
</hbox>
<hbox>
<label>Preference Name4:</label>
<textbox id="PreferenceName4"/>
<label>Value:</label>
<textbox id="PreferenceValue4"/>
</hbox>
<hbox>
<label>Preference Name5:</label>
<textbox id="PreferenceName5"/>
<label>Value:</label>
<textbox id="PreferenceValue5"/>
</hbox>
</groupbox>
</wizardpage>
<wizardpage>
<groupbox>
<caption label="&proxyTitle.label;"/>