Commit e9b42d7a by Tom Giannattasio

added embeddable xml input text to modal

parent edacd22c
...@@ -21,13 +21,12 @@ $(document).ready(function() { ...@@ -21,13 +21,12 @@ $(document).ready(function() {
$('.unit-history ol a').bind('click', showHistoryModal); $('.unit-history ol a').bind('click', showHistoryModal);
$modal.bind('click', hideModal); $modal.bind('click', hideModal);
$modalCover.bind('click', hideHistoryModal); $modalCover.bind('click', hideHistoryModal);
$modalCover.bind('click', hideModal);
$('.assets .upload-button').bind('click', showUploadModal); $('.assets .upload-button').bind('click', showUploadModal);
$('.upload-modal .close-button').bind('click', hideModal); $('.upload-modal .close-button').bind('click', hideModal);
$('a.show-xml').toggle(showEmbeddableXML, hideEmbeddableXML);
$('.embeddable-xml-input').bind('click', function(){ $(this).select(); }); $('.embeddable-xml-input').bind('click', function(){ $(this).select(); });
$('a.copy-button').toggle(showEmbeddableXML, hideEmbeddableXML);
$('.unit .item-actions .delete-button').bind('click', deleteUnit); $('.unit .item-actions .delete-button').bind('click', deleteUnit);
$('.new-unit-item').bind('click', createNewUnit); $('.new-unit-item').bind('click', createNewUnit);
$('.save-subsection').bind('click', saveSubsection); $('.save-subsection').bind('click', saveSubsection);
...@@ -119,18 +118,6 @@ function removePolicyMetadata(e) { ...@@ -119,18 +118,6 @@ function removePolicyMetadata(e) {
_parent_el.appendTo("#policy-to-delete"); _parent_el.appendTo("#policy-to-delete");
} }
function showEmbeddableXML(e) {
$ceiling = $(this).parents('tr');
if ($ceiling.length === 0) $ceiling = $(this).parents('.upload-modal');
$ceiling.find('.embeddable-xml').html('<img src="'+$(this).attr('href')+'"/>');
}
function hideEmbeddableXML(e) {
$ceiling = $(this).parents('tr');
console.log($ceiling.length)
if ($ceiling.length === 0) $ceiling = $(this).parents('.upload-modal');
$ceiling.find('.embeddable-xml').html("");
}
// This method only changes the ordering of the child objects in a subsection // This method only changes the ordering of the child objects in a subsection
function onUnitReordered() { function onUnitReordered() {
...@@ -342,8 +329,11 @@ function displayFinishedUpload(xhr) { ...@@ -342,8 +329,11 @@ function displayFinishedUpload(xhr) {
if(xhr.status = 200){ if(xhr.status = 200){
markAsLoaded(); markAsLoaded();
} }
var resp = JSON.parse(xhr.responseText); var resp = JSON.parse(xhr.responseText);
$('.upload-modal .copy-button').attr('href', xhr.getResponseHeader('asset_url')); $('.upload-modal .embeddable-xml-input').val('<img src="' + xhr.getResponseHeader('asset_url') + '"/>');
$('.upload-modal .embeddable').show();
$('.upload-modal .file-name').hide();
$('.upload-modal .progress-fill').html(resp.msg); $('.upload-modal .progress-fill').html(resp.msg);
$('.upload-modal .choose-file-button').html('Load Another File').show(); $('.upload-modal .choose-file-button').html('Load Another File').show();
$('.upload-modal .progress-fill').width('100%'); $('.upload-modal .progress-fill').width('100%');
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
} }
} }
.name-col {
font-size: 14px;
}
.date-col { .date-col {
font-size: 12px; font-size: 12px;
} }
...@@ -165,6 +169,21 @@ ...@@ -165,6 +169,21 @@
text-align: center; text-align: center;
} }
.embeddable {
display: none;
margin: 30px 0 130px;
label {
display: block;
margin-bottom: 10px;
font-weight: 700;
}
}
.embeddable-xml-input {
width: 400px;
}
.copy-button { .copy-button {
@include white-button; @include white-button;
display: none; display: none;
......
...@@ -97,8 +97,10 @@ ...@@ -97,8 +97,10 @@
<div class="progress-bar"> <div class="progress-bar">
<div class="progress-fill"></div> <div class="progress-fill"></div>
</div> </div>
<div class="embeddable-xml"></div> <div class="embeddable">
<a href="#" class="copy-button">Show Embeddable XML</a> <label>Embeddable XML:</label>
<input type="text" class="embeddable-xml-input" value='<img src="${asset['url']}"/>'>
</div>
<form class="file-chooser" action="${upload_asset_callback_url}" <form class="file-chooser" action="${upload_asset_callback_url}"
method="post" enctype="multipart/form-data"> method="post" enctype="multipart/form-data">
<a href="#" class="choose-file-button">Choose File</a> <a href="#" class="choose-file-button">Choose File</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment