Skip to content

Commit

Permalink
Merge branch 'v1.1SAKIII-3689' of git://github.com/bp323/3akai-ux int…
Browse files Browse the repository at this point in the history
…o SAKIII-3689

* 'v1.1SAKIII-3689' of git://github.com/bp323/3akai-ux:
  SAKIII-3689 Extend threedots API to be able to threedot a string in the middle and apply to suggested url in create group screen
  SAKIII-3689 Server URL should be cut off if it is too long for the Create new world screen
  • Loading branch information
Nicolaas Matthijs committed Sep 6, 2011
2 parents acfdc70 + 500bbea commit 83b6c91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions dev/lib/sakai/sakai.api.util.js
Expand Up @@ -451,6 +451,16 @@ define(
if (!alreadySecure) {
dotted = sakai_util.Security.safeOutput(dotted);
}
// if params contains middledots = true then the string is threedotted in the middle
if(params && params.middledots && body.length > dotted.length){
var maxlength = dotted.length - 3;
if (!alreadySecure) {
body = sakai_util.Security.safeOutput(body);
}
var prepend = body.slice(0, maxlength / 2);
var append = body.slice(body.length - (maxlength / 2), body.length);
return prepend + "..." + append;
}
return dotted;
},

Expand Down
4 changes: 3 additions & 1 deletion devwidgets/newcreategroup/javascript/newcreategroup.js
Expand Up @@ -349,6 +349,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
$newcreategroupGroupTitle.bind("keyup", function(){
var suggestedURL = sakai.api.Util.makeSafeURL($(this).val(), "-");
$newcreategroupSuggestedURL.val(suggestedURL);
$newcreategroupSuggestedURLBase.attr("title", window.location.protocol + "//" + window.location.host + "/~" + suggestedURL);
renderShareMessage();
});

Expand All @@ -369,7 +370,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var doInit = function(){
currentTemplate = sakai.api.Groups.getTemplate(widgetData.category, widgetData.id);
$(".newcreategroup_template_name", $rootel).text(currentTemplate.title);
$newcreategroupSuggestedURLBase.text(window.location.protocol + "//" + window.location.host + "/~");
$newcreategroupSuggestedURLBase.text(sakai.api.Util.applyThreeDots(window.location.protocol + "//" + window.location.host + "/~", 105, {"middledots": true}, null, true));
$newcreategroupSuggestedURLBase.attr("title", window.location.protocol + "//" + window.location.host + "/~");
if (sakai.config.Permissions.Groups.defaultaccess){
$("#newcreategroup_can_be_found_in [value=" + sakai.config.Permissions.Groups.defaultaccess + "]", $rootel).attr("selected", "selected");
}
Expand Down

0 comments on commit 83b6c91

Please sign in to comment.