Skip to content
Snippets Groups Projects
Commit 37e3206b authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_15.2'

parents ab4a82e3 0c3e0d90
No related branches found
No related tags found
No related merge requests found
Showing with 30 additions and 30 deletions
...@@ -48,21 +48,8 @@ import org.olat.core.util.StringHelper; ...@@ -48,21 +48,8 @@ import org.olat.core.util.StringHelper;
import org.olat.core.util.filter.impl.OWASPAntiSamyXSSFilter; import org.olat.core.util.filter.impl.OWASPAntiSamyXSSFilter;
/** /**
* Description:<br>
* component to use the TextBoxList from
* http://www.interiders.com/2008/02/18/protomultiselect-02/ a bugfixed-version
* (the one used in OLAT) stays here:
* http://github.com/thewebfellas/protomultiselect
*
* note: march 2012, strentini merged some bugfixes from
* https://github.com/garrytan/protomultiselect as of march 2012, this is
* intended to be used always within a flexiform.
*
* <P>
* Initial Date: 23.07.2010 <br> * Initial Date: 23.07.2010 <br>
* *
*
*
* @author Roman Haag, roman.haag@frentix.com, http://www.frentix.com * @author Roman Haag, roman.haag@frentix.com, http://www.frentix.com
*/ */
public abstract class TextBoxListComponent extends FormBaseComponentImpl { public abstract class TextBoxListComponent extends FormBaseComponentImpl {
...@@ -285,6 +272,7 @@ public abstract class TextBoxListComponent extends FormBaseComponentImpl { ...@@ -285,6 +272,7 @@ public abstract class TextBoxListComponent extends FormBaseComponentImpl {
return new ArrayList<>(currentItems.values()); return new ArrayList<>(currentItems.values());
} }
@Override
public void validate(UserRequest ureq, ValidationResult vr) { public void validate(UserRequest ureq, ValidationResult vr) {
super.validate(ureq, vr); super.validate(ureq, vr);
JSAndCSSAdder jsa = vr.getJsAndCSSAdder(); JSAndCSSAdder jsa = vr.getJsAndCSSAdder();
...@@ -302,6 +290,7 @@ public abstract class TextBoxListComponent extends FormBaseComponentImpl { ...@@ -302,6 +290,7 @@ public abstract class TextBoxListComponent extends FormBaseComponentImpl {
*/ */
private void setMapper(UserRequest ureq) { private void setMapper(UserRequest ureq) {
Mapper mapper = new Mapper() { Mapper mapper = new Mapper() {
@Override
public MediaResource handle(String relPath, HttpServletRequest request) { public MediaResource handle(String relPath, HttpServletRequest request) {
String lastInput = request.getParameter("term"); String lastInput = request.getParameter("term");
if (lastInput != null && lastInput.length() > 2) { if (lastInput != null && lastInput.length() > 2) {
......
...@@ -49,7 +49,7 @@ import org.olat.core.gui.render.velocity.VelocityRenderDecorator; ...@@ -49,7 +49,7 @@ import org.olat.core.gui.render.velocity.VelocityRenderDecorator;
* characters, the system performs a server side search and shows a list of * characters, the system performs a server side search and shows a list of
* search results the user can choose from. * search results the user can choose from.
* <p> * <p>
* This controller uses ExtJS javascript library to implement the feature * This controller uses typeahead javascript library to implement the feature
* <p> * <p>
* Fires: an EntriesChosenEvent which contain the chosen entry/entries as * Fires: an EntriesChosenEvent which contain the chosen entry/entries as
* strings * strings
...@@ -121,8 +121,7 @@ public class AutoCompleterController extends BasicController { ...@@ -121,8 +121,7 @@ public class AutoCompleterController extends BasicController {
// Add mapper URL to JS data store in velocity // Add mapper URL to JS data store in velocity
String fetchUri = registerMapper(ureq, mapper); String fetchUri = registerMapper(ureq, mapper);
final String fulluri = fetchUri; // + "/" + fileName; myContent.contextPut("mapuri", fetchUri + "/autocomplete.json");
myContent.contextPut("mapuri", fulluri+"/autocomplete.json");
putInitialPanel(myContent); putInitialPanel(myContent);
} }
......
...@@ -85,7 +85,7 @@ public class AutoCompleterListReceiver implements ListReceiver { ...@@ -85,7 +85,7 @@ public class AutoCompleterListReceiver implements ListReceiver {
throw new AssertException("Can not add entry with displayText::" + displayText + " with a NULL key!"); throw new AssertException("Can not add entry with displayText::" + displayText + " with a NULL key!");
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Add entry with key::" + key+ ", displayKey::" + displayKey + ", displayText::" + displayText + ", iconCssClass::" + iconCssClass); log.debug("Add entry with key::{}, displayKey::{}, displayText::{}, iconCssClass::{}", key, displayKey, displayText, iconCssClass);
} }
try { try {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
...@@ -112,7 +112,7 @@ public class AutoCompleterListReceiver implements ListReceiver { ...@@ -112,7 +112,7 @@ public class AutoCompleterListReceiver implements ListReceiver {
} catch (JSONException e) { } catch (JSONException e) {
// do nothing, only log error to logfile // do nothing, only log error to logfile
log.error("Could not add entry with key::" + key+ ", displayKey::" + displayKey + ", displayText::" + displayText + ", iconCssClass::" + iconCssClass, e); log.error("Could not add entry with key::{}, displayKey::{}, displayText::{}, iconCssClass::{}", key, displayKey, displayText, iconCssClass, e);
} }
} }
......
...@@ -51,7 +51,7 @@ import org.olat.core.gui.control.WindowControl; ...@@ -51,7 +51,7 @@ import org.olat.core.gui.control.WindowControl;
* characters, the system performs a server side search and shows a list of * characters, the system performs a server side search and shows a list of
* search results the user can choose from. * search results the user can choose from.
* <p> * <p>
* This controller uses ExtJS javascript library to implement the feature * This controller uses the typeahead javascript library to implement the feature
* <p> * <p>
* Fires: an EntriesChosenEvent which contain the chosen entry/entries as * Fires: an EntriesChosenEvent which contain the chosen entry/entries as
* strings * strings
...@@ -166,8 +166,7 @@ public class FlexiAutoCompleterController extends FormBasicController { ...@@ -166,8 +166,7 @@ public class FlexiAutoCompleterController extends FormBasicController {
// Add mapper URL to JS data store in velocity // Add mapper URL to JS data store in velocity
String fetchUri = registerMapper(ureq, mapper); String fetchUri = registerMapper(ureq, mapper);
final String fulluri = fetchUri; // + "/" + fileName; layoutCont.contextPut("mapuri", fetchUri + "/autocomplete.json");
layoutCont.contextPut("mapuri", fulluri+"/autocomplete.json");
} }
@Override @Override
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#end #end
</div> </div>
<script> <script>
/* <![CDATA[ */
jQuery(function(){ jQuery(function(){
var fullNameTypeahead = new Bloodhound({ var fullNameTypeahead = new Bloodhound({
datumTokenizer: function (d) { datumTokenizer: function (d) {
...@@ -59,7 +58,14 @@ jQuery(function(){ ...@@ -59,7 +58,14 @@ jQuery(function(){
'<div>','$autocompleter_emptymessage','</div>' '<div>','$autocompleter_emptymessage','</div>'
].join('\n'), ].join('\n'),
#end #end
suggestion: function(obj) {return "<div class='"+obj.cssClass+"'>"+obj.fullName+"</div>"} suggestion: function(obj) {
var s = "<div>";
if(obj.cssClass !== "undefined" && obj.cssClass != null && obj.cssClass.length > 0) {
s += "<i class='o_icon " + obj.cssClass + "'> </i> ";
}
s += obj.fullName + "</div>";
return s;
}
} }
}).on('typeahead:render', function (e) { }).on('typeahead:render', function (e) {
// disabled and error items should not be selectable // disabled and error items should not be selectable
...@@ -72,5 +78,4 @@ jQuery(function(){ ...@@ -72,5 +78,4 @@ jQuery(function(){
'$r.getId("o_autocomplete_input")',jQuery('#$r.getId("o_autocomplete_input")').val()); '$r.getId("o_autocomplete_input")',jQuery('#$r.getId("o_autocomplete_input")').val());
}); });
}); });
/* ]]> */
</script> </script>
\ No newline at end of file
...@@ -122,8 +122,12 @@ public class BigBlueButtonGuestJoinController extends FormBasicController implem ...@@ -122,8 +122,12 @@ public class BigBlueButtonGuestJoinController extends FormBasicController implem
&& !Boolean.TRUE.equals(ureq.getUserSession().getEntry("meeting-" + meeting.getKey()))) { && !Boolean.TRUE.equals(ureq.getUserSession().getEntry("meeting-" + meeting.getKey()))) {
FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout; FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout;
layoutCont.contextPut("title", meeting.getName()); layoutCont.contextPut("title", meeting.getName());
if(StringHelper.containsNonWhitespace(meeting.getDescription())) { String descr = meeting.getDescription();
layoutCont.contextPut("description", meeting.getDescription()); if(StringHelper.containsNonWhitespace(descr)) {
if(!StringHelper.isHtml(descr)) {
descr = Formatter.escWithBR(descr).toString();
}
layoutCont.contextPut("description", descr);
} }
if(meeting.getStartDate() != null) { if(meeting.getStartDate() != null) {
String start = Formatter.getInstance(getLocale()).formatDateAndTime(meeting.getStartDate()); String start = Formatter.getInstance(getLocale()).formatDateAndTime(meeting.getStartDate());
......
...@@ -141,8 +141,12 @@ public class BigBlueButtonMeetingController extends FormBasicController implemen ...@@ -141,8 +141,12 @@ public class BigBlueButtonMeetingController extends FormBasicController implemen
if(formLayout instanceof FormLayoutContainer) { if(formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout; FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout;
layoutCont.contextPut("title", meeting.getName()); layoutCont.contextPut("title", meeting.getName());
if(StringHelper.containsNonWhitespace(meeting.getDescription())) { String descr = meeting.getDescription();
layoutCont.contextPut("description", meeting.getDescription()); if(StringHelper.containsNonWhitespace(descr)) {
if(!StringHelper.isHtml(descr)) {
descr = Formatter.escWithBR(descr).toString();
}
layoutCont.contextPut("description", descr);
} }
if(meeting.getStartDate() != null) { if(meeting.getStartDate() != null) {
String start = Formatter.getInstance(getLocale()).formatDateAndTime(meeting.getStartDate()); String start = Formatter.getInstance(getLocale()).formatDateAndTime(meeting.getStartDate());
......
...@@ -280,10 +280,10 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController ...@@ -280,10 +280,10 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
&& lock.getResourceableTypeName().equals(resource.getResourceableTypeName()); && lock.getResourceableTypeName().equals(resource.getResourceableTypeName());
} }
protected void reloadSecurity(UserRequest ureq) { protected final void reloadSecurity(UserRequest ureq) {
reSecurity.setWrappedSecurity(repositoryManager.isAllowed(ureq, getRepositoryEntry())); reSecurity.setWrappedSecurity(repositoryManager.isAllowed(ureq, getRepositoryEntry()));
initToolbar();
onSecurityReloaded(ureq); onSecurityReloaded(ureq);
initToolbar();
} }
//ureq my be used by sub controller //ureq my be used by sub controller
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment