Skip to content

Commit

Permalink
Atmos js browser 2.1.0 (#4)
Browse files Browse the repository at this point in the history
* updated atmos-js to 2.1.2 and removed check for Atmos browser-compat feature (ECS supports this but does not advertise the feature)

* Removes external Jquery dependency from the JSBrowser. This is allowed due to Jquery's MIT license.
  • Loading branch information
Ken Steinfeldt authored and twincitiesguy committed Sep 17, 2018
1 parent 9da89da commit 0455c3f
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 122 deletions.
92 changes: 0 additions & 92 deletions AtmosJSBrowser/WebContent/js/atmos-min-2.1.1.js

This file was deleted.

5 changes: 5 additions & 0 deletions AtmosJSBrowser/WebContent/js/jquery-min-1.9.1.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions AtmosJSBrowser/WebContent/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
</style>
<![endif]-->
<!-- Atmos REST API -->
<script type="text/javascript" src="js/atmos-min-2.1.1.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/atmos-browser-min-2.0.1.js"></script>
<script type="text/javascript" src="js/atmos-min-2.1.2.js"></script>
<script type="text/javascript" src="js/jquery-min-1.9.1.js"></script>
<script type="text/javascript" src="js/atmos-browser-min-2.1.0.js"></script>
<script type="text/javascript">
function getHashParameterByName( name ) {
var match = new RegExp( '[#&]' + name + '=([^&]*)' ).exec( window.location.hash );
Expand Down
15 changes: 12 additions & 3 deletions AtmosJSBrowser/build.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="atmos-js-browser" default="dist">
<property name="src" location="src"/>
<property name="version" value="2.0.1"/>
<property name="version" value="2.1.0"/>

<property name="jsdoc_home" value="${user.home}/local/jsdoc-toolkit"/>
<property name="jsdoc_home" value="${user.home}/Projects/jsdoc-toolkit"/>

<!-- TODO: need to find a replacement for this
<path id="jsdoc_classpath">
<fileset dir="${jsdoc_home}">
<include name="*.jar"/>
Expand All @@ -24,11 +25,19 @@
<fileset dir="${src}" includes="*.js"/>
</jsdoctoolkit>
</target>
-->

<target name="atmos-js">
<ant dir="../AtmosJS" antfile="build.xml" target="compile" inheritall="false"/>
<copy todir="WebContent/js">
<fileset dir="../AtmosJS" includes="atmos-min-*.js"/>
</copy>
</target>

<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask"
classpath="compiler.jar"/>

<target name="compile">
<target name="compile" depends="atmos-js">

<jscomp compilationLevel="simple" debug="false" output="WebContent/js/atmos-browser-min-${version}.js">
<define name="ATMOS_BROWSER_VERSION" value="${version}"/>
Expand Down
9 changes: 1 addition & 8 deletions AtmosJSBrowser/src/AtmosBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ AtmosBrowser.prototype._init = function() {
// selecting files triggers an upload
if ( this.$uploadField.length > 0 ) AtmosBrowserUtil.bind( this.$uploadField[0], 'change', function( event ) {
if ( event.target.files ) browser.uploadFiles( event.target.files );
else {
if ( browser.atmosInfo.browsercompat ) browser.uploadFile( null, true );
else browser.util.error( browser.templates.get( 'atmosError.noBrowserCompat' ).render( {info: AtmosBrowserUtil.dumpObject( browser.atmosInfo )} ) );
}
else browser.uploadFile( null, true );
} );

// drag-n-drop upload
Expand Down Expand Up @@ -286,10 +283,6 @@ AtmosBrowser.prototype.openSelectedItems = function() {
}
};
AtmosBrowser.prototype.downloadSelectedItems = function() {
if ( !this.atmosInfo.browsercompat ) {
this.util.error( this.templates.get( 'atmosError.noBrowserCompat' ).render( {info: AtmosBrowserUtil.dumpObject( this.atmosInfo )} ) );
return;
}
var selectedRows = this.getSelectedRows();
if ( selectedRows.length == 0 ) this.util.error( this.templates.get( 'nothingSelectedError' ).render() );
if ( !this._checkNoDirectories( selectedRows ) ) return;
Expand Down
2 changes: 1 addition & 1 deletion AtmosJSBrowser/src/AtmosBrowserUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ AtmosBrowserUtil.prototype.parentDirectory = function( path ) {
};
AtmosBrowserUtil.prototype.list = function( path, includeMetadata, callback ) {
var util = this;
var options = new ListOptions( 0, null, true, null, null );
var options = new ListOptions( 0, null, includeMetadata, null, null );
this.showStatus( 'Listing directory...' );
if ( this.useNamespace ) {
var list_call = function( util, options, entries ) {
Expand Down
3 changes: 1 addition & 2 deletions AtmosJSBrowser/src/AtmosTemplateEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,5 @@ AtmosTemplateEngine.MESSAGE_TEMPLATES = {
'atmosError.1051': 'Checksum verification may only be used with append update requests',
'atmosError.1052': 'The specified checksum algorithm is not implemented.',
'atmosError.1053': 'Checksum cannot be computed for an object on update for which one wasn\'t computed at create time.',
'atmosError.1054': 'The checksum input parameter was missing from the request.',
'atmosError.noBrowserCompat': 'This feature is not supported on your current browser by this version of Atmos (%{info}).'
'atmosError.1054': 'The checksum input parameter was missing from the request.'
};
2 changes: 1 addition & 1 deletion AtmosJSBrowser/test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</style>
<![endif]-->
<!-- Atmos REST API -->
<script type="text/javascript" src="../WebContent/js/atmos-min-2.1.1.js"></script>
<script type="text/javascript" src="../WebContent/js/atmos-min-2.1.2.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.1.1.js"></script>
<script type="text/javascript" src="../src/deps.js"></script>
Expand Down
39 changes: 27 additions & 12 deletions AtmosJSBrowser/upload.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
#!/bin/sh
if [ -z "$2" ]
then
echo usage: "$0 <local_html_file> /remote_path"
echo usage: "$0 <local_html_file> <remote_path>"
echo typical remote path is /browser
exit 1
fi

# set these to avoid typing
export HOST=
export PORT=
export xUID=
export SECRET=

# set jar location here
UPLOAD_JAR=./JSUpload.jar

echo "Atmos hostname: \c"
read HOST
if [ -z "$HOST" ]; then
echo "Atmos hostname: \c"
read HOST
fi

echo "Atmos port [80]: \c"
read PORT
if [ -z "$PORT" ]
then
PORT=80
if [ -z "$PORT" ]; then
echo "Atmos port [80]: \c"
read PORT
if [ -z "$PORT" ]
then
PORT=80
fi
fi

echo "Atmos UID: \c"
read xUID
if [ -z "xUID" ]; then
echo "Atmos UID: \c"
read xUID
fi

echo "Atmos secret: \c"
read SECRET
if [ -z "SECRET" ]; then
echo "Atmos secret: \c"
read SECRET
fi

java -jar $UPLOAD_JAR -h $HOST -p $PORT -u $xUID -s $SECRET -f $1 -r $2

0 comments on commit 0455c3f

Please sign in to comment.