Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

SAKIII-5573 Uniquely identify the Sakai2Tools widget from the BasicLTI wiget #2075

Closed
wants to merge 2 commits into from

2 participants

Chris Roby Christian Vuerings
Chris Roby
  • Also added a separate commit to clean up the trailing whitespace in the two JS files

https://jira.sakaiproject.org/browse/SAKIII-5573

Christian Vuerings christianv commented on the diff
devwidgets/sakai2tools/css/sakai2tools.css
@@ -16,35 +16,35 @@
* specific language governing permissions and limitations under the License.
*/
/* Settings */
-#basiclti_settings input[type="text"]{background-color:#f1f1f1;border:1px solid #d6d6d6;margin-top:3px;padding:3px;width:99%;}
-.basiclti_settings_error{color:red;}
-.basiclti_settings_label_head{font-weight:bold;}
-#basiclti_settings_reset_size{margin-left:15px;}
-.basiclti_settings_subcontainer{border-bottom:1px solid #ddd;margin-bottom:15px;padding-bottom:10px;}
-.basiclti_settings_width_unit_selected{font-weight:bold;text-decoration:underline;}
+#sakai2tools_settings input[type="text"]{background-color:#f1f1f1;border:1px solid #d6d6d6;margin-top:3px;padding:3px;width:99%;}

@croby Can we convert this to the new style guidelines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christian Vuerings christianv commented on the diff
devwidgets/sakai2tools/javascript/sakai2tools.js
((8 lines not shown))
- var basicltiSettingsAdvancedToggleSettings = basicltiSettingsAdvanced + "_toggle_settings";
- var basicltiSettingsAdvancedUp = basicltiSettingsAdvanced + "_up";
- var basicltiSettingsBorders = basicltiSettings + "_borders";
- var basicltiSettingsCancel = basicltiSettings + "_cancel";
- var basicltiSettingsColorContainer = basicltiSettings + "_color_container";
- var basicltiSettingsHeight = basicltiSettings + "_frame_height";
- var basicltiSettingsInsert = basicltiSettings + "_insert";
- var basicltiSettingsPreview = basicltiSettings + "_preview";
- var basicltiSettingsPreviewId = tuid + "_frame";
- var basicltiSettingsPreviewFrame = "#" + basicltiSettingsPreviewId;
- var basicltiSettingsLtiUrl = basicltiSettings + "_ltiurl";
- var basicltiSettingsLtiKey = basicltiSettings + "_ltikey";
- var basicltiSettingsLtiSecret = basicltiSettings + "_ltisecret";
- var basicltiSettingsWidth = basicltiSettings + "_width";
- var basicltiSettingsReleaseName = basicltiSettings + "_release_names";
+ var sakai2tools = "#sakai2tools";

@croby Can we convert this file and the following one(s) to use the new style guidelines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christian Vuerings

@croby please issue a new PR against 1.5.0

Christian Vuerings christianv closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  devwidgets/basiclti/basiclti.html
View
@@ -94,7 +94,7 @@
<!-- Template to show the preview of the iframe -->
<div id="basiclti_settings_preview_template"><!--
- <iframe id="${tuidFrame}" style="border: ${border_size}px #${border_color} solid" width="${width}${width_unit}" height="${frame_height}px"></iframe>
+ <iframe id="${tuidFrame}" name="basiclti_iframe" style="border: ${border_size}px #${border_color} solid" width="${width}${width_unit}" height="${frame_height}px"></iframe>
--></div>
<!-- Template for choosing the color -->
6 devwidgets/basiclti/javascript/basiclti.js
View
@@ -161,8 +161,8 @@ require(['jquery', 'sakai/sakai.api.core'], function($, sakai) {
* @param {Boolean} complete Render the preview completely or only adjust values
*/
var renderIframeSettings = function(complete) {
- if (complete) {
- json.launchDataUrl = sakai.config.URL.SDATA_FETCH_URL.replace(/__PLACEMENT__/, sakai.site.currentsite.id + '/_widgets').replace(/__TUID__/, tuid).replace(/__NAME__/, 'basiclti') + '.launch.html';
+ if (complete) {
+ json.launchDataUrl = sakai.config.URL.SDATA_FETCH_URL.replace(/__PLACEMENT__/, sakai.site.currentsite.id + '/_widgets').replace(/__TUID__/, tuid).replace(/__NAME__/, 'basiclti') + '.launch.html';
$(basicltiSettingsPreview, $rootel).html(sakai.api.Util.TemplateRenderer($basicltiSettingsPreviewTemplate, json));
} else {
$(basicltiSettingsPreviewFrame, $rootel).attr('style', 'border: ' + json.border_size + 'px #' + json.border_color + ' solid');
@@ -254,7 +254,7 @@ require(['jquery', 'sakai/sakai.api.core'], function($, sakai) {
* Save the basiclti to the jcr
*/
var saveRemoteContent = function(){
-
+
if (json.ltiurl !== '') {
var savejson = {
48 devwidgets/sakai2tools/css/sakai2tools.css
View
@@ -16,35 +16,35 @@
* specific language governing permissions and limitations under the License.
*/
/* Settings */
-#basiclti_settings input[type="text"]{background-color:#f1f1f1;border:1px solid #d6d6d6;margin-top:3px;padding:3px;width:99%;}
-.basiclti_settings_error{color:red;}
-.basiclti_settings_label_head{font-weight:bold;}
-#basiclti_settings_reset_size{margin-left:15px;}
-.basiclti_settings_subcontainer{border-bottom:1px solid #ddd;margin-bottom:15px;padding-bottom:10px;}
-.basiclti_settings_width_unit_selected{font-weight:bold;text-decoration:underline;}
+#sakai2tools_settings input[type="text"]{background-color:#f1f1f1;border:1px solid #d6d6d6;margin-top:3px;padding:3px;width:99%;}

@croby Can we convert this to the new style guidelines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+.sakai2tools_settings_error{color:red;}
+.sakai2tools_settings_label_head{font-weight:bold;}
+#sakai2tools_settings_reset_size{margin-left:15px;}
+.sakai2tools_settings_subcontainer{border-bottom:1px solid #ddd;margin-bottom:15px;padding-bottom:10px;}
+.sakai2tools_settings_width_unit_selected{font-weight:bold;text-decoration:underline;}
/* Preview */
-#basiclti_settings_preview{text-align:center;}
-#basiclti_settings_preview_frame{border-style:solid;margin-bottom:1px;}
+#sakai2tools_settings_preview{text-align:center;}
+#sakai2tools_settings_preview_frame{border-style:solid;margin-bottom:1px;}
/* Color */
-#basiclti_settings_color_container{margin-top:9px;}
-.basiclti_settings_color{border:1px solid #eee;cursor:pointer;display:block;float:left;height:26px;margin-right:9px;text-decoration:none;width:26px;}
-.basiclti_settings_color:hover{border:1px solid #ccc;text-decoration:none;}
-.basiclti_settings_color_selected,.basiclti_settings_color_selected:hover{border:1px solid #000;}
-#basiclti_settings_color_000000{background-color:#000;}
-#basiclti_settings_color_cccccc{background-color:#ccc;}
-#basiclti_settings_color_ff0000{background-color:red;}
-#basiclti_settings_color_008000{background-color:green;}
-#basiclti_settings_color_0000ff{background-color:#00f;}
+#sakai2tools_settings_color_container{margin-top:9px;}
+.sakai2tools_settings_color{border:1px solid #eee;cursor:pointer;display:block;float:left;height:26px;margin-right:9px;text-decoration:none;width:26px;}
+.sakai2tools_settings_color:hover{border:1px solid #ccc;text-decoration:none;}
+.sakai2tools_settings_color_selected,.sakai2tools_settings_color_selected:hover{border:1px solid #000;}
+#sakai2tools_settings_color_000000{background-color:#000;}
+#sakai2tools_settings_color_cccccc{background-color:#ccc;}
+#sakai2tools_settings_color_ff0000{background-color:red;}
+#sakai2tools_settings_color_008000{background-color:green;}
+#sakai2tools_settings_color_0000ff{background-color:#00f;}
/* Advanced */
-#basiclti_settings_advanced_toggle_settings{margin-top:-30px;float:right;}
-#basiclti_settings_advanced input[type="text"]{width:65px;}
+#sakai2tools_settings_advanced_toggle_settings{margin-top:-30px;float:right;}
+#sakai2tools_settings_advanced input[type="text"]{width:65px;}
/* Block */
-.basiclti_settings_block{margin-left:15px;}
-.basiclti_settings_block label{float:left;margin-right:5px;margin-top:3px;padding-top:5px;width:75px;}
-.basiclti_settings_block .basiclti_settings_checkbox{float:left;margin:10px 20px 0 0;width:auto;}
-.basiclti_settings_block .basiclti_settings_checkbox label{float:none;width:auto;}
-.basiclti_settings_block .basiclti_settings_checkbox input[type="checkbox"]{margin:0 auto;}
+.sakai2tools_settings_block{margin-left:15px;}
+.sakai2tools_settings_block label{float:left;margin-right:5px;margin-top:3px;padding-top:5px;width:75px;}
+.sakai2tools_settings_block .sakai2tools_settings_checkbox{float:left;margin:10px 20px 0 0;width:auto;}
+.sakai2tools_settings_block .sakai2tools_settings_checkbox label{float:none;width:auto;}
+.sakai2tools_settings_block .sakai2tools_settings_checkbox input[type="checkbox"]{margin:0 auto;}
178 devwidgets/sakai2tools/javascript/sakai2tools.js
View
@@ -26,9 +26,9 @@
require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
/**
- * @name sakai_global.basiclti
+ * @name sakai_global.sakai2tools
*
- * @class basiclti
+ * @class sakai2tools
*
* @description
* Basiclti widget
@@ -55,37 +55,37 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var defaultHeight = 200;
// Links and labels
- var basiclti = "#basiclti";
- var basicltiSettings = basiclti + "_settings";
- var basicltiSettingsAdvanced = basicltiSettings + "_advanced";
- var basicltiSettingsAdvancedDown = basicltiSettingsAdvanced + "_down";
- var basicltiSettingsAdvancedToggleSettings = basicltiSettingsAdvanced + "_toggle_settings";
- var basicltiSettingsAdvancedUp = basicltiSettingsAdvanced + "_up";
- var basicltiSettingsBorders = basicltiSettings + "_borders";
- var basicltiSettingsCancel = basicltiSettings + "_cancel";
- var basicltiSettingsColorContainer = basicltiSettings + "_color_container";
- var basicltiSettingsHeight = basicltiSettings + "_frame_height";
- var basicltiSettingsInsert = basicltiSettings + "_insert";
- var basicltiSettingsPreview = basicltiSettings + "_preview";
- var basicltiSettingsPreviewId = tuid + "_frame";
- var basicltiSettingsPreviewFrame = "#" + basicltiSettingsPreviewId;
- var basicltiSettingsLtiUrl = basicltiSettings + "_ltiurl";
- var basicltiSettingsLtiKey = basicltiSettings + "_ltikey";
- var basicltiSettingsLtiSecret = basicltiSettings + "_ltisecret";
- var basicltiSettingsWidth = basicltiSettings + "_width";
- var basicltiSettingsReleaseName = basicltiSettings + "_release_names";
+ var sakai2tools = "#sakai2tools";

@croby Can we convert this file and the following one(s) to use the new style guidelines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ var sakai2toolsSettings = sakai2tools + "_settings";
+ var sakai2toolsSettingsAdvanced = sakai2toolsSettings + "_advanced";
+ var sakai2toolsSettingsAdvancedDown = sakai2toolsSettingsAdvanced + "_down";
+ var sakai2toolsSettingsAdvancedToggleSettings = sakai2toolsSettingsAdvanced + "_toggle_settings";
+ var sakai2toolsSettingsAdvancedUp = sakai2toolsSettingsAdvanced + "_up";
+ var sakai2toolsSettingsBorders = sakai2toolsSettings + "_borders";
+ var sakai2toolsSettingsCancel = sakai2toolsSettings + "_cancel";
+ var sakai2toolsSettingsColorContainer = sakai2toolsSettings + "_color_container";
+ var sakai2toolsSettingsHeight = sakai2toolsSettings + "_frame_height";
+ var sakai2toolsSettingsInsert = sakai2toolsSettings + "_insert";
+ var sakai2toolsSettingsPreview = sakai2toolsSettings + "_preview";
+ var sakai2toolsSettingsPreviewId = tuid + "_frame";
+ var sakai2toolsSettingsPreviewFrame = "#" + sakai2toolsSettingsPreviewId;
+ var sakai2toolsSettingsLtiUrl = sakai2toolsSettings + "_ltiurl";
+ var sakai2toolsSettingsLtiKey = sakai2toolsSettings + "_ltikey";
+ var sakai2toolsSettingsLtiSecret = sakai2toolsSettings + "_ltisecret";
+ var sakai2toolsSettingsWidth = sakai2toolsSettings + "_width";
+ var sakai2toolsSettingsReleaseName = sakai2toolsSettings + "_release_names";
// Containers
- var basicltiMainContainer = basiclti + "_main_container";
+ var sakai2toolsMainContainer = sakai2tools + "_main_container";
// Classes
- var basicltiSettingsWidthUnitClass = ".basiclti_settings_width_unit";
- var basicltiSettingsWidthUnitSelectedClass = "basiclti_settings_width_unit_selected";
+ var sakai2toolsSettingsWidthUnitClass = ".sakai2tools_settings_width_unit";
+ var sakai2toolsSettingsWidthUnitSelectedClass = "sakai2tools_settings_width_unit_selected";
// Templates
- var $basicltiSettingsColorContainerTemplate = $("#basiclti_settings_color_container_template", rootel);
- var $basicltiSettingsTemplate = $("#basiclti_settings_template", rootel);
- var $basicltiSettingsPreviewTemplate = $("#basiclti_settings_preview_template", rootel);
+ var $sakai2toolsSettingsColorContainerTemplate = $("#sakai2tools_settings_color_container_template", rootel);
+ var $sakai2toolsSettingsTemplate = $("#sakai2tools_settings_template", rootel);
+ var $sakai2toolsSettingsPreviewTemplate = $("#sakai2tools_settings_preview_template", rootel);
// see: http://www.ietf.org/rfc/rfc2396.txt Appendix B
var urlRegExp = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
@@ -164,12 +164,12 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
* @param {Boolean} complete Render the preview completely or only adjust values
*/
var renderIframeSettings = function(complete){
- if (complete) {
- json.launchDataUrl = sakai.config.URL.SDATA_FETCH_URL.replace(/__PLACEMENT__/, sakai.site.currentsite.id + "/_widgets").replace(/__TUID__/, tuid).replace(/__NAME__/, "basiclti") + '.launch.html';
- $(basicltiSettingsPreview, rootel).html(sakai.api.Util.TemplateRenderer($basicltiSettingsPreviewTemplate, json));
+ if (complete) {
+ json.launchDataUrl = sakai.config.URL.SDATA_FETCH_URL.replace(/__PLACEMENT__/, sakai.site.currentsite.id + "/_widgets").replace(/__TUID__/, tuid).replace(/__NAME__/, "sakai2tools") + '.launch.html';
+ $(sakai2toolsSettingsPreview, rootel).html(sakai.api.Util.TemplateRenderer($sakai2toolsSettingsPreviewTemplate, json));
}
else {
- $(basicltiSettingsPreviewFrame, rootel).attr("style", "border: " + json.border_size + "px #" + json.border_color + " solid");
+ $(sakai2toolsSettingsPreviewFrame, rootel).attr("style", "border: " + json.border_size + "px #" + json.border_color + " solid");
}
};
@@ -178,39 +178,39 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
*/
var renderIframe = function(){
if (json) {
- json.tuidFrame = basicltiSettingsPreviewId;
- $(basicltiMainContainer, rootel).html(sakai.api.Util.TemplateRenderer($basicltiSettingsPreviewTemplate, json));
+ json.tuidFrame = sakai2toolsSettingsPreviewId;
+ $(sakai2toolsMainContainer, rootel).html(sakai.api.Util.TemplateRenderer($sakai2toolsSettingsPreviewTemplate, json));
json.launchDataUrl = sakai.api.Widgets.getWidgetDataStorageURL(tuid) + ".launch.html";
if (sakai_global.group) {
json.launchDataUrl += "?groupid=" + sakai_global.group.groupData["sakai:group-id"];
}
- $("#" + json.tuidFrame, rootel).attr("src", json.launchDataUrl);
+ $("#" + json.tuidFrame, rootel).attr("src", json.launchDataUrl);
// resize the iframe to match inner body height if in the same origin (i.e. same protocol/domain/port)
if(isSameOriginPolicy(window.location.href, json.ltiurl)) {
- $(basicltiSettingsPreviewFrame, rootel).load(function() {
+ $(sakai2toolsSettingsPreviewFrame, rootel).load(function() {
$(this).height($(this).contents().find("body").height() + 15); // add 10px for IE and 5px more for Gradebook weirdness
});
}
// SAKIII-314 We need to show the container, otherwise the second item won't be shown.
- $(basicltiMainContainer, rootel).show();
+ $(sakai2toolsMainContainer, rootel).show();
}
};
/**
- * Render the html of the basicltisettings
+ * Render the html of the sakai2toolssettings
*/
var renderRemoteContentSettings = function(){
if (json) {
// temporarily add the toolList to the json for rendering, but
// remove it afterwards because we don't want to store it in the node
json.toolList = toolList;
- $(basicltiSettings, rootel).html(sakai.api.Util.TemplateRenderer($basicltiSettingsTemplate, json));
+ $(sakai2toolsSettings, rootel).html(sakai.api.Util.TemplateRenderer($sakai2toolsSettingsTemplate, json));
delete json.toolList;
- // Necessary until we parameterize the tool list on the server and client side.
+ // Necessary until we parameterize the tool list on the server and client side.
if (isSakai2Tool && json.lti_virtual_tool_id) {
- $('#basiclti_settings_lti_virtual_tool_id',rootel).val(json.lti_virtual_tool_id);
+ $('#sakai2tools_settings_lti_virtual_tool_id',rootel).val(json.lti_virtual_tool_id);
}
}
};
@@ -220,7 +220,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
*/
var renderColorContainer = function(){
if (json) {
- $(basicltiSettingsColorContainer, rootel).html(sakai.api.Util.TemplateRenderer($basicltiSettingsColorContainerTemplate, json));
+ $(sakai2toolsSettingsColorContainer, rootel).html(sakai.api.Util.TemplateRenderer($sakai2toolsSettingsColorContainerTemplate, json));
}
};
@@ -255,7 +255,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
};
/**
- * Save the basiclti to the jcr
+ * Save the sakai2tools to the jcr
*/
var saveRemoteContent = function(){
var saveContentAjax = function(json_data) {
@@ -264,32 +264,32 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
type: "POST",
url: url,
data: json,
- success: function(data) {
- savedDataToJCR(true, data);
+ success: function(data) {
+ savedDataToJCR(true, data);
}
- });
+ });
// Because we need to use a particular servlet (LiteBasicLTI), and it
// requires some different options, we make our own ajax call above
// instead of using saveWidgetData for now.
- //
- //sakai.api.Widgets.saveWidgetData(tuid, json, savedDataToJCR);
+ //
+ //sakai.api.Widgets.saveWidgetData(tuid, json, savedDataToJCR);
};
if (isSakai2Tool()) {
- json["lti_virtual_tool_id"] = $('#basiclti_settings_lti_virtual_tool_id',rootel).val();
+ json["lti_virtual_tool_id"] = $('#sakai2tools_settings_lti_virtual_tool_id',rootel).val();
json[":operation"] = "basiclti";
json["sling:resourceType"] = "sakai/basiclti";
- json.ltikey = $(basicltiSettingsLtiKey,rootel).val() || "";
- json.ltisecret = $(basicltiSettingsLtiSecret,rootel).val() || "";
+ json.ltikey = $(sakai2toolsSettingsLtiKey,rootel).val() || "";
+ json.ltisecret = $(sakai2toolsSettingsLtiSecret,rootel).val() || "";
json["debug@TypeHint"] = "Boolean";
- json.debug = $('#basiclti_settings_debug:checked',rootel).val() !== null;
+ json.debug = $('#sakai2tools_settings_debug:checked',rootel).val() !== null;
json["release_names@TypeHint"] = "Boolean";
- json.release_names = $('#basiclti_settings_release_names:checked',rootel).val() !== null;
+ json.release_names = $('#sakai2tools_settings_release_names:checked',rootel).val() !== null;
json["release_principal_name@TypeHint"] = "Boolean";
- json.release_principal_name = $('#basiclti_settings_release_principal_name:checked',rootel).val() !== null;
+ json.release_principal_name = $('#sakai2tools_settings_release_principal_name:checked',rootel).val() !== null;
json["release_email@TypeHint"] = "Boolean";
- json.release_email = $('#basiclti_settings_release_email:checked',rootel).val() !== null;
+ json.release_email = $('#sakai2tools_settings_release_email:checked',rootel).val() !== null;
json.launchDataUrl = ""; // does not need to be persisted
json.tuidFrame = ""; // does not need to be persisted
json.defined = ""; // what the heck is this? Where does it come from?
@@ -298,19 +298,19 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
saveContentAjax(json);
}
else if (json.ltiurl !== "") {
- json.ltiurl = $(basicltiSettingsLtiUrl,rootel).val() || "";
+ json.ltiurl = $(sakai2toolsSettingsLtiUrl,rootel).val() || "";
json[":operation"] = "basiclti";
json["sling:resourceType"] = "sakai/basiclti";
- json.ltikey = $(basicltiSettingsLtiKey,rootel).val() || "";
- json.ltisecret = $(basicltiSettingsLtiSecret,rootel).val() || "";
+ json.ltikey = $(sakai2toolsSettingsLtiKey,rootel).val() || "";
+ json.ltisecret = $(sakai2toolsSettingsLtiSecret,rootel).val() || "";
json["debug@TypeHint"] = "Boolean";
- json.debug = $('#basiclti_settings_debug:checked',rootel).val() !== null;
+ json.debug = $('#sakai2tools_settings_debug:checked',rootel).val() !== null;
json["release_names@TypeHint"] = "Boolean";
- json.release_names = $('#basiclti_settings_release_names:checked',rootel).val() !== null;
+ json.release_names = $('#sakai2tools_settings_release_names:checked',rootel).val() !== null;
json["release_principal_name@TypeHint"] = "Boolean";
- json.release_principal_name = $('#basiclti_settings_release_principal_name:checked',rootel).val() !== null;
+ json.release_principal_name = $('#sakai2tools_settings_release_principal_name:checked',rootel).val() !== null;
json["release_email@TypeHint"] = "Boolean";
- json.release_email = $('#basiclti_settings_release_email:checked',rootel).val() !== null;
+ json.release_email = $('#sakai2tools_settings_release_email:checked',rootel).val() !== null;
json.launchDataUrl = ""; // does not need to be persisted
json.tuidFrame = ""; // does not need to be persisted
json.defined = ""; // what the heck is this? Where does it come from?
@@ -329,12 +329,12 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
*/
var changeAdvancedSettingsArrow = function(){
if (isAdvancedSettingsVisible) {
- $(basicltiSettingsAdvancedDown, rootel).hide();
- $(basicltiSettingsAdvancedUp, rootel).show();
+ $(sakai2toolsSettingsAdvancedDown, rootel).hide();
+ $(sakai2toolsSettingsAdvancedUp, rootel).show();
}
else {
- $(basicltiSettingsAdvancedUp, rootel).hide();
- $(basicltiSettingsAdvancedDown, rootel).show();
+ $(sakai2toolsSettingsAdvancedUp, rootel).hide();
+ $(sakai2toolsSettingsAdvancedDown, rootel).show();
}
};
@@ -347,7 +347,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
* Add binding to the color boxes
*/
var addColorBinding = function(){
- $(".basiclti_settings_color",rootel).click(function(){
+ $(".sakai2tools_settings_color",rootel).click(function(){
json.border_color = $(this).attr("id").split("_")[$(this).attr("id").split("_").length - 1];
renderIframeSettings(false);
renderColorContainer();
@@ -361,7 +361,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var addBinding = function(){
// Change the url for the iFrame
- $(basicltiSettingsLtiUrl,rootel).change(function(){
+ $(sakai2toolsSettingsLtiUrl,rootel).change(function(){
var urlValue = $(this).val();
if (urlValue !== "") {
// Check if someone already wrote http inside the url
@@ -374,8 +374,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
});
// Change the iframe width
- $(basicltiSettingsWidth,rootel).change(function(){
- var widthValue = $(basicltiSettingsWidth,rootel).val();
+ $(sakai2toolsSettingsWidth,rootel).change(function(){
+ var widthValue = $(sakai2toolsSettingsWidth,rootel).val();
if (isDecimal(widthValue)) {
json.width = widthValue;
@@ -384,8 +384,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
});
// Change the iframe height
- $(basicltiSettingsHeight,rootel).change(function(){
- var heightValue = $(basicltiSettingsHeight,rootel).val();
+ $(sakai2toolsSettingsHeight,rootel).change(function(){
+ var heightValue = $(sakai2toolsSettingsHeight,rootel).val();
if (isDecimal(heightValue)) {
json.frame_height = heightValue;
@@ -394,8 +394,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
});
// Change the border width
- $(basicltiSettingsBorders,rootel).change(function(){
- var borderValue = $(basicltiSettingsBorders,rootel).val();
+ $(sakai2toolsSettingsBorders,rootel).change(function(){
+ var borderValue = $(sakai2toolsSettingsBorders,rootel).val();
if (isDecimal(borderValue)) {
json.border_size = borderValue;
renderIframeSettings(false);
@@ -403,14 +403,14 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
});
// Toggle the advanced view
- $(basicltiSettingsAdvancedToggleSettings,rootel).click(function(){
- $("#basiclti_settings_advanced", rootel).toggle();
+ $(sakai2toolsSettingsAdvancedToggleSettings,rootel).click(function(){
+ $("#sakai2tools_settings_advanced", rootel).toggle();
isAdvancedSettingsVisible = !isAdvancedSettingsVisible;
changeAdvancedSettingsArrow();
});
// When you click on one of the width units (px or percentage)
- $(basicltiSettingsWidthUnitClass,rootel).click(function(){
+ $(sakai2toolsSettingsWidthUnitClass,rootel).click(function(){
var widthUnitValue = $(this).attr("id").split("_")[$(this).attr("id").split("_").length - 1];
if (widthUnitValue === "px") {
json.width_unit = widthUnitValue;
@@ -418,19 +418,19 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
else {
json.width_unit = "%";
}
- $(basicltiSettingsWidthUnitClass,rootel).removeClass(basicltiSettingsWidthUnitSelectedClass);
- $(this).addClass(basicltiSettingsWidthUnitSelectedClass);
+ $(sakai2toolsSettingsWidthUnitClass,rootel).removeClass(sakai2toolsSettingsWidthUnitSelectedClass);
+ $(this).addClass(sakai2toolsSettingsWidthUnitSelectedClass);
renderIframeSettings(false);
});
// When you push the save button..
- $(basicltiSettingsInsert,rootel).click(function(){
+ $(sakai2toolsSettingsInsert,rootel).click(function(){
saveRemoteContent();
});
// Cancel it
- $(basicltiSettingsCancel,rootel).click(function(){
- sakai.api.Widgets.Container.informCancel(tuid, "basiclti");
+ $(sakai2toolsSettingsCancel,rootel).click(function(){
+ sakai.api.Widgets.Container.informCancel(tuid, "sakai2tools");
});
addColorBinding();
@@ -444,7 +444,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
/**
* Function that fills in the input fields in the settings tab.
* @param {Object} parameters A JSON object that contains the necessary information.
- * @param {Boolean} exists Does there exist a previous basiclti
+ * @param {Boolean} exists Does there exist a previous sakai2tools
*/
var displaySettings = function(parameters, exists){
if (exists && parameters.ltiurl) {
@@ -471,19 +471,19 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
renderColorContainer();
addBinding(); // Add binding to the various elements
changeAdvancedSettingsArrow();
- $(basicltiSettings,rootel).show(); // Show the basiclti settings
+ $(sakai2toolsSettings,rootel).show(); // Show the sakai2tools settings
};
/*
* Is the widget in settings mode or not
*/
if (showSettings) {
- $(basicltiMainContainer,rootel).hide();
- $(basicltiSettings,rootel).show();
+ $(sakai2toolsMainContainer,rootel).hide();
+ $(sakai2toolsSettings,rootel).show();
}
else {
- $(basicltiSettings,rootel).hide();
- $(basicltiMainContainer,rootel).show();
+ $(sakai2toolsSettings,rootel).hide();
+ $(sakai2toolsMainContainer,rootel).show();
}
/**
@@ -493,7 +493,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var getRemoteContent = function() {
// The list of available Sakai 2 Tools is configurable at runtime on nakamura
sakai.api.Server.loadJSON('/var/basiclti/cletools.json' , function(success,data) {
- toolList = [];
+ toolList = [];
for (var i = 0; i < data.toolList.length; i++) {
// Our i18n keys for the tools are formatted as: sakai.announcements -> CLE_SAKAI_ANNOUNCEMENTS
var key = "CLE_" + data.toolList[i].replace(/\./g,"_").toUpperCase();
@@ -520,7 +520,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
}
else {
displayRemoteContent(data);
- }
+ }
}
else {
displaySettings(null, false);
108 devwidgets/sakai2tools/sakai2tools.html
View
@@ -4,111 +4,111 @@
<span style="display:none;">__MSG__IE_PLACEHOLDER__</span>
<!-- SETTINGS -->
-<div id="basiclti_settings" style="display:none;">
+<div id="sakai2tools_settings" style="display:none;">
</div>
<!-- The main settings template -->
-<div id="basiclti_settings_template"><!--
+<div id="sakai2tools_settings_template"><!--
<form>
- <div class="basiclti_settings_subcontainer">
+ <div class="sakai2tools_settings_subcontainer">
<p>
{if isSakai2Tool === true}
- <label for="basiclti_settings_lti_virtual_tool_id">Tool:</label>
- <select id="basiclti_settings_lti_virtual_tool_id" name="lti_virtual_tool_id">
+ <label for="sakai2tools_settings_lti_virtual_tool_id">Tool:</label>
+ <select id="sakai2tools_settings_lti_virtual_tool_id" name="lti_virtual_tool_id">
{for sakai2Tool in toolList}
<option value="${sakai2Tool.toolid}">${sakai2Tool.toolname}</option>
{/for}
</select>
{else}
- <label for="basiclti_settings_ltiurl">__MSG__URL__: </label>
- <input type="text" id="basiclti_settings_ltiurl" value="${ltiurl}" /><br />
- <label for="basiclti_settings_ltikey">__MSG__KEY__: </label>
- <input type="text" id="basiclti_settings_ltikey" value="${ltikey}" /><br />
- <label for="basiclti_settings_ltisecret">__MSG__SECRET__: </label>
- <input type="text" id="basiclti_settings_ltisecret" value="${ltisecret}" /><br />
+ <label for="sakai2tools_settings_ltiurl">__MSG__URL__: </label>
+ <input type="text" id="sakai2tools_settings_ltiurl" value="${ltiurl}" /><br />
+ <label for="sakai2tools_settings_ltikey">__MSG__KEY__: </label>
+ <input type="text" id="sakai2tools_settings_ltikey" value="${ltikey}" /><br />
+ <label for="sakai2tools_settings_ltisecret">__MSG__SECRET__: </label>
+ <input type="text" id="sakai2tools_settings_ltisecret" value="${ltisecret}" /><br />
{/if}
</p>
<p>
- <label class="basiclti_settings_label_head"></label> <span><br class="fl-push" />
+ <label class="sakai2tools_settings_label_head"></label> <span><br class="fl-push" />
</p>
- <div id="basiclti_settings_preview">
+ <div id="sakai2tools_settings_preview">
</div>
- <button type="button" class="s3d-button s3d-button-primary" id="basiclti_settings_advanced_toggle_settings"><span class="s3d-button-inner">__MSG__ADVANCED_SETTINGS__ <span id="basiclti_settings_advanced_down">&#8595;</span><span id="basiclti_settings_advanced_up">&#8593;</span></span></button>
+ <button type="button" class="s3d-button s3d-button-primary" id="sakai2tools_settings_advanced_toggle_settings"><span class="s3d-button-inner">__MSG__ADVANCED_SETTINGS__ <span id="sakai2tools_settings_advanced_down">&#8595;</span><span id="sakai2tools_settings_advanced_up">&#8593;</span></span></button>
</div>
- <div id="basiclti_settings_advanced" style="display:none;">
- <div class="basiclti_settings_subcontainer">
- <label class="basiclti_settings_label_head">__MSG__PRIVACY__:</label><br />
- <div class="basiclti_settings_block">
- <div class="basiclti_settings_checkbox">
- <label for="basiclti_settings_release_names">__MSG__RELEASE_NAMES__:</label>
- <input type="checkbox" id="basiclti_settings_release_names" name="release_names" {if release_names}checked="checked"{/if} /><span>&nbsp;</span>
+ <div id="sakai2tools_settings_advanced" style="display:none;">
+ <div class="sakai2tools_settings_subcontainer">
+ <label class="sakai2tools_settings_label_head">__MSG__PRIVACY__:</label><br />
+ <div class="sakai2tools_settings_block">
+ <div class="sakai2tools_settings_checkbox">
+ <label for="sakai2tools_settings_release_names">__MSG__RELEASE_NAMES__:</label>
+ <input type="checkbox" id="sakai2tools_settings_release_names" name="release_names" {if release_names}checked="checked"{/if} /><span>&nbsp;</span>
</div>
- <div class="basiclti_settings_checkbox">
- <label for="basiclti_settings_release_principal_name">__MSG__RELEASE_USERNAME__:</label>
- <input type="checkbox" id="basiclti_settings_release_principal_name" name="release_principal_name" {if release_principal_name}checked="checked"{/if} /><span>&nbsp;</span>
+ <div class="sakai2tools_settings_checkbox">
+ <label for="sakai2tools_settings_release_principal_name">__MSG__RELEASE_USERNAME__:</label>
+ <input type="checkbox" id="sakai2tools_settings_release_principal_name" name="release_principal_name" {if release_principal_name}checked="checked"{/if} /><span>&nbsp;</span>
</div>
- <div class="basiclti_settings_checkbox">
- <label for="basiclti_settings_release_email">__MSG__RELEASE_EMAIL_ADDRESS__:</label>
- <input type="checkbox" id="basiclti_settings_release_email" name="release_email" {if release_email}checked="checked"{/if} /><span>&nbsp;</span><br class="fl-push" />
+ <div class="sakai2tools_settings_checkbox">
+ <label for="sakai2tools_settings_release_email">__MSG__RELEASE_EMAIL_ADDRESS__:</label>
+ <input type="checkbox" id="sakai2tools_settings_release_email" name="release_email" {if release_email}checked="checked"{/if} /><span>&nbsp;</span><br class="fl-push" />
</div>
<br class="fl-push" />
</div>
</div>
- <div class="basiclti_settings_subcontainer">
- <label class="basiclti_settings_label_head">__MSG__SIZE__:</label><br />
- <div class="basiclti_settings_block">
- <label for="basiclti_settings_width">__MSG__WIDTH__:</label>
- <input type="text" id="basiclti_settings_width" value="${width}" />
- <button type="button" id="basiclti_settings_width_unit_px" class="s3d-link-button s3d-action basiclti_settings_width_unit {if width_unit == "px"} basiclti_settings_width_unit_selected{/if}"> px</button>
+ <div class="sakai2tools_settings_subcontainer">
+ <label class="sakai2tools_settings_label_head">__MSG__SIZE__:</label><br />
+ <div class="sakai2tools_settings_block">
+ <label for="sakai2tools_settings_width">__MSG__WIDTH__:</label>
+ <input type="text" id="sakai2tools_settings_width" value="${width}" />
+ <button type="button" id="sakai2tools_settings_width_unit_px" class="s3d-link-button s3d-action sakai2tools_settings_width_unit {if width_unit == "px"} sakai2tools_settings_width_unit_selected{/if}"> px</button>
<span> or </span>
- <button type="button" id="basiclti_settings_width_unit_percent" class="s3d-link-button s3d-action basiclti_settings_width_unit {if width_unit == "%"} basiclti_settings_width_unit_selected{/if}"> %</button>
+ <button type="button" id="sakai2tools_settings_width_unit_percent" class="s3d-link-button s3d-action sakai2tools_settings_width_unit {if width_unit == "%"} sakai2tools_settings_width_unit_selected{/if}"> %</button>
<br />
- <label for="basiclti_settings_frame_height">__MSG__HEIGHT__:</label>
- <input type="text" id="basiclti_settings_frame_height" value="${frame_height}" /><span> __MSG__PX__</span>
- <button type="button" class="s3d-button s3d-button-primary" id="basiclti_settings_reset_size"><span class="s3d-button-inner">__MSG__RESET_TO_ORIGINAL_SIZE__</span></button>
+ <label for="sakai2tools_settings_frame_height">__MSG__HEIGHT__:</label>
+ <input type="text" id="sakai2tools_settings_frame_height" value="${frame_height}" /><span> __MSG__PX__</span>
+ <button type="button" class="s3d-button s3d-button-primary" id="sakai2tools_settings_reset_size"><span class="s3d-button-inner">__MSG__RESET_TO_ORIGINAL_SIZE__</span></button>
<br class="fl-push" />
</div>
</div>
- <div class="basiclti_settings_subcontainer">
- <label class="basiclti_settings_label_head">__MSG__BORDER__:</label><br />
- <div class="basiclti_settings_block">
- <label for="basiclti_settings_borders">__MSG__WIDTH__:</label>
- <input type="text" id="basiclti_settings_borders" value="${border_size}" /><span> __MSG__PX__</span><br class="fl-push" />
- <div id="basiclti_settings_color_container">
+ <div class="sakai2tools_settings_subcontainer">
+ <label class="sakai2tools_settings_label_head">__MSG__BORDER__:</label><br />
+ <div class="sakai2tools_settings_block">
+ <label for="sakai2tools_settings_borders">__MSG__WIDTH__:</label>
+ <input type="text" id="sakai2tools_settings_borders" value="${border_size}" /><span> __MSG__PX__</span><br class="fl-push" />
+ <div id="sakai2tools_settings_color_container">
</div>
</div>
</div>
</div>
<div class="dialog_buttons">
- <button type="button" class="s3d-button s3d-button-primary" id="basiclti_settings_insert"><span class="s3d-button-inner">__MSG__SAVE__</span></button>
- <button type="button" class="s3d-button" id="basiclti_settings_cancel"><span class="s3d-button-inner">__MSG__CANCEL__</span></button>
+ <button type="button" class="s3d-button s3d-button-primary" id="sakai2tools_settings_insert"><span class="s3d-button-inner">__MSG__SAVE__</span></button>
+ <button type="button" class="s3d-button" id="sakai2tools_settings_cancel"><span class="s3d-button-inner">__MSG__CANCEL__</span></button>
</div>
</form>
--></div>
<!-- Template to show the preview of the iframe -->
-<div id="basiclti_settings_preview_template"><!--
- <iframe id="${tuidFrame}" style="border: ${border_size}px #${border_color} solid" width="${width}${width_unit}" height="${frame_height}px"></iframe>
+<div id="sakai2tools_settings_preview_template"><!--
+ <iframe id="${tuidFrame}" name="sakai2tools_iframe" style="border: ${border_size}px #${border_color} solid" width="${width}${width_unit}" height="${frame_height}px"></iframe>
--></div>
<!-- Template for choosing the color -->
-<div id="basiclti_settings_color_container_template"><!--
+<div id="sakai2tools_settings_color_container_template"><!--
<label>Color:</label>
- <a title="__MSG__BLACK__" id="basiclti_settings_color_000000" class="basiclti_settings_color {if border_color == "000000"} basiclti_settings_color_selected{/if}">&nbsp;</a>
- <a title="__MSG__GREY__" id="basiclti_settings_color_cccccc" class="basiclti_settings_color {if border_color == "cccccc"} basiclti_settings_color_selected{/if}">&nbsp;</a>
- <a title="__MSG__RED__" id="basiclti_settings_color_ff0000" class="basiclti_settings_color {if border_color == "ff0000"} basiclti_settings_color_selected{/if}">&nbsp;</a>
- <a title="__MSG__GREEN__" id="basiclti_settings_color_008000" class="basiclti_settings_color {if border_color == "008000"} basiclti_settings_color_selected{/if}">&nbsp;</a>
- <a title="__MSG__BLUE__" id="basiclti_settings_color_0000ff" class="basiclti_settings_color {if border_color == "0000ff"} basiclti_settings_color_selected{/if}">&nbsp;</a>
+ <a title="__MSG__BLACK__" id="sakai2tools_settings_color_000000" class="sakai2tools_settings_color {if border_color == "000000"} sakai2tools_settings_color_selected{/if}">&nbsp;</a>
+ <a title="__MSG__GREY__" id="sakai2tools_settings_color_cccccc" class="sakai2tools_settings_color {if border_color == "cccccc"} sakai2tools_settings_color_selected{/if}">&nbsp;</a>
+ <a title="__MSG__RED__" id="sakai2tools_settings_color_ff0000" class="sakai2tools_settings_color {if border_color == "ff0000"} sakai2tools_settings_color_selected{/if}">&nbsp;</a>
+ <a title="__MSG__GREEN__" id="sakai2tools_settings_color_008000" class="sakai2tools_settings_color {if border_color == "008000"} sakai2tools_settings_color_selected{/if}">&nbsp;</a>
+ <a title="__MSG__BLUE__" id="sakai2tools_settings_color_0000ff" class="sakai2tools_settings_color {if border_color == "0000ff"} sakai2tools_settings_color_selected{/if}">&nbsp;</a>
<br class="fl-push" />
--></div>
<!-- MAIN CONTAINER -->
-<div id="basiclti_main_container" style="display:none;">
+<div id="sakai2tools_main_container" style="display:none;">
</div>
<!-- JAVASCRIPT -->
Something went wrong with that request. Please try again.