Skip to content

Commit

Permalink
SAK-32721 - Check the LTI Add Tool Checkboxes for Sanity in JavaScript (
Browse files Browse the repository at this point in the history
  • Loading branch information
csev authored Aug 1, 2017
1 parent 8083d35 commit 9434d26
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
2 changes: 2 additions & 0 deletions basiclti/basiclti-tool/src/bundle/ltitool.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ tool.note=<p>If you have a key and secret, you must first install the tool using
tool.launch=Launch URL:
tool.resource.handler=Resource Handler:
tool.already.exists=<br/><span style="color:red">(Note tool aready exists for resource_handler)</span>
tool.patch.title=Content Item Launch
tool.patch.body=Since you are placing this tool as a Content Item tool, we have automatically set it so the title and launch URL can be changed.
content.menu=Tool Link
content.title=Tool Link
Expand Down
54 changes: 40 additions & 14 deletions basiclti/basiclti-tool/src/webapp/vm/lti_tool_insert.vm
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
<script type="text/javascript" src="/library/js/fontIconPicker/2.0.1-cs/jquery.fonticonpicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="/library/js/fontIconPicker/2.0.1-cs/css/jquery.fonticonpicker.css" />
<link rel="stylesheet" type="text/css" href="/library/js/fontIconPicker/2.0.1-cs/themes/grey-theme/jquery.fonticonpicker.grey.min.css" />
<h3>
$tlang.getString("tool.put")
</h3>
#if ($messageSuccess)<div class="messageSuccess">$tlang.getString("gen.success") $validator.escapeHtml($messageSuccess)</div><div class="clear"></div>#end
#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
<form action="#toolForm("")" method="post" name="customizeForm" >
$formInput
<h3>
$tlang.getString("tool.put")
</h3>
#if ($messageSuccess)<div class="messageSuccess">$tlang.getString("gen.success") $validator.escapeHtml($messageSuccess)</div><div class="clear"></div>#end
#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div class="clear"></div>#end
<form action="#toolForm("")" method="post" name="customizeForm" >
$formInput
<input type="hidden" name="sakai_csrf_token" value="$sakai_csrf_token" />
<p class="act">
<input type="submit" accesskey ="s" class="active" name="$doToolAction"
value="$tlang.getString('gen.save')" />
<input type="submit" accesskey ="x" name="$doCancel" value="$tlang.getString('gen.cancel')"
onclick="location = '$sakai_ActionURL.setPanel("ToolSystem")';return false;">
</p>
</form>
<p class="act">
<input type="submit" accesskey ="s" class="active" name="$doToolAction"
value="$tlang.getString('gen.save')" />
<input type="submit" accesskey ="x" name="$doCancel" value="$tlang.getString('gen.cancel')"
onclick="location = '$sakai_ActionURL.setPanel("ToolSystem")';return false;">
</p>
</form>
<script type="text/javascript">$(document).ready(function () { fontawesome_icon_picker('#fa_icon'); });</script>
#if ( ! $isAdmin )
<script>
Expand All @@ -31,4 +31,30 @@ $(document).ready( function() {
});
</script>
#end
<div id="radioDialog" title="$tlang.getString("tool.patch.title")" style="display:none">
<p>
$tlang.getString("tool.patch.body")
</p>
</div>
<script>
function checkRadioSettings() {
if ($('#pl_linkselection').is(":checked") || $('#pl_contenteditor').is(":checked")) {
var changed = false;
if ( $("input[name='allowtitle']:checked").val() == 0 ||
$("input[name='allowlaunch']:checked").val() == 0 ) {
$("#allowtitle_allow").click();
$("#allowlaunch_allow").click();
$( "#radioDialog" ).dialog();
}
}
}
$(document).ready( function() {
$("#pl_linkselection").change(function(){
checkRadioSettings();
});
$("#pl_contenteditor").change(function(){
checkRadioSettings();
});
});
</script>
</div>

0 comments on commit 9434d26

Please sign in to comment.