зеркало из https://github.com/mozilla/pjs.git
fix for bug 188956 - Clean up Cache pref panel. This changes the UI display in cache panel from KB to MB. r-varga, sr-alecf.
This commit is contained in:
Родитель
78cf09123a
Коммит
f6f6c2877f
|
@ -38,6 +38,15 @@
|
|||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["browserCacheDiskCache", "browserCacheCheckDocFrequency", "enablePrefetch"];
|
||||
function GetFields(pageData) {
|
||||
// because the cache is in kilobytes, and the UI is in megabytes.
|
||||
pageData.browserCacheDiskCache.value <<= 10;
|
||||
return null;
|
||||
}
|
||||
function SetFields(pageData) {
|
||||
pageData.browserCacheDiskCache.value >>= 10;
|
||||
return true;
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
@ -52,9 +61,9 @@
|
|||
|
||||
<hbox align="center">
|
||||
<label value="&diskCache.label;" accesskey="&diskCache.accesskey;" control="browserCacheDiskCache"/>
|
||||
<textbox id="browserCacheDiskCache" size="8" preftype="int"
|
||||
<textbox id="browserCacheDiskCache" size="5" preftype="int"
|
||||
prefstring="browser.cache.disk.capacity" prefattribute="value"/>
|
||||
<label value="&kbytes;"/>
|
||||
<label value="&mbytes;"/>
|
||||
<button label="&clearDiskCache.label;" accesskey="&clearDiskCache.accesskey;"
|
||||
oncommand="prefClearDiskAndMemCache();"
|
||||
id="clearDiskCache"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<!ENTITY cachePara "The cache keeps copies of frequently visited web pages on your hard disk. (Clicking Reload always shows you the latest version of a page.)">
|
||||
<!ENTITY diskCache.label "Cache:">
|
||||
<!ENTITY diskCache.accesskey "C">
|
||||
<!ENTITY kbytes "KB">
|
||||
<!ENTITY mbytes "MB">
|
||||
<!ENTITY diskCacheFolder.label "Cache Folder:">
|
||||
<!ENTITY clearDiskCache.label "Clear Cache">
|
||||
<!ENTITY clearDiskCache.accesskey "l">
|
||||
|
|
|
@ -110,13 +110,6 @@ nsWidgetStateManager.prototype =
|
|||
if (!(aPageTag in this.dataManager.pageData))
|
||||
return;
|
||||
|
||||
if( 'GetFields' in this.contentArea)
|
||||
{
|
||||
// save page data based on user supplied function in content area
|
||||
var dataObject = this.contentArea.GetFields();
|
||||
if (dataObject)
|
||||
this.dataManager.setPageData( aPageTag, dataObject );
|
||||
}
|
||||
|
||||
// Automatic element retrieval. This is done in two ways.
|
||||
// 1) if an element id array is present in the document, this is
|
||||
|
@ -157,6 +150,14 @@ nsWidgetStateManager.prototype =
|
|||
this.handlers.default_handler.get;
|
||||
this.dataManager.setItemData( aPageTag, elementID, get_Func( elementID ) );
|
||||
}
|
||||
if( 'GetFields' in this.contentArea)
|
||||
{
|
||||
// save page data based on user supplied function in content area
|
||||
var dataObject = this.dataManager.getPageData( aPageTag );
|
||||
dataObject = this.contentArea.GetFields( dataObject );
|
||||
if (dataObject)
|
||||
this.dataManager.setPageData( aPageTag, dataObject );
|
||||
}
|
||||
},
|
||||
|
||||
setPageData:
|
||||
|
|
Загрузка…
Ссылка в новой задаче