Added setting for PDF page size

This commit is contained in:
benweet 2013-10-27 19:19:56 +00:00
parent fbb366c59e
commit 293aac30ed
6 changed files with 26 additions and 10 deletions

View File

@ -129,7 +129,9 @@ define([
// Template // Template
utils.setInputValue("#textarea-settings-publish-template", settings.template); utils.setInputValue("#textarea-settings-publish-template", settings.template);
// PDF template // PDF template
utils.setInputValue("#textarea-settings-publish-pdf-template", settings.pdfTemplate); utils.setInputValue("#textarea-settings-pdf-template", settings.pdfTemplate);
// PDF page size
utils.setInputValue("#input-settings-pdf-page-size", settings.pdfPageSize);
// SSH proxy // SSH proxy
utils.setInputValue("#input-settings-ssh-proxy", settings.sshProxy); utils.setInputValue("#input-settings-ssh-proxy", settings.sshProxy);
@ -165,7 +167,9 @@ define([
// Template // Template
newSettings.template = utils.getInputTextValue("#textarea-settings-publish-template", event); newSettings.template = utils.getInputTextValue("#textarea-settings-publish-template", event);
// PDF template // PDF template
newSettings.pdfTemplate = utils.getInputTextValue("#textarea-settings-publish-pdf-template", event); newSettings.pdfTemplate = utils.getInputTextValue("#textarea-settings-pdf-template", event);
// PDF page size
newSettings.pdfPageSize = utils.getInputValue("#input-settings-pdf-page-size");
// SSH proxy // SSH proxy
newSettings.sshProxy = utils.checkUrl(utils.getInputTextValue("#input-settings-ssh-proxy", event), true); newSettings.sshProxy = utils.checkUrl(utils.getInputTextValue("#input-settings-ssh-proxy", event), true);

View File

@ -983,14 +983,25 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-lg-4 control-label" <label class="col-lg-4 control-label"
for="textarea-settings-publish-pdf-template">PDF for="textarea-settings-pdf-template">PDF
template <a href="#" class="tooltip-template">(?)</a> template <a href="#" class="tooltip-template">(?)</a>
</label> </label>
<div class="col-lg-7"> <div class="col-lg-7">
<textarea id="textarea-settings-publish-pdf-template" <textarea id="textarea-settings-pdf-template"
class="form-control"></textarea> class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-lg-4 control-label" for="input-settings-pdf-page-size">PDF page size</label>
<div class="col-lg-7">
<select id="input-settings-pdf-page-size" class="form-control">
<option value="A3">A3</option>
<option value="A4">A4</option>
<option value="Legal">Legal</option>
<option value="Letter">Letter</option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-lg-4 control-label" <label class="col-lg-4 control-label"
for="input-settings-publish-commit-msg">GitHub commit message</label> for="input-settings-publish-commit-msg">GitHub commit message</label>

View File

@ -336,6 +336,7 @@ define([
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', HTMLTOPDF_URL, true); xhr.open('POST', HTMLTOPDF_URL, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('page-size', settings.pdfPageSize);
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if(this.readyState == 4) { if(this.readyState == 4) {

View File

@ -48,6 +48,7 @@ define([
'<body class="pdf"><%= documentHTML %></body>\n', '<body class="pdf"><%= documentHTML %></body>\n',
'</html>' '</html>'
].join(""), ].join(""),
pdfPageSize: 'A4',
sshProxy: SSH_PROXY_URL, sshProxy: SSH_PROXY_URL,
shortcuts: {}, shortcuts: {},
extensionSettings: {} extensionSettings: {}

View File

@ -1217,14 +1217,13 @@ div.dropdown-menu textarea {
opacity: 0.1; opacity: 0.1;
margin-top: -4px; margin-top: -4px;
margin-left: -2px; margin-left: -2px;
margin-right: 3px; margin-right: 2px;
font-size: 12px; font-size: 14px;
vertical-align: top; vertical-align: top;
.file-title-navbar & { .file-title-navbar & {
font-size: 14px; font-size: 16px;
margin-top: -2px; margin-top: -2px;
margin-left: -4px; margin-left: -4px;
margin-right: 4px;
} }
} }