diff options
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 70 | ||||
-rw-r--r-- | apps/files_external/tests/Storage/SmbTest.php | 19 | ||||
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 19 | ||||
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 50 | ||||
-rw-r--r-- | core/css/styles.scss | 1 | ||||
-rw-r--r-- | core/js/jquery-showpassword.js | 6 | ||||
-rw-r--r-- | core/js/jquery-ui-fixes.js | 2 | ||||
-rw-r--r-- | core/js/js.js | 16 | ||||
-rw-r--r-- | core/js/login/authpicker.js | 4 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 8 | ||||
-rw-r--r-- | core/js/octemplate.js | 2 | ||||
-rw-r--r-- | core/js/placeholder.js | 2 | ||||
-rw-r--r-- | core/js/setup.js | 2 | ||||
-rw-r--r-- | core/js/sharedialogshareelistview.js | 2 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 11 | ||||
-rw-r--r-- | core/js/singleselect.js | 2 | ||||
-rw-r--r-- | core/js/systemtags/systemtagsinputfield.js | 6 | ||||
-rw-r--r-- | core/js/tags.js | 371 | ||||
-rw-r--r-- | core/templates/layout.user.php | 4 | ||||
-rw-r--r-- | settings/templates/admin/additional-mail.php | 2 | ||||
-rw-r--r-- | version.php | 2 |
21 files changed, 173 insertions, 428 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index cc4cd641ce5..7afdb746a98 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -31,6 +31,7 @@ namespace OCA\Files_External\Lib\Storage; +use Icewind\SMB\Exception\AlreadyExistsException; use Icewind\SMB\Exception\ConnectException; use Icewind\SMB\Exception\Exception; use Icewind\SMB\Exception\ForbiddenException; @@ -90,6 +91,7 @@ class SMB extends Common implements INotifyStorage { throw new \Exception('Invalid configuration'); } $this->statCache = new CappedMemoryCache(); + parent::__construct($params); } /** @@ -162,10 +164,42 @@ class SMB extends Common implements INotifyStorage { * @return array */ protected function formatInfo($info) { - return array( + $result = [ 'size' => $info->getSize(), - 'mtime' => $info->getMTime() - ); + 'mtime' => $info->getMTime(), + ]; + if ($info->isDirectory()) { + $result['type'] = 'dir'; + } else { + $result['type'] = 'file'; + } + return $result; + } + + /** + * Rename the files. If the source or the target is the root, the rename won't happen. + * + * @param string $source the old name of the path + * @param string $target the new name of the path + * @return bool true if the rename is successful, false otherwise + */ + public function rename($source, $target) { + if ($this->isRootDir($source) || $this->isRootDir($target)) { + return false; + } + + $absoluteSource = $this->buildPath($source); + $absoluteTarget = $this->buildPath($target); + try { + $result = $this->share->rename($absoluteSource, $absoluteTarget); + } catch (AlreadyExistsException $e) { + $this->remove($target); + $result = $this->share->rename($absoluteSource, $absoluteTarget); + } catch (\Exception $e) { + return false; + } + unset($this->statCache[$absoluteSource], $this->statCache[$absoluteTarget]); + return $result; } /** @@ -220,6 +254,10 @@ class SMB extends Common implements INotifyStorage { * @return bool */ public function unlink($path) { + if ($this->isRootDir($path)) { + return false; + } + try { if ($this->is_dir($path)) { return $this->rmdir($path); @@ -239,26 +277,6 @@ class SMB extends Common implements INotifyStorage { } /** - * @param string $path1 the old name - * @param string $path2 the new name - * @return bool - */ - public function rename($path1, $path2) { - try { - $this->remove($path2); - $path1 = $this->buildPath($path1); - $path2 = $this->buildPath($path2); - return $this->share->rename($path1, $path2); - } catch (NotFoundException $e) { - return false; - } catch (ForbiddenException $e) { - return false; - } catch (ConnectException $e) { - throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e); - } - } - - /** * check if a file or folder has been updated since $time * * @param string $path @@ -266,7 +284,7 @@ class SMB extends Common implements INotifyStorage { * @return bool */ public function hasUpdated($path, $time) { - if (!$path and $this->root == '/') { + if (!$path and $this->root === '/') { // mtime doesn't work for shares, but giving the nature of the backend, // doing a full update is still just fast enough return true; @@ -343,6 +361,10 @@ class SMB extends Common implements INotifyStorage { } public function rmdir($path) { + if ($this->isRootDir($path)) { + return false; + } + try { $this->statCache = array(); $content = $this->share->dir($this->buildPath($path)); diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php index 45c01a0c59e..037c4cd4d39 100644 --- a/apps/files_external/tests/Storage/SmbTest.php +++ b/apps/files_external/tests/Storage/SmbTest.php @@ -132,4 +132,23 @@ class SmbTest extends \Test\Files\Storage\Storage { $this->assertEquals(new Change(IChange::ADDED, 'newfile.txt'), $result); } + + public function testRenameRoot() { + // root can't be renamed + $this->assertFalse($this->instance->rename('', 'foo1')); + + $this->instance->mkdir('foo2'); + $this->assertFalse($this->instance->rename('foo2', '')); + $this->instance->rmdir('foo2'); + } + + public function testUnlinkRoot() { + // root can't be deleted + $this->assertFalse($this->instance->unlink('')); + } + + public function testRmdirRoot() { + // root can't be deleted + $this->assertFalse($this->instance->rmdir('')); + } } diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index cffc628e9b9..faaff1f2174 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -40,6 +40,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\File; use OCP\Files\IAppData; use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; use OCP\IConfig; use OCP\IL10N; use OCP\ILogger; @@ -265,6 +266,24 @@ class ThemingController extends Controller { $value = $this->themingDefaults->undo($setting); // reprocess server scss for preview $cssCached = $this->scssCacher->process(\OC::$SERVERROOT, '/core/css/server.scss', 'core'); + + if($setting === 'logoMime') { + try { + $file = $this->appData->getFolder('images')->getFile('logo'); + $file->delete(); + } catch (NotFoundException $e) { + } catch (NotPermittedException $e) { + } + } + if($setting === 'backgroundMime') { + try { + $file = $this->appData->getFolder('images')->getFile('background'); + $file->delete(); + } catch (NotFoundException $e) { + } catch (NotPermittedException $e) { + } + } + return new DataResponse( [ 'data' => diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 0aa9ead3742..f22c317d73d 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -385,6 +385,56 @@ class ThemingControllerTest extends TestCase { $this->assertEquals($expected, $this->themingController->undo('MySetting')); } + public function dataUndoDelete() { + return [ + [ 'backgroundMime', 'background' ], + [ 'logoMime', 'logo' ] + ]; + } + + /** @dataProvider dataUndoDelete */ + public function testUndoDelete($value, $filename) { + $this->l10n + ->expects($this->once()) + ->method('t') + ->with('Saved') + ->willReturn('Saved'); + $this->themingDefaults + ->expects($this->once()) + ->method('undo') + ->with($value) + ->willReturn($value); + $folder = $this->createMock(ISimpleFolder::class); + $file = $this->createMock(ISimpleFile::class); + $this->appData + ->expects($this->once()) + ->method('getFolder') + ->with('images') + ->willReturn($folder); + $folder + ->expects($this->once()) + ->method('getFile') + ->with($filename) + ->willReturn($file); + $file + ->expects($this->once()) + ->method('delete'); + + $expected = new DataResponse( + [ + 'data' => + [ + 'value' => $value, + 'message' => 'Saved', + ], + 'status' => 'success' + ] + ); + $this->assertEquals($expected, $this->themingController->undo($value)); + } + + + public function testGetLogoNotExistent() { $this->appData->method('getFolder') ->with($this->equalTo('images')) diff --git a/core/css/styles.scss b/core/css/styles.scss index f85ae93ccc8..3468cf6900a 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -1072,6 +1072,7 @@ span.ui-icon { /* show ~4.5 entries */ height: 278px; width: 350px; + max-width: 90%; right: 13px; &::after { diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js index 23ddf947719..5d518c78bcb 100644 --- a/core/js/jquery-showpassword.js +++ b/core/js/jquery-showpassword.js @@ -17,8 +17,8 @@ showPassword: function(c) { // Setup callback object - var callback = {'fn':null,'args':{}} - callback.fn = c; + var callback = {'fn':null,'args':{}}; + callback.fn = c; // Clones passwords and turn the clones into text inputs var cloneElement = function( element ) { @@ -90,7 +90,7 @@ }); $input.bind('keyup', function() { - update( $input, $clone ) + update( $input, $clone ); }); $clone.bind('keyup', function(){ diff --git a/core/js/jquery-ui-fixes.js b/core/js/jquery-ui-fixes.js index 9ccaa38cc47..39f6d7a354e 100644 --- a/core/js/jquery-ui-fixes.js +++ b/core/js/jquery-ui-fixes.js @@ -5,4 +5,4 @@ jQuery.ui.autocomplete.prototype._resizeMenu = function () { var ul = this.menu.element; ul.outerWidth(this.element.outerWidth()); -} +}; diff --git a/core/js/js.js b/core/js/js.js index d601f79033e..b6086846d59 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -150,7 +150,7 @@ var OCP = {}, _.defaults(allOptions, defaultOptions); var _build = function (text, vars) { - var vars = vars || []; + vars = vars || []; return text.replace(/{([^{}]*)}/g, function (a, b) { var r = (vars[b]); @@ -1422,7 +1422,7 @@ function initCore() { } else { // Close navigation when opening app in // a new tab - OC.hideMenus(function(){return false}); + OC.hideMenus(function(){return false;}); } }); @@ -1430,7 +1430,7 @@ function initCore() { if(event.which === 2) { // Close navigation when opening app in // a new tab via middle click - OC.hideMenus(function(){return false}); + OC.hideMenus(function(){return false;}); } }); @@ -1444,7 +1444,7 @@ function initCore() { } else { // Close navigation when opening app in // a new tab - OC.hideMenus(function(){return false}); + OC.hideMenus(function(){return false;}); } }); } @@ -1465,7 +1465,7 @@ function initCore() { } else { // Close navigation when opening menu entry in // a new tab - OC.hideMenus(function(){return false}); + OC.hideMenus(function(){return false;}); } }); @@ -1473,7 +1473,7 @@ function initCore() { if(event.which === 2) { // Close navigation when opening app in // a new tab via middle click - OC.hideMenus(function(){return false}); + OC.hideMenus(function(){return false;}); } }); } @@ -1884,7 +1884,7 @@ OC.Util = { * @return {boolean} true if the browser supports SVG, false otherwise */ hasSVGSupport: function(){ - return true + return true; }, /** * If SVG is not supported, replaces the given icon's extension @@ -2385,4 +2385,4 @@ jQuery.fn.tipsy = function(argument) { jQuery.fn.tooltip.call(this, argument); } return this; -} +}; diff --git a/core/js/login/authpicker.js b/core/js/login/authpicker.js index 6d8a6bb4160..666a63da365 100644 --- a/core/js/login/authpicker.js +++ b/core/js/login/authpicker.js @@ -8,6 +8,8 @@ jQuery(document).ready(function() { $('#submit-app-token-login').click(function(e) { e.preventDefault(); - window.location.href = 'nc://' + encodeURIComponent($('#user').val()) + ':' + encodeURIComponent($('#password').val()) + '@' + encodeURIComponent($('#serverHost').val()); + window.location.href = 'nc://' + + encodeURIComponent($('#user').val()) + ':' + encodeURIComponent($('#password').val()) + + '@' + encodeURIComponent($('#serverHost').val()); }); }); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 92f256699af..5fc224e38bf 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -561,7 +561,7 @@ var OCdialogs = { .prop('checked', true) .prop('disabled', true); $originalDiv.find('.message') - .text(t('core','read-only')) + .text(t('core','read-only')); } }; //var selection = controller.getSelection(data.originalFiles); @@ -813,11 +813,13 @@ var OCdialogs = { $.each(files, function(idx, entry) { entry.icon = OC.MimeType.getIconUrl(entry.mimetype); + var simpleSize, sizeColor; if (typeof(entry.size) !== 'undefined' && entry.size >= 0) { - var simpleSize = humanFileSize(parseInt(entry.size, 10), true); - var sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2)); + simpleSize = humanFileSize(parseInt(entry.size, 10), true); + sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2)); } else { simpleSize = t('files', 'Pending'); + sizeColor = 80; } var $row = self.$listTmpl.octemplate({ type: entry.type, diff --git a/core/js/octemplate.js b/core/js/octemplate.js index b24ad95c2b0..659f795982a 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -94,7 +94,7 @@ }; $.fn.octemplate = function(vars, options) { - var vars = vars ? vars : {}; + vars = vars || {}; if(this.length) { var _template = Object.create(Template); return _template.init(vars, options, this); diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 1b03a28ecca..b8075b5397f 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -71,7 +71,7 @@ } function rgbToHsl(r, g, b) { - r /= 255, g /= 255, b /= 255; + r /= 255; g /= 255; b /= 255; var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, l = (max + min) / 2; if(max === min) { diff --git a/core/js/setup.js b/core/js/setup.js index 3c09bb6da49..b3b2049c447 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -66,7 +66,7 @@ $(document).ready(function() { $('.strengthify-wrapper, .tipsy') .css('-ms-filter', '"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"') .css('filter', 'alpha(opacity=30)') - .css('opacity', .3); + .css('opacity', 0.3); // Create the form var form = $('<form>'); diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index f513eb75848..d51504c3771 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -369,7 +369,7 @@ var shareType = $this.data('share-type'); $this.find('div.avatar, span.username').contactsMenu(shareWith, shareType, $this); - }) + }); } else { var permissionChangeShareId = parseInt(this._renderPermissionChange, 10); var shareWithIndex = this.model.findShareWithIndex(permissionChangeShareId); diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 007e13dd366..157887fbb94 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -183,15 +183,13 @@ var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups); var remotes = result.ocs.data.exact.remotes.concat(result.ocs.data.remotes); var lookup = result.ocs.data.lookup; + var emails = [], + circles = []; if (typeof(result.ocs.data.emails) !== 'undefined') { - var emails = result.ocs.data.exact.emails.concat(result.ocs.data.emails); - } else { - var emails = []; + emails = result.ocs.data.exact.emails.concat(result.ocs.data.emails); } if (typeof(result.ocs.data.circles) !== 'undefined') { - var circles = result.ocs.data.exact.circles.concat(result.ocs.data.circles); - } else { - var circles = []; + circles = result.ocs.data.exact.circles.concat(result.ocs.data.circles); } var usersLength; @@ -199,7 +197,6 @@ var remotesLength; var emailsLength; var circlesLength; - var lookupLength; var i, j; diff --git a/core/js/singleselect.js b/core/js/singleselect.js index 1b2016aabb9..cd0dd52651a 100644 --- a/core/js/singleselect.js +++ b/core/js/singleselect.js @@ -8,7 +8,7 @@ input.attr('title', inputTooltip); } if (typeof gravity === 'undefined') { - gravity = 'n' + gravity = 'n'; } select = $(select); input.css('position', 'absolute'); diff --git a/core/js/systemtags/systemtagsinputfield.js b/core/js/systemtags/systemtagsinputfield.js index 62dae1e0a8f..ba72d486204 100644 --- a/core/js/systemtags/systemtagsinputfield.js +++ b/core/js/systemtags/systemtagsinputfield.js @@ -240,7 +240,11 @@ self.collection.fetch({ success: function(collection) { // find the tag in the collection - var model = collection.where({name: e.object.name.trim(), userVisible: true, userAssignable: true}); + var model = collection.where({ + name: e.object.name.trim(), + userVisible: true, + userAssignable: true + }); if (model.length) { model = model[0]; // the tag already exists or was already assigned, diff --git a/core/js/tags.js b/core/js/tags.js deleted file mode 100644 index b4c2c220df2..00000000000 --- a/core/js/tags.js +++ /dev/null @@ -1,371 +0,0 @@ -OC.Tags= { - edit:function(type, cb) { - if(!type && !this.type) { - throw { - name: 'MissingParameter', - message: t( - 'core', - 'The object type is not specified.' - ) - }; - } - type = type ? type : this.type; - var self = this; - $.when(this._getTemplate()).then(function($tmpl) { - if(self.$dialog) { - self.$dialog.ocdialog('close'); - } - self.$dialog = $tmpl.octemplate({ - addText: t('core', 'Enter new') - }); - $('body').append(self.$dialog); - - self.$dialog.ready(function() { - self.$taglist = self.$dialog.find('.taglist'); - self.$taginput = self.$dialog.find('.addinput'); - self.$taglist.on('change', 'input:checkbox', function(event) { - self._handleChanges(self.$taglist, self.$taginput); - }); - self.$taginput.on('input', function(event) { - self._handleChanges(self.$taglist, self.$taginput); - }); - self.deleteButton = { - text: t('core', 'Delete'), - click: function() { - self._deleteTags( - self, - type, - self._selectedIds() - ); - } - }; - self.addButton = { - text: t('core', 'Add'), - click: function() { - self._addTag( - self, - type, - self.$taginput.val() - ); - } - }; - - self._fillTagList(type, self.$taglist); - }); - - self.$dialog.ocdialog({ - title: t('core', 'Edit tags'), - closeOnEscape: true, - width: 250, - height: 'auto', - modal: true, - //buttons: buttonlist, - close: function(event, ui) { - try { - $(this).ocdialog('destroy').remove(); - } catch(e) {console.warn(e);} - self.$dialog = null; - } - }); - }) - .fail(function(status, error) { - // If the method is called while navigating away - // from the page, it is probably not needed ;) - if(status !== 0) { - alert(t('core', 'Error loading dialog template: {error}', {error: error})); - } - }); - }, - /** - * @param {string} type - * @param {string} tag - * @return jQuery.Promise which resolves with an array of ids - */ - getIdsForTag:function(type, tag) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}/ids', {type: type}); - $.getJSON(url, {tag: tag}, function(response) { - if(response.status === 'success') { - defer.resolve(response.ids); - } else { - defer.reject(response); - } - }); - return defer.promise(); - }, - /** - * @param {string} type - * @return {*} jQuery.Promise which resolves with an array of ids - */ - getFavorites:function(type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}/favorites', {type: type}); - $.getJSON(url, function(response) { - if(response.status === 'success') { - defer.resolve(response.ids); - } else { - defer.reject(response); - } - }); - return defer.promise(); - }, - /** - * @param {string} type - * @return {*} jQuery.Promise which resolves with an array of id/name objects - */ - getTags:function(type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}', {type: type}); - $.getJSON(url, function(response) { - if(response.status === 'success') { - defer.resolve(response.tags); - } else { - defer.reject(response); - } - }); - return defer.promise(); - }, - /** - * @param {number} id - * @param {string} tag - * @param {string} type - * @return {*} jQuery.Promise - */ - tagAs:function(id, tag, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}/tag/{id}/', {type: type, id: id}); - $.post(url, {tag: tag}, function(response) { - if(response.status === 'success') { - defer.resolve(response); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - /** - * @param {number} id - * @param {string} tag - * @param {string} type - * @return {*} jQuery.Promise - */ - unTag:function(id, tag, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - self = this, - url = OC.generateUrl('/tags/{type}/untag/{id}/', {type: type, id: id}); - $.post(url, {tag: tag}, function(response) { - if(response.status === 'success') { - defer.resolve(response); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - /** - * @param {number} id - * @param {string} type - * @return {*} jQuery.Promise - */ - addToFavorites:function(id, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl( - '/tags/{type}/favorite/{id}/', - {type: type, id: id} - ); - $.post(url, function(response) { - if(response.status === 'success') { - defer.resolve(response); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - /** - * @param {number} id - * @param {string} type - * @return {*} jQuery.Promise - */ - removeFromFavorites:function(id, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl( - '/tags/{type}/unfavorite/{id}/', - {type: type, id: id} - ); - $.post(url, function(response) { - if(response.status === 'success') { - defer.resolve(); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - /** - * @param {string} tag - * @param {string} type - * @return {*} jQuery.Promise which resolves with an object with the name and the new id - */ - addTag:function(tag, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}/add', {type: type}); - $.post(url,{tag:tag}, function(response) { - if(typeof cb == 'function') { - cb(response); - } - if(response.status === 'success') { - defer.resolve({id:response.id, name: tag}); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - /** - * @param {array} tags - * @param {string} type - * @return {*} jQuery.Promise - */ - deleteTags:function(tags, type) { - if(!type && !this.type) { - throw new Error('The object type is not specified.'); - } - type = type ? type : this.type; - var defer = $.Deferred(), - url = OC.generateUrl('/tags/{type}/delete', {type: type}); - if(!tags || !tags.length) { - throw new Error(t('core', 'No tags selected for deletion.')); - } - $.post(url, {tags:tags}, function(response) { - if(response.status === 'success') { - defer.resolve(response.tags); - } else { - defer.reject(response); - } - }).fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - return defer.promise(); - }, - _update:function(tags, type) { - if(!this.$dialog) { - return; - } - var $taglist = this.$dialog.find('.taglist'), - self = this; - $taglist.empty(); - $.each(tags, function(idx, tag) { - var $item = self.$listTmpl.octemplate({id: tag.id, name: tag.name}); - $item.appendTo($taglist); - }); - $(this).trigger('change', {type: type, tags: tags}); - if(typeof this.changed === 'function') { - this.changed(tags); - } - }, - _getTemplate: function() { - var defer = $.Deferred(); - if(!this.$template) { - var self = this; - $.get(OC.filePath('core', 'templates', 'tags.html'), function(tmpl) { - self.$template = $(tmpl); - self.$listTmpl = self.$template.find('.taglist li:first-child').detach(); - defer.resolve(self.$template); - }) - .fail(function(jqXHR, textStatus, errorThrown) { - defer.reject(jqXHR.status, errorThrown); - }); - } else { - defer.resolve(this.$template); - } - return defer.promise(); - }, - _fillTagList: function(type) { - var self = this; - $.when(this.getTags(type)) - .then(function(tags) { - self._update(tags, type); - }) - .fail(function(response) { - console.warn(response); - }); - }, - _selectedIds: function() { - return $.map(this.$taglist.find('input:checked'), function(b) {return $(b).val();}); - }, - _handleChanges: function($list, $input) { - var ids = this._selectedIds(); - var buttons = []; - if($input.val().length) { - buttons.push(this.addButton); - } - if(ids.length) { - buttons.push(this.deleteButton); - } - this.$dialog.ocdialog('option', 'buttons', buttons); - }, - _deleteTags: function(self, type, ids) { - $.when(self.deleteTags(ids, type)) - .then(function() { - self._fillTagList(type); - self.$dialog.ocdialog('option', 'buttons', []); - }) - .fail(function(response) { - console.warn(response); - }); - }, - _addTag: function(self, type, tag) { - $.when(self.addTag(tag, type)) - .then(function(tag) { - self._fillTagList(type); - self.$taginput.val('').trigger('input'); - }) - .fail(function(response) { - console.warn(response); - }); - } -}; - diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 426ed4b1125..978534b869c 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -85,7 +85,7 @@ </ul> <nav role="navigation"> - <div id="navigation"> + <div id="navigation" style="display: none;"> <div id="apps"> <ul> <?php foreach($_['navigation'] as $entry): ?> @@ -134,7 +134,7 @@ </div> <div id="expandDisplayName" class="icon-settings-white"></div> </div> - <div id="expanddiv"> + <div id="expanddiv" style="display:none;"> <ul> <?php foreach($_['settingsnavigation'] as $entry):?> <li> diff --git a/settings/templates/admin/additional-mail.php b/settings/templates/admin/additional-mail.php index 249252dc694..bce7e5adeee 100644 --- a/settings/templates/admin/additional-mail.php +++ b/settings/templates/admin/additional-mail.php @@ -61,7 +61,7 @@ if ($_['mail_smtpmode'] === 'qmail') { <p> <label for="mail_smtpmode"><?php p($l->t('Send mode')); ?></label> - <select name="mail_smtpmode" id="mail_smtpmode'> + <select name="mail_smtpmode" id="mail_smtpmode"> <?php foreach ($mail_smtpmode as $smtpmode): $selected = ''; if ($smtpmode[0] == $_['mail_smtpmode']): diff --git a/version.php b/version.php index 1e44a19368e..c4a33654a8e 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ $OC_Version = array(12, 0, 0, 15); // The human readable string -$OC_VersionString = '12.0 alpha'; +$OC_VersionString = '12.0 beta 1'; $OC_VersionCanBeUpgradedFrom = [ 'nextcloud' => [ |