Skip to content

Commit

Permalink
issue #20, contacts, jnlp, error logging added
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherOneAckap committed Feb 28, 2014
1 parent c5f2e3e commit 7a8aa38
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/samp.js
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ You can pass options object to initialization function:

get Aladin(DSS2) #{coords} 15arcmin;sync;"UCAC3, #{name}" = get VizieR(UCAC3,allcolumns) #{coords} #{radius}arcmin;sync;set "UCAC3, #{name}" shape=triangle color=red

where #{coords}, #{name} and #{radius} are placeholders.
where #{coords}, #{name} and #{radius} are placeholders. IMPORTANT: To be able send scripts to aladin, you must use included in distribution jnlp file as default hub. JSAMP hub used in Topcat restricts by default unknown MTypes, so it is necessary to run it with -web:norestrictmtypes key.

e.g. customizing table headings sort icons

var tOptions = { sortIcon: { asc: '<img src="up.png"/>', desc: '<img src="down.png"/>' } };
AstroTools.init({ tableOptions: tOptions })


Features
========

Expand Down Expand Up @@ -165,3 +166,4 @@ Markup Example

<a class="at-table-link" data-vo-table-id="123456" href="http://andromeda.star.bris.ac.uk/data/messier.xml" data-vo-table-name="Exampe table">Table</a>

Contact me anotheroneackap@gmail.com, if you still have a question.
14 changes: 9 additions & 5 deletions js/astrotools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var AstroTools = (function() {
ClientTracker,
waitingForHubInterval,
isHubOnlineInterval,
defaultHubUrl = 'http://www.starlink.ac.uk/topcat/topcat-lite.jnlp',
defaultHubUrl = 'topcat-lite.jnlp',
iconUrl = 'img/icon.png',
aladinScript = 'get Aladin(DSS2) #{coords} 15arcmin;sync;"UCAC3, #{name}" = get VizieR(UCAC3,allcolumns) #{coords} #{radius}arcmin;sync;set "UCAC3, #{name}" shape=triangle color=red',
table,
Expand Down Expand Up @@ -177,6 +177,7 @@ var AstroTools = (function() {
}

function noop() { }
function errorHandler( error ) { if ( window.console ) console.error( error ) }

function disconnect() {
if ( SAMPConnection ) {
Expand Down Expand Up @@ -225,8 +226,11 @@ var AstroTools = (function() {
function declareMetadata() {
SAMPConnection.declareMetadata([{
'samp.name': 'AstroTools',
'samp.description': 'Simple toolbox',
'samp.icon.url': absolutizeURL( iconUrl )
'samp.description.text': 'Simple toolbox',
'samp.icon.url': absolutizeURL( iconUrl ),
'home.page': 'https://github.com/AnotherOneAckap/AstroTools',
'author.name': 'Askar Timirgazin, Ivan Zolotukhin',
'author.email': 'anotheroneackap@gmail.com'
}], noop, onError );
}

Expand Down Expand Up @@ -331,7 +335,7 @@ var AstroTools = (function() {
'script': script
});
if ( that.SAMPConnection instanceof samp.Connection && ! that.SAMPConnection.closed )
that.SAMPConnection.notifyAll([message]);
that.SAMPConnection.notifyAll( [message], noop, errorHandler );

// sending to others
var
Expand All @@ -343,7 +347,7 @@ var AstroTools = (function() {
'dec': dec.toString()
});
if ( that.SAMPConnection instanceof samp.Connection && ! that.SAMPConnection.closed )
that.SAMPConnection.notifyAll([message]);
that.SAMPConnection.notifyAll( [message], noop, errorHandler );
});
}

Expand Down
28 changes: 28 additions & 0 deletions topcat-lite.jnlp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<jnlp spec="1.0+" codebase="http://andromeda.star.bris.ac.uk/~mbt/topcat">
<information>
<title>TOPCAT</title>
<vendor>Mark Taylor, Bristol University, UK</vendor>
<homepage href="http://www.starlink.ac.uk/topcat/"/>
<description kind="one-line">"TOPCAT - lite version"</description>
<icon href="images/tc_sok.gif"/>
<offline-allowed/>
<!-- <shortcut online="false"><desktop/></shortcut> -->
<related-content href="sun253/index.html">
<title>SUN/253</title>
<description kind="one-line">Comprehensive user document</description>
</related-content>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+"/>
<jar href="topcat-lite.jar"/>
</resources>
<application-desc main-class="uk.ac.starlink.topcat.Driver">
<argument>-jsamp</argument>
<argument>hub</argument>
<argument>-web:norestrictmtypes</argument>
</application-desc>
</jnlp>

0 comments on commit 7a8aa38

Please sign in to comment.