r1984 - branches/milestone_43.x/wpi/extensions

1 view
Skip to first unread message

martijn....@bigcat.unimaas.nl

unread,
Jan 5, 2017, 3:00:04 PM1/5/17
to wikipathw...@googlegroups.com
Author: ariutta
Date: Thu Jan 5 22:45:43 2017
New Revision: 1984

Log:
Changed styling of editor launch button. Fixed instructions to display for FF.

Modified:
branches/milestone_43.x/wpi/extensions/pathwayThumb.php

Modified: branches/milestone_43.x/wpi/extensions/pathwayThumb.php
==============================================================================
--- branches/milestone_43.x/wpi/extensions/pathwayThumb.php (original)
+++ branches/milestone_43.x/wpi/extensions/pathwayThumb.php Thu Jan 5 22:45:43 2017
@@ -72,17 +72,21 @@
$identifier = $pathway->getIdentifier();
$version = $pathway->getLatestRevision();
$editButton = '<div style="float:left;">' .
- //'<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>' .
// see http://www.ericmmartin.com/projects/simplemodal/
'<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/simplemodal/1.4.4/jquery.simplemodal.min.js"></script>' .
- '<button id="download-from-page" type="button" class="btn btn-primary btn-lg">Launch Editor</button>' .
+ // this should just be a button, but the button class only works for "a" elements with text inside.
+ '<a id="download-from-page" href="#" onclick="return false;" class="button"><span>Launch Editor</span></a>' .
'<script type="text/javascript">' .
" $('#download-from-page').click(function() { " .
- " $.modal('<div id=\"jnlp-instructions\" style=\"width: 576px; height: 450px; background-color:white; \"> <img src=\"//wikipathways.github.io/academy/images/jnlp-instructions.png\"> <button id=\"download-from-modal\" class=\"btn btn-primary btn-lg\" type=\"button\" onClick=\"$.modal.close()\" style=\"float:right; margin: 2px;\">Got It</button> </div>', {overlayClose:true, overlayCss: {backgroundColor: \"gray\"}, opacity: 50}); " .
+ " $.modal('<div id=\"jnlp-instructions\" style=\"width: 576px; height: 450px; background-color:white; \"> <img id=\"jnlp-instructions-diagram\" src=\"https://wikipathways.github.io/academy/images/jnlp-instructions.png\" width=\"576px\" height=\"403px\" alt=\"The JNLP will download to your default folder. Right-click the JNLP file and select Open.\"> <button id=\"download-from-modal\" class=\"btn btn-primary btn-lg\" type=\"button\" onClick=\"$.modal.close()\" style=\"float:right; margin: 2px;\">Got It</button> </div>', {overlayClose:true, overlayCss: {backgroundColor: \"gray\"}, opacity: 50}); " .
+ // We need the kludge below, because the image doesn't display in FF otherwise.
+ " window.setTimeout(function() { " .
+ " $('#jnlp-instructions-diagram').attr('src', 'https://wikipathways.github.io/academy/images/jnlp-instructions.png'); " .
+ "}, 10);" .
// server must set Content-Disposition: attachment
- " window.location = '" . SITE_URL . "/wpi/extensions/PathwayViewer/pathway-jnlp.php?identifier=" . $identifier . "'; " .
- // TODO why do the ampersand symbols below get parsed as HTML entities?
+ // TODO why do the ampersand symbols below get parsed as HTML entities? Disabling this line and using the minimal line below for now, but we shouldn't have to do this..
//" window.location = '" . SITE_URL . "/wpi/extensions/PathwayViewer/pathway-jnlp.php?identifier=" . $identifier . "&version=" . $version . "&filename=WikiPathwaysEditor'; " .
+ " window.location = '" . SITE_URL . "/wpi/extensions/PathwayViewer/pathway-jnlp.php?identifier=" . $identifier . "'; " .
" }); " .
'</script>' .
'</div>';
Reply all
Reply to author
Forward
0 new messages