diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 96c9017dbf9c507bbd92b778408a5eece71bcbd4..afe31a75d0b5d14f7f1ca394e388af6f4eef9ec0 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -360,7 +360,8 @@ $(document).ready(function() { $(this).select(); }); - $('#emailPrivateLink').live('submit', function() { + $('#emailPrivateLink').live('submit', function(event) { + event.preventDefault(); OC.Share.emailPrivateLink(); }); }); \ No newline at end of file diff --git a/core/js/multiselect.js b/core/js/multiselect.js index db5afa637c94de4a50318b9b9de5d6064a70ae15..c4fd74b0475e746844b554f23d9b94f487de8b45 100644 --- a/core/js/multiselect.js +++ b/core/js/multiselect.js @@ -35,6 +35,7 @@ } button.click(function(event){ + var button=$(this); if(button.parent().children('ul').length>0){ button.parent().children('ul').slideUp(400,function(){ @@ -128,19 +129,30 @@ if(event.keyCode == 13) { event.preventDefault(); event.stopPropagation(); + var value = $(this).val(); + var exists = false; + $.each(options,function(index, item) { + if ($(item).val() == value) { + exists = true; + return false; + } + }); + if (exists) { + return false; + } var li=$(this).parent(); $(this).remove(); li.text('+ '+settings.createText); li.before(createItem(this)); var select=button.parent().next(); var option=$('<option selected="selected"/>'); - option.attr('value',$(this).val()); + option.attr('value',value); option.text($(this).val()); - select.append(options); + select.append(option); li.prev().children('input').trigger('click'); button.parent().data('preventHide',false); if(settings.createCallback){ - settings.createCallback(); + settings.createCallback($(this).val()); } } }); diff --git a/lib/l10n.php b/lib/l10n.php index c5967109a60c8ac7c6d4c8fdef1ef0204d24adb0..de8514573d393a68db014dfdd7a4694f9f4e169c 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -115,7 +115,7 @@ class OC_L10N{ // (Just no need to define date/time format etc. twice) if((OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC_App::getAppPath($app).'/l10n/') || OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/core/l10n/') || OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/settings')) && file_exists($i18ndir.$lang.'.php')) { // Include the file, save the data from $CONFIG - include($i18ndir.$lang.'.php'); + include(strip_tags($i18ndir).strip_tags($lang).'.php'); if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)){ $this->translations = $TRANSLATIONS; } diff --git a/settings/js/users.js b/settings/js/users.js index 6ee7fb04f07a8542ef4a9ada866cbabc274e8b9f..784f8b888cb66ff52d5c6e387367948d2644f0fa 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -40,7 +40,15 @@ $(document).ready(function(){ }else{ checkHandeler=false; } + var addGroup = function(group) { + $('select[multiple]').each(function(index, element) { + if ($(element).find('option[value="'+group +'"]').length == 0) { + $(element).append('<option value="'+group+'">'+group+'</option>'); + } + }) + }; element.multiSelect({ + createCallback:addGroup, createText:'add group', checked:checked, oncheck:checkHandeler, @@ -213,6 +221,5 @@ $(document).ready(function(){ } } ); - location.reload(); }); });