Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions restman/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ <h3 class="expander">Headers</h3>
<input type="button" data-clear-all="#HeadersTable" class="error" value="Clear All" tabindex="0" />
</div>
</section>
<section class="expandable closed flex-item-static">
<h3 class="expander">Certificate</h3>
<div class="tabs-content">
<ul id="CertificateTable" class="name-value-list">
<li data-clone-template class="flex-container">
<input class="flat key flex-item-dynamic" type="text" placeholder="Certificate..." tabindex="0" readonly/>
<input class="flat value flex-item-dynamic" type="text" placeholder="Key..." tabindex="0" readonly/>
<span class="flex-item-static icon-delete" data-delete-item tabindex="0" />
</li>
</ul>
<input type="button" data-reveal-id="CertificateForm" value="Add certificate" tabindex="0" />
<input type="button" data-clear-all="#CertificateTable" class="error" value="Clear All" tabindex="0" />
</div>
</section>

<div id="MainEditors" class="flex-item-static flex-container">
<section id="BodySection" class="expandable closed flex-item-dynamic">
Expand Down Expand Up @@ -193,6 +207,20 @@ <h4>Basic Authentication</h4>
<input type="button" class="save-modal ok" value="Save" tabindex="0" />
</div>
</div>
<!-- Certificate Upload modal -->
<div id="CertificateForm" class="reveal-modal" data-reveal>
<div class="modal-content">
<h4>Certificate</h4>
<form>
<label>Certificate: <input id="cert" type="file" name="cert"/></label>
<label>Key: <input id="key" type="file" name="key"/></label>
</form>
</div>
<div class="modal-buttons">
<input type="button" class="close-modal" value="Cancel" tabindex="0" />
<input type="button" class="save-modal ok" value="Save" tabindex="0" />
</div>
</div>

<!-- Options modal -->
<div id="OptionsForm" class="reveal-modal tiny" data-reveal>
Expand Down
13 changes: 13 additions & 0 deletions restman/js/ui/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ $(document).ready(function(event) {

$('#BasicAuthForm').foundation('reveal', 'close')
});

/* Save Certificate header */
$('#CertificateForm .save-modal').click(function (event) {
var certinput = document.getElementById('cert');
var keyinput = document.getElementById('key');
var item = restman.ui.dynamic_list.add_item('#CertificateTable');
var cert = certinput.value.split(/(\\|\/)/g).pop();
var key = keyinput.value.split(/(\\|\/)/g).pop();
item.find('input.key').val(cert);
item.find('input.value').val(key);

$('#CertificateForm').foundation('reveal', 'close')
});

/* Save Options */
$('#OptionsForm .save-modal').click(function (event) {
Expand Down