Merge pull request #3486 from Rob--W/csp-unsafe-inline

Remove all inline JavaScript from viewer.html to comply with CSP unsafe-inline and correct error textarea's height
This commit is contained in:
Yury Delendik 2013-07-18 06:08:39 -07:00
commit 984b9bf78b
2 changed files with 9 additions and 5 deletions

View File

@ -230,15 +230,15 @@ limitations under the License.
<div id="errorWrapper" hidden='true'>
<div id="errorMessageLeft">
<span id="errorMessage"></span>
<button id="errorShowMore" onclick="" oncontextmenu="return false;" data-l10n-id="error_more_info">
<button id="errorShowMore" data-l10n-id="error_more_info">
More Information
</button>
<button id="errorShowLess" onclick="" oncontextmenu="return false;" data-l10n-id="error_less_info" hidden='true'>
<button id="errorShowLess" data-l10n-id="error_less_info" hidden='true'>
Less Information
</button>
</div>
<div id="errorMessageRight">
<button id="errorClose" oncontextmenu="return false;" data-l10n-id="error_close">
<button id="errorClose" data-l10n-id="error_close">
Close
</button>
</div>

View File

@ -1104,17 +1104,21 @@ var PDFView = {
errorMoreInfo.removeAttribute('hidden');
moreInfoButton.setAttribute('hidden', 'true');
lessInfoButton.removeAttribute('hidden');
errorMoreInfo.style.height = errorMoreInfo.scrollHeight + 'px';
};
lessInfoButton.onclick = function() {
errorMoreInfo.setAttribute('hidden', 'true');
moreInfoButton.removeAttribute('hidden');
lessInfoButton.setAttribute('hidden', 'true');
};
moreInfoButton.oncontextmenu =
lessInfoButton.oncontextmenu =
closeButton.oncontextmenu = function(e) {
e.preventDefault();
};
moreInfoButton.removeAttribute('hidden');
lessInfoButton.setAttribute('hidden', 'true');
errorMoreInfo.value = moreInfoText;
errorMoreInfo.rows = moreInfoText.split('\n').length - 1;
//#else
// console.error(message + '\n' + moreInfoText);
// this.fallback();