Skip to content

Commit

Permalink
Merge pull request #52 from mwoehlke-kitware/view-detail-url
Browse files Browse the repository at this point in the history
Add 'view URL' function
  • Loading branch information
jcfr committed Apr 1, 2014
2 parents a2774c4 + 4f15764 commit 7d22178
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions public/js/extension/extension.view.js
Expand Up @@ -148,6 +148,22 @@ $(document).ready(function() {
});
}

$('#viewUrl').click(function(){
$('#dialogUrl').dialog({
width: 450,
modal: true,
open: function(){
$('.ui-widget-overlay').click(function(){
$('#dialogUrl').dialog('close');
})
}
});
$('#dialogUrl input').select();
$('#dialogUrl input').click(function(){
$(this).select();
})
});

$('#commentsDiv h4').remove();
$('#ratingsDiv h4').remove();
$('#ratingsUser').appendTo('#ratingsDiv');
Expand Down
22 changes: 22 additions & 0 deletions views/extension/view.phtml
Expand Up @@ -92,6 +92,28 @@ $this->headScript()->appendFile($this->webroot.'/modules/comments/public/js/item
<div class="info_item">
<?php echo $this->extension->getItem()->getDownload() ?> downloads
</div>
<div class="info_item">
<a id="viewUrl">View URL</a>
<div id="dialogUrl" title="Extension: <?php echo $this->extension->getProductname()?>" style="display: none;">
<p>
The following URL points to the extension details page (for the Slicer <?php
echo $this->extension->getSlicerRevision();
echo ' ';
echo $this->extension->getArch();
echo ' ';
echo $this->extension->getOs();
?> build). This URL will remain unchanged, allowing you to share it.
</p>
<div style="width: 100%; position: relative; margin: 0; padding: 0;">
<input
style="position: absolute; left: 0; right: 0; width: -moz-calc(100% - 14px);"
class="extensionField"
type="text"
value="<?php echo UtilityComponent::getServerURL().$this->webroot?>/slicerappstore/extension/view?extensionId=<?php echo $this->extension->getKey()?>"
readonly>
</div>
</div>
</div>
</div>
<div class="rating_area">
<?php echo $this->element('rating', 'ratings'); ?>
Expand Down

0 comments on commit 7d22178

Please sign in to comment.