@ -219,7 +219,18 @@ OC.Share={
html += '<div id="link">' ;
html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">' + t ( 'core' , 'Share link' ) + '</label>' ;
html += '<br />' ;
var defaultExpireMessage = '' ;
if ( ( itemType === 'folder' || itemType === 'file' ) && oc _appconfig . core . defaultExpireDateEnabled === 'yes' ) {
if ( oc _appconfig . core . defaultExpireDateEnforced === 'yes' ) {
defaultExpireMessage = t ( 'core' , 'The public link will expire no later than {days} days after it is created' , { 'days' : oc _appconfig . core . defaultExpireDate } ) + '<br/>' ;
} else {
defaultExpireMessage = t ( 'core' , 'By default the public link will expire after {days} days' , { 'days' : oc _appconfig . core . defaultExpireDate } ) + '<br/>' ;
}
}
html += '<input id="linkText" type="text" readonly="readonly" />' ;
html += '<input type="checkbox" name="showPassword" id="showPassword" value="1" style="display:none;" /><label for="showPassword" style="display:none;">' + t ( 'core' , 'Password protect' ) + '</label>' ;
html += '<div id="linkPass">' ;
html += '<input id="linkPassText" type="password" placeholder="' + t ( 'core' , 'Password' ) + '" />' ;
@ -239,6 +250,7 @@ OC.Share={
html += '<div id="expiration">' ;
html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">' + t ( 'core' , 'Set expiration date' ) + '</label>' ;
html += '<input id="expirationDate" type="text" placeholder="' + t ( 'core' , 'Expiration date' ) + '" style="display:none; width:90%;" />' ;
html += '<div id="defaultExpireMessage">' + defaultExpireMessage + '</div>' ;
html += '</div>' ;
dropDownEl = $ ( html ) ;
dropDownEl = dropDownEl . appendTo ( appendTo ) ;
@ -490,19 +502,20 @@ OC.Share={
$ ( '#linkPassText' ) . attr ( 'placeholder' , '**********' ) ;
}
$ ( '#expiration' ) . show ( ) ;
$ ( '#defaultExpireMessage' ) . show ( ) ;
$ ( '#emailPrivateLink #email' ) . show ( ) ;
$ ( '#emailPrivateLink #emailButton' ) . show ( ) ;
$ ( '#allowPublicUploadWrapper' ) . show ( ) ;
} ,
hideLink : function ( ) {
$ ( '#linkText' ) . hide ( 'blind' ) ;
$ ( '#defaultExpireMessage' ) . hide ( ) ;
$ ( '#showPassword' ) . hide ( ) ;
$ ( '#showPassword+label' ) . hide ( ) ;
$ ( '#linkPass' ) . hide ( ) ;
$ ( '#emailPrivateLink #email' ) . hide ( ) ;
$ ( '#emailPrivateLink #emailButton' ) . hide ( ) ;
$ ( '#allowPublicUploadWrapper' ) . hide ( ) ;
$ ( '#expirationDate' ) . hide ( ) ;
} ,
dirname : function ( path ) {
return path . replace ( /\\/g , '/' ) . replace ( /\/[^\/]*$/ , '' ) ;
@ -734,6 +747,9 @@ $(document).ready(function() {
OC . dialogs . alert ( t ( 'core' , 'Error unsetting expiration date' ) , t ( 'core' , 'Error' ) ) ;
}
$ ( '#expirationDate' ) . hide ( 'blind' ) ;
if ( oc _appconfig . core . defaultExpireDateEnforced === 'no' ) {
$ ( '#defaultExpireMessage' ) . show ( 'blind' ) ;
}
} ) ;
}
} ) ;
@ -756,6 +772,10 @@ $(document).ready(function() {
expirationDateField . tipsy ( { gravity : 'n' , fade : true } ) ;
expirationDateField . tipsy ( 'show' ) ;
expirationDateField . addClass ( 'error' ) ;
} else {
if ( oc _appconfig . core . defaultExpireDateEnforced === 'no' ) {
$ ( '#defaultExpireMessage' ) . hide ( 'blind' ) ;
}
}
} ) ;
} ) ;