summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-11 20:25:59 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-11 20:25:59 -0400
commit4bf13adff25f012c735931c0578b1f5d0790bdbe (patch)
treea7c5451ff25e2f39936ae984ceb5b3b9eb519088 /core/js
parent88f4845ca33fd6f2988f230116e2190d15ab1866 (diff)
parent8890a4128015df0ad57101703d6c164ea54fe4ee (diff)
downloadnextcloud-server-4bf13adff25f012c735931c0578b1f5d0790bdbe.tar.gz
nextcloud-server-4bf13adff25f012c735931c0578b1f5d0790bdbe.zip
Merge branch 'master' into share_api
Conflicts: apps/contacts/lib/addressbook.php apps/files_sharing/js/share.js apps/files_sharing/sharedstorage.php
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js4
-rw-r--r--core/js/multiselect.js18
2 files changed, 18 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 7a53bb75ef5..df834157cdb 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -67,6 +67,8 @@ OC={
if(type){
link+= '/'+type+'/';
}
+ if(link.substring(link.length-1) != '/')
+ link+='/';
link+=file;
}else{
link+='/';
@@ -516,5 +518,5 @@ function formatDate(date){
}
var monthNames = [ t('files','January'), t('files','February'), t('files','March'), t('files','April'), t('files','May'), t('files','June'),
t('files','July'), t('files','August'), t('files','September'), t('files','October'), t('files','November'), t('files','December') ];
- return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+date.getMinutes();
+ return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+((date.getMinutes()<10)?'0':'')+date.getMinutes();
}
diff --git a/core/js/multiselect.js b/core/js/multiselect.js
index db5afa637c9..c4fd74b0475 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());
}
}
});