]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into share_expiration
authorMichael Gapczynski <mtgap@owncloud.com>
Wed, 12 Sep 2012 05:06:57 +0000 (01:06 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Wed, 12 Sep 2012 05:06:57 +0000 (01:06 -0400)
Conflicts:
core/js/share.js
lib/util.php

1  2 
core/ajax/share.php
core/js/share.js
db_structure.xml
lib/public/share.php
lib/util.php

Simple merge
index 2f3b5c2fa505027125db0a3f4cb15b632daa2f4d,3fe1f25961796c6637ea9f712a683e9a0dcb8ac8..8a00587b77abb9c1fe859bd1d14d815569fa44f0
@@@ -136,16 -132,14 +132,17 @@@ OC.Share=
                        if (link) {
                                html += '<div id="link">';
                                html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">Share with link</label>';
-                               // TODO Change to lock/unlock icon?
-                               html += '<a href="#" id="showPassword" style="display:none;"><img class="svg" alt="Password protect" src="'+OC.imagePath('core', 'actions/triangle-n')+'"/></a>';
+                               html += '<a href="#" id="showPassword" style="display:none;"><img class="svg" alt="Password protect" src="'+OC.imagePath('core', 'actions/lock')+'"/></a>';
                                html += '<br />';
-                               html += '<input id="linkText" style="display:none; width:90%;" readonly="readonly" />';
-                               html += '<input id="linkPassText" type="password" placeholder="Password" style="display:none; width:90%;" />';
+                               html += '<input id="linkText" type="text" readonly="readonly" />';
+                               html += '<div id="linkPass">';
+                               html += '<input id="linkPassText" type="password" placeholder="Password" />';
+                               html += '</div>';
                                html += '</div>';
                        }
 +                      html += '<div id="expiration">';
 +                      html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">Set expiration date</label>';
 +                      html += '<input id="expirationDate" type="text" placeholder="Expiration date" style="display:none; width:90%;" />';
                        html += '</div>';
                        $(html).appendTo(appendTo);
                        // Reset item shares
@@@ -419,37 -436,10 +439,33 @@@ $(document).ready(function() 
                if (event.keyCode == 13) {
                        var itemType = $('#dropdown').data('item-type');
                        var itemSource = $('#dropdown').data('item-source');
-                       // TODO Do this internally
-                       OC.Share.unshare(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '');
-                       OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.Share.PERMISSION_READ);
+                       OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
+                               $('#linkPassText').val('');
+                               $('#linkPassText').attr('placeholder', 'Password protected');
+                       });
                }
        });
-       $('#expirationCheckbox').live('change', function() {
 +
-                       console.log('checked');
++      $('#expirationCheckbox').live('click', function() {
 +              if (this.checked) {
-                       console.log('unchecled');
 +                      $('#expirationDate').before('<br />');
 +                      $('#expirationDate').show();
 +                      $('#expirationDate').datepicker({
 +                              dateFormat : 'dd-mm-yy'
 +                      });
 +              } else {
-       $('#emailPrivateLink').live('submit', function() {
-               OC.Share.emailPrivateLink();
-       });
 +                      $('#expirationDate').hide();
 +              }
 +      });
 +      
 +      $('#expirationDate').live('change', function() {
 +              var itemType = $('#dropdown').data('item-type');
 +              var itemSource = $('#dropdown').data('item-source');
 +              $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) {
 +                      if (!result || result.status !== 'success') {
 +                              OC.dialogs.alert('Error', 'Error setting expiration date');
 +                      }
 +              });
 +      });
 +
  });
Simple merge
index a9fd23bfac8540c6205feab78a002a38f7dd92c6,9d2c98e41797174bfd1032ca7dae2b6a9e1f1c64..b215d7f93894853a14c26208f1862dcc12f7e010
@@@ -1125,6 -1204,4 +1221,4 @@@ interface Share_Backend_Collection exte
        */
        public function getChildren($itemSource);
  
 -}
 +}
- ?>
diff --cc lib/util.php
index 01f53cb2f38a1724595a064ecaeb0a57ce9bf690,f69dacaa2240e7083431db29b773553c8ea9ffc7..f28f83ad71736ca2a2c71b3ce6f5dfeba34b225b
@@@ -74,8 -79,9 +79,9 @@@ class OC_Util 
         * get the current installed version of ownCloud
         * @return array
         */
-       public static function getVersion(){
-               return array(4,82,5);
+       public static function getVersion() {
+               // hint: We only can count up. So the internal version number of ownCloud 4.5 will be 4,9,0. This is not visible to the user
 -              return array(4,83,6);
++              return array(4,83,7);
        }
  
        /**