Skip to content

Commit

Permalink
SAK-41150 Added handlers for all done buttons in preview (sakaiprojec…
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Apr 30, 2019
1 parent 2a661be commit 25618e9
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 12 deletions.
3 changes: 1 addition & 2 deletions samigo/samigo-app/src/webapp/js/delivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ fixImplicitLabeling = function(){
});
};


function disableShowTimeWarning() {
document.getElementById('takeAssessmentForm:showTimeWarning').value = "false";
}

</script>
8 changes: 8 additions & 0 deletions samigo/samigo-app/src/webapp/js/samigo-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ function resizeFrame(updown) {
}
}

function returnToHostUrl(url) {

if (url) {
parent.location.href = url;
return false;
}
}

// SAK-38320: add scope to the table. Maybe can add these direct to the JSF table after JSF 2.3 upgrade?
$( document ).ready(function() {
$('table.matrixTable th.matrixSurvey').attr('scope', 'col');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<div class="previewMessage">
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
</div>
</h:panelGroup>

Expand Down Expand Up @@ -254,7 +257,10 @@
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down
7 changes: 5 additions & 2 deletions samigo/samigo-app/src/webapp/jsf/delivery/confirmSubmit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ remove the javascript onclick stuff.
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");"/>
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down Expand Up @@ -189,7 +192,7 @@ function saveTime()
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton type="submit" value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
onclick="if (\"#{delivery.selectURL}\") { parent.location.href = \"#{delivery.selectURL}\"; }"/>
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");"/>
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down
10 changes: 8 additions & 2 deletions samigo/samigo-app/src/webapp/jsf/delivery/deliverAssessment.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ document.links[newindex].onclick();
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<div class="previewMessage">
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton id="done" value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton id="done" value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
</div>
</h:panelGroup>

Expand Down Expand Up @@ -560,7 +563,10 @@ document.links[newindex].onclick();
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>
</h:form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down Expand Up @@ -77,7 +80,10 @@
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down
10 changes: 8 additions & 2 deletions samigo/samigo-app/src/webapp/jsf/delivery/tableOfContents.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ function saveTime()
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down Expand Up @@ -238,7 +241,10 @@ function saveTime()
<h:panelGroup rendered="#{delivery.actionString=='previewAssessment'}">
<f:verbatim><div class="previewMessage"></f:verbatim>
<h:outputText value="#{deliveryMessages.ass_preview}" />
<h:commandButton value="#{deliveryMessages.done}" action="#{person.cleanResourceIdListInPreview}" type="submit"/>
<h:commandButton value="#{deliveryMessages.done}"
action="#{person.cleanResourceIdListInPreview}"
type="submit"
onclick="return returnToHostUrl(\"#{delivery.selectURL}\");" />
<f:verbatim></div></f:verbatim>
</h:panelGroup>

Expand Down

0 comments on commit 25618e9

Please sign in to comment.