Bug 948883 - Move inline scripts and styles into separate file for toolkit/content/aboutSupport.xhtml (URL=about:support). r=Unfocused

This commit is contained in:
Michael Green 2014-03-24 09:11:21 -04:00
parent 8c1fa0accb
commit df9b1be85f
3 changed files with 42 additions and 17 deletions

View File

@ -16,6 +16,7 @@ window.addEventListener("load", function onload(event) {
snapshotFormatters[prop](snapshot[prop]);
});
populateResetBox();
setupEventListeners();
}, false);
// Each property in this object corresponds to a property in Troubleshoot.jsm's
@ -594,12 +595,6 @@ function openProfileDirectory() {
new nsLocalFile(profileDir).reveal();
}
function showUpdateHistory() {
var prompter = Cc["@mozilla.org/updates/update-prompt;1"]
.createInstance(Ci.nsIUpdatePrompt);
prompter.showUpdateHistory(window);
}
/**
* Profile reset is only supported for the default profile if the appropriate migrator exists.
*/
@ -607,3 +602,25 @@ function populateResetBox() {
if (ResetProfile.resetSupported())
$("reset-box").style.visibility = "visible";
}
/**
* Set up event listeners for buttons.
*/
function setupEventListeners(){
$("show-update-history-button").addEventListener("click", function (event) {
var prompter = Cc["@mozilla.org/updates/update-prompt;1"].createInstance(Ci.nsIUpdatePrompt);
prompter.showUpdateHistory(window);
});
$("reset-box-button").addEventListener("click", function (event){
ResetProfile.openConfirmationDialog(window);
});
$("copy-raw-data-to-clipboard").addEventListener("click", function (event){
copyRawDataToClipboard(this);
});
$("copy-to-clipboard").addEventListener("click", function (event){
copyContentsToClipboard();
});
$("profile-dir-button").addEventListener("click", function (event){
openProfileDirectory();
});
}

View File

@ -29,10 +29,10 @@
<body dir="&locale.dir;">
<div id="reset-box" style="visibility: hidden">
<div id="reset-box">
<h3>&resetProfile.title;</h3>
<p>&resetProfile.description;</p>
<button onclick="ResetProfile.openConfirmationDialog(window)">
<button id="reset-box-button">
&resetProfile.button.label2;
</button>
</div>
@ -46,11 +46,10 @@
</div>
<div>
<button id="copy-raw-data-to-clipboard"
onclick="copyRawDataToClipboard(this);">
<button id="copy-raw-data-to-clipboard">
&aboutSupport.copyRawDataToClipboard.label;
</button>
<button id="copy-to-clipboard" onclick="copyContentsToClipboard()">
<button id="copy-to-clipboard">
&aboutSupport.copyTextToClipboard.label;
</button>
</div>
@ -90,7 +89,7 @@
</th>
<td>
<button onclick="showUpdateHistory()">
<button id="show-update-history-button">
&aboutSupport.appBasicsShowUpdateHistory;
</button>
</td>
@ -120,7 +119,7 @@
</th>
<td>
<button onclick="openProfileDirectory()">
<button id="profile-dir-button">
#ifdef XP_WIN
&aboutSupport.showWin.label;
#else
@ -188,10 +187,10 @@
<tbody id="crashes-tbody">
</tbody>
</table>
<p id="crashes-allReports" class="no-copy" style="display: none">
<a href="about:crashes" id="crashes-allReportsWithPending" style="display: block">&aboutSupport.crashes.allReports;</a>
<p id="crashes-allReports" class="hidden no-copy">
<a href="about:crashes" id="crashes-allReportsWithPending" class="block">&aboutSupport.crashes.allReports;</a>
</p>
<p id="crashes-noConfig" class="no-copy" style="display: none">&aboutSupport.crashes.noConfig;</p>
<p id="crashes-noConfig" class="hidden no-copy">&aboutSupport.crashes.noConfig;</p>
#endif
<!-- - - - - - - - - - - - - - - - - - - - - -->
@ -242,7 +241,7 @@
</tbody>
</table>
<section id="prefs-user-js-section" class="no-copy" style="display:none">
<section id="prefs-user-js-section" class="hidden no-copy">
<h3>&aboutSupport.userJSTitle;</h3>
<p>&aboutSupport.userJSDescription;</p>
</section>

View File

@ -89,6 +89,7 @@ td {
-moz-margin-end: 0;
padding: 16px;
width: 30%;
visibility: hidden;
}
#reset-box:-moz-dir(rtl) {
@ -103,3 +104,11 @@ td {
display: block;
margin: auto;
}
.block {
display: block;
}
.hidden {
display: none;
}