Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Jump Options #3683

Merged
merged 7 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions app/views/explore.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -621,31 +621,15 @@ <h2 id="pop-up-message-title" class="bold">Title</h2>
<div id="modal-skip-holder" class="hidden">
<div id="modal-skip-background"></div>
<div id="modal-skip-box">
<div id="modal-skip-box-new-location"></div>
<div id="modal-skip-box-new-neighborhood"></div>
<div id="modal-skip-title" class="bold">
<p>@Messages("audit.left.ui.jump.title")</p>
</div>
<div id="modal-skip-box-content">
@if(user.isEmpty || user.get.role.getOrElse("") != "Turker") {
<input type="button" class="overlay-option" id="modal-skip-explore" value="@Messages("audit.left.ui.jump.button.explore")">
}
<input type="button" class="overlay-option" id="modal-skip-unavailable" value="@Messages("audit.left.ui.jump.button.unavailable")">
</div>
<div class="modal-skip-cancel-button">
<button class="button" id="modal-skip-cancel-first-button">@Messages("cancel")</button>
</div>
</div>
<div id="modal-skip-box-neighborhood">
<div id="modal-skip-neighborhood-title" class="bold">
<p>@Messages("audit.left.ui.jump.explore.title")</p>
</div>
<div id="modal-skip-neighborhood-content">
<input type="button" class="overlay-option" id="modal-skip-continue-neighborhood" value="@Messages("audit.left.ui.jump.explore.button.same.neighborhood")">
<input type="button" class="overlay-option" id="modal-skip-new-neighborhood" value="@Messages("audit.left.ui.jump.explore.button.new.neighborhood")">
<div id="modal-skip-content">
<input type="button" class="overlay-option" id="modal-skip-continue-neighborhood" value="@Messages("audit.left.ui.jump.same.neighborhood")">
<input type="button" class="overlay-option" id="modal-skip-new-neighborhood" value="@Messages("audit.left.ui.jump.new.neighborhood")">
</div>
<div class="modal-skip-cancel-button">
<button class="button" id="modal-skip-cancel-second-button">@Messages("cancel")</button>
<div class="modal-skip-cancel-button-holder">
<button class="button" id="modal-skip-cancel-button">@Messages("cancel")</button>
</div>
</div>
</div>
Expand Down
9 changes: 3 additions & 6 deletions conf/messages.de
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,9 @@ audit.left.ui.stuck = Verlaufen
audit.left.ui.stuck.tooltip = Wir werden versuchen, Sie zurück zu Ihrer Mission zu bringen
audit.left.ui.jump = Wechseln
audit.left.ui.jump.tooltip = Beginnen Sie mit der Erkundung eines neuen Ortes
audit.left.ui.jump.title = Ort wechseln, weil:
audit.left.ui.jump.button.explore = Ich will ein anderes Gebiet erkunden!
audit.left.ui.jump.button.unavailable = Ich kann nicht in die Richtung gehen, in die ihr mich führt.
audit.left.ui.jump.explore.title = Zu einem neuem Ort wechseln oder in ein neues Quartier wechseln?
audit.left.ui.jump.explore.button.same.neighborhood = Zu einem neuen Ort in diesem Quartier wechseln
audit.left.ui.jump.explore.button.new.neighborhood = In ein neues Quartier wechseln
audit.left.ui.jump.title = Wenn Sie nicht weiterkommen, klicken Sie stattdessen auf die Schaltfläche "Verlaufen“!
audit.left.ui.jump.same.neighborhood = Zu einem neuen Ort in diesem Quartier wechseln
audit.left.ui.jump.new.neighborhood = In ein neues Quartier wechseln

audit.right.ui.overall.stats = Gesamtübersicht
audit.right.ui.current.neighborhood = Aktuelles Quartier
Expand Down
9 changes: 3 additions & 6 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,9 @@ audit.left.ui.stuck = Stuck
audit.left.ui.stuck.tooltip = We''ll try to move you back to your mission
audit.left.ui.jump = Jump
audit.left.ui.jump.tooltip = Start exploring somewhere new
audit.left.ui.jump.title = Jump to another location because:
audit.left.ui.jump.button.explore = I want to explore another area!
audit.left.ui.jump.button.unavailable = I cannot go the direction you want me to walk.
audit.left.ui.jump.explore.title = Go to a new location or a new neighborhood?
audit.left.ui.jump.explore.button.same.neighborhood = Go to a new location in this neighborhood
audit.left.ui.jump.explore.button.new.neighborhood = Go to a new neighborhood
audit.left.ui.jump.title = If you can''t move forward, click the "Stuck" button instead!
audit.left.ui.jump.same.neighborhood = Go to a new location in this neighborhood
audit.left.ui.jump.new.neighborhood = Go to a new neighborhood

audit.right.ui.overall.stats = Overall Stats
audit.right.ui.current.neighborhood = Current Neighborhood
Expand Down
5 changes: 2 additions & 3 deletions conf/messages.en-NZ
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ audit.ribbon.missing.ramp = <u>M</u>issing Drop Kerb
audit.ribbon.no.sidewalk = <u>N</u>o Footpath
audit.ribbon.crosswalk = Pedestrian<br>Crossing (<u>W</u>)
audit.ribbon.occlusion = Can''t See the Footpath (<u>B</u>)
audit.left.ui.jump.explore.title = Go to a new location or a new neighbourhood?
audit.left.ui.jump.explore.button.same.neighborhood = Go to a new location in this neighbourhood
audit.left.ui.jump.explore.button.new.neighborhood = Go to a new neighbourhood
audit.left.ui.jump.same.neighborhood = Go to a new location in this neighbourhood
audit.left.ui.jump.new.neighborhood = Go to a new neighbourhood
audit.right.ui.current.neighborhood = Current Neighbourhood
audit.right.ui.distance = kilometres
audit.mission.complete.progress.neighborhood.others = Others explored in this neighbourhood
Expand Down
9 changes: 3 additions & 6 deletions conf/messages.es
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,9 @@ audit.left.ui.stuck = Atorado
audit.left.ui.stuck.tooltip = Intentaremos llevarte de regreso a tu misión
audit.left.ui.jump = Saltar
audit.left.ui.jump.tooltip = Empieza a explorar un lugar nuevo
audit.left.ui.jump.title = Saltar a otra ubicación porque:
audit.left.ui.jump.button.explore = ¡Quiero explorar otra área!
audit.left.ui.jump.button.unavailable = No puedo ir en la dirección que quieres que camine.
audit.left.ui.jump.explore.title = ¿Ir a una nueva ubicación o un nuevo barrio?
audit.left.ui.jump.explore.button.same.neighborhood = Ve a una nueva ubicación en este barrio
audit.left.ui.jump.explore.button.new.neighborhood = Ir a un nuevo barrio
audit.left.ui.jump.title = Si no puedes avanzar, haz clic en el botón "Atorado".
audit.left.ui.jump.same.neighborhood = Ve a una nueva ubicación en este barrio
audit.left.ui.jump.new.neighborhood = Ir a un nuevo barrio

audit.right.ui.overall.stats = Estadísticas generales
audit.right.ui.current.neighborhood = Colonia actual
Expand Down
9 changes: 3 additions & 6 deletions conf/messages.nl
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,9 @@ audit.left.ui.stuck = Vastgelopen
audit.left.ui.stuck.tooltip = We zullen proberen u terug te brengen naar uw missie
audit.left.ui.jump = Spring
audit.left.ui.jump.tooltip = Begin met het verkennen van een nieuwe plek
audit.left.ui.jump.title = Spring naar een andere locatie omdat:
audit.left.ui.jump.button.explore = Ik wil een andere locatie ontdekken!
audit.left.ui.jump.button.unavailable = Ik kan me niet bewegen in de richting waar je me heen wilt laten lopen.
audit.left.ui.jump.explore.title = Naar een nieuwe locatie of naar een nieuwe wijk gaan?
audit.left.ui.jump.explore.button.same.neighborhood = Ga naar een nieuwe locatie in de wijk
audit.left.ui.jump.explore.button.new.neighborhood = Ga naar een nieuwe wijk
audit.left.ui.jump.title = Als je niet verder kunt, klik dan op de knop "Vastgelopen"!
audit.left.ui.jump.same.neighborhood = Ga naar een nieuwe locatie in de wijk
audit.left.ui.jump.new.neighborhood = Ga naar een nieuwe wijk

audit.right.ui.overall.stats = Algemene statistieken
audit.right.ui.current.neighborhood = Huidige Wijk
Expand Down
9 changes: 3 additions & 6 deletions conf/messages.zh-TW
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,9 @@ audit.left.ui.stuck = 卡住
audit.left.ui.stuck.tooltip = 我們會盡力讓您回到您的使命
audit.left.ui.jump = 跳過
audit.left.ui.jump.tooltip = 開始探索新的地方
audit.left.ui.jump.title = 跳到另一個地點,因為:
audit.left.ui.jump.button.explore = 我想要探索其他的鄰里!
audit.left.ui.jump.button.unavailable = 我無法往您要我行走的方向前進...
audit.left.ui.jump.explore.title = 前往新的地點或鄰里嗎?
audit.left.ui.jump.explore.button.same.neighborhood = 前往此鄰里的另一個地點
audit.left.ui.jump.explore.button.new.neighborhood = 前往新的鄰里
audit.left.ui.jump.title = 如果您无法前进,请单击“卡住”按钮!
audit.left.ui.jump.same.neighborhood = 前往此鄰里的另一個地點
audit.left.ui.jump.new.neighborhood = 前往新的鄰里

audit.right.ui.overall.stats = 整體統計數據
audit.right.ui.current.neighborhood = 目前所在的鄰里
Expand Down
12 changes: 4 additions & 8 deletions public/javascripts/SVLabel/css/svl-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
width: 110%;
}

#modal-skip-box, #modal-comment-box, #modal-skip-box-neighborhood {
#modal-skip-box, #modal-comment-box {
background: rgba(255, 255, 255, 1);
color: rgba(80, 80, 80, 1);
font-size: 13pt;
Expand All @@ -34,19 +34,15 @@
-moz-border-radius: 3px 3px 3px 3px;
}

#modal-skip-box .overlay-option, #modal-skip-box-neighborhood .overlay-option {
#modal-skip-box .overlay-option {
background-color: rgb(220, 220, 220);
}

#modal-skip-box .overlay-option:hover, #modal-skip-box-neighborhood .overlay-option:hover {
#modal-skip-box .overlay-option:hover {
background-color: rgb(190, 190, 190);
}

#modal-skip-box-neighborhood {
display: none;
}

.modal-skip-cancel-button {
.modal-skip-cancel-button-holder {
text-align: right;
}

Expand Down
9 changes: 3 additions & 6 deletions public/javascripts/SVLabel/src/SVLabel/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,11 @@ function Main (params) {
// Modal.
svl.ui.modalSkip = {};
svl.ui.modalSkip.holder = $("#modal-skip-holder");
svl.ui.modalSkip.firstBox = $("#modal-skip-box");
svl.ui.modalSkip.unavailable = $("#modal-skip-unavailable");
svl.ui.modalSkip.background = $("#modal-skip-background");
svl.ui.modalSkip.box = $("#modal-skip-box");
svl.ui.modalSkip.continueNeighborhood = $("#modal-skip-continue-neighborhood");
svl.ui.modalSkip.cancelFirst = $("#modal-skip-cancel-first-button");
svl.ui.modalSkip.secondBox = $("#modal-skip-box-neighborhood");
svl.ui.modalSkip.newNeighborhood = $("#modal-skip-new-neighborhood");
svl.ui.modalSkip.explore = $("#modal-skip-explore");
svl.ui.modalSkip.cancelSecond = $("#modal-skip-cancel-second-button");
svl.ui.modalSkip.cancel = $("#modal-skip-cancel-button");
svl.ui.modalComment = {};
svl.ui.modalComment.holder = $("#modal-comment-holder");
svl.ui.modalComment.ok = $("#modal-comment-ok-button");
Expand Down
103 changes: 42 additions & 61 deletions public/javascripts/SVLabel/src/SVLabel/modal/ModalSkip.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,44 @@ function ModalSkip(form, onboardingModel, ribbonMenu, taskContainer, tracker, ui
self.hideSkipMenu();
});

/**
* Event Handlers:
*/

/**
* Callback for clicking jump button.
* @param e
*/
this._handleClickJump = function(e) {
this._handleClickJump = (e) => {
e.preventDefault();
tracker.push('ModalSkip_ClickJump');
svl.modalComment.hide();
uiModalSkip.box.show();
self.showSkipMenu();
};

this.enableStuckButton = function() {
uiLeftColumn.stuck.on('click', this._handleClickStuck);
}

this.disableStuckButton = function() {
uiLeftColumn.stuck.off('click');
}

/**
* Callback for clicking stuck button.
*
* The algorithm searches for available GSV imagery along the street you are assigned to. If the pano you are put in
* doesn't help, you can click the Stuck button again; we save the attempted panos so we'll try something new. If we
* can't find anything along the street, we just mark it as complete and move you to a new street.
*/
this._handleClickStuck = function(e) {
this._handleClickStuck = (e) => {
e.preventDefault();
svl.stuckAlert.compassOrStuckClicked();
tracker.push('ModalStuck_ClickStuck');
svl.map.moveForward('ModalStuck_Unstuck', 'ModalStuck_GSVNotAvailable', svl.stuckAlert.stuckClicked);
}

/**
* This method handles a click Unavailable event.
* @param e
*/
this._handleClickUnavailable = function(e) {
tracker.push("ModalSkip_ClickUnavailable");
var task = taskContainer.getCurrentTask();
form.skip(task, "GSVNotAvailable");

ribbonMenu.backToWalk();
self.hideSkipMenu();
};

/**
* This method handles a click Continue Neighborhood event.
* @param e
*/
this._handleClickContinueNeighborhood = function(e) {
this._handleClickContinueNeighborhood = (e) => {
tracker.push("ModalSkip_ClickContinueNeighborhood");
uiModalSkip.secondBox.hide();
uiModalSkip.firstBox.show();
uiModalSkip.box.hide();
var task = taskContainer.getCurrentTask();
form.skip(task, "IWantToExplore");

Expand All @@ -82,46 +66,40 @@ function ModalSkip(form, onboardingModel, ribbonMenu, taskContainer, tracker, ui
* This method handles a click Redirect event.
* @param e
*/
this._handleClickNewNeighborhood = function(e) {
this._handleClickNewNeighborhood = (e) => {
tracker.push("ModalSkip_ClickRedirect");
window.location.replace('/explore?newRegion=true&resumeRoute=false');
};

/**
* This method handles a click Explore event.
* @param e
*/
this._handleClickExplore = function(e) {
tracker.push("ModalSkip_ClickExplore");
uiModalSkip.firstBox.hide();
uiModalSkip.secondBox.show();
};

/**
* This method handles a click Cancel event on the first jump screen.
* This method handles a click Cancel event on the second jump screen.
* @param e
*/
this._handleClickCancelFirst = function(e) {
tracker.push("ModalSkip_ClickCancelFirst");
this._handleClickCancel = (e) => {
tracker.push("ModalSkip_ClickCancel");
uiModalSkip.box.hide();
self.hideSkipMenu();
};

/**
* Enable the stuck button
*/
this.enableStuckButton = () => {
uiLeftColumn.stuck.on('click', this._handleClickStuck);
}

/**
* This method handles a click Cancel event on the second jump screen.
* @param e
* Disable the stuck button
*/
this._handleClickCancelSecond = function(e) {
tracker.push("ModalSkip_ClickCancelSecond");
uiModalSkip.secondBox.hide();
uiModalSkip.firstBox.show();
self.hideSkipMenu();
};
this.disableStuckButton = () => {
uiLeftColumn.stuck.off('click');
}

/**
* Blink the stuck button.
* Todo. This should be moved LeftMenu.js
*/
this.blink = function() {
this.blink = () => {
self.stopBlinking();
blinkInterval = window.setInterval(function () {
uiLeftColumn.stuck.toggleClass("highlight-100");
Expand All @@ -131,7 +109,7 @@ function ModalSkip(form, onboardingModel, ribbonMenu, taskContainer, tracker, ui
/**
* Hide the skip menu.
*/
this.hideSkipMenu = function() {
this.hideSkipMenu = () => {
uiModalSkip.holder.addClass('hidden');
svl.popUpMessage.enableInteractions();
self.hideBackground();
Expand All @@ -140,19 +118,25 @@ function ModalSkip(form, onboardingModel, ribbonMenu, taskContainer, tracker, ui
/**
* Show the skip menu.
*/
this.showSkipMenu = function() {
this.showSkipMenu = () => {
uiModalSkip.holder.removeClass('hidden');
svl.popUpMessage.disableInteractions();
self.showBackground();
};

this.hideBackground = function() {
$('#modal-skip-background').css({ width: '', height: ''})
/**
* Hide the background of the skip menu.
* */
this.hideBackground = () => {
uiModalSkip.background.css({ width: '', height: ''})
};

this.showBackground = function() {
$('#modal-skip-background').css("background-color", "white");
$('#modal-skip-background').css({
/**
* Show the background of the skip menu.
*/
this.showBackground = () => {
uiModalSkip.background.css("background-color", "white");
uiModalSkip.background.css({
width: '100%',
height: '100%',
opacity: '0.5',
Expand All @@ -164,18 +148,15 @@ function ModalSkip(form, onboardingModel, ribbonMenu, taskContainer, tracker, ui
* Stop blinking the jump button.
* Todo. This should be moved to LeftMenu.js
*/
this.stopBlinking = function() {
this.stopBlinking = () => {
window.clearInterval(blinkInterval);
uiLeftColumn.stuck.removeClass("highlight-100");
};

// Initialize
uiModalSkip.unavailable.bind("click", this._handleClickUnavailable);
// Initialize Event Listeners
uiModalSkip.continueNeighborhood.bind("click", this._handleClickContinueNeighborhood);
uiModalSkip.cancelFirst.bind("click", this._handleClickCancelFirst);
uiModalSkip.cancelSecond.bind("click", this._handleClickCancelSecond);
uiModalSkip.cancel.bind("click", this._handleClickCancel);
uiModalSkip.newNeighborhood.bind("click", this._handleClickNewNeighborhood);
uiModalSkip.explore.bind("click", this._handleClickExplore);
uiLeftColumn.jump.on('click', this._handleClickJump);
self.enableStuckButton();
}