Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunil committed Sep 29, 2024
1 parent 9cc6098 commit 1cf1f63
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 35 deletions.
64 changes: 37 additions & 27 deletions js/pages/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,36 +235,46 @@ class cDetailSolButtons {

//-------------------------------------------------------------------------------
var sID
sID = cJquery.child_ID(oContainer, this.SOL_CHILD_ID)
this.pr_add_button(oContainer, sID, ' All Sol Images', '???', e => oThis.onClickSol(e))
sID = cJquery.child_ID(oContainer, this.INSTR_CHILD_ID)
this.pr_add_button(oContainer, sID, 'Show Intrument Images', 'loading', () => oThis.onClickInstr())

sID = cJquery.child_ID(oContainer, this.UTC_CHILD_ID)
var oSpan = $('<SPAN>', { id: sID, class: 'date' })
var oSubcontainer = $('<SPAN>', { class: 'w3-theme-l1 w3-padding' })
{
oSpan.append('date goes here')
oContainer.append(oSpan)
oSubcontainer.append('Sol: ')
sID = cJquery.child_ID(oContainer, this.SOL_CHILD_ID)
this.pr_add_button(oSubcontainer, sID, ' All Sol Images', '???', e => oThis.onClickSol(e))
sID = cJquery.child_ID(oContainer, this.INSTR_CHILD_ID)
this.pr_add_button(oSubcontainer, sID, 'Show Intrument Images', 'loading', () => oThis.onClickInstr())
sID = cJquery.child_ID(oContainer, this.CAL_CHILD_ID)
this.pr_add_button(oSubcontainer, sID, 'Show Sol Calendar', 'Calendar', () => oThis.onClickCal())
this.pr_add_button(oSubcontainer, null, 'Highlights', 'Highlights', () => oThis.onClickHighlights())
this.pr_add_button(oSubcontainer, null, 'Show Thumbnails', 'Thumbnails', () => oThis.onClickThumbnails())
oContainer.append(oSubcontainer)
}
oContainer.append(cBrowser.whitespace(20))

sID = cJquery.child_ID(oContainer, this.CAL_CHILD_ID)
this.pr_add_button(oContainer, sID, 'Show Sol Calendar', 'Calendar', () => oThis.onClickCal())
this.pr_add_button(oContainer, null, 'Highlights', 'Highlights', () => oThis.onClickHighlights())
this.pr_add_button(oContainer, null, 'Show Thumbnails', 'Thumbnails', () => oThis.onClickThumbnails())
this.pr_add_button(oContainer, null, 'Original NASA Image', 'Original', () => oThis.onClickNASA())
sID = cJquery.child_ID(oContainer, this.NASA_CHILD_ID)
this.pr_add_button(oContainer, sID, 'MSL curiosity Raw images', 'MSL Raw Image', () => oThis.onClickMSLRaw())
sID = cJquery.child_ID(oContainer, this.PDS_CHILD_ID)
this.pr_add_button(oContainer, sID, 'released PDS product', 'PDS Product', () => oThis.onClickPDS())
this.pr_add_button(oContainer, null, 'Search related with google', 'Google', () => oThis.onClickGoogle())

//------------------------------------------------------------------------------
oContainer.append(cBrowser.whitespace(50))

//------------------------------------------------------------------------------
const sImgNoID = cJquery.child_ID(oContainer, this.IMGNO_CHILD_ID)
const sImgMaxID = cJquery.child_ID(oContainer, this.IMGMAX_CHILD_ID)
oContainer.append("image <span id='" + sImgNoID + "'>??</span> of <span id='" + sImgMaxID + "'>??</span>")
oSubcontainer = $('<SPAN>', { class: 'w3-theme-l1 w3-padding' })
{
oSubcontainer.append('This Product: ')
sID = cJquery.child_ID(oContainer, this.UTC_CHILD_ID)
var oSpan = $('<SPAN>', { id: sID, class: 'date' })
{
oSpan.append('date goes here')
oSubcontainer.append(oSpan)
}
this.pr_add_button(oSubcontainer, null, 'Original NASA Image', 'Original', () => oThis.onClickNASA())
sID = cJquery.child_ID(oContainer, this.NASA_CHILD_ID)
this.pr_add_button(oSubcontainer, sID, 'MSL curiosity Raw images', 'MSL Raw Image', () => oThis.onClickMSLRaw())
sID = cJquery.child_ID(oContainer, this.PDS_CHILD_ID)
this.pr_add_button(oSubcontainer, sID, 'released PDS product', 'PDS Product', () => oThis.onClickPDS())
this.pr_add_button(oSubcontainer, null, 'Search related with google', 'Google', () => oThis.onClickGoogle())

//------------------------------------------------------------------------------
oSubcontainer.append(cBrowser.whitespace(20))

//------------------------------------------------------------------------------
const sImgNoID = cJquery.child_ID(oContainer, this.IMGNO_CHILD_ID)
const sImgMaxID = cJquery.child_ID(oContainer, this.IMGMAX_CHILD_ID)
oSubcontainer.append("image <span id='" + sImgNoID + "'>??</span> of <span id='" + sImgMaxID + "'>??</span>")
oContainer.append(oSubcontainer)
}
}

//****************************************************************
Expand Down
3 changes: 1 addition & 2 deletions js/widgets/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ $.widget('ck.instrumentimage', {
},
consts: {
WAIT_VISIBLE: 1000,
WAIT_IMAGE: cAppLocations.home + '/images/browser/chicken_icon.png',
TAGS_CHILD_ID: 'iitci'
},

Expand Down Expand Up @@ -55,7 +54,7 @@ $.widget('ck.instrumentimage', {
oDiv = $('<DIV>', { class: 'ui-widget-body' })
const sWaitImgID = oElement.attr('id') + 'i'
const oWaitImg = $('<IMG>', {
src: this.consts.WAIT_IMAGE,
src: cAppLocations.CK_IMAGE,
id: sWaitImgID
})
oDiv.append(oWaitImg)
Expand Down
11 changes: 11 additions & 0 deletions js/widgets/solhighlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ $.widget('ck.solhighlights', {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% Definition
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/* global cQueueRunner */
class cInstrHighlight {
static delay = 250
static {
this.imgqueue = new cQueueRunner(this.delay)
}
options = {
mission: null,
sol: null,
Expand Down Expand Up @@ -181,6 +186,12 @@ class cInstrHighlight {
//using the query CSS styles
oElement.uniqueId()
oElement.empty()

//subscribe to the queue
const oQueue = cInstrHighlight.imgqueue
bean.on(oQueue, cQueueRunner.EVENT_STEP, () => oThis.onImageQueue())

//render
oElement.addClass('w3-card')

var oHeader = $('<Header>', { class: 'w3-container w3-theme-d3' })
Expand Down
8 changes: 4 additions & 4 deletions js/widgets/thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
/* global cQueueRunner */
class cThumbnail {
static delay = 250
static thumbqueue

static thumbqueue = null
static {
cThumbnail.thumbqueue = new cQueueRunner(cThumbnail.delay)
this.thumbqueue = new cQueueRunner(this.delay)
}

element = null
Expand Down Expand Up @@ -83,6 +82,8 @@ class cThumbnail {
oImg.on('click', () => oThis.onThumbClick())
oElement.append(oImg)
}
const oThumbQ = cThumbnail.thumbqueue
bean.on(oThumbQ, cQueueRunner.EVENT_STEP, oInstance => oInstance.onBetterQStep())

// optimise server requests, only display thumbnail if its in viewport
oElement.on('inview', function (poEvent, pbIsInView) {
Expand Down Expand Up @@ -163,7 +164,6 @@ class cThumbnail {
if (oThumbQ.stopping) return
if (oImg.visible()) {
oThumbQ.queue.push(null, this)
bean.on(oThumbQ, cQueueRunner.EVENT_STEP, oq => oq.onBetterQStep())
if (!oThumbQ.running) oThumbQ.start()
} else {
cDebug.write('Basic thumb not in view: ')
Expand Down
2 changes: 2 additions & 0 deletions php/app-config/app-consts.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ class cAppConsts {
const CROP_WIDTH = 120;
const CROP_HEIGHT = 120;
const THUMB_QUALITY = 90;
static $CK_IMAGE = null;
}
cAppConsts::$CK_IMAGE = cAppGlobals::$jsImages . "/browser/chicken-icon.png";

class cAppUrlParams {
const OPERATION = "o";
Expand Down
1 change: 1 addition & 0 deletions php/fragments/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class cSecret {
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/http.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/httpqueue.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/auth.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/queue.js"></script>
<script src="<?= cAppGlobals::$jsSpaceInc ?>/curiosity.js"></script>
<script src="<?= cAppGlobals::$jsSpaceInc ?>/tagging.js"></script>
<script src="<?= cAppGlobals::$jsSpaceInc ?>/imghilite.js"></script>
Expand Down
1 change: 0 additions & 1 deletion php/pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class cIndexPageConsts {
<!-- main scripts -->
<LINK href="<?= $home ?>/css/drag.css" rel="stylesheet" type="text/css">
<LINK href="<?= $home ?>/css/tabs.css" rel="stylesheet" type="text/css">
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/queue.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/actionqueue.js"></script>
<script src="<?= cAppGlobals::$jsHome ?>/pages/index.js"></script>
<script src="<?= cAppGlobals::$jsWidgets ?>/thumbnail.js"></script>
Expand Down
1 change: 0 additions & 1 deletion php/pages/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
include cAppGlobals::$appPhpFragments . "/header.php";
?>
<script src="<?= cAppGlobals::$jsHome ?>/pages/tag.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/queue.js"></script>
<script src="<?= cAppGlobals::$jsInc ?>/ck-inc/actionqueue.js"></script>
<script src="<?= cAppGlobals::$jsWidgets ?>/tag-view.js"></script>
<script src="<?= cAppGlobals::$jsWidgets ?>/image.js"></script>
Expand Down

0 comments on commit 1cf1f63

Please sign in to comment.