\")\n\t\t\t\t.append(insert);\n\t\t\treturn $(\"\")\n\t\t\t\t.addClass((item.value.shareType === OC.Share.SHARE_TYPE_GROUP) ? 'group' : 'user')\n\t\t\t\t.append(insert)\n\t\t\t\t.appendTo(ul);\n\t\t},\n\n\t\t_onSelectRecipient: function(e, s) {\n\t\t\tvar self = this;\n\n\t\t\tif (e.keyCode == 9) {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (typeof s.item.name !== 'undefined') {\n\t\t\t\t\te.target.value = s.item.name;\n\t\t\t\t} else {\n\t\t\t\t\te.target.value = s.item.label;\n\t\t\t\t}\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(e.target).attr('disabled', false)\n\t\t\t\t\t\t.autocomplete('search', $(e.target).val());\n\t\t\t\t}, 0);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (s.item.lookup) {\n\t\t\t\t// Retrigger search but with global lookup this time\n\t\t\t\tthis._lookup = true;\n\t\t\t\tvar $shareWithField = this.$el.find('.shareWithField');\n\t\t\t\tvar val = $shareWithField.val();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tconsole.debug('searching again, but globally. search term: ' + val);\n\t\t\t\t\t$shareWithField.autocomplete(\"search\", val);\n\t\t\t\t}, 0);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\t// Ensure that the keydown handler for the input field is not\n\t\t\t// called; otherwise it would try to add the recipient again, which\n\t\t\t// would fail.\n\t\t\te.stopImmediatePropagation();\n\t\t\t$(e.target).attr('disabled', true)\n\t\t\t\t.val(s.item.label);\n\n\t\t\tvar $loading = this.$el.find('.shareWithLoading');\n\t\t\tvar $confirm = this.$el.find('.shareWithConfirm');\n\n\t\t\t$loading.removeClass('hidden');\n\t\t\t$loading.addClass('inlineblock');\n\t\t\t$confirm.addClass('hidden');\n\t\t\tthis._pendingOperationsCount++;\n\n\t\t\tthis.model.addShare(s.item.value, {success: function() {\n\t\t\t\t// Adding a share changes the suggestions.\n\t\t\t\tself._lastSuggestions = undefined;\n\n\t\t\t\t$(e.target).val('')\n\t\t\t\t\t.attr('disabled', false);\n\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\t\t\t}, error: function(obj, msg) {\n\t\t\t\tOC.Notification.showTemporary(msg);\n\t\t\t\t$(e.target).attr('disabled', false)\n\t\t\t\t\t.autocomplete('search', $(e.target).val());\n\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\t\t\t}});\n\t\t},\n\n\t\t_confirmShare: function() {\n\t\t\tvar self = this;\n\t\t\tvar $shareWithField = $('.shareWithField');\n\t\t\tvar $loading = this.$el.find('.shareWithLoading');\n\t\t\tvar $confirm = this.$el.find('.shareWithConfirm');\n\n\t\t\t$loading.removeClass('hidden');\n\t\t\t$loading.addClass('inlineblock');\n\t\t\t$confirm.addClass('hidden');\n\t\t\tthis._pendingOperationsCount++;\n\n\t\t\t$shareWithField.prop('disabled', true);\n\n\t\t\t// Disabling the autocompletion does not clear its search timeout;\n\t\t\t// removing the focus from the input field does, but only if the\n\t\t\t// autocompletion is not disabled when the field loses the focus.\n\t\t\t// Thus, the field has to be disabled before disabling the\n\t\t\t// autocompletion to prevent an old pending search result from\n\t\t\t// appearing once the field is enabled again.\n\t\t\t$shareWithField.autocomplete('close');\n\t\t\t$shareWithField.autocomplete('disable');\n\n\t\t\tvar restoreUI = function() {\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\n\t\t\t\t$shareWithField.prop('disabled', false);\n\t\t\t\t$shareWithField.focus();\n\t\t\t};\n\n\t\t\tvar perPage = parseInt(oc_config['sharing.maxAutocompleteResults'], 10) || 200;\n\t\t\tthis._getSuggestions(\n\t\t\t\t$shareWithField.val(),\n\t\t\t\tperPage,\n\t\t\t\tthis.model,\n\t\t\t\tthis._lookup\n\t\t\t).done(function(suggestions, exactMatches) {\n\t\t\t\tif (suggestions.length === 0) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\t// There is no need to show an error message here; it will\n\t\t\t\t\t// be automatically shown when the autocomplete is activated\n\t\t\t\t\t// again (due to the focus on the field) and it finds no\n\t\t\t\t\t// matches.\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (exactMatches.length !== 1) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar actionSuccess = function() {\n\t\t\t\t\t// Adding a share changes the suggestions.\n\t\t\t\t\tself._lastSuggestions = undefined;\n\n\t\t\t\t\t$shareWithField.val('');\n\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\t\t\t\t};\n\n\t\t\t\tvar actionError = function(obj, msg) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\tOC.Notification.showTemporary(msg);\n\t\t\t\t};\n\n\t\t\t\tself.model.addShare(exactMatches[0].value, {\n\t\t\t\t\tsuccess: actionSuccess,\n\t\t\t\t\terror: actionError\n\t\t\t\t});\n\t\t\t}).fail(function(message) {\n\t\t\t\trestoreUI();\n\n\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t// There is no need to show an error message here; it will be\n\t\t\t\t// automatically shown when the autocomplete is activated again\n\t\t\t\t// (due to the focus on the field) and getting the suggestions\n\t\t\t\t// fail.\n\t\t\t});\n\t\t},\n\n\t\t_toggleLoading: function(state) {\n\t\t\tthis._loading = state;\n\t\t\tthis.$el.find('.subView').toggleClass('hidden', state);\n\t\t\tthis.$el.find('.loading').toggleClass('hidden', !state);\n\t\t},\n\n\t\t_onRequest: function() {\n\t\t\t// only show the loading spinner for the first request (for now)\n\t\t\tif (!this._loadingOnce) {\n\t\t\t\tthis._toggleLoading(true);\n\t\t\t}\n\t\t},\n\n\t\t_onEndRequest: function() {\n\t\t\tvar self = this;\n\t\t\tthis._toggleLoading(false);\n\t\t\tif (!this._loadingOnce) {\n\t\t\t\tthis._loadingOnce = true;\n\t\t\t}\n\t\t},\n\n\t\trender: function() {\n\t\t\tvar self = this;\n\t\t\tvar baseTemplate = OC.Share.Templates['sharedialogview'];\n\n\t\t\tthis.$el.html(baseTemplate({\n\t\t\t\tcid: this.cid,\n\t\t\t\tshareLabel: t('core', 'Share'),\n\t\t\t\tsharePlaceholder: this._renderSharePlaceholderPart(),\n\t\t\t\tisSharingAllowed: this.model.sharePermissionPossible()\n\t\t\t}));\n\n\t\t\tvar $shareField = this.$el.find('.shareWithField');\n\t\t\tif ($shareField.length) {\n\t\t\t\tvar shareFieldKeydownHandler = function(event) {\n\t\t\t\t\tif (event.keyCode !== 13) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tself._confirmShare();\n\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\n\t\t\t\t$shareField.autocomplete({\n\t\t\t\t\tminLength: 0,\n\t\t\t\t\tdelay: 750,\n\t\t\t\t\tfocus: function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tsource: this.autocompleteHandler,\n\t\t\t\t\tselect: this._onSelectRecipient,\n\t\t\t\t\topen: function() {\n\t\t\t\t\t\tvar autocomplete = $(this).autocomplete('widget');\n\t\t\t\t\t\tvar numberOfItems = autocomplete.find('li').size();\n\t\t\t\t\t\tautocomplete.removeClass('item-count-1');\n\t\t\t\t\t\tautocomplete.removeClass('item-count-2');\n\t\t\t\t\t\tif (numberOfItems <= 2) {\n\t\t\t\t\t\t\tautocomplete.addClass('item-count-' + numberOfItems);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem;\n\n\t\t\t\t$shareField.on('keydown', null, shareFieldKeydownHandler);\n\t\t\t}\n\n\t\t\tthis.resharerInfoView.$el = this.$el.find('.resharerInfoView');\n\t\t\tthis.resharerInfoView.render();\n\n\t\t\tthis.linkShareView.$el = this.$el.find('.linkShareView');\n\t\t\tthis.linkShareView.render();\n\n\t\t\tthis.shareeListView.$el = this.$el.find('.shareeListView');\n\t\t\tthis.shareeListView.render();\n\n\t\t\tthis.$el.find('.hasTooltip').tooltip();\n\n\t\t\treturn this;\n\t\t},\n\n\t\t/**\n\t\t * sets whether share by link should be displayed or not. Default is\n\t\t * true.\n\t\t *\n\t\t * @param {bool} showLink\n\t\t */\n\t\tsetShowLink: function(showLink) {\n\t\t\tthis._showLink = (typeof showLink === 'boolean') ? showLink : true;\n\t\t\tthis.linkShareView.showLink = this._showLink;\n\t\t},\n\n\t\t_renderSharePlaceholderPart: function () {\n\t\t\tvar allowRemoteSharing = this.configModel.get('isRemoteShareAllowed');\n\t\t\tvar allowMailSharing = this.configModel.get('isMailShareAllowed');\n\n\t\t\tif (!allowRemoteSharing && allowMailSharing) {\n\t\t\t\treturn t('core', 'Name or email address...');\n\t\t\t}\n\t\t\tif (allowRemoteSharing && !allowMailSharing) {\n\t\t\t\treturn t('core', 'Name or federated cloud ID...');\n\t\t\t}\n\t\t\tif (allowRemoteSharing && allowMailSharing) {\n\t\t\t\treturn t('core', 'Name, federated cloud ID or email address...');\n\t\t\t}\n\n\t\t\treturn \tt('core', 'Name...');\n\t\t},\n\n\t});\n\n\tOC.Share.ShareDialogView = ShareDialogView;\n\n})();\n","/* global escapeHTML */\n\n/**\n * @namespace\n */\nOC.Share = _.extend(OC.Share || {}, {\n\tSHARE_TYPE_USER:0,\n\tSHARE_TYPE_GROUP:1,\n\tSHARE_TYPE_LINK:3,\n\tSHARE_TYPE_EMAIL:4,\n\tSHARE_TYPE_REMOTE:6,\n\tSHARE_TYPE_CIRCLE:7,\n\tSHARE_TYPE_GUEST:8,\n\tSHARE_TYPE_REMOTE_GROUP:9,\n\tSHARE_TYPE_ROOM:10,\n\n\t/**\n\t * Regular expression for splitting parts of remote share owners:\n\t * \"user@example.com/path/to/owncloud\"\n\t * \"user@anotherexample.com@example.com/path/to/owncloud\n\t */\n\t_REMOTE_OWNER_REGEXP: new RegExp(\"^([^@]*)@(([^@]*)@)?([^/]*)([/](.*)?)?$\"),\n\n\t/**\n\t * @deprecated use OC.Share.currentShares instead\n\t */\n\titemShares:[],\n\t/**\n\t * Full list of all share statuses\n\t */\n\tstatuses:{},\n\t/**\n\t * Shares for the currently selected file.\n\t * (for which the dropdown is open)\n\t *\n\t * Key is item type and value is an array or\n\t * shares of the given item type.\n\t */\n\tcurrentShares: {},\n\t/**\n\t * Whether the share dropdown is opened.\n\t */\n\tdroppedDown:false,\n\t/**\n\t * Loads ALL share statuses from server, stores them in\n\t * OC.Share.statuses then calls OC.Share.updateIcons() to update the\n\t * files \"Share\" icon to \"Shared\" according to their share status and\n\t * share type.\n\t *\n\t * If a callback is specified, the update step is skipped.\n\t *\n\t * @param itemType item type\n\t * @param fileList file list instance, defaults to OCA.Files.App.fileList\n\t * @param callback function to call after the shares were loaded\n\t */\n\tloadIcons:function(itemType, fileList, callback) {\n\t\tvar path = fileList.dirInfo.path;\n\t\tif (path === '/') {\n\t\t\tpath = '';\n\t\t}\n\t\tpath += '/' + fileList.dirInfo.name;\n\n\t\t// Load all share icons\n\t\t$.get(\n\t\t\tOC.linkToOCS('apps/files_sharing/api/v1', 2) + 'shares',\n\t\t\t{\n\t\t\t\tsubfiles: 'true',\n\t\t\t\tpath: path,\n\t\t\t\tformat: 'json'\n\t\t\t}, function(result) {\n\t\t\t\tif (result && result.ocs.meta.statuscode === 200) {\n\t\t\t\t\tOC.Share.statuses = {};\n\t\t\t\t\t$.each(result.ocs.data, function(it, share) {\n\t\t\t\t\t\tif (!(share.item_source in OC.Share.statuses)) {\n\t\t\t\t\t\t\tOC.Share.statuses[share.item_source] = {link: false};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (share.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\tOC.Share.statuses[share.item_source] = {link: true};\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (_.isFunction(callback)) {\n\t\t\t\t\t\tcallback(OC.Share.statuses);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tOC.Share.updateIcons(itemType, fileList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\t/**\n\t * Updates the files' \"Share\" icons according to the known\n\t * sharing states stored in OC.Share.statuses.\n\t * (not reloaded from server)\n\t *\n\t * @param itemType item type\n\t * @param fileList file list instance\n\t * defaults to OCA.Files.App.fileList\n\t */\n\tupdateIcons:function(itemType, fileList){\n\t\tvar item;\n\t\tvar $fileList;\n\t\tvar currentDir;\n\t\tif (!fileList && OCA.Files) {\n\t\t\tfileList = OCA.Files.App.fileList;\n\t\t}\n\t\t// fileList is usually only defined in the files app\n\t\tif (fileList) {\n\t\t\t$fileList = fileList.$fileList;\n\t\t\tcurrentDir = fileList.getCurrentDirectory();\n\t\t}\n\t\t// TODO: iterating over the files might be more efficient\n\t\tfor (item in OC.Share.statuses){\n\t\t\tvar iconClass = 'icon-shared';\n\t\t\tvar data = OC.Share.statuses[item];\n\t\t\tvar hasLink = data.link;\n\t\t\t// Links override shared in terms of icon display\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public';\n\t\t\t}\n\t\t\tif (itemType !== 'file' && itemType !== 'folder') {\n\t\t\t\t$('a.share[data-item=\"'+item+'\"] .icon').removeClass('icon-shared icon-public').addClass(iconClass);\n\t\t\t} else {\n\t\t\t\t// TODO: ultimately this part should be moved to files_sharing app\n\t\t\t\tvar file = $fileList.find('tr[data-id=\"'+item+'\"]');\n\t\t\t\tvar shareFolder = OC.imagePath('core', 'filetypes/folder-shared');\n\t\t\t\tvar img;\n\t\t\t\tif (file.length > 0) {\n\t\t\t\t\tthis.markFileAsShared(file, true, hasLink);\n\t\t\t\t} else {\n\t\t\t\t\tvar dir = currentDir;\n\t\t\t\t\tif (dir.length > 1) {\n\t\t\t\t\t\tvar last = '';\n\t\t\t\t\t\tvar path = dir;\n\t\t\t\t\t\t// Search for possible parent folders that are shared\n\t\t\t\t\t\twhile (path != last) {\n\t\t\t\t\t\t\tif (path === data.path && !data.link) {\n\t\t\t\t\t\t\t\tvar actions = $fileList.find('.fileactions .action[data-action=\"Share\"]');\n\t\t\t\t\t\t\t\tvar files = $fileList.find('.filename');\n\t\t\t\t\t\t\t\tvar i;\n\t\t\t\t\t\t\t\tfor (i = 0; i < actions.length; i++) {\n\t\t\t\t\t\t\t\t\t// TODO: use this.markFileAsShared()\n\t\t\t\t\t\t\t\t\timg = $(actions[i]).find('img');\n\t\t\t\t\t\t\t\t\tif (img.attr('src') !== OC.imagePath('core', 'actions/public')) {\n\t\t\t\t\t\t\t\t\t\timg.attr('src', image);\n\t\t\t\t\t\t\t\t\t\t$(actions[i]).addClass('permanent');\n\t\t\t\t\t\t\t\t\t\t$(actions[i]).html(' '+t('core', 'Shared')+' ').prepend(img);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(i = 0; i < files.length; i++) {\n\t\t\t\t\t\t\t\t\tif ($(files[i]).closest('tr').data('type') === 'dir') {\n\t\t\t\t\t\t\t\t\t\t$(files[i]).find('.thumbnail').css('background-image', 'url('+shareFolder+')');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlast = path;\n\t\t\t\t\t\t\tpath = OC.Share.dirname(path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tupdateIcon:function(itemType, itemSource) {\n\t\tvar shares = false;\n\t\tvar link = false;\n\t\tvar iconClass = '';\n\t\t$.each(OC.Share.itemShares, function(index) {\n\t\t\tif (OC.Share.itemShares[index]) {\n\t\t\t\tif (index == OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\tif (OC.Share.itemShares[index] == true) {\n\t\t\t\t\t\tshares = true;\n\t\t\t\t\t\ticonClass = 'icon-public';\n\t\t\t\t\t\tlink = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else if (OC.Share.itemShares[index].length > 0) {\n\t\t\t\t\tshares = true;\n\t\t\t\t\ticonClass = 'icon-shared';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (itemType != 'file' && itemType != 'folder') {\n\t\t\t$('a.share[data-item=\"'+itemSource+'\"] .icon').removeClass('icon-shared icon-public').addClass(iconClass);\n\t\t} else {\n\t\t\tvar $tr = $('tr').filterAttr('data-id', String(itemSource));\n\t\t\tif ($tr.length > 0) {\n\t\t\t\t// it might happen that multiple lists exist in the DOM\n\t\t\t\t// with the same id\n\t\t\t\t$tr.each(function() {\n\t\t\t\t\tOC.Share.markFileAsShared($(this), shares, link);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (shares) {\n\t\t\tOC.Share.statuses[itemSource] = OC.Share.statuses[itemSource] || {};\n\t\t\tOC.Share.statuses[itemSource].link = link;\n\t\t} else {\n\t\t\tdelete OC.Share.statuses[itemSource];\n\t\t}\n\t},\n\t/**\n\t * Format a remote address\n\t *\n\t * @param {String} shareWith userid, full remote share, or whatever\n\t * @param {String} shareWithDisplayName\n\t * @param {String} message\n\t * @return {String} HTML code to display\n\t */\n\t_formatRemoteShare: function(shareWith, shareWithDisplayName, message) {\n\t\tvar parts = this._REMOTE_OWNER_REGEXP.exec(shareWith);\n\t\tif (!parts) {\n\t\t\t// display avatar of the user\n\t\t\tvar avatar = ' ';\n\t\t\tvar hidden = '' + message + ' ' + escapeHTML(shareWithDisplayName) + ' ';\n\t\t\treturn avatar + hidden;\n\t\t}\n\n\t\tvar userName = parts[1];\n\t\tvar userDomain = parts[3];\n\t\tvar server = parts[4];\n\t\tvar tooltip = message + ' ' + userName;\n\t\tif (userDomain) {\n\t\t\ttooltip += '@' + userDomain;\n\t\t}\n\t\tif (server) {\n\t\t\tif (!userDomain) {\n\t\t\t\tuserDomain = '…';\n\t\t\t}\n\t\t\ttooltip += '@' + server;\n\t\t}\n\n\t\tvar html = '';\n\t\thtml += '' + escapeHTML(userName) + ' ';\n\t\tif (userDomain) {\n\t\t\thtml += '@' + escapeHTML(userDomain) + ' ';\n\t\t}\n\t\thtml += ' ';\n\t\treturn html;\n\t},\n\t/**\n\t * Loop over all recipients in the list and format them using\n\t * all kind of fancy magic.\n\t *\n\t * @param {Object} recipients array of all the recipients\n\t * @return {String[]} modified list of recipients\n\t */\n\t_formatShareList: function(recipients) {\n\t\tvar _parent = this;\n\t\trecipients = _.toArray(recipients);\n\t\trecipients.sort(function(a, b) {\n\t\t\treturn a.shareWithDisplayName.localeCompare(b.shareWithDisplayName);\n\t\t});\n\t\treturn $.map(recipients, function(recipient) {\n\t\t\treturn _parent._formatRemoteShare(recipient.shareWith, recipient.shareWithDisplayName, t('core', 'Shared with'));\n\t\t});\n\t},\n\t/**\n\t * Marks/unmarks a given file as shared by changing its action icon\n\t * and folder icon.\n\t *\n\t * @param $tr file element to mark as shared\n\t * @param hasShares whether shares are available\n\t * @param hasLink whether link share is available\n\t */\n\tmarkFileAsShared: function($tr, hasShares, hasLink) {\n\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]');\n\t\tvar type = $tr.data('type');\n\t\tvar icon = action.find('.icon');\n\t\tvar message, recipients, avatars;\n\t\tvar ownerId = $tr.attr('data-share-owner-id');\n\t\tvar owner = $tr.attr('data-share-owner');\n\t\tvar mountType = $tr.attr('data-mounttype');\n\t\tvar shareFolderIcon;\n\t\tvar iconClass = 'icon-shared';\n\t\taction.removeClass('shared-style');\n\t\t// update folder icon\n\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType);\n\t\t\t} else if (hasLink) {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public');\n\t\t\t} else {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared');\n\t\t\t}\n\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');\n\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t} else if (type === 'dir') {\n\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted');\n\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\tif (isEncrypted === 'true') {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted');\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external');\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t\t} else {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir');\n\t\t\t\t// back to default\n\t\t\t\t$tr.removeAttr('data-icon');\n\t\t\t}\n\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');\n\t\t}\n\t\t// update share action text / icon\n\t\tif (hasShares || ownerId) {\n\t\t\trecipients = $tr.data('share-recipient-data');\n\t\t\taction.addClass('shared-style');\n\n\t\t\tavatars = '' + t('core', 'Shared') + ' ';\n\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\tif (ownerId) {\n\t\t\t\tmessage = t('core', 'Shared by');\n\t\t\t\tavatars = this._formatRemoteShare(ownerId, owner, message);\n\t\t\t} else if (recipients) {\n\t\t\t\tavatars = this._formatShareList(recipients);\n\t\t\t}\n\t\t\taction.html(avatars).prepend(icon);\n\n\t\t\tif (ownerId || recipients) {\n\t\t\t\tvar avatarElement = action.find('.avatar');\n\t\t\t\tavatarElement.each(function () {\n\t\t\t\t\t$(this).avatar($(this).data('username'), 32);\n\t\t\t\t});\n\t\t\t\taction.find('span[title]').tooltip({placement: 'top'});\n\t\t\t}\n\t\t} else {\n\t\t\taction.html('' + t('core', 'Shared') + ' ').prepend(icon);\n\t\t}\n\t\tif (hasLink) {\n\t\t\ticonClass = 'icon-public';\n\t\t}\n\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass);\n\t},\n\tshowDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) {\n\t\tvar configModel = new OC.Share.ShareConfigModel();\n\t\tvar attributes = {itemType: itemType, itemSource: itemSource, possiblePermissions: possiblePermissions};\n\t\tvar itemModel = new OC.Share.ShareItemModel(attributes, {configModel: configModel});\n\t\tvar dialogView = new OC.Share.ShareDialogView({\n\t\t\tid: 'dropdown',\n\t\t\tmodel: itemModel,\n\t\t\tconfigModel: configModel,\n\t\t\tclassName: 'drop shareDropDown',\n\t\t\tattributes: {\n\t\t\t\t'data-item-source-name': filename,\n\t\t\t\t'data-item-type': itemType,\n\t\t\t\t'data-item-source': itemSource\n\t\t\t}\n\t\t});\n\t\tdialogView.setShowLink(link);\n\t\tvar $dialog = dialogView.render().$el;\n\t\t$dialog.appendTo(appendTo);\n\t\t$dialog.slideDown(OC.menuSpeed, function() {\n\t\t\tOC.Share.droppedDown = true;\n\t\t});\n\t\titemModel.fetch();\n\t},\n\thideDropDown:function(callback) {\n\t\tOC.Share.currentShares = null;\n\t\t$('#dropdown').slideUp(OC.menuSpeed, function() {\n\t\t\tOC.Share.droppedDown = false;\n\t\t\t$('#dropdown').remove();\n\t\t\tif (typeof FileActions !== 'undefined') {\n\t\t\t\t$('tr').removeClass('mouseOver');\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tcallback.call();\n\t\t\t}\n\t\t});\n\t},\n\tdirname:function(path) {\n\t\treturn path.replace(/\\\\/g,'/').replace(/\\/[^\\/]*$/, '');\n\t}\n});\n\n$(document).ready(function() {\n\tif(typeof monthNames != 'undefined'){\n\t\t// min date should always be the next day\n\t\tvar minDate = new Date();\n\t\tminDate.setDate(minDate.getDate()+1);\n\t\t$.datepicker.setDefaults({\n\t\t\tmonthNames: monthNames,\n\t\t\tmonthNamesShort: monthNamesShort,\n\t\t\tdayNames: dayNames,\n\t\t\tdayNamesMin: dayNamesMin,\n\t\t\tdayNamesShort: dayNamesShort,\n\t\t\tfirstDay: firstDay,\n\t\t\tminDate : minDate\n\t\t});\n\t}\n\n\t$(this).click(function(event) {\n\t\tvar target = $(event.target);\n\t\tvar isMatched = !target.is('.drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon')\n\t\t\t&& !target.closest('#ui-datepicker-div').length && !target.closest('.ui-autocomplete').length;\n\t\tif (OC.Share && OC.Share.droppedDown && isMatched && $('#dropdown').has(event.target).length === 0) {\n\t\t\tOC.Share.hideDropDown();\n\t\t}\n\t});\n\n\n\n});\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./core/js/merged-share-backend.js","webpack:///./core/js/shareconfigmodel.js","webpack:///./core/js/sharetemplates.js","webpack:///./core/js/shareitemmodel.js","webpack:///./core/js/sharesocialmanager.js","webpack:///./core/js/sharedialogresharerinfoview.js","webpack:///./core/js/sharedialoglinkshareview.js","webpack:///./core/js/sharedialogshareelistview.js","webpack:///./core/js/sharedialogview.js","webpack:///./core/js/share.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","OC","Share","Types","ShareConfigModel","Backbone","Model","extend","defaults","publicUploadEnabled","enforcePasswordForPublicLink","oc_appconfig","core","enableLinkPasswordByDefault","isDefaultExpireDateEnforced","defaultExpireDateEnforced","isDefaultExpireDateEnabled","defaultExpireDateEnabled","isRemoteShareAllowed","remoteShareAllowed","isMailShareAllowed","undefined","shareByMailEnabled","defaultExpireDate","isResharingAllowed","resharingAllowed","isPasswordForMailSharesRequired","shareByMail","enforcePasswordProtection","allowGroupSharing","isPublicUploadEnabled","$","data","isShareWithLinkAllowed","val","getFederatedShareDocLink","federatedCloudShareDoc","getDefaultExpirationDateString","expireDateString","this","date","moment","utc","expireAfterDays","add","format","template","templates","Handlebars","Templates","1","container","depth0","helpers","partials","stack1","alias1","nullContext","nolinkShares","hash","fn","program","inverse","noop","each","linkShares","2","helper","alias2","helperMissing","alias4","escapeExpression","_typeof","newShareId","newShareLabel","showPending","newShareTitle","unless","3","5","pendingPopoverMenu","7","alias3","cid","linkShareCreationDate","linkShareLabel","shareLinkURL","copyLabel","8","popoverMenu","10","noSharingPlaceholder","11","compiler","main","shareAllowed","useData","publicUploadRValue","publicUploadRChecked","publicUploadRLabel","publicUploadRWValue","publicUploadRWChecked","publicUploadRWLabel","publicUploadWValue","publicUploadWChecked","publicUploadWLabel","publicEditingChecked","publicEditingLabel","9","isPasswordByTalkSet","passwordByTalkLabel","13","15","expireDate","17","19","21","url","newWindow","iconClass","label","publicUpload","publicEditing","hideDownload","hideDownloadLabel","isPasswordSet","isPasswordEnforced","enablePasswordLabel","passwordPlaceholder","showPasswordByTalkCheckBox","hasExpireDate","isExpirationEnforced","expireDateLabel","expirationDate","expirationLabel","expirationDatePlaceholder","maxDate","addNoteLabel","hasNote","shareNote","shareId","social","unshareLinkLabel","enforcedPasswordLabel","minPasswordLength","reshareOwner","sharedByText","hasShareNote","isShareWithCurrentUser","shareType","shareWith","modSeed","shareWithAvatar","shareWithDisplayName","shareWithTitle","canUpdateShareSettings","editPermissionPossible","canEditLabel","shareInitiator","shareInitiatorText","unshareLabel","sharees","linkReshares","sharePermissionPossible","isMailShare","hasSharePermission","sharePermission","canShareLabel","4","6","createPermissionPossible","updatePermissionPossible","deletePermissionPossible","hasCreatePermission","createPermission","createPermissionLabel","hasUpdatePermission","updatePermission","updatePermissionLabel","14","hasDeletePermission","deletePermission","deletePermissionLabel","16","passwordLabel","password","passwordValue","isTalkEnabled","secureDropMode","readPermission","secureDropLabel","20","22","24","passwordByTalkPlaceholder","26","28","30","isFolder","isNoteAvailable","shareLabel","sharePlaceholder","isSharingAllowed","SHARE_RESPONSE_INT_PROPS","ShareItemModel","_linkShareId","initialize","attributes","options","_","isUndefined","configModel","fileInfoModel","bindAll","allowPublicUploadStatus","permissions","saveLinkShare","expiration","shareIndex","findIndex","share","id","length","updateShare","passwordChanged","sendPasswordByTalk","PERMISSION_READ","SHARE_TYPE_LINK","addShare","defaultPermissions","getCapabilities","PERMISSION_ALL","possiblePermissions","PERMISSION_UPDATE","PERMISSION_CREATE","PERMISSION_DELETE","PERMISSION_SHARE","path","getFullPath","_addOrUpdateShare","type","_getUrl","dataType","attrs","encodeURIComponent","ajaxSettings","self","ajax","always","isFunction","complete","done","fetch","success","fail","xhr","msg","result","responseJSON","ocs","meta","message","error","dialogs","alert","removeShare","isPublicUploadAllowed","isPublicEditingAllowed","isHideFileListSet","isFile","hasReshare","reshare","isObject","uid_owner","hasUserShares","getSharesWithCurrentItem","hasLinkShares","getReshareOwner","getReshareOwnerDisplayname","displayname_owner","getReshareNote","note","getReshareWith","share_with","getReshareWithDisplayName","share_with_displayname","getReshareType","share_type","getExpireDate","_shareExpireDate","getNote","_shareNote","shares","fileId","filter","item_source","getShareWith","getShareWithDisplayName","getShareWithAvatar","share_with_avatar","getSharedBy","getSharedByDisplayName","getFileOwnerUid","uid_file_owner","findShareWithIndex","isArray","getShareType","_shareHasPermission","permission","getPermissions","hasReadPermission","editPermissionState","hcp","hup","hdp","linkSharePermissions","base","params","linkToOCS","buildQueryString","_fetchShares","reshares","_fetchReshare","_reshareFetched","Deferred","resolve","shared_with_me","_groupReshares","superShare","shift","combinedPermissions","SHARE_TYPE_USER","SHARE_TYPE_GROUP","model","trigger","deferred","when","data1","data2","sharesMap","shareItem","set","parse","_legacyFillCurrentShares","statuses","currentShares","itemShares","currentShareStatus","link","push","console","warn","currentUser","allowPublicEditingStatus","hideFileListStatus","map","prop","parseInt","reject","file_source","window","location","protocol","host","token","generateUrl","fullPath","isDirectory","linkTo","hide_download","send_password_by_talk","_parseTime","time","isString","isNaN","getShareTypes","pluck","uniq","Social","SocialModel","SocialCollection","Collection","comparator","ShareDialogResharerInfoView","View","tagName","className","_template","view","on","render","$el","empty","reshareTemplate","ownerDisplayName","group","owner","escape","SHARE_TYPE_CIRCLE","circle","SHARE_TYPE_ROOM","conversation","html","find","$this","avatar","contactsMenu","PASSWORD_PLACEHOLDER_MESSAGE","PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL","ShareDialogLinkShareView","showLink","events","click .share-menu .icon-more","change .hideDownloadCheckbox","click input.share-pass-submit","keyup input.linkPassText","change .showPasswordCheckbox","change .passwordByTalkCheckbox","change .publicEditingCheckbox","click .linkText","click .pop-up","change .publicUploadRadio","click .expireDate","change .datepicker","click .datepicker","click .share-add","click .share-note-delete","click .share-note-submit","click .unshare","click .new-share","submit .enforcedPassForm","previousLinkShares","previous","clipboard","Clipboard","e","$trigger","tooltip","attr","placement","delay","$menu","next","$linkTextMenu","$input","closest","showMenu","actionMsg","test","navigator","userAgent","removeClass","select","newShare","event","$li","target","$loading","hasClass","addClass","hideMenus","shareData","defaultExpireDays","focus","$newShare","response","Notification","showTemporary","then","enforcedPasswordSet","preventDefault","onLinkTextClick","onHideDownloadChange","$checkbox","siblings","is","obj","onShowPasswordClick","slideToggle","menuSpeed","toggleClass","Util","isIE","onPasswordKeyUp","keyCode","onPasswordEntered","parent","$container","onPasswordByTalkChange","onAllowPublicEditingChange","onPublicUploadChange","currentTarget","showNoteForm","stopPropagation","$element","$form","deleteNote","sendNote","updateNote","prev","trim","$submit","$error","hide","method","show","setTimeout","linkShareTemplate","templateData","passwordPlaceholderInitial","publicEditable","minDate","Date","setDate","getDate","datepicker","setDefaults","dateFormat","oc_capabilities","password_policy","minLength","popoverBase","urlLabel","mailPrivatePlaceholder","mailButtonText","pendingPopover","pendingPopoverMenuTemplate","getShareeList","replace","popover","getPopoverObject","popoverMenuTemplate","delegateEvents","autosize","onToggleMenu","isPasswordEnabledByDefault","onPopUpClick","left","screen","width","top","height","open","href","onExpireDateChange","datePicker","state","showDatePicker","setExpirationDate","expirationDatePicker","onSelect","onChangeExpirationDate","list","index","getShareeObject","stime","oc_appswebroots","shareTime","isNumber","stripTime","getTime","onUnshare","eq","remove","ShareDialogShareeListView","_menuOpen","_renderPermissionChange","click .permissions","click .password","click .passwordByTalk","click .secureDrop","keyup input.passwordField","focusout input.passwordField","sharedBy","sharedByDisplayName","fileOwnerUid","SHARE_TYPE_REMOTE","SHARE_TYPE_REMOTE_GROUP","SHARE_TYPE_EMAIL","oc_current_user","sharer","hasPassword","isRemoteShare","isRemoteGroupShare","isCircleShare","isFileSharedByMail","getShareProperties","crudsLabel","triangleSImage","imagePath","universal","getLinkReshares","shareInitiatorDisplayName","permissionChangeShareId","shareWithIndex","sharee","replaceWith","css","imageplaceholder","_this","forEach","$edit","datePickerClass","datePickerInput","expireDateCheckbox","liSelector","log","onMailSharePasswordProtectChange","element","passwordContainerClass","passwordContainer","loading","inputClass","passwordField","passwordByTalkElement","passwordByTalkState","passwordByTalkContainerClass","onMailSharePasswordProtectByTalkChange","passwordByTalkContainer","passwordByTalkField","passwordElement","passwordState","onMailSharePasswordKeyUp","onMailSharePasswordEntered","startsWith","blur","onPermissionChange","checked","$checkboxes","not","numberChecked","$editCb","checkbox","enableCb","elem","onSecureDropChange","ShareDialogView","_templates","_showLink","_lookup","_lookupAllowed","resharerInfoView","linkShareView","shareeListView","_lastSuggestions","_lastRecommendations","_pendingOperationsCount","focus .shareWithField","input .shareWithField","click .shareWithConfirm","_onRequest","_onEndRequest","subViewOptions","subViews","Plugins","attach","onShareWithFieldChanged","onShareWithFieldFocus","$shareWithField","autocomplete","_getSuggestions","searchTerm","perPage","lookup","promise","capabilities","files_sharing","query_lookup_default","search","itemType","statuscode","users","groups","remotes","remote_groups","emails","circles","rooms","usersLength","groupsLength","remotesLength","remoteGroupsLength","emailsLength","circlesLength","roomsLength","j","splice","sharesLength","exact","exactUsers","exactGroups","exactRemotes","exactRemoteGroups","exactEmails","exactCircles","exactRooms","exactMatches","concat","remoteGroups","lookupEnabled","grouped","sort","a","b","aProperty","bProperty","previousUuid","groupedLength","uuid","merged","moreResultsAvailable","oc_config","Math","min","max","_getRecommendations","recommendationHandler","suggestions","info","autocompleteHandler","term","$confirm","count","title","append","autocompleteRenderItem","ul","item","icon","text","escapeHTML","description","getTranslatedType","circleInfo","circleOwner","insert","appendTo","RegExp","_onSelectRecipient","debug","stopImmediatePropagation","_confirmShare","restoreUI","_toggleLoading","_loading","_loadingOnce","baseTemplate","_renderSharePlaceholderPart","$shareField","source","numberOfItems","size","_renderItem","setShowLink","allowRemoteSharing","allowMailSharing","SHARE_TYPE_GUEST","_REMOTE_OWNER_REGEXP","droppedDown","loadIcons","fileList","callback","dirInfo","subfiles","it","updateIcons","$fileList","currentDir","OCA","Files","App","getCurrentDirectory","hasLink","img","file","shareFolder","markFileAsShared","dir","last","actions","files","image","prepend","dirname","updateIcon","itemSource","$tr","filterAttr","String","_formatRemoteShare","parts","exec","userName","userDomain","server","_formatShareList","recipients","_parent","toArray","localeCompare","recipient","hasShares","avatars","shareFolderIcon","action","ownerId","mountType","MimeType","getIconUrl","indexOf","removeAttr","showDropDown","filename","itemModel","dialogView","data-item-source-name","data-item-type","data-item-source","$dialog","slideDown","hideDropDown","slideUp","FileActions","document","ready","monthNames","monthNamesShort","dayNames","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yB,IAAI3X,EAAME,QAAQ1O,QACrF7N,GAAGC,MAAMkzB","file":"share_backend.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import './shareconfigmodel.js';\nimport './sharetemplates.js';\nimport './shareitemmodel.js';\nimport './sharesocialmanager.js';\nimport './sharedialogresharerinfoview.js';\nimport './sharedialoglinkshareview.js';\nimport './sharedialogshareelistview.js';\nimport './sharedialogview.js';\nimport './share.js';\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* global moment, oc_appconfig, oc_config */\n\n(function() {\n\tif (!OC.Share) {\n\t\tOC.Share = {};\n\t\tOC.Share.Types = {};\n\t}\n\n\t// FIXME: the config model should populate its own model attributes based on\n\t// the old DOM-based config\n\tvar ShareConfigModel = OC.Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\tpublicUploadEnabled: false,\n\t\t\tenforcePasswordForPublicLink: oc_appconfig.core.enforcePasswordForPublicLink,\n\t\t\tenableLinkPasswordByDefault: oc_appconfig.core.enableLinkPasswordByDefault,\n\t\t\tisDefaultExpireDateEnforced: oc_appconfig.core.defaultExpireDateEnforced === true,\n\t\t\tisDefaultExpireDateEnabled: oc_appconfig.core.defaultExpireDateEnabled === true,\n\t\t\tisRemoteShareAllowed: oc_appconfig.core.remoteShareAllowed,\n\t\t\tisMailShareAllowed: oc_appconfig.shareByMailEnabled !== undefined,\n\t\t\tdefaultExpireDate: oc_appconfig.core.defaultExpireDate,\n\t\t\tisResharingAllowed: oc_appconfig.core.resharingAllowed,\n\t\t\tisPasswordForMailSharesRequired: (oc_appconfig.shareByMail === undefined) ? false : oc_appconfig.shareByMail.enforcePasswordProtection,\n\t\t\tallowGroupSharing: oc_appconfig.core.allowGroupSharing\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisPublicUploadEnabled: function() {\n\t\t\tvar publicUploadEnabled = $('#filestable').data('allow-public-upload');\n\t\t\treturn publicUploadEnabled === 'yes';\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisShareWithLinkAllowed: function() {\n\t\t\treturn $('#allowShareWithLink').val() === 'yes';\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetFederatedShareDocLink: function() {\n\t\t\treturn oc_appconfig.core.federatedCloudShareDoc;\n\t\t},\n\n\t\tgetDefaultExpirationDateString: function () {\n\t\t\tvar expireDateString = '';\n\t\t\tif (this.get('isDefaultExpireDateEnabled')) {\n\t\t\t\tvar date = moment.utc();\n\t\t\t\tvar expireAfterDays = this.get('defaultExpireDate');\n\t\t\t\tdate.add(expireAfterDays, 'days');\n\t\t\t\texpireDateString = date.format('YYYY-MM-DD 00:00:00');\n\t\t\t}\n\t\t\treturn expireDateString;\n\t\t}\n\t});\n\n\n\tOC.Share.ShareConfigModel = ShareConfigModel;\n})();\n","(function() {\n var template = Handlebars.template, templates = OC.Share.Templates = OC.Share.Templates || {};\ntemplates['sharedialoglinkshareview'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return \"\\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.nolinkShares : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(2, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.linkShares : depth0),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \" \\n\";\n},\"2\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t \\n\t\t\t
\\n\t\t\t\"\n + alias4(((helper = (helper = helpers.newShareLabel || (depth0 != null ? depth0.newShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"newShareLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\t\t \\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n return \"hidden\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n var stack1, helper;\n\n return \"\t\t\t\t\t\t\"\n + ((stack1 = ((helper = (helper = helpers.pendingPopoverMenu || (depth0 != null ? depth0.pendingPopoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"pendingPopoverMenu\",\"hash\":{},\"data\":data}) : helper))) != null ? stack1 : \"\")\n + \"\\n\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\\n\t\t\t
\\n\t\t\t\"\n + alias4(((helper = (helper = helpers.linkShareLabel || (depth0 != null ? depth0.linkShareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"linkShareLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\\n\t\t\t\\n\t\t\t\t \\n\t\t\t\t\\n\t\t\t \\n\t\t \\n\";\n},\"8\":function(container,depth0,helpers,partials,data) {\n var stack1, helper;\n\n return \"\t\t\t\t\t\t\"\n + ((stack1 = ((helper = (helper = helpers.popoverMenu || (depth0 != null ? depth0.popoverMenu : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"popoverMenu\",\"hash\":{},\"data\":data}) : helper))) != null ? stack1 : \"\")\n + \"\\n\";\n},\"10\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.noSharingPlaceholder : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(11, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\";\n},\"11\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \" \";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.shareAllowed : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.program(10, data, 0),\"data\":data})) != null ? stack1 : \"\");\n},\"useData\":true});\ntemplates['sharedialoglinkshareview_popover_menu'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n return \"checked=\\\"checked\\\"\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n return \"disabled=\\\"disabled\\\"\";\n},\"9\":function(container,depth0,helpers,partials,data) {\n return \"hidden\";\n},\"11\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t\t\t \\n\t\t\t\t\t \\n\t\t\t\t\t\"\n + alias4(((helper = (helper = helpers.passwordByTalkLabel || (depth0 != null ? depth0.passwordByTalkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"passwordByTalkLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\t \\n\t\t\t \\n\";\n},\"13\":function(container,depth0,helpers,partials,data) {\n return \"datepicker\";\n},\"15\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"expireDate\",\"hash\":{},\"data\":data}) : helper)));\n},\"17\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"defaultExpireDate\",\"hash\":{},\"data\":data}) : helper)));\n},\"19\":function(container,depth0,helpers,partials,data) {\n return \"readonly\";\n},\"21\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\";\n},\"useData\":true});\ntemplates['sharedialoglinkshareview_popover_menu_pending'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\t\t\t\\n\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return \"\\n\";\n},\"useData\":true});\ntemplates['sharedialogresharerinfoview'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \"\"\n + container.escapeExpression(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"shareNote\",\"hash\":{},\"data\":data}) : helper)))\n + \"
\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\t
\\n\t\"\n + alias4(((helper = (helper = helpers.sharedByText || (depth0 != null ? depth0.sharedByText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"sharedByText\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\n \\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.hasShareNote : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\";\n},\"useData\":true});\ntemplates['sharedialogshareelistview'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isShareWithCurrentUser : depth0),{\"name\":\"unless\",\"hash\":{},\"fn\":container.program(2, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"2\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\\n\t\t\t
\\n\t\t\t\"\n + alias4(((helper = (helper = helpers.shareWithDisplayName || (depth0 != null ? depth0.shareWithDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shareWithDisplayName\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.canUpdateShareSettings : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t \\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n return \"imageplaceholderseed\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"data-seed=\\\"\"\n + alias4(((helper = (helper = helpers.shareWith || (depth0 != null ? depth0.shareWith : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shareWith\",\"hash\":{},\"data\":data}) : helper)))\n + \" \"\n + alias4(((helper = (helper = helpers.shareType || (depth0 != null ? depth0.shareType : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shareType\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\"\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return \"\t\t\t\\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.editPermissionPossible : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(8, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t\t\t\\n\t\t\t \\n\";\n},\"8\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\t\t\\n\t\t\t\t\t\t \\n\t\t\t\t\t\t\"\n + alias4(((helper = (helper = helpers.canEditLabel || (depth0 != null ? depth0.canEditLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"canEditLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\t\t \\n\";\n},\"10\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\\n\t\t\t
\\n\t\t\t\"\n + alias4(((helper = (helper = helpers.shareInitiatorText || (depth0 != null ? depth0.shareInitiatorText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shareInitiatorText\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\\n\t\t\t\t\"\n + alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"unshareLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t \\n\t\t \\n\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return \"\\n\"\n + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.sharees : depth0),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.linkReshares : depth0),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(10, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \" \\n\";\n},\"useData\":true});\ntemplates['sharedialogshareelistview_popover_menu'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return \" \"\n + ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.sharePermissionPossible : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(2, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \" \";\n},\"2\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return \" \"\n + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{\"name\":\"unless\",\"hash\":{},\"fn\":container.program(3, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \" \";\n},\"3\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\t\t\t\\n\t\t\t\t\\n\t\t\t\t \\n\t\t\t\";\n},\"4\":function(container,depth0,helpers,partials,data) {\n return \"checked=\\\"checked\\\"\";\n},\"6\":function(container,depth0,helpers,partials,data) {\n var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return \"\t\t\t\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.createPermissionPossible : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\t\t\t\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.updatePermissionPossible : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(10, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\t\t\t\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.deletePermissionPossible : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(13, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{\"name\":\"unless\",\"hash\":{},\"fn\":container.program(8, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"8\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\t\t\t\t\\n\t\t\t\t\t\\n\t\t\t\t \\n\t\t\t\";\n},\"10\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{\"name\":\"unless\",\"hash\":{},\"fn\":container.program(11, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"11\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\t\t\t\t\\n\t\t\t\t\t\\n\t\t\t\t \\n\t\t\t\t\";\n},\"13\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers.unless.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isMailShare : depth0),{\"name\":\"unless\",\"hash\":{},\"fn\":container.program(14, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"14\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\t\t\t\t\\n\t\t\t\t\t\\n\t\t\t\t \\n\t\t\t\t\";\n},\"16\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.hasCreatePermission : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(17, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\t\t\t\\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.isTalkEnabled : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(24, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"17\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\t\\n\t\t\t\t\t\\n\t\t\t\t \\n\";\n},\"19\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isPasswordForMailSharesRequired : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(20, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"20\":function(container,depth0,helpers,partials,data) {\n return \"disabled=\\\"\\\"\";\n},\"22\":function(container,depth0,helpers,partials,data) {\n return \"hidden\";\n},\"24\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\t\\n\t\t\t\t\t\\n\t\t\t\t \\n\t\t\t\t\\n\";\n},\"26\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"expireDate\",\"hash\":{},\"data\":data}) : helper)));\n},\"28\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"defaultExpireDate\",\"hash\":{},\"data\":data}) : helper)));\n},\"30\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\\n\t\t\t\t\\n\t\t\t\t\t \\n\t\t\t\t\t \\n\t\t\t\t\t\"\n + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"addNoteLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\t\t\t\t \\n\t\t\t\t \\n\t\t\t \\n\t\t\t\\n\t\t\t\t\\n\t\t\t \\n\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\\n\";\n},\"useData\":true});\ntemplates['sharedialogview'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\"\n + alias4(((helper = (helper = helpers.shareLabel || (depth0 != null ? depth0.shareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shareLabel\",\"hash\":{},\"data\":data}) : helper)))\n + \" \\n\t\\n\t\t \\n\t\t \\n\t\t \\n\t
\\n\";\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return \"
\\n\"\n + ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.isSharingAllowed : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"
\\n
\\n
\\n\";\n},\"useData\":true});\n})();","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function() {\n\tif(!OC.Share) {\n\t\tOC.Share = {};\n\t\tOC.Share.Types = {};\n\t}\n\n\t/**\n\t * @typedef {object} OC.Share.Types.LinkShareInfo\n\t * @property {string} token\n\t * @property {bool} hideDownload\n\t * @property {string|null} password\n\t * @property {bool} sendPasswordByTalk\n\t * @property {number} permissions\n\t * @property {Date} expiration\n\t * @property {number} stime share time\n\t */\n\n\t/**\n\t * @typedef {object} OC.Share.Types.Reshare\n\t * @property {string} uid_owner\n\t * @property {number} share_type\n\t * @property {string} share_with\n\t * @property {string} displayname_owner\n\t * @property {number} permissions\n\t */\n\n\t/**\n\t * @typedef {object} OC.Share.Types.ShareInfo\n\t * @property {number} share_type\n\t * @property {number} permissions\n\t * @property {number} file_source optional\n\t * @property {number} item_source\n\t * @property {string} token\n\t * @property {string} share_with\n\t * @property {string} share_with_displayname\n\t * @property {string} share_with_avatar\n\t * @property {string} mail_send\n\t * @property {Date} expiration optional?\n\t * @property {number} stime optional?\n\t * @property {string} uid_owner\n\t * @property {string} displayname_owner\n\t */\n\n\t/**\n\t * @typedef {object} OC.Share.Types.ShareItemInfo\n\t * @property {OC.Share.Types.Reshare} reshare\n\t * @property {OC.Share.Types.ShareInfo[]} shares\n\t * @property {OC.Share.Types.LinkShareInfo|undefined} linkShare\n\t */\n\n\t/**\n\t * These properties are sometimes returned by the server as strings instead\n\t * of integers, so we need to convert them accordingly...\n\t */\n\tvar SHARE_RESPONSE_INT_PROPS = [\n\t\t'id', 'file_parent', 'mail_send', 'file_source', 'item_source', 'permissions',\n\t\t'storage', 'share_type', 'parent', 'stime'\n\t];\n\n\t/**\n\t * @class OCA.Share.ShareItemModel\n\t * @classdesc\n\t *\n\t * Represents the GUI of the share dialogue\n\t *\n\t * // FIXME: use OC Share API once #17143 is done\n\t *\n\t * // TODO: this really should be a collection of share item models instead,\n\t * where the link share is one of them\n\t */\n\tvar ShareItemModel = OC.Backbone.Model.extend({\n\t\t/**\n\t\t * share id of the link share, if applicable\n\t\t */\n\t\t_linkShareId: null,\n\n\t\tinitialize: function(attributes, options) {\n\t\t\tif(!_.isUndefined(options.configModel)) {\n\t\t\t\tthis.configModel = options.configModel;\n\t\t\t}\n\t\t\tif(!_.isUndefined(options.fileInfoModel)) {\n\t\t\t\t/** @type {OC.Files.FileInfo} **/\n\t\t\t\tthis.fileInfoModel = options.fileInfoModel;\n\t\t\t}\n\n\t\t\t_.bindAll(this, 'addShare');\n\t\t},\n\n\t\tdefaults: {\n\t\t\tallowPublicUploadStatus: false,\n\t\t\tpermissions: 0,\n\t\t\tlinkShares: []\n\t\t},\n\n\t\t/**\n\t\t * Saves the current link share information.\n\t\t *\n\t\t * This will trigger an ajax call and, if successful, refetch the model\n\t\t * afterwards. Callbacks \"success\", \"error\" and \"complete\" can be given\n\t\t * in the options object; \"success\" is called after a successful save\n\t\t * once the model is refetch, \"error\" is called after a failed save, and\n\t\t * \"complete\" is called both after a successful save and after a failed\n\t\t * save. Note that \"complete\" is called before \"success\" and \"error\" are\n\t\t * called (unlike in jQuery, in which it is called after them); this\n\t\t * ensures that \"complete\" is called even if refetching the model fails.\n\t\t *\n\t\t * TODO: this should be a separate model\n\t\t */\n\t\tsaveLinkShare: function(attributes, options) {\n\t\t\toptions = options || {};\n\t\t\tattributes = _.extend({}, attributes);\n\n\t\t\tvar shareId = null;\n\t\t\tvar call;\n\n\t\t\t// oh yeah...\n\t\t\tif (attributes.expiration) {\n\t\t\t\tattributes.expireDate = attributes.expiration;\n\t\t\t\tdelete attributes.expiration;\n\t\t\t}\n\n\t\t\tvar linkShares = this.get('linkShares');\n\t\t\tvar shareIndex = _.findIndex(linkShares, function(share) {return share.id === attributes.cid})\n\n\t\t\tif (linkShares.length > 0 && shareIndex !== -1) {\n\t\t\t\tshareId = linkShares[shareIndex].id;\n\n\t\t\t\t// note: update can only update a single value at a time\n\t\t\t\tcall = this.updateShare(shareId, attributes, options);\n\t\t\t} else {\n\t\t\t\tattributes = _.defaults(attributes, {\n\t\t\t\t\thideDownload: false,\n\t\t\t\t\tpassword: '',\n\t\t\t\t\tpasswordChanged: false,\n\t\t\t\t\tsendPasswordByTalk: false,\n\t\t\t\t\tpermissions: OC.PERMISSION_READ,\n\t\t\t\t\texpireDate: this.configModel.getDefaultExpirationDateString(),\n\t\t\t\t\tshareType: OC.Share.SHARE_TYPE_LINK\n\t\t\t\t});\n\n\t\t\t\tcall = this.addShare(attributes, options);\n\t\t\t}\n\n\t\t\treturn call;\n\t\t},\n\n\t\taddShare: function(attributes, options) {\n\t\t\tvar shareType = attributes.shareType;\n\t\t\tattributes = _.extend({}, attributes);\n\n\t\t\t// get default permissions\n\t\t\tvar defaultPermissions = OC.getCapabilities()['files_sharing']['default_permissions'] || OC.PERMISSION_ALL;\n\t\t\tvar possiblePermissions = OC.PERMISSION_READ;\n\n\t\t\tif (this.updatePermissionPossible()) {\n\t\t\t\tpossiblePermissions = possiblePermissions | OC.PERMISSION_UPDATE;\n\t\t\t}\n\t\t\tif (this.createPermissionPossible()) {\n\t\t\t\tpossiblePermissions = possiblePermissions | OC.PERMISSION_CREATE;\n\t\t\t}\n\t\t\tif (this.deletePermissionPossible()) {\n\t\t\t\tpossiblePermissions = possiblePermissions | OC.PERMISSION_DELETE;\n\t\t\t}\n\t\t\tif (this.configModel.get('isResharingAllowed') && (this.sharePermissionPossible())) {\n\t\t\t\tpossiblePermissions = possiblePermissions | OC.PERMISSION_SHARE;\n\t\t\t}\n\n\t\t\tattributes.permissions = defaultPermissions & possiblePermissions;\n\t\t\tif (_.isUndefined(attributes.path)) {\n\t\t\t\tattributes.path = this.fileInfoModel.getFullPath();\n\t\t\t}\n\n\t\t\treturn this._addOrUpdateShare({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: this._getUrl('shares'),\n\t\t\t\tdata: attributes,\n\t\t\t\tdataType: 'json'\n\t\t\t}, options);\n\t\t},\n\n\t\tupdateShare: function(shareId, attrs, options) {\n\t\t\treturn this._addOrUpdateShare({\n\t\t\t\ttype: 'PUT',\n\t\t\t\turl: this._getUrl('shares/' + encodeURIComponent(shareId)),\n\t\t\t\tdata: attrs,\n\t\t\t\tdataType: 'json'\n\t\t\t}, options);\n\t\t},\n\n\t\t_addOrUpdateShare: function(ajaxSettings, options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\n\t\t\treturn $.ajax(\n\t\t\t\tajaxSettings\n\t\t\t).always(function() {\n\t\t\t\tif (_.isFunction(options.complete)) {\n\t\t\t\t\toptions.complete(self);\n\t\t\t\t}\n\t\t\t}).done(function() {\n\t\t\t\tself.fetch().done(function() {\n\t\t\t\t\tif (_.isFunction(options.success)) {\n\t\t\t\t\t\toptions.success(self);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}).fail(function(xhr) {\n\t\t\t\tvar msg = t('core', 'Error');\n\t\t\t\tvar result = xhr.responseJSON;\n\t\t\t\tif (result && result.ocs && result.ocs.meta) {\n\t\t\t\t\tmsg = result.ocs.meta.message;\n\t\t\t\t}\n\n\t\t\t\tif (_.isFunction(options.error)) {\n\t\t\t\t\toptions.error(self, msg);\n\t\t\t\t} else {\n\t\t\t\t\tOC.dialogs.alert(msg, t('core', 'Error while sharing'));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Deletes the share with the given id\n\t\t *\n\t\t * @param {int} shareId share id\n\t\t * @return {jQuery}\n\t\t */\n\t\tremoveShare: function(shareId, options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\t\t\treturn $.ajax({\n\t\t\t\ttype: 'DELETE',\n\t\t\t\turl: this._getUrl('shares/' + encodeURIComponent(shareId)),\n\t\t\t}).done(function() {\n\t\t\t\tself.fetch({\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\tif (_.isFunction(options.success)) {\n\t\t\t\t\t\t\toptions.success(self);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}).fail(function(xhr) {\n\t\t\t\tvar msg = t('core', 'Error');\n\t\t\t\tvar result = xhr.responseJSON;\n\t\t\t\tif (result.ocs && result.ocs.meta) {\n\t\t\t\t\tmsg = result.ocs.meta.message;\n\t\t\t\t}\n\n\t\t\t\tif (_.isFunction(options.error)) {\n\t\t\t\t\toptions.error(self, msg);\n\t\t\t\t} else {\n\t\t\t\t\tOC.dialogs.alert(msg, t('core', 'Error removing share'));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisPublicUploadAllowed: function() {\n\t\t\treturn this.get('allowPublicUploadStatus');\n\t\t},\n\n\t\tisPublicEditingAllowed: function() {\n\t\t\treturn this.get('allowPublicEditingStatus');\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisHideFileListSet: function() {\n\t\t\treturn this.get('hideFileListStatus');\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFolder: function() {\n\t\t\treturn this.get('itemType') === 'folder';\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFile: function() {\n\t\t\treturn this.get('itemType') === 'file';\n\t\t},\n\n\t\t/**\n\t\t * whether this item has reshare information\n\t\t * @returns {boolean}\n\t\t */\n\t\thasReshare: function() {\n\t\t\tvar reshare = this.get('reshare');\n\t\t\treturn _.isObject(reshare) && !_.isUndefined(reshare.uid_owner);\n\t\t},\n\n\t\t/**\n\t\t * whether this item has user share information\n\t\t * @returns {boolean}\n\t\t */\n\t\thasUserShares: function() {\n\t\t\treturn this.getSharesWithCurrentItem().length > 0;\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this item has link shares\n\t\t *\n\t\t * @return {bool} true if a link share exists, false otherwise\n\t\t */\n\t\thasLinkShares: function() {\n\t\t\tvar linkShares = this.get('linkShares');\n\t\t\tif (linkShares && linkShares.length > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetReshareOwner: function() {\n\t\t\treturn this.get('reshare').uid_owner;\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetReshareOwnerDisplayname: function() {\n\t\t\treturn this.get('reshare').displayname_owner;\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetReshareNote: function() {\n\t\t\treturn this.get('reshare').note;\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetReshareWith: function() {\n\t\t\treturn this.get('reshare').share_with;\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t */\n\t\tgetReshareWithDisplayName: function() {\n\t\t\tvar reshare = this.get('reshare');\n\t\t\treturn reshare.share_with_displayname || reshare.share_with;\n\t\t},\n\n\t\t/**\n\t\t * @returns {number}\n\t\t */\n\t\tgetReshareType: function() {\n\t\t\treturn this.get('reshare').share_type;\n\t\t},\n\n\t\tgetExpireDate: function(shareIndex) {\n\t\t\treturn this._shareExpireDate(shareIndex);\n\t\t},\n\n\t\tgetNote: function(shareIndex) {\n\t\t\treturn this._shareNote(shareIndex);\n\t\t},\n\n\t\t/**\n\t\t * Returns all share entries that only apply to the current item\n\t\t * (file/folder)\n\t\t *\n\t\t * @return {Array.}\n\t\t */\n\t\tgetSharesWithCurrentItem: function() {\n\t\t\tvar shares = this.get('shares') || [];\n\t\t\tvar fileId = this.fileInfoModel.get('id');\n\t\t\treturn _.filter(shares, function(share) {\n\t\t\t\treturn share.item_source === fileId;\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetShareWith: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.share_with;\n\t\t},\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetShareWithDisplayName: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.share_with_displayname;\n\t\t},\n\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetShareWithAvatar: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.share_with_avatar;\n\t\t},\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetSharedBy: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.uid_owner;\n\t\t},\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetSharedByDisplayName: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.displayname_owner;\n\t\t},\n\n\t\t/**\n\t\t * @param shareIndex\n\t\t * @returns {string}\n\t\t */\n\t\tgetFileOwnerUid: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.uid_file_owner;\n\t\t},\n\n\t\t/**\n\t\t * returns the array index of a sharee for a provided shareId\n\t\t *\n\t\t * @param shareId\n\t\t * @returns {number}\n\t\t */\n\t\tfindShareWithIndex: function(shareId) {\n\t\t\tvar shares = this.get('shares');\n\t\t\tif(!_.isArray(shares)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\tfor(var i = 0; i < shares.length; i++) {\n\t\t\t\tvar shareWith = shares[i];\n\t\t\t\tif(shareWith.id === shareId) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow \"Unknown Sharee\";\n\t\t},\n\n\t\tgetShareType: function(shareIndex) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.share_type;\n\t\t},\n\n\t\t/**\n\t\t * whether a share from shares has the requested permission\n\t\t *\n\t\t * @param {number} shareIndex\n\t\t * @param {number} permission\n\t\t * @returns {boolean}\n\t\t * @private\n\t\t */\n\t\t_shareHasPermission: function(shareIndex, permission) {\n\t\t\t/** @type OC.Share.Types.ShareInfo **/\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn (share.permissions & permission) === permission;\n\t\t},\n\n\n\t\t_shareExpireDate: function(shareIndex) {\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\tvar date2 = share.expiration;\n\t\t\treturn date2;\n\t\t},\n\n\n\t\t_shareNote: function(shareIndex) {\n\t\t\tvar share = this.get('shares')[shareIndex];\n\t\t\tif(!_.isObject(share)) {\n\t\t\t\tthrow \"Unknown Share\";\n\t\t\t}\n\t\t\treturn share.note;\n\t\t},\n\n\t\t/**\n\t\t * @return {int}\n\t\t */\n\t\tgetPermissions: function() {\n\t\t\treturn this.get('permissions');\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tsharePermissionPossible: function() {\n\t\t\treturn (this.get('permissions') & OC.PERMISSION_SHARE) === OC.PERMISSION_SHARE;\n\t\t},\n\n\t\t/**\n\t\t * @param {number} shareIndex\n\t\t * @returns {boolean}\n\t\t */\n\t\thasSharePermission: function(shareIndex) {\n\t\t\treturn this._shareHasPermission(shareIndex, OC.PERMISSION_SHARE);\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tcreatePermissionPossible: function() {\n\t\t\treturn (this.get('permissions') & OC.PERMISSION_CREATE) === OC.PERMISSION_CREATE;\n\t\t},\n\n\t\t/**\n\t\t * @param {number} shareIndex\n\t\t * @returns {boolean}\n\t\t */\n\t\thasCreatePermission: function(shareIndex) {\n\t\t\treturn this._shareHasPermission(shareIndex, OC.PERMISSION_CREATE);\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tupdatePermissionPossible: function() {\n\t\t\treturn (this.get('permissions') & OC.PERMISSION_UPDATE) === OC.PERMISSION_UPDATE;\n\t\t},\n\n\t\t/**\n\t\t * @param {number} shareIndex\n\t\t * @returns {boolean}\n\t\t */\n\t\thasUpdatePermission: function(shareIndex) {\n\t\t\treturn this._shareHasPermission(shareIndex, OC.PERMISSION_UPDATE);\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\tdeletePermissionPossible: function() {\n\t\t\treturn (this.get('permissions') & OC.PERMISSION_DELETE) === OC.PERMISSION_DELETE;\n\t\t},\n\n\t\t/**\n\t\t * @param {number} shareIndex\n\t\t * @returns {boolean}\n\t\t */\n\t\thasDeletePermission: function(shareIndex) {\n\t\t\treturn this._shareHasPermission(shareIndex, OC.PERMISSION_DELETE);\n\t\t},\n\n\t\thasReadPermission: function(shareIndex) {\n\t\t\treturn this._shareHasPermission(shareIndex, OC.PERMISSION_READ);\n\t\t},\n\n\t\t/**\n\t\t * @returns {boolean}\n\t\t */\n\t\teditPermissionPossible: function() {\n\t\t\treturn this.createPermissionPossible()\n\t\t\t\t || this.updatePermissionPossible()\n\t\t\t\t || this.deletePermissionPossible();\n\t\t},\n\n\t\t/**\n\t\t * @returns {string}\n\t\t * The state that the 'can edit' permission checkbox should have.\n\t\t * Possible values:\n\t\t * - empty string: no permission\n\t\t * - 'checked': all applicable permissions\n\t\t * - 'indeterminate': some but not all permissions\n\t\t */\n\t\teditPermissionState: function(shareIndex) {\n\t\t\tvar hcp = this.hasCreatePermission(shareIndex);\n\t\t\tvar hup = this.hasUpdatePermission(shareIndex);\n\t\t\tvar hdp = this.hasDeletePermission(shareIndex);\n\t\t\tif (this.isFile()) {\n\t\t\t\tif (hcp || hup || hdp) {\n\t\t\t\t\treturn 'checked';\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tif (!hcp && !hup && !hdp) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tif ( (this.createPermissionPossible() && !hcp)\n\t\t\t\t|| (this.updatePermissionPossible() && !hup)\n\t\t\t\t|| (this.deletePermissionPossible() && !hdp) ) {\n\t\t\t\treturn 'indeterminate';\n\t\t\t}\n\t\t\treturn 'checked';\n\t\t},\n\n\t\t/**\n\t\t * @returns {int}\n\t\t */\n\t\tlinkSharePermissions: function(shareId) {\n\t\t\tvar linkShares = this.get('linkShares');\n\t\t\tvar shareIndex = _.findIndex(linkShares, function(share) {return share.id === shareId})\n\n\t\t\tif (!this.hasLinkShares()) {\n\t\t\t\treturn -1;\n\t\t\t} else if (linkShares.length > 0 && shareIndex !== -1) {\n\t\t\t\treturn linkShares[shareIndex].permissions;\n\t\t\t}\n\t\t\treturn -1;\n\t\t},\n\n\t\t_getUrl: function(base, params) {\n\t\t\tparams = _.extend({format: 'json'}, params || {});\n\t\t\treturn OC.linkToOCS('apps/files_sharing/api/v1', 2) + base + '?' + OC.buildQueryString(params);\n\t\t},\n\n\t\t_fetchShares: function() {\n\t\t\tvar path = this.fileInfoModel.getFullPath();\n\t\t\treturn $.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: this._getUrl('shares', {path: path, reshares: true})\n\t\t\t});\n\t\t},\n\n\t\t_fetchReshare: function() {\n\t\t\t// only fetch original share once\n\t\t\tif (!this._reshareFetched) {\n\t\t\t\tvar path = this.fileInfoModel.getFullPath();\n\t\t\t\tthis._reshareFetched = true;\n\t\t\t\treturn $.ajax({\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: this._getUrl('shares', {path: path, shared_with_me: true})\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn $.Deferred().resolve([{\n\t\t\t\t\tocs: {\n\t\t\t\t\t\tdata: [this.get('reshare')]\n\t\t\t\t\t}\n\t\t\t\t}]);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Group reshares into a single super share element.\n\t\t * Does this by finding the most precise share and\n\t\t * combines the permissions to be the most permissive.\n\t\t *\n\t\t * @param {Array} reshares\n\t\t * @return {Object} reshare\n\t\t */\n\t\t_groupReshares: function(reshares) {\n\t\t\tif (!reshares || !reshares.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar superShare = reshares.shift();\n\t\t\tvar combinedPermissions = superShare.permissions;\n\t\t\t_.each(reshares, function(reshare) {\n\t\t\t\t// use share have higher priority than group share\n\t\t\t\tif (reshare.share_type === OC.Share.SHARE_TYPE_USER && superShare.share_type === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\tsuperShare = reshare;\n\t\t\t\t}\n\t\t\t\tcombinedPermissions |= reshare.permissions;\n\t\t\t});\n\n\t\t\tsuperShare.permissions = combinedPermissions;\n\t\t\treturn superShare;\n\t\t},\n\n\t\tfetch: function(options) {\n\t\t\tvar model = this;\n\t\t\tthis.trigger('request', this);\n\n\t\t\tvar deferred = $.when(\n\t\t\t\tthis._fetchShares(),\n\t\t\t\tthis._fetchReshare()\n\t\t\t);\n\t\t\tdeferred.done(function(data1, data2) {\n\t\t\t\tmodel.trigger('sync', 'GET', this);\n\t\t\t\tvar sharesMap = {};\n\t\t\t\t_.each(data1[0].ocs.data, function(shareItem) {\n\t\t\t\t\tsharesMap[shareItem.id] = shareItem;\n\t\t\t\t});\n\n\t\t\t\tvar reshare = false;\n\t\t\t\tif (data2[0].ocs.data.length) {\n\t\t\t\t\treshare = model._groupReshares(data2[0].ocs.data);\n\t\t\t\t}\n\n\t\t\t\tmodel.set(model.parse({\n\t\t\t\t\tshares: sharesMap,\n\t\t\t\t\treshare: reshare\n\t\t\t\t}));\n\n\t\t\t\tif(!_.isUndefined(options) && _.isFunction(options.success)) {\n\t\t\t\t\toptions.success();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn deferred;\n\t\t},\n\n\t\t/**\n\t\t * Updates OC.Share.itemShares and OC.Share.statuses.\n\t\t *\n\t\t * This is required in case the user navigates away and comes back,\n\t\t * the share statuses from the old arrays are still used to fill in the icons\n\t\t * in the file list.\n\t\t */\n\t\t_legacyFillCurrentShares: function(shares) {\n\t\t\tvar fileId = this.fileInfoModel.get('id');\n\t\t\tif (!shares || !shares.length) {\n\t\t\t\tdelete OC.Share.statuses[fileId];\n\t\t\t\tOC.Share.currentShares = {};\n\t\t\t\tOC.Share.itemShares = [];\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar currentShareStatus = OC.Share.statuses[fileId];\n\t\t\tif (!currentShareStatus) {\n\t\t\t\tcurrentShareStatus = {link: false};\n\t\t\t\tOC.Share.statuses[fileId] = currentShareStatus;\n\t\t\t}\n\t\t\tcurrentShareStatus.link = false;\n\n\t\t\tOC.Share.currentShares = {};\n\t\t\tOC.Share.itemShares = [];\n\t\t\t_.each(shares,\n\t\t\t\t/**\n\t\t\t\t * @param {OC.Share.Types.ShareInfo} share\n\t\t\t\t */\n\t\t\t\tfunction(share) {\n\t\t\t\t\tif (share.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\tOC.Share.itemShares[share.share_type] = true;\n\t\t\t\t\t\tcurrentShareStatus.link = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!OC.Share.itemShares[share.share_type]) {\n\t\t\t\t\t\t\tOC.Share.itemShares[share.share_type] = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tOC.Share.itemShares[share.share_type].push(share.share_with);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\tparse: function(data) {\n\t\t\tif(data === false) {\n\t\t\t\tconsole.warn('no data was returned');\n\t\t\t\tthis.trigger('fetchError');\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tvar permissions = this.fileInfoModel.get('permissions');\n\t\t\tif(!_.isUndefined(data.reshare) && !_.isUndefined(data.reshare.permissions) && data.reshare.uid_owner !== OC.currentUser) {\n\t\t\t\tpermissions = permissions & data.reshare.permissions;\n\t\t\t}\n\n\t\t\tvar allowPublicUploadStatus = false;\n\t\t\tif(!_.isUndefined(data.shares)) {\n\t\t\t\t$.each(data.shares, function (key, value) {\n\t\t\t\t\tif (value.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\tallowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvar allowPublicEditingStatus = true;\n\t\t\tif(!_.isUndefined(data.shares)) {\n\t\t\t\t$.each(data.shares, function (key, value) {\n\t\t\t\t\tif (value.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\tallowPublicEditingStatus = (value.permissions & OC.PERMISSION_UPDATE) ? true : false;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t\tvar hideFileListStatus = false;\n\t\t\tif(!_.isUndefined(data.shares)) {\n\t\t\t\t$.each(data.shares, function (key, value) {\n\t\t\t\t\tif (value.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\thideFileListStatus = (value.permissions & OC.PERMISSION_READ) ? false : true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** @type {OC.Share.Types.ShareInfo[]} **/\n\t\t\tvar shares = _.map(data.shares, function(share) {\n\t\t\t\t// properly parse some values because sometimes the server\n\t\t\t\t// returns integers as string...\n\t\t\t\tvar i;\n\t\t\t\tfor (i = 0; i < SHARE_RESPONSE_INT_PROPS.length; i++) {\n\t\t\t\t\tvar prop = SHARE_RESPONSE_INT_PROPS[i];\n\t\t\t\t\tif (!_.isUndefined(share[prop])) {\n\t\t\t\t\t\tshare[prop] = parseInt(share[prop], 10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn share;\n\t\t\t});\n\n\t\t\tthis._legacyFillCurrentShares(shares);\n\n\t\t\tvar linkShares = [];\n\t\t\t// filter out the share by link\n\t\t\tshares = _.reject(shares,\n\t\t\t\t/**\n\t\t\t\t * @param {OC.Share.Types.ShareInfo} share\n\t\t\t\t */\n\t\t\t\tfunction(share) {\n\t\t\t\t\tvar isShareLink =\n\t\t\t\t\t\tshare.share_type === OC.Share.SHARE_TYPE_LINK\n\t\t\t\t\t\t&& ( share.file_source === this.get('itemSource')\n\t\t\t\t\t\t|| share.item_source === this.get('itemSource'));\n\n\t\t\t\t\tif (isShareLink) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Ignore reshared link shares for now\n\t\t\t\t\t\t * FIXME: Find a way to display properly\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (share.uid_owner !== OC.currentUser) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar link = window.location.protocol + '//' + window.location.host;\n\t\t\t\t\t\tif (!share.token) {\n\t\t\t\t\t\t\t// pre-token link\n\t\t\t\t\t\t\tvar fullPath = this.fileInfoModel.get('path') + '/' +\n\t\t\t\t\t\t\t\tthis.fileInfoModel.get('name');\n\t\t\t\t\t\t\tvar location = '/' + OC.currentUser + '/files' + fullPath;\n\t\t\t\t\t\t\tvar type = this.fileInfoModel.isDirectory() ? 'folder' : 'file';\n\t\t\t\t\t\t\tlink += OC.linkTo('', 'public.php') + '?service=files&' +\n\t\t\t\t\t\t\t\ttype + '=' + encodeURIComponent(location);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlink += OC.generateUrl('/s/') + share.token;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlinkShares.push(_.extend({}, share, {\n\t\t\t\t\t\t\t// hide_download is returned as an int, so force it\n\t\t\t\t\t\t\t// to a boolean\n\t\t\t\t\t\t\thideDownload: !!share.hide_download,\n\t\t\t\t\t\t\tpassword: share.share_with,\n\t\t\t\t\t\t\tsendPasswordByTalk: share.send_password_by_talk\n\t\t\t\t\t\t}));\n\n\t\t\t\t\t\treturn share;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tthis\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\treshare: data.reshare,\n\t\t\t\tshares: shares,\n\t\t\t\tlinkShares: linkShares,\n\t\t\t\tpermissions: permissions,\n\t\t\t\tallowPublicUploadStatus: allowPublicUploadStatus,\n\t\t\t\tallowPublicEditingStatus: allowPublicEditingStatus,\n\t\t\t\thideFileListStatus: hideFileListStatus\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Parses a string to an valid integer (unix timestamp)\n\t\t * @param time\n\t\t * @returns {*}\n\t\t * @internal Only used to work around a bug in the backend\n\t\t */\n\t\t_parseTime: function(time) {\n\t\t\tif (_.isString(time)) {\n\t\t\t\t// skip empty strings and hex values\n\t\t\t\tif (time === '' || (time.length > 1 && time[0] === '0' && time[1] === 'x')) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\ttime = parseInt(time, 10);\n\t\t\t\tif(isNaN(time)) {\n\t\t\t\t\ttime = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn time;\n\t\t},\n\n\t\t/**\n\t\t * Returns a list of share types from the existing shares.\n\t\t *\n\t\t * @return {Array.} array of share types\n\t\t */\n\t\tgetShareTypes: function() {\n\t\t\tvar result;\n\t\t\tresult = _.pluck(this.getSharesWithCurrentItem(), 'share_type');\n\t\t\tif (this.hasLinkShares()) {\n\t\t\t\tresult.push(OC.Share.SHARE_TYPE_LINK);\n\t\t\t}\n\t\t\treturn _.uniq(result);\n\t\t}\n\t});\n\n\tOC.Share.ShareItemModel = ShareItemModel;\n})();\n","/**\n * @copyright 2017, Roeland Jago Douma \n *\n * @author Roeland Jago Douma \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\n(function() {\n\tif (!OC.Share) {\n\t\tOC.Share = {};\n\t}\n\n\tOC.Share.Social = {};\n\n\tvar SocialModel = OC.Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\t/** used for sorting social buttons */\n\t\t\tkey: null,\n\t\t\t/** url to open, {{reference}} will be replaced with the link */\n\t\t\turl: null,\n\t\t\t/** Name to show in the tooltip */\n\t\t\tname: null,\n\t\t\t/** Icon class to display */\n\t\t\ticonClass: null,\n\t\t\t/** Open in new windows */\n\t\t\tnewWindow: true\n\t\t}\n\t});\n\n\tOC.Share.Social.Model = SocialModel;\n\n\tvar SocialCollection = OC.Backbone.Collection.extend({\n\t\tmodel: OC.Share.Social.Model,\n\n\t\tcomparator: 'key'\n\t});\n\n\n\tOC.Share.Social.Collection = new SocialCollection;\n})();\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* globals Handlebars */\n\n(function() {\n\tif (!OC.Share) {\n\t\tOC.Share = {};\n\t}\n\n\t/**\n\t * @class OCA.Share.ShareDialogView\n\t * @member {OC.Share.ShareItemModel} model\n\t * @member {jQuery} $el\n\t * @memberof OCA.Sharing\n\t * @classdesc\n\t *\n\t * Represents the GUI of the share dialogue\n\t *\n\t */\n\tvar ShareDialogResharerInfoView = OC.Backbone.View.extend({\n\t\t/** @type {string} **/\n\t\tid: 'shareDialogResharerInfo',\n\n\t\t/** @type {string} **/\n\t\ttagName: 'div',\n\n\t\t/** @type {string} **/\n\t\tclassName: 'reshare',\n\n\t\t/** @type {OC.Share.ShareConfigModel} **/\n\t\tconfigModel: undefined,\n\n\t\t/** @type {Function} **/\n\t\t_template: undefined,\n\n\t\tinitialize: function(options) {\n\t\t\tvar view = this;\n\n\t\t\tthis.model.on('change:reshare', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tif(!_.isUndefined(options.configModel)) {\n\t\t\t\tthis.configModel = options.configModel;\n\t\t\t} else {\n\t\t\t\tthrow 'missing OC.Share.ShareConfigModel';\n\t\t\t}\n\t\t},\n\n\t\trender: function() {\n\t\t\tif (!this.model.hasReshare()\n\t\t\t\t|| this.model.getReshareOwner() === OC.currentUser)\n\t\t\t{\n\t\t\t\tthis.$el.empty();\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tvar reshareTemplate = this.template();\n\t\t\tvar ownerDisplayName = this.model.getReshareOwnerDisplayname();\n\t\t\tvar shareNote = this.model.getReshareNote();\n\t\t\t\n\t\t\tvar sharedByText = '';\n\n\t\t\tif (this.model.getReshareType() === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\tsharedByText = t(\n\t\t\t\t\t'core',\n\t\t\t\t\t'Shared with you and the group {group} by {owner}',\n\t\t\t\t\t{\n\t\t\t\t\t\tgroup: this.model.getReshareWithDisplayName(),\n\t\t\t\t\t\towner: ownerDisplayName\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{escape: false}\n\t\t\t\t);\n\t\t\t} else if (this.model.getReshareType() === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\tsharedByText = t(\n\t\t\t\t\t'core',\n\t\t\t\t\t'Shared with you and {circle} by {owner}',\n\t\t\t\t\t{\n\t\t\t\t\t\tcircle: this.model.getReshareWithDisplayName(),\n\t\t\t\t\t\towner: ownerDisplayName\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{escape: false}\n\t\t\t\t);\n\t\t\t} else if (this.model.getReshareType() === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\tif (this.model.get('reshare').share_with_displayname) {\n\t\t\t\t\tsharedByText = t(\n\t\t\t\t\t\t'core',\n\t\t\t\t\t\t'Shared with you and the conversation {conversation} by {owner}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconversation: this.model.getReshareWithDisplayName(),\n\t\t\t\t\t\t\towner: ownerDisplayName\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t{escape: false}\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsharedByText = t(\n\t\t\t\t\t\t'core',\n\t\t\t\t\t\t'Shared with you in a conversation by {owner}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\towner: ownerDisplayName\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t{escape: false}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsharedByText = t(\n\t\t\t\t\t'core',\n\t\t\t\t\t'Shared with you by {owner}',\n\t\t\t\t\t{ owner: ownerDisplayName },\n\t\t\t\t\tundefined,\n\t\t\t\t\t{escape: false}\n\t\t\t\t);\n\t\t\t}\n\n\n\n\t\t\tthis.$el.html(reshareTemplate({\n\t\t\t\treshareOwner: this.model.getReshareOwner(),\n\t\t\t\tsharedByText: sharedByText,\n\t\t\t\tshareNote: shareNote,\n\t\t\t\thasShareNote: shareNote !== ''\n\t\t\t}));\n\n\t\t\tthis.$el.find('.avatar').each(function() {\n\t\t\t\tvar $this = $(this);\n\t\t\t\t$this.avatar($this.data('username'), 32);\n\t\t\t});\n\n\t\t\tthis.$el.find('.reshare').contactsMenu(\n\t\t\t\tthis.model.getReshareOwner(),\n\t\t\t\tOC.Share.SHARE_TYPE_USER,\n\t\t\t\tthis.$el);\n\n\t\t\treturn this;\n\t\t},\n\n\t\t/**\n\t\t * @returns {Function} from Handlebars\n\t\t * @private\n\t\t */\n\t\ttemplate: function () {\n\t\t\treturn OC.Share.Templates['sharedialogresharerinfoview'];\n\t\t}\n\n\t});\n\n\tOC.Share.ShareDialogResharerInfoView = ShareDialogResharerInfoView;\n\n})();\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* globals Clipboard, Handlebars */\n\n(function() {\n\tif (!OC.Share) {\n\t\tOC.Share = {};\n\t}\n\n\tvar PASSWORD_PLACEHOLDER = '**********';\n\tvar PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the public link');\n\tvar PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL = t('core', 'Choose a password for the public link or press the \"Enter\" key');\n\n\t/**\n\t * @class OCA.Share.ShareDialogLinkShareView\n\t * @member {OC.Share.ShareItemModel} model\n\t * @member {jQuery} $el\n\t * @memberof OCA.Sharing\n\t * @classdesc\n\t *\n\t * Represents the GUI of the share dialogue\n\t *\n\t */\n\tvar ShareDialogLinkShareView = OC.Backbone.View.extend({\n\t\t/** @type {string} **/\n\t\tid: 'shareDialogLinkShare',\n\n\t\t/** @type {OC.Share.ShareConfigModel} **/\n\t\tconfigModel: undefined,\n\n\t\t/** @type {boolean} **/\n\t\tshowLink: true,\n\n\t\t/** @type {boolean} **/\n\t\tshowPending: false,\n\n\t\t/** @type {string} **/\n\t\tpassword: '',\n\n\t\t/** @type {string} **/\n\t\tnewShareId: 'new-share',\n\n\t\tevents: {\n\t\t\t// open menu\n\t\t\t'click .share-menu .icon-more': 'onToggleMenu',\n\t\t\t// hide download\n\t\t\t'change .hideDownloadCheckbox': 'onHideDownloadChange',\n\t\t\t// password\n\t\t\t'click input.share-pass-submit': 'onPasswordEntered', \n\t\t\t'keyup input.linkPassText': 'onPasswordKeyUp', // check for the enter key\n\t\t\t'change .showPasswordCheckbox': 'onShowPasswordClick',\n\t\t\t'change .passwordByTalkCheckbox': 'onPasswordByTalkChange',\n\t\t\t'change .publicEditingCheckbox': 'onAllowPublicEditingChange',\n\t\t\t// copy link url\n\t\t\t'click .linkText': 'onLinkTextClick',\n\t\t\t// social\n\t\t\t'click .pop-up': 'onPopUpClick',\n\t\t\t// permission change\n\t\t\t'change .publicUploadRadio': 'onPublicUploadChange',\n\t\t\t// expire date\n\t\t\t'click .expireDate' : 'onExpireDateChange',\n\t\t\t'change .datepicker': 'onChangeExpirationDate',\n\t\t\t'click .datepicker' : 'showDatePicker',\n\t\t\t// note\n\t\t\t'click .share-add': 'showNoteForm',\n\t\t\t'click .share-note-delete': 'deleteNote',\n\t\t\t'click .share-note-submit': 'updateNote',\n\t\t\t// remove\n\t\t\t'click .unshare': 'onUnshare',\n\t\t\t// new share\n\t\t\t'click .new-share': 'newShare',\n\t\t\t// enforced pass set\n\t\t\t'submit .enforcedPassForm': 'enforcedPasswordSet',\n\t\t},\n\n\t\tinitialize: function(options) {\n\t\t\tvar view = this;\n\n\t\t\tthis.model.on('change:permissions', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tthis.model.on('change:itemType', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tthis.model.on('change:allowPublicUploadStatus', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tthis.model.on('change:hideFileListStatus', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tthis.model.on('change:linkShares', function(model, linkShares) {\n\t\t\t\t// The \"Password protect by Talk\" item is shown only when there\n\t\t\t\t// is a password. Unfortunately there is no fine grained\n\t\t\t\t// rendering of items in the link shares, so the whole view\n\t\t\t\t// needs to be rendered again when the password of a share\n\t\t\t\t// changes.\n\t\t\t\t// Note that this event handler is concerned only about password\n\t\t\t\t// changes; other changes in the link shares does not trigger\n\t\t\t\t// a rendering, so the view must be rendered again as needed in\n\t\t\t\t// those cases (for example, when a link share is removed).\n\t\t\t\t\n\t\t\t\tvar previousLinkShares = model.previous('linkShares');\n\t\t\t\tif (previousLinkShares.length !== linkShares.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar i;\n\t\t\t\tfor (i = 0; i < linkShares.length; i++) {\n\t\t\t\t\tif (linkShares[i].id !== previousLinkShares[i].id) {\n\t\t\t\t\t\t// A resorting should never happen, but just in case.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (linkShares[i].password !== previousLinkShares[i].password) {\n\t\t\t\t\t\tview.render();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif(!_.isUndefined(options.configModel)) {\n\t\t\t\tthis.configModel = options.configModel;\n\t\t\t} else {\n\t\t\t\tthrow 'missing OC.Share.ShareConfigModel';\n\t\t\t}\n\n\t\t\tvar clipboard = new Clipboard('.clipboard-button');\n\t\t\tclipboard.on('success', function(e) {\n\t\t\t\tvar $trigger = $(e.trigger);\n\n\t\t\t\t$trigger.tooltip('hide')\n\t\t\t\t\t.attr('data-original-title', t('core', 'Copied!'))\n\t\t\t\t\t.tooltip('fixTitle')\n\t\t\t\t\t.tooltip({placement: 'bottom', trigger: 'manual'})\n\t\t\t\t\t.tooltip('show');\n\t\t\t\t_.delay(function() {\n\t\t\t\t\t$trigger.tooltip('hide')\n\t\t\t\t\t\t.attr('data-original-title', t('core', 'Copy link'))\n\t\t\t\t\t\t.tooltip('fixTitle')\n\t\t\t\t}, 3000);\n\t\t\t});\n\t\t\tclipboard.on('error', function (e) {\n\t\t\t\tvar $trigger = $(e.trigger);\n\t\t\t\tvar $menu = $trigger.next('.share-menu').find('.popovermenu');\n\t\t\t\tvar $linkTextMenu = $menu.find('li.linkTextMenu');\n\t\t\t\tvar $input = $linkTextMenu.find('.linkText');\n\n\t\t\t\tvar $li = $trigger.closest('li[data-share-id]');\n\t\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\t\t// show menu\n\t\t\t\tOC.showMenu(null, $menu);\n\n\t\t\t\tvar actionMsg = '';\n\t\t\t\tif (/iPhone|iPad/i.test(navigator.userAgent)) {\n\t\t\t\t\tactionMsg = t('core', 'Not supported!');\n\t\t\t\t} else if (/Mac/i.test(navigator.userAgent)) {\n\t\t\t\t\tactionMsg = t('core', 'Press ⌘-C to copy.');\n\t\t\t\t} else {\n\t\t\t\t\tactionMsg = t('core', 'Press Ctrl-C to copy.');\n\t\t\t\t}\n\n\t\t\t\t$linkTextMenu.removeClass('hidden');\n\t\t\t\t$input.select();\n\t\t\t\t$input.tooltip('hide')\n\t\t\t\t\t.attr('data-original-title', actionMsg)\n\t\t\t\t\t.tooltip('fixTitle')\n\t\t\t\t\t.tooltip({placement: 'bottom', trigger: 'manual'})\n\t\t\t\t\t.tooltip('show');\n\t\t\t\t_.delay(function () {\n\t\t\t\t\t$input.tooltip('hide');\n\t\t\t\t\t$input.attr('data-original-title', t('core', 'Copy'))\n\t\t\t\t\t\t .tooltip('fixTitle');\n\t\t\t\t}, 3000);\n\t\t\t});\n\t\t},\n\n\t\tnewShare: function(event) {\n\t\t\tvar self = this;\n\t\t\tvar $target = $(event.target);\n\t\t\tvar $li = $target.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $loading = $li.find('.share-menu > .icon-loading-small');\n\n\t\t\tif(!$loading.hasClass('hidden') && this.password === '') {\n\t\t\t\t// in process\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// hide all icons and show loading\n\t\t\t$li.find('.icon').addClass('hidden');\n\t\t\t$loading.removeClass('hidden');\n\n\t\t\t// hide menu\n\t\t\tOC.hideMenus();\n\n\t\t\tvar shareData = {}\n\n\t\t\tvar isPasswordEnforced = this.configModel.get('enforcePasswordForPublicLink');\n\t\t\tvar isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');\n\n\t\t\t// set default expire date\n\t\t\tif (isExpirationEnforced) {\n\t\t\t\tvar defaultExpireDays = this.configModel.get('defaultExpireDate');\n\t\t\t\tvar expireDate = moment().add(defaultExpireDays, 'day').format('DD-MM-YYYY')\n\t\t\t\tshareData.expireDate = expireDate;\n\t\t\t}\n\n\t\t\t// if password is set, add to data\n\t\t\tif (isPasswordEnforced && this.password !== '') {\n\t\t\t\tshareData.password = this.password\n\t\t\t}\n\n\t\t\tvar newShareId = false;\n\n\t\t\t// We need a password before the share creation\n\t\t\tif (isPasswordEnforced && !this.showPending && this.password === '') {\n\t\t\t\tthis.showPending = shareId;\n\t\t\t\tvar self = this.render();\n\t\t\t\tself.$el.find('.pending #enforcedPassText').focus();\n\t\t\t} else {\n\t\t\t\t// else, we have a password or it is not enforced\n\t\t\t\t$.when(this.model.saveLinkShare(shareData, {\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t\t$li.find('.icon').removeClass('hidden');\n\t\t\t\t\t\tself.render();\n\t\t\t\t\t\t// open the menu by default\n\t\t\t\t\t\t// we can only do that after the render\n\t\t\t\t\t\tif (newShareId) {\n\t\t\t\t\t\t\tvar shares = self.$el.find('li[data-share-id]');\n\t\t\t\t\t\t\tvar $newShare = self.$el.find('li[data-share-id=\"'+newShareId+'\"]');\n\t\t\t\t\t\t\t// only open the menu by default if this is the first share\n\t\t\t\t\t\t\tif ($newShare && shares.length === 1) {\n\t\t\t\t\t\t\t\tvar $menu = $newShare.find('.popovermenu');\n\t\t\t\t\t\t\t\tOC.showMenu(null, $menu);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function() {\n\t\t\t\t\t\t// empty function to override the default Dialog warning\n\t\t\t\t\t}\n\t\t\t\t})).fail(function(response) {\n\t\t\t\t\t// password failure? Show error\n\t\t\t\t\tself.password = ''\n\t\t\t\t\tif (isPasswordEnforced && response && response.responseJSON && response.responseJSON.ocs.meta && response.responseJSON.ocs.meta.message) {\n\t\t\t\t\t\tvar $input = self.$el.find('.pending #enforcedPassText')\n\t\t\t\t\t\t$input.tooltip('destroy');\n\t\t\t\t\t\t$input.attr('title', response.responseJSON.ocs.meta.message);\n\t\t\t\t\t\t$input.tooltip({placement: 'bottom', trigger: 'manual'});\n\t\t\t\t\t\t$input.tooltip('show');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Unable to create a link share'));\n\t\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t\t$li.find('.icon').removeClass('hidden');\n\t\t\t\t\t}\n\t\t\t\t}).then(function(response) {\n\t\t\t\t\t// resolve before success\n\t\t\t\t\tnewShareId = response.ocs.data.id\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\tenforcedPasswordSet: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar $form = $(event.target);\n\t\t\tvar $input = $form.find('input.enforcedPassText');\n\t\t\tthis.password = $input.val();\n\t\t\tthis.showPending = false;\n\t\t\tthis.newShare(event);\n\t\t},\n\n\t\tonLinkTextClick: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar $el = $li.find('.linkText');\n\t\t\t$el.focus();\n\t\t\t$el.select();\n\t\t},\n\n\t\tonHideDownloadChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $checkbox = $li.find('.hideDownloadCheckbox');\n\t\t\t$checkbox.siblings('.icon-loading-small').removeClass('hidden').addClass('inlineblock');\n\n\t\t\tvar hideDownload = false;\n\t\t\tif($checkbox.is(':checked')) {\n\t\t\t\thideDownload = true;\n\t\t\t}\n\n\t\t\tthis.model.saveLinkShare({\n\t\t\t\thideDownload: hideDownload,\n\t\t\t\tcid: shareId\n\t\t\t}, {\n\t\t\t\tsuccess: function() {\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t},\n\t\t\t\terror: function(obj, msg) {\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Unable to toggle this option'));\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tonShowPasswordClick: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\t$li.find('.linkPass').slideToggle(OC.menuSpeed);\n\t\t\t$li.find('.linkPassMenu').toggleClass('hidden');\n\t\t\tif(!$li.find('.showPasswordCheckbox').is(':checked')) {\n\t\t\t\tthis.model.saveLinkShare({\n\t\t\t\t\tpassword: '',\n\t\t\t\t\tcid: shareId\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (!OC.Util.isIE()) {\n\t\t\t\t\t$li.find('.linkPassText').focus();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tonPasswordKeyUp: function(event) {\n\t\t\tif(event.keyCode === 13) {\n\t\t\t\tthis.onPasswordEntered(event);\n\t\t\t}\n\t\t},\n\n\t\tonPasswordEntered: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $loading = $li.find('.linkPassMenu .icon-loading-small');\n\t\t\tif (!$loading.hasClass('hidden')) {\n\t\t\t\t// still in process\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar $input = $li.find('.linkPassText');\n\t\t\t$input.removeClass('error');\n\t\t\t$input.parent().find('input').removeClass('error');\n\t\t\tvar password = $input.val();\n\n\t\t\tif ($li.find('.linkPassText').attr('placeholder') === PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL) {\n\n\t\t\t\t// in IE9 the password might be the placeholder due to bugs in the placeholders polyfill\n\t\t\t\tif(password === PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL) {\n\t\t\t\t\tpassword = '';\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// in IE9 the password might be the placeholder due to bugs in the placeholders polyfill\n\t\t\t\tif(password === '' || password === PASSWORD_PLACEHOLDER || password === PASSWORD_PLACEHOLDER_MESSAGE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$loading\n\t\t\t\t.removeClass('hidden')\n\t\t\t\t.addClass('inlineblock');\n\n\t\t\tthis.model.saveLinkShare({\n\t\t\t\tpassword: password,\n\t\t\t\tcid: shareId\n\t\t\t}, {\n\t\t\t\tcomplete: function(model) {\n\t\t\t\t\t$loading.removeClass('inlineblock').addClass('hidden');\n\t\t\t\t},\n\t\t\t\terror: function(model, msg) {\n\t\t\t\t\t// Add visual feedback to both the input and the submit button\n\t\t\t\t\t$input.parent().find('input').addClass('error');\n\n\t\t\t\t\t// destroy old tooltips\n\t\t\t\t\tvar $container = $input.parent();\n\t\t\t\t\t$container.tooltip('destroy');\n\t\t\t\t\t$input.addClass('error');\n\t\t\t\t\t$container.attr('title', msg);\n\t\t\t\t\t$container.tooltip({placement: 'bottom', trigger: 'manual'});\n\t\t\t\t\t$container.tooltip('show');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tonPasswordByTalkChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $checkbox = $li.find('.passwordByTalkCheckbox');\n\t\t\t$checkbox.siblings('.icon-loading-small').removeClass('hidden').addClass('inlineblock');\n\n\t\t\tvar sendPasswordByTalk = false;\n\t\t\tif($checkbox.is(':checked')) {\n\t\t\t\tsendPasswordByTalk = true;\n\t\t\t}\n\n\t\t\tthis.model.saveLinkShare({\n\t\t\t\tsendPasswordByTalk: sendPasswordByTalk,\n\t\t\t\tcid: shareId\n\t\t\t}, {\n\t\t\t\tsuccess: function() {\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t},\n\t\t\t\terror: function(obj, msg) {\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Unable to toggle this option'));\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tonAllowPublicEditingChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $checkbox = $li.find('.publicEditingCheckbox');\n\t\t\t$checkbox.siblings('.icon-loading-small').removeClass('hidden').addClass('inlineblock');\n\n\t\t\tvar permissions = OC.PERMISSION_READ;\n\t\t\tif($checkbox.is(':checked')) {\n\t\t\t\tpermissions = OC.PERMISSION_UPDATE | OC.PERMISSION_READ;\n\t\t\t}\n\n\t\t\tthis.model.saveLinkShare({\n\t\t\t\tpermissions: permissions,\n\t\t\t\tcid: shareId\n\t\t\t}, {\n\t\t\t\tsuccess: function() {\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t},\n\t\t\t\terror: function(obj, msg) {\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Unable to toggle this option'));\n\t\t\t\t\t$checkbox.siblings('.icon-loading-small').addClass('hidden').removeClass('inlineblock');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\n\t\tonPublicUploadChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar permissions = event.currentTarget.value;\n\t\t\tthis.model.saveLinkShare({\n\t\t\t\tpermissions: permissions,\n\t\t\t\tcid: shareId\n\t\t\t});\n\t\t},\n\n\t\tshowNoteForm: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar $menu = $element.closest('li');\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\n\t\t\t// show elements\n\t\t\t$menu.find('.share-note-delete').toggleClass('hidden');\n\t\t\t$form.toggleClass('hidden');\n\t\t\t$form.find('textarea').focus();\n\t\t},\n\n\t\tdeleteNote: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $menu = $element.closest('li');\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\n\t\t\t$form.find('.share-note').val('');\n\n\t\t\t$form.addClass('hidden');\n\t\t\t$menu.find('.share-note-delete').addClass('hidden');\n\n\t\t\tself.sendNote('', shareId, $menu);\n\t\t},\n\n\t\tupdateNote: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $form = $element.closest('li.share-note-form');\n\t\t\tvar $menu = $form.prev('li');\n\t\t\tvar message = $form.find('.share-note').val().trim();\n\n\t\t\tif (message.length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.sendNote(message, shareId, $menu);\n\t\t},\n\n\t\tsendNote: function(note, shareId, $menu) {\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\t\t\tvar $submit = $form.find('input.share-note-submit');\n\t\t\tvar $error = $form.find('input.share-note-error');\n\n\t\t\t$submit.prop('disabled', true);\n\t\t\t$menu.find('.icon-loading-small').removeClass('hidden');\n\t\t\t$menu.find('.icon-edit').hide();\n\n\t\t\tvar complete = function() {\n\t\t\t\t$submit.prop('disabled', false);\n\t\t\t\t$menu.find('.icon-loading-small').addClass('hidden');\n\t\t\t\t$menu.find('.icon-edit').show();\n\t\t\t};\n\t\t\tvar error = function() {\n\t\t\t\t$error.show();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$error.hide();\n\t\t\t\t}, 3000);\n\t\t\t};\n\n\t\t\t// send data\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares',2) + shareId + '?' + OC.buildQueryString({format: 'json'}),\n\t\t\t\tdata: { note: note },\n\t\t\t\tcomplete : complete,\n\t\t\t\terror: error\n\t\t\t});\n\t\t},\n\n\t\trender: function() {\n\t\t\tthis.$el.find('.has-tooltip').tooltip();\n\n\t\t\t// reset previously set passwords\n\t\t\tthis.password = '';\n\n\t\t\tvar linkShareTemplate = this.template();\n\t\t\tvar resharingAllowed = this.model.sharePermissionPossible();\n\n\t\t\tif(!resharingAllowed\n\t\t\t\t|| !this.showLink\n\t\t\t\t|| !this.configModel.isShareWithLinkAllowed())\n\t\t\t{\n\t\t\t\tvar templateData = {shareAllowed: false};\n\t\t\t\tif (!resharingAllowed) {\n\t\t\t\t\t// add message\n\t\t\t\t\ttemplateData.noSharingPlaceholder = t('core', 'Resharing is not allowed');\n\t\t\t\t}\n\t\t\t\tthis.$el.html(linkShareTemplate(templateData));\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tvar publicUpload =\n\t\t\t\tthis.model.isFolder()\n\t\t\t\t&& this.model.createPermissionPossible()\n\t\t\t\t&& this.configModel.isPublicUploadEnabled();\n\n\n\t\t\tvar publicEditingChecked = '';\n\t\t\tif(this.model.isPublicEditingAllowed()) {\n\t\t\t\tpublicEditingChecked = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tvar isPasswordEnforced = this.configModel.get('enforcePasswordForPublicLink');\n\t\t\tvar isPasswordEnabledByDefault = this.configModel.get('enableLinkPasswordByDefault') === true;\n\t\t\tvar passwordPlaceholderInitial = this.configModel.get('enforcePasswordForPublicLink')\n\t\t\t\t? PASSWORD_PLACEHOLDER_MESSAGE : PASSWORD_PLACEHOLDER_MESSAGE_OPTIONAL;\n\n\t\t\tvar publicEditable =\n\t\t\t\t!this.model.isFolder()\n\t\t\t\t&& this.model.updatePermissionPossible();\n\n\t\t\tvar isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');\n\n\t\t\t// what if there is another date picker on that page?\n\t\t\tvar minDate = new Date();\n\t\t\t// min date should always be the next day\n\t\t\tminDate.setDate(minDate.getDate()+1);\n\n\t\t\t$.datepicker.setDefaults({\n\t\t\t\tminDate: minDate\n\t\t\t});\n\n\t\t\tthis.$el.find('.datepicker').datepicker({dateFormat : 'dd-mm-yy'});\n\n\t\t\tvar minPasswordLength = 4\n\t\t\t// password policy?\n\t\t\tif(oc_capabilities.password_policy && oc_capabilities.password_policy.minLength) {\n\t\t\t\tminPasswordLength = oc_capabilities.password_policy.minLength;\n\t\t\t}\n\n\t\t\tvar popoverBase = {\n\t\t\t\turlLabel: t('core', 'Link'),\n\t\t\t\thideDownloadLabel: t('core', 'Hide download'),\n\t\t\t\tenablePasswordLabel: isPasswordEnforced ? t('core', 'Password protection enforced') : t('core', 'Password protect'),\n\t\t\t\tpasswordLabel: t('core', 'Password'),\n\t\t\t\tpasswordPlaceholderInitial: passwordPlaceholderInitial,\n\t\t\t\tpublicUpload: publicUpload,\n\t\t\t\tpublicEditing: publicEditable,\n\t\t\t\tpublicEditingChecked: publicEditingChecked,\n\t\t\t\tpublicEditingLabel: t('core', 'Allow editing'),\n\t\t\t\tmailPrivatePlaceholder: t('core', 'Email link to person'),\n\t\t\t\tmailButtonText: t('core', 'Send'),\n\t\t\t\tpublicUploadRWLabel: t('core', 'Allow upload and editing'),\n\t\t\t\tpublicUploadRLabel: t('core', 'Read only'),\n\t\t\t\tpublicUploadWLabel: t('core', 'File drop (upload only)'),\n\t\t\t\tpublicUploadRWValue: OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_READ | OC.PERMISSION_DELETE,\n\t\t\t\tpublicUploadRValue: OC.PERMISSION_READ,\n\t\t\t\tpublicUploadWValue: OC.PERMISSION_CREATE,\n\t\t\t\texpireDateLabel: isExpirationEnforced ? t('core', 'Expiration date enforced') : t('core', 'Set expiration date'),\n\t\t\t\texpirationLabel: t('core', 'Expiration'),\n\t\t\t\texpirationDatePlaceholder: t('core', 'Expiration date'),\n\t\t\t\tisExpirationEnforced: isExpirationEnforced,\n\t\t\t\tisPasswordEnforced: isPasswordEnforced,\n\t\t\t\tdefaultExpireDate: moment().add(1, 'day').format('DD-MM-YYYY'), // Can't expire today\n\t\t\t\taddNoteLabel: t('core', 'Note to recipient'),\n\t\t\t\tunshareLabel: t('core', 'Unshare'),\n\t\t\t\tunshareLinkLabel: t('core', 'Delete share link'),\n\t\t\t\tnewShareLabel: t('core', 'Add another link'),\n\t\t\t};\n\n\t\t\tvar pendingPopover = {\n\t\t\t\tisPasswordEnforced: isPasswordEnforced,\n\t\t\t\tenforcedPasswordLabel: t('core', 'Password protection for links is mandatory'),\n\t\t\t\tpasswordPlaceholder: passwordPlaceholderInitial,\n\t\t\t\tminPasswordLength: minPasswordLength,\n\t\t\t};\n\t\t\tvar pendingPopoverMenu = this.pendingPopoverMenuTemplate(_.extend({}, pendingPopover))\n\n\t\t\tvar linkShares = this.getShareeList();\n\t\t\tif(_.isArray(linkShares)) {\n\t\t\t\tfor (var i = 0; i < linkShares.length; i++) {\n\t\t\t\t\tvar social = [];\n\t\t\t\t\tOC.Share.Social.Collection.each(function (model) {\n\t\t\t\t\t\tvar url = model.get('url');\n\t\t\t\t\t\turl = url.replace('{{reference}}', linkShares[i].shareLinkURL);\n\t\t\t\t\t\tsocial.push({\n\t\t\t\t\t\t\turl: url,\n\t\t\t\t\t\t\tlabel: t('core', 'Share to {name}', {name: model.get('name')}),\n\t\t\t\t\t\t\tname: model.get('name'),\n\t\t\t\t\t\t\ticonClass: model.get('iconClass'),\n\t\t\t\t\t\t\tnewWindow: model.get('newWindow')\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tvar popover = this.getPopoverObject(linkShares[i])\n\t\t\t\t\tlinkShares[i].popoverMenu = this.popoverMenuTemplate(_.extend({}, popoverBase, popover, {social: social}));\n\t\t\t\t\tlinkShares[i].pendingPopoverMenu = pendingPopoverMenu\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.$el.html(linkShareTemplate({\n\t\t\t\tlinkShares: linkShares,\n\t\t\t\tshareAllowed: true,\n\t\t\t\tnolinkShares: linkShares.length === 0,\n\t\t\t\tnewShareLabel: t('core', 'Share link'),\n\t\t\t\tnewShareTitle: t('core', 'New share link'),\n\t\t\t\tpendingPopoverMenu: pendingPopoverMenu,\n\t\t\t\tshowPending: this.showPending === this.newShareId,\n\t\t\t\tnewShareId: this.newShareId,\n\t\t\t}));\n\n\t\t\tthis.delegateEvents();\n\n\t\t\t// new note autosize\n\t\t\tautosize(this.$el.find('.share-note-form .share-note'));\n\n\t\t\treturn this;\n\t\t},\n\n\t\tonToggleMenu: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar $menu = $li.find('.sharingOptionsGroup .popovermenu');\n\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\tOC.showMenu(null, $menu);\n\n\t\t\t// focus the password if not set and enforced\n\t\t\tvar isPasswordEnabledByDefault = this.configModel.get('enableLinkPasswordByDefault') === true;\n\t\t\tvar haspassword = $menu.find('.linkPassText').val() !== '';\n\n\t\t\tif (!haspassword && isPasswordEnabledByDefault) {\n\t\t\t\t$menu.find('.linkPassText').focus();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @returns {Function} from Handlebars\n\t\t * @private\n\t\t */\n\t\ttemplate: function () {\n\t\t\treturn OC.Share.Templates['sharedialoglinkshareview'];\n\t\t},\n\n\t\t/**\n\t\t * renders the popover template and returns the resulting HTML\n\t\t *\n\t\t * @param {Object} data\n\t\t * @returns {string}\n\t\t */\n\t\tpopoverMenuTemplate: function(data) {\n\t\t\treturn OC.Share.Templates['sharedialoglinkshareview_popover_menu'](data);\n\t\t},\n\n\t\t/**\n\t\t * renders the pending popover template and returns the resulting HTML\n\t\t *\n\t\t * @param {Object} data\n\t\t * @returns {string}\n\t\t */\n\t\tpendingPopoverMenuTemplate: function(data) {\n\t\t\treturn OC.Share.Templates['sharedialoglinkshareview_popover_menu_pending'](data);\n\t\t},\n\n\t\tonPopUpClick: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar url = $(event.currentTarget).data('url');\n\t\t\tvar newWindow = $(event.currentTarget).data('window');\n\t\t\t$(event.currentTarget).tooltip('hide');\n\t\t\tif (url) {\n\t\t\t\tif (newWindow === true) {\n\t\t\t\t\tvar width = 600;\n\t\t\t\t\tvar height = 400;\n\t\t\t\t\tvar left = (screen.width / 2) - (width / 2);\n\t\t\t\t\tvar top = (screen.height / 2) - (height / 2);\n\n\t\t\t\t\twindow.open(url, 'name', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tonExpireDateChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar expirationDatePicker = '#expirationDateContainer-' + shareId;\n\t\t\tvar datePicker = $(expirationDatePicker);\n\t\t\tvar state = $element.prop('checked');\n\t\t\tdatePicker.toggleClass('hidden', !state);\n\n\t\t\tif (!state) {\n\t\t\t\t// disabled, let's hide the input and\n\t\t\t\t// set the expireDate to nothing\n\t\t\t\t$element.closest('li').next('li').addClass('hidden');\n\t\t\t\tthis.setExpirationDate('', shareId);\n\t\t\t} else {\n\t\t\t\t// enabled, show the input and the datepicker\n\t\t\t\t$element.closest('li').next('li').removeClass('hidden');\n\t\t\t\tthis.showDatePicker(event);\n\n\t\t\t}\n\t\t},\n\n\t\tshowDatePicker: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar maxDate = $element.data('max-date');\n\t\t\tvar expirationDatePicker = '#expirationDatePicker-' + shareId;\n\t\t\tvar self = this;\n\n\t\t\t$(expirationDatePicker).datepicker({\n\t\t\t\tdateFormat : 'dd-mm-yy',\n\t\t\t\tonSelect: function (expireDate) {\n\t\t\t\t\tself.setExpirationDate(expireDate, shareId);\n\t\t\t\t},\n\t\t\t\tmaxDate: maxDate\n\t\t\t});\n\t\t\t$(expirationDatePicker).datepicker('show');\n\t\t\t$(expirationDatePicker).focus();\n\n\t\t},\n\n\t\tsetExpirationDate: function(expireDate, shareId) {\n\t\t\tthis.model.saveLinkShare({expireDate: expireDate, cid: shareId});\n\t\t},\n\n\t\tonChangeExpirationDate: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar expireDate = $element.val();\n\t\t\tvar li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar expirationDatePicker = '#expirationDatePicker-' + shareId;\n\n\t\t\tthis.setExpirationDate(expireDate, shareId);\n\t\t\t$(expirationDatePicker).datepicker('hide');\n\t\t},\n\n\t\t/**\n\t\t * get an array of sharees' share properties\n\t\t *\n\t\t * @returns {Array}\n\t\t */\n\t\tgetShareeList: function() {\n\t\t\tvar shares = this.model.get('linkShares');\n\n\t\t\tif(!this.model.hasLinkShares()) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tvar list = [];\n\t\t\tfor(var index = 0; index < shares.length; index++) {\n\t\t\t\tvar share = this.getShareeObject(index);\n\t\t\t\t// first empty {} is necessary, otherwise we get in trouble\n\t\t\t\t// with references\n\t\t\t\tlist.push(_.extend({}, share));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t},\n\n\t\t/**\n\t\t *\n\t\t * @param {OC.Share.Types.ShareInfo} shareInfo\n\t\t * @returns {object}\n\t\t */\n\t\tgetShareeObject: function(shareIndex) {\n\t\t\tvar share = this.model.get('linkShares')[shareIndex];\n\n\t\t\treturn _.extend({}, share, {\n\t\t\t\tcid: share.id,\n\t\t\t\tshareAllowed: true,\n\t\t\t\tlinkShareLabel: share.label ? share.label : t('core', 'Share link'),\n\t\t\t\tpopoverMenu: {},\n\t\t\t\tshareLinkURL: share.url,\n\t\t\t\tnewShareTitle: t('core', 'New share link'),\n\t\t\t\tcopyLabel: t('core', 'Copy link'),\n\t\t\t\tshowPending: this.showPending === share.id,\n\t\t\t\tlinkShareCreationDate: t('core', 'Created on {time}', { time: moment(share.stime * 1000).format('LLLL') })\n\t\t\t})\n\t\t},\n\n\t\tgetPopoverObject: function(share) {\n\t\t\tvar publicUploadRWChecked = '';\n\t\t\tvar publicUploadRChecked = '';\n\t\t\tvar publicUploadWChecked = '';\n\n\t\t\tswitch (this.model.linkSharePermissions(share.id)) {\n\t\t\t\tcase OC.PERMISSION_READ:\n\t\t\t\t\tpublicUploadRChecked = 'checked';\n\t\t\t\t\tbreak;\n\t\t\t\tcase OC.PERMISSION_CREATE:\n\t\t\t\t\tpublicUploadWChecked = 'checked';\n\t\t\t\t\tbreak;\n\t\t\t\tcase OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_READ | OC.PERMISSION_DELETE:\n\t\t\t\t\tpublicUploadRWChecked = 'checked';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar isPasswordSet = !!share.password;\n\t\t\tvar isPasswordEnabledByDefault = this.configModel.get('enableLinkPasswordByDefault') === true;\n\t\t\tvar isPasswordEnforced = this.configModel.get('enforcePasswordForPublicLink');\n\t\t\tvar isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');\n\t\t\tvar defaultExpireDays = this.configModel.get('defaultExpireDate');\n\t\t\tvar hasExpireDate = !!share.expiration || isExpirationEnforced;\n\n\t\t\tvar expireDate;\n\t\t\tif (hasExpireDate) {\n\t\t\t\texpireDate = moment(share.expiration, 'YYYY-MM-DD').format('DD-MM-YYYY');\n\t\t\t}\n\n\t\t\tvar isTalkEnabled = oc_appswebroots['spreed'] !== undefined;\n\t\t\tvar sendPasswordByTalk = share.sendPasswordByTalk;\n\n\t\t\tvar hideDownload = share.hideDownload;\n\n\t\t\tvar maxDate = null;\n\n\t\t\tif(hasExpireDate) {\n\t\t\t\tif(isExpirationEnforced) {\n\t\t\t\t\t// TODO: hack: backend returns string instead of integer\n\t\t\t\t\tvar shareTime = share.stime;\n\t\t\t\t\tif (_.isNumber(shareTime)) {\n\t\t\t\t\t\tshareTime = new Date(shareTime * 1000);\n\t\t\t\t\t}\n\t\t\t\t\tif (!shareTime) {\n\t\t\t\t\t\tshareTime = new Date(); // now\n\t\t\t\t\t}\n\t\t\t\t\tshareTime = OC.Util.stripTime(shareTime).getTime();\n\t\t\t\t\tmaxDate = new Date(shareTime + defaultExpireDays * 24 * 3600 * 1000);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcid: share.id,\n\t\t\t\tshareLinkURL: share.url,\n\t\t\t\tpasswordPlaceholder: isPasswordSet ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,\n\t\t\t\tisPasswordSet: isPasswordSet || isPasswordEnabledByDefault || isPasswordEnforced,\n\t\t\t\tshowPasswordByTalkCheckBox: isTalkEnabled && isPasswordSet,\n\t\t\t\tpasswordByTalkLabel: t('core', 'Password protect by Talk'),\n\t\t\t\tisPasswordByTalkSet: sendPasswordByTalk,\n\t\t\t\tpublicUploadRWChecked: publicUploadRWChecked,\n\t\t\t\tpublicUploadRChecked: publicUploadRChecked,\n\t\t\t\tpublicUploadWChecked: publicUploadWChecked,\n\t\t\t\thasExpireDate: hasExpireDate,\n\t\t\t\texpireDate: expireDate,\n\t\t\t\tshareNote: share.note,\n\t\t\t\thasNote: share.note !== '',\n\t\t\t\tmaxDate: maxDate,\n\t\t\t\thideDownload: hideDownload,\n\t\t\t\tisExpirationEnforced: isExpirationEnforced,\n\t\t\t}\n\t\t},\n\n\t\tonUnshare: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tif (!$element.is('a')) {\n\t\t\t\t$element = $element.closest('a');\n\t\t\t}\n\n\t\t\tvar $loading = $element.find('.icon-loading-small').eq(0);\n\t\t\tif(!$loading.hasClass('hidden')) {\n\t\t\t\t// in process\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$loading.removeClass('hidden');\n\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\n\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\tself.model.removeShare(shareId, {\n\t\t\t\tsuccess: function() {\n\t\t\t\t\t$li.remove();\n\t\t\t\t\tself.render()\n\t\t\t\t},\n\t\t\t\terror: function() {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Could not unshare'));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn false;\n\t\t},\n\n\n\t});\n\n\tOC.Share.ShareDialogLinkShareView = ShareDialogLinkShareView;\n\n})();\n","/* global OC, Handlebars */\n\n/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* globals Handlebars */\n\n(function() {\n\n\tvar PASSWORD_PLACEHOLDER = '**********';\n\tvar PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the mail share');\n\n\tif (!OC.Share) {\n\t\tOC.Share = {};\n\t}\n\n\t/**\n\t * @class OCA.Share.ShareDialogShareeListView\n\t * @member {OC.Share.ShareItemModel} model\n\t * @member {jQuery} $el\n\t * @memberof OCA.Sharing\n\t * @classdesc\n\t *\n\t * Represents the sharee list part in the GUI of the share dialogue\n\t *\n\t */\n\tvar ShareDialogShareeListView = OC.Backbone.View.extend({\n\t\t/** @type {string} **/\n\t\tid: 'shareDialogLinkShare',\n\n\t\t/** @type {OC.Share.ShareConfigModel} **/\n\t\tconfigModel: undefined,\n\n\t\t_menuOpen: false,\n\n\t\t/** @type {boolean|number} **/\n\t\t_renderPermissionChange: false,\n\n\t\tevents: {\n\t\t\t'click .unshare': 'onUnshare',\n\t\t\t'click .share-add': 'showNoteForm',\n\t\t\t'click .share-note-delete': 'deleteNote',\n\t\t\t'click .share-note-submit': 'updateNote',\n\t\t\t'click .share-menu .icon-more': 'onToggleMenu',\n\t\t\t'click .permissions': 'onPermissionChange',\n\t\t\t'click .expireDate' : 'onExpireDateChange',\n\t\t\t'click .password' : 'onMailSharePasswordProtectChange',\n\t\t\t'click .passwordByTalk' : 'onMailSharePasswordProtectByTalkChange',\n\t\t\t'click .secureDrop' : 'onSecureDropChange',\n\t\t\t'keyup input.passwordField': 'onMailSharePasswordKeyUp',\n\t\t\t'focusout input.passwordField': 'onMailSharePasswordEntered',\n\t\t\t'change .datepicker': 'onChangeExpirationDate',\n\t\t\t'click .datepicker' : 'showDatePicker'\n\t\t},\n\n\t\tinitialize: function(options) {\n\t\t\tif(!_.isUndefined(options.configModel)) {\n\t\t\t\tthis.configModel = options.configModel;\n\t\t\t} else {\n\t\t\t\tthrow 'missing OC.Share.ShareConfigModel';\n\t\t\t}\n\n\t\t\tvar view = this;\n\t\t\tthis.model.on('change:shares', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t *\n\t\t * @param {OC.Share.Types.ShareInfo} shareInfo\n\t\t * @returns {object}\n\t\t */\n\t\tgetShareeObject: function(shareIndex) {\n\t\t\tvar shareWith = this.model.getShareWith(shareIndex);\n\t\t\tvar shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);\n\t\t\tvar shareWithAvatar = this.model.getShareWithAvatar(shareIndex);\n\t\t\tvar shareWithTitle = '';\n\t\t\tvar shareType = this.model.getShareType(shareIndex);\n\t\t\tvar sharedBy = this.model.getSharedBy(shareIndex);\n\t\t\tvar sharedByDisplayName = this.model.getSharedByDisplayName(shareIndex);\n\t\t\tvar fileOwnerUid = this.model.getFileOwnerUid(shareIndex);\n\n\t\t\tvar hasPermissionOverride = {};\n\t\t\tif (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\tshareWithDisplayName = shareWithDisplayName + \" (\" + t('core', 'group') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\tshareWithDisplayName = shareWithDisplayName + \" (\" + t('core', 'remote') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\tshareWithDisplayName = shareWithDisplayName + \" (\" + t('core', 'remote group') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\tshareWithDisplayName = shareWithDisplayName + \" (\" + t('core', 'email') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\tshareWithDisplayName = shareWithDisplayName + \" (\" + t('core', 'conversation') + ')';\n\t\t\t}\n\n\t\t\tif (shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\tshareWithTitle = shareWith + \" (\" + t('core', 'group') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\tshareWithTitle = shareWith + \" (\" + t('core', 'remote') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\tshareWithTitle = shareWith + \" (\" + t('core', 'remote group') + ')';\n\t\t\t}\n\t\t\telse if (shareType === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\tshareWithTitle = shareWith + \" (\" + t('core', 'email') + ')';\n\t\t\t} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\tshareWithTitle = shareWith;\n\t\t\t\t// Force \"shareWith\" in the template to a safe value, as the\n\t\t\t\t// original \"shareWith\" returned by the model may contain\n\t\t\t\t// problematic characters like \"'\".\n\t\t\t\tshareWith = 'circle-' + shareIndex;\n\t\t\t}\n\n\t\t\tif (sharedBy !== oc_current_user) {\n\t\t\t\tvar empty = shareWithTitle === '';\n\t\t\t\tif (!empty) {\n\t\t\t\t\tshareWithTitle += ' (';\n\t\t\t\t}\n\t\t\t\tshareWithTitle += t('core', 'shared by {sharer}', {sharer: sharedByDisplayName});\n\t\t\t\tif (!empty) {\n\t\t\t\t\tshareWithTitle += ')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar share = this.model.get('shares')[shareIndex];\n\t\t\tvar password = share.password;\n\t\t\tvar hasPassword = password !== null && password !== '';\n\t\t\tvar sendPasswordByTalk = share.send_password_by_talk;\n\n\t\t\tvar shareNote = this.model.getNote(shareIndex);\n\n\t\t\treturn _.extend(hasPermissionOverride, {\n\t\t\t\tcid: this.cid,\n\t\t\t\thasSharePermission: this.model.hasSharePermission(shareIndex),\n\t\t\t\teditPermissionState: this.model.editPermissionState(shareIndex),\n\t\t\t\thasCreatePermission: this.model.hasCreatePermission(shareIndex),\n\t\t\t\thasUpdatePermission: this.model.hasUpdatePermission(shareIndex),\n\t\t\t\thasDeletePermission: this.model.hasDeletePermission(shareIndex),\n\t\t\t\tsharedBy: sharedBy,\n\t\t\t\tsharedByDisplayName: sharedByDisplayName,\n\t\t\t\tshareWith: shareWith,\n\t\t\t\tshareWithDisplayName: shareWithDisplayName,\n\t\t\t\tshareWithAvatar: shareWithAvatar,\n\t\t\t\tshareWithTitle: shareWithTitle,\n\t\t\t\tshareType: shareType,\n\t\t\t\tshareId: this.model.get('shares')[shareIndex].id,\n\t\t\t\tmodSeed: shareWithAvatar || (shareType !== OC.Share.SHARE_TYPE_USER && shareType !== OC.Share.SHARE_TYPE_CIRCLE && shareType !== OC.Share.SHARE_TYPE_ROOM),\n\t\t\t\towner: fileOwnerUid,\n\t\t\t\tisShareWithCurrentUser: (shareType === OC.Share.SHARE_TYPE_USER && shareWith === oc_current_user),\n\t\t\t\tcanUpdateShareSettings: (sharedBy === oc_current_user || fileOwnerUid === oc_current_user),\n\t\t\t\tisRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE,\n\t\t\t\tisRemoteGroupShare: shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP,\n\t\t\t\tisNoteAvailable: shareType !== OC.Share.SHARE_TYPE_REMOTE && shareType !== OC.Share.SHARE_TYPE_REMOTE_GROUP,\n\t\t\t\tisMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL,\n\t\t\t\tisCircleShare: shareType === OC.Share.SHARE_TYPE_CIRCLE,\n\t\t\t\tisFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder(),\n\t\t\t\tisPasswordSet: hasPassword && !sendPasswordByTalk,\n\t\t\t\tisPasswordByTalkSet: hasPassword && sendPasswordByTalk,\n\t\t\t\tisTalkEnabled: oc_appswebroots['spreed'] !== undefined,\n\t\t\t\tsecureDropMode: !this.model.hasReadPermission(shareIndex),\n\t\t\t\thasExpireDate: this.model.getExpireDate(shareIndex) !== null,\n\t\t\t\tshareNote: shareNote,\n\t\t\t\thasNote: shareNote !== '',\n\t\t\t\texpireDate: moment(this.model.getExpireDate(shareIndex), 'YYYY-MM-DD').format('DD-MM-YYYY'),\n\t\t\t\t// The password placeholder does not take into account if\n\t\t\t\t// sending the password by Talk is enabled or not; when\n\t\t\t\t// switching from sending the password by Talk to sending the\n\t\t\t\t// password by email the password is reused and the share\n\t\t\t\t// updated, so the placeholder already shows the password in the\n\t\t\t\t// brief time between disabling sending the password by email\n\t\t\t\t// and receiving the updated share.\n\t\t\t\tpasswordPlaceholder: hasPassword ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,\n\t\t\t\tpasswordByTalkPlaceholder: (hasPassword && sendPasswordByTalk)? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE,\n\t\t\t});\n\t\t},\n\n\t\tgetShareProperties: function() {\n\t\t\treturn {\n\t\t\t\tunshareLabel: t('core', 'Unshare'),\n\t\t\t\taddNoteLabel: t('core', 'Note to recipient'),\n\t\t\t\tcanShareLabel: t('core', 'Can reshare'),\n\t\t\t\tcanEditLabel: t('core', 'Can edit'),\n\t\t\t\tcreatePermissionLabel: t('core', 'Can create'),\n\t\t\t\tupdatePermissionLabel: t('core', 'Can change'),\n\t\t\t\tdeletePermissionLabel: t('core', 'Can delete'),\n\t\t\t\tsecureDropLabel: t('core', 'File drop (upload only)'),\n\t\t\t\texpireDateLabel: t('core', 'Set expiration date'),\n\t\t\t\tpasswordLabel: t('core', 'Password protect'),\n\t\t\t\tpasswordByTalkLabel: t('core', 'Password protect by Talk'),\n\t\t\t\tcrudsLabel: t('core', 'Access control'),\n\t\t\t\texpirationDatePlaceholder: t('core', 'Expiration date'),\n\t\t\t\tdefaultExpireDate: moment().add(1, 'day').format('DD-MM-YYYY'), // Can't expire today\n\t\t\t\ttriangleSImage: OC.imagePath('core', 'actions/triangle-s'),\n\t\t\t\tisResharingAllowed: this.configModel.get('isResharingAllowed'),\n\t\t\t\tisPasswordForMailSharesRequired: this.configModel.get('isPasswordForMailSharesRequired'),\n\t\t\t\tsharePermissionPossible: this.model.sharePermissionPossible(),\n\t\t\t\teditPermissionPossible: this.model.editPermissionPossible(),\n\t\t\t\tcreatePermissionPossible: this.model.createPermissionPossible(),\n\t\t\t\tupdatePermissionPossible: this.model.updatePermissionPossible(),\n\t\t\t\tdeletePermissionPossible: this.model.deletePermissionPossible(),\n\t\t\t\tsharePermission: OC.PERMISSION_SHARE,\n\t\t\t\tcreatePermission: OC.PERMISSION_CREATE,\n\t\t\t\tupdatePermission: OC.PERMISSION_UPDATE,\n\t\t\t\tdeletePermission: OC.PERMISSION_DELETE,\n\t\t\t\treadPermission: OC.PERMISSION_READ,\n\t\t\t\tisFolder: this.model.isFolder()\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * get an array of sharees' share properties\n\t\t *\n\t\t * @returns {Array}\n\t\t */\n\t\tgetShareeList: function() {\n\t\t\tvar universal = this.getShareProperties();\n\n\t\t\tif(!this.model.hasUserShares()) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tvar shares = this.model.get('shares');\n\t\t\tvar list = [];\n\t\t\tfor(var index = 0; index < shares.length; index++) {\n\t\t\t\tvar share = this.getShareeObject(index);\n\n\t\t\t\tif (share.shareType === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// first empty {} is necessary, otherwise we get in trouble\n\t\t\t\t// with references\n\t\t\t\tlist.push(_.extend({}, universal, share));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t},\n\n\t\tgetLinkReshares: function() {\n\t\t\tvar universal = {\n\t\t\t\tunshareLabel: t('core', 'Unshare'),\n\t\t\t};\n\n\t\t\tif(!this.model.hasUserShares()) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tvar shares = this.model.get('shares');\n\t\t\tvar list = [];\n\t\t\tfor(var index = 0; index < shares.length; index++) {\n\t\t\t\tvar share = this.getShareeObject(index);\n\n\t\t\t\tif (share.shareType !== OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// first empty {} is necessary, otherwise we get in trouble\n\t\t\t\t// with references\n\t\t\t\tlist.push(_.extend({}, universal, share, {\n\t\t\t\t\tshareInitiator: shares[index].uid_owner,\n\t\t\t\t\tshareInitiatorText: t('core', '{shareInitiatorDisplayName} shared via link', {shareInitiatorDisplayName: shares[index].displayname_owner})\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\treturn list;\n\t\t},\n\n\t\trender: function() {\n\t\t\tif(!this._renderPermissionChange) {\n\t\t\t\tthis.$el.html(this.template({\n\t\t\t\t\tcid: this.cid,\n\t\t\t\t\tsharees: this.getShareeList(),\n\t\t\t\t\tlinkReshares: this.getLinkReshares()\n\t\t\t\t}));\n\n\t\t\t\tthis.$('.avatar').each(function () {\n\t\t\t\t\tvar $this = $(this);\n\n\t\t\t\t\tif ($this.hasClass('imageplaceholderseed')) {\n\t\t\t\t\t\t$this.css({width: 32, height: 32});\n\t\t\t\t\t\tif ($this.data('avatar')) {\n\t\t\t\t\t\t\t$this.css('border-radius', '0%');\n\t\t\t\t\t\t\t$this.css('background', 'url(' + $this.data('avatar') + ') no-repeat');\n\t\t\t\t\t\t\t$this.css('background-size', '31px');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.imageplaceholder($this.data('seed'));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// user, size, ie8fix, hidedefault, callback, displayname\n\t\t\t\t\t\t$this.avatar($this.data('username'), 32, undefined, undefined, undefined, $this.data('displayname'));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tthis.$('.has-tooltip').tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\n\t\t\t\tthis.$('ul.shareWithList > li').each(function() {\n\t\t\t\t\tvar $this = $(this);\n\n\t\t\t\t\tvar shareWith = $this.data('share-with');\n\t\t\t\t\tvar shareType = $this.data('share-type');\n\n\t\t\t\t\t$this.find('div.avatar, span.username').contactsMenu(shareWith, shareType, $this);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tvar permissionChangeShareId = parseInt(this._renderPermissionChange, 10);\n\t\t\t\tvar shareWithIndex = this.model.findShareWithIndex(permissionChangeShareId);\n\t\t\t\tvar sharee = this.getShareeObject(shareWithIndex);\n\t\t\t\t$.extend(sharee, this.getShareProperties());\n\t\t\t\tvar $li = this.$('li[data-share-id=' + permissionChangeShareId + ']');\n\t\t\t\t$li.find('.sharingOptionsGroup .popovermenu').replaceWith(this.popoverMenuTemplate(sharee));\n\t\t\t}\n\n\t\t\tvar _this = this;\n\t\t\tthis.getShareeList().forEach(function(sharee) {\n\t\t\t\tvar $edit = _this.$('#canEdit-' + _this.cid + '-' + sharee.shareId);\n\t\t\t\tif($edit.length === 1) {\n\t\t\t\t\t$edit.prop('checked', sharee.editPermissionState === 'checked');\n\t\t\t\t\tif (sharee.isFolder) {\n\t\t\t\t\t\t$edit.prop('indeterminate', sharee.editPermissionState === 'indeterminate');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.$('.popovermenu').on('afterHide', function() {\n\t\t\t\t_this._menuOpen = false;\n\t\t\t});\n\t\t\tthis.$('.popovermenu').on('beforeHide', function() {\n\t\t\t\tvar shareId = parseInt(_this._menuOpen, 10);\n\t\t\t\tif(!_.isNaN(shareId)) {\n\t\t\t\t\tvar datePickerClass = '.expirationDateContainer-' + _this.cid + '-' + shareId;\n\t\t\t\t\tvar datePickerInput = '#expirationDatePicker-' + _this.cid + '-' + shareId;\n\t\t\t\t\tvar expireDateCheckbox = '#expireDate-' + _this.cid + '-' + shareId;\n\t\t\t\t\tif ($(expireDateCheckbox).prop('checked')) {\n\t\t\t\t\t\t$(datePickerInput).removeClass('hidden-visually');\n\t\t\t\t\t\t$(datePickerClass).removeClass('hasDatepicker');\n\t\t\t\t\t\t$(datePickerClass + ' .ui-datepicker').hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (this._menuOpen !== false) {\n\t\t\t\t// Open menu again if it was opened before\n\t\t\t\tvar shareId = parseInt(this._menuOpen, 10);\n\t\t\t\tif(!_.isNaN(shareId)) {\n\t\t\t\t\tvar liSelector = 'li[data-share-id=' + shareId + ']';\n\t\t\t\t\tOC.showMenu(null, this.$(liSelector + ' .sharingOptionsGroup .popovermenu'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._renderPermissionChange = false;\n\n\t\t\t// new note autosize\n\t\t\tautosize(this.$el.find('.share-note-form .share-note'));\n\n\t\t\tthis.delegateEvents();\n\n\t\t\treturn this;\n\t\t},\n\n\t\t/**\n\t\t * @returns {Function} from Handlebars\n\t\t * @private\n\t\t */\n\t\ttemplate: function (data) {\n\t\t\tvar sharees = data.sharees;\n\t\t\tif(_.isArray(sharees)) {\n\t\t\t\tfor (var i = 0; i < sharees.length; i++) {\n\t\t\t\t\tdata.sharees[i].popoverMenu = this.popoverMenuTemplate(sharees[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn OC.Share.Templates['sharedialogshareelistview'](data);\n\t\t},\n\n\t\t/**\n\t\t * renders the popover template and returns the resulting HTML\n\t\t *\n\t\t * @param {Object} data\n\t\t * @returns {string}\n\t\t */\n\t\tpopoverMenuTemplate: function(data) {\n\t\t\treturn OC.Share.Templates['sharedialogshareelistview_popover_menu'](data);\n\t\t},\n\n\t\tshowNoteForm: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $menu = $element.closest('li');\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\n\t\t\t// show elements\n\t\t\t$menu.find('.share-note-delete').toggleClass('hidden');\n\t\t\t$form.toggleClass('hidden');\n\t\t\t$form.find('textarea').focus();\n\t\t},\n\n\t\tdeleteNote: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $menu = $element.closest('li');\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\n\t\t\tconsole.log($form.find('.share-note'));\n\t\t\t$form.find('.share-note').val('');\n\t\t\t\n\t\t\t$form.addClass('hidden');\n\t\t\t$menu.find('.share-note-delete').addClass('hidden');\n\n\t\t\tself.sendNote('', shareId, $menu);\n\t\t},\n\n\t\tupdateNote: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\t\t\tvar $form = $element.closest('li.share-note-form');\n\t\t\tvar $menu = $form.prev('li');\n\t\t\tvar message = $form.find('.share-note').val().trim();\n\n\t\t\tif (message.length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.sendNote(message, shareId, $menu);\n\n\t\t},\n\n\t\tsendNote: function(note, shareId, $menu) {\n\t\t\tvar $form = $menu.next('li.share-note-form');\n\t\t\tvar $submit = $form.find('input.share-note-submit');\n\t\t\tvar $error = $form.find('input.share-note-error');\n\n\t\t\t$submit.prop('disabled', true);\n\t\t\t$menu.find('.icon-loading-small').removeClass('hidden');\n\t\t\t$menu.find('.icon-edit').hide();\n\n\t\t\tvar complete = function() {\n\t\t\t\t$submit.prop('disabled', false);\n\t\t\t\t$menu.find('.icon-loading-small').addClass('hidden');\n\t\t\t\t$menu.find('.icon-edit').show();\n\t\t\t};\n\t\t\tvar error = function() {\n\t\t\t\t$error.show();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$error.hide();\n\t\t\t\t}, 3000);\n\t\t\t};\n\n\t\t\t// send data\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares',2) + shareId + '?' + OC.buildQueryString({format: 'json'}),\n\t\t\t\tdata: { note: note },\n\t\t\t\tcomplete : complete,\n\t\t\t\terror: error\n\t\t\t});\n\t\t},\n\n\t\tonUnshare: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar self = this;\n\t\t\tvar $element = $(event.target);\n\t\t\tif (!$element.is('a')) {\n\t\t\t\t$element = $element.closest('a');\n\t\t\t}\n\n\t\t\tvar $loading = $element.find('.icon-loading-small').eq(0);\n\t\t\tif(!$loading.hasClass('hidden')) {\n\t\t\t\t// in process\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$loading.removeClass('hidden');\n\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\n\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\tself.model.removeShare(shareId)\n\t\t\t\t.done(function() {\n\t\t\t\t\t$li.remove();\n\t\t\t\t})\n\t\t\t\t.fail(function() {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'Could not unshare'));\n\t\t\t\t});\n\t\t\treturn false;\n\t\t},\n\n\t\tonToggleMenu: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar $menu = $li.find('.sharingOptionsGroup .popovermenu');\n\n\t\t\tOC.showMenu(null, $menu);\n\t\t\tthis._menuOpen = $li.data('share-id');\n\t\t},\n\n\t\tonExpireDateChange: function(event) {\n\t\t\tvar $element = $(event.target);\n\t\t\tvar li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar datePickerClass = '.expirationDateContainer-' + this.cid + '-' + shareId;\n\t\t\tvar datePicker = $(datePickerClass);\n\t\t\tvar state = $element.prop('checked');\n\t\t\tdatePicker.toggleClass('hidden', !state);\n\t\t\tif (!state) {\n\t\t\t\t// disabled, let's hide the input and\n\t\t\t\t// set the expireDate to nothing\n\t\t\t\t$element.closest('li').next('li').addClass('hidden');\n\t\t\t\tthis.setExpirationDate(shareId, '');\n\t\t\t} else {\n\t\t\t\t// enabled, show the input and the datepicker\n\t\t\t\t$element.closest('li').next('li').removeClass('hidden');\n\t\t\t\tthis.showDatePicker(event);\n\n\t\t\t}\n\t\t},\n\n\t\tshowDatePicker: function(event) {\n\t\t\tvar element = $(event.target);\n\t\t\tvar li = element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar expirationDatePicker = '#expirationDatePicker-' + this.cid + '-' + shareId;\n\t\t\tvar view = this;\n\t\t\t$(expirationDatePicker).datepicker({\n\t\t\t\tdateFormat : 'dd-mm-yy',\n\t\t\t\tonSelect: function (expireDate) {\n\t\t\t\t\tview.setExpirationDate(shareId, expireDate);\n\t\t\t\t}\n\t\t\t});\n\t\t\t$(expirationDatePicker).focus();\n\n\t\t},\n\n\t\tsetExpirationDate: function(shareId, expireDate) {\n\t\t\tthis.model.updateShare(shareId, {expireDate: expireDate}, {});\n\t\t},\n\n\t\tonMailSharePasswordProtectChange: function(event) {\n\t\t\tvar element = $(event.target);\n\t\t\tvar li = element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar passwordContainerClass = '.passwordMenu-' + this.cid + '-' + shareId;\n\t\t\tvar passwordContainer = $(passwordContainerClass);\n\t\t\tvar loading = this.$el.find(passwordContainerClass + ' .icon-loading-small');\n\t\t\tvar inputClass = '#passwordField-' + this.cid + '-' + shareId;\n\t\t\tvar passwordField = $(inputClass);\n\t\t\tvar state = element.prop('checked');\n\t\t\tvar passwordByTalkElement = $('#passwordByTalk-' + this.cid + '-' + shareId);\n\t\t\tvar passwordByTalkState = passwordByTalkElement.prop('checked');\n\t\t\tif (!state && !passwordByTalkState) {\n\t\t\t\tthis.model.updateShare(shareId, {password: '', sendPasswordByTalk: false});\n\t\t\t\tpasswordField.attr('value', '');\n\t\t\t\tpasswordField.removeClass('error');\n\t\t\t\tpasswordField.tooltip('hide');\n\t\t\t\tloading.addClass('hidden');\n\t\t\t\tpasswordField.attr('placeholder', PASSWORD_PLACEHOLDER_MESSAGE);\n\t\t\t\t// We first need to reset the password field before we hide it\n\t\t\t\tpasswordContainer.toggleClass('hidden', !state);\n\t\t\t} else if (state) {\n\t\t\t\tif (passwordByTalkState) {\n\t\t\t\t\t// Switching from sending the password by Talk to sending\n\t\t\t\t\t// the password by mail can be done keeping the previous\n\t\t\t\t\t// password sent by Talk.\n\t\t\t\t\tthis.model.updateShare(shareId, {sendPasswordByTalk: false});\n\n\t\t\t\t\tvar passwordByTalkContainerClass = '.passwordByTalkMenu-' + this.cid + '-' + shareId;\n\t\t\t\t\tvar passwordByTalkContainer = $(passwordByTalkContainerClass);\n\t\t\t\t\tpasswordByTalkContainer.addClass('hidden');\n\t\t\t\t\tpasswordByTalkElement.prop('checked', false);\n\t\t\t\t}\n\n\t\t\t\tpasswordContainer.toggleClass('hidden', !state);\n\t\t\t\tpasswordField = '#passwordField-' + this.cid + '-' + shareId;\n\t\t\t\tthis.$(passwordField).focus();\n\t\t\t}\n\t\t},\n\n\t\tonMailSharePasswordProtectByTalkChange: function(event) {\n\t\t\tvar element = $(event.target);\n\t\t\tvar li = element.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar passwordByTalkContainerClass = '.passwordByTalkMenu-' + this.cid + '-' + shareId;\n\t\t\tvar passwordByTalkContainer = $(passwordByTalkContainerClass);\n\t\t\tvar loading = this.$el.find(passwordByTalkContainerClass + ' .icon-loading-small');\n\t\t\tvar inputClass = '#passwordByTalkField-' + this.cid + '-' + shareId;\n\t\t\tvar passwordByTalkField = $(inputClass);\n\t\t\tvar state = element.prop('checked');\n\t\t\tvar passwordElement = $('#password-' + this.cid + '-' + shareId);\n\t\t\tvar passwordState = passwordElement.prop('checked');\n\t\t\tif (!state) {\n\t\t\t\tthis.model.updateShare(shareId, {password: '', sendPasswordByTalk: false});\n\t\t\t\tpasswordByTalkField.attr('value', '');\n\t\t\t\tpasswordByTalkField.removeClass('error');\n\t\t\t\tpasswordByTalkField.tooltip('hide');\n\t\t\t\tloading.addClass('hidden');\n\t\t\t\tpasswordByTalkField.attr('placeholder', PASSWORD_PLACEHOLDER_MESSAGE);\n\t\t\t\t// We first need to reset the password field before we hide it\n\t\t\t\tpasswordByTalkContainer.toggleClass('hidden', !state);\n\t\t\t} else if (state) {\n\t\t\t\tif (passwordState) {\n\t\t\t\t\t// Enabling sending the password by Talk requires a new\n\t\t\t\t\t// password to be given (the one sent by mail is not reused,\n\t\t\t\t\t// as it would defeat the purpose of checking the identity\n\t\t\t\t\t// of the sharee by Talk if it was already sent by mail), so\n\t\t\t\t\t// the share is not updated until the user explicitly gives\n\t\t\t\t\t// the new password.\n\n\t\t\t\t\tvar passwordContainerClass = '.passwordMenu-' + this.cid + '-' + shareId;\n\t\t\t\t\tvar passwordContainer = $(passwordContainerClass);\n\t\t\t\t\tpasswordContainer.addClass('hidden');\n\t\t\t\t\tpasswordElement.prop('checked', false);\n\t\t\t\t}\n\n\t\t\t\tpasswordByTalkContainer.toggleClass('hidden', !state);\n\t\t\t\tpasswordByTalkField = '#passwordByTalkField-' + this.cid + '-' + shareId;\n\t\t\t\tthis.$(passwordByTalkField).focus();\n\t\t\t}\n\t\t},\n\n\t\tonMailSharePasswordKeyUp: function(event) {\n\t\t\tif(event.keyCode === 13) {\n\t\t\t\tthis.onMailSharePasswordEntered(event);\n\t\t\t}\n\t\t},\n\n\t\tonMailSharePasswordEntered: function(event) {\n\t\t\tvar passwordField = $(event.target);\n\t\t\tvar li = passwordField.closest('li[data-share-id]');\n\t\t\tvar shareId = li.data('share-id');\n\t\t\tvar passwordContainerClass = '.passwordMenu-' + this.cid + '-' + shareId;\n\t\t\tvar passwordByTalkContainerClass = '.passwordByTalkMenu-' + this.cid + '-' + shareId;\n\t\t\tvar sendPasswordByTalk = passwordField.attr('id').startsWith('passwordByTalk');\n\t\t\tvar loading;\n\t\t\tif (sendPasswordByTalk) {\n\t\t\t\tloading = this.$el.find(passwordByTalkContainerClass + ' .icon-loading-small');\n\t\t\t} else {\n\t\t\t\tloading = this.$el.find(passwordContainerClass + ' .icon-loading-small');\n\t\t\t}\n\t\t\tif (!loading.hasClass('hidden')) {\n\t\t\t\t// still in process\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tpasswordField.removeClass('error');\n\t\t\tvar password = passwordField.val();\n\t\t\t// in IE9 the password might be the placeholder due to bugs in the placeholders polyfill\n\t\t\tif(password === '' || password === PASSWORD_PLACEHOLDER || password === PASSWORD_PLACEHOLDER_MESSAGE) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tloading\n\t\t\t\t.removeClass('hidden')\n\t\t\t\t.addClass('inlineblock');\n\n\n\t\t\tthis.model.updateShare(shareId, {\n\t\t\t\tpassword: password,\n\t\t\t\tsendPasswordByTalk: sendPasswordByTalk\n\t\t\t}, {\n\t\t\t\terror: function(model, msg) {\n\t\t\t\t\t// destroy old tooltips\n\t\t\t\t\tpasswordField.tooltip('destroy');\n\t\t\t\t\tloading.removeClass('inlineblock').addClass('hidden');\n\t\t\t\t\tpasswordField.addClass('error');\n\t\t\t\t\tpasswordField.attr('title', msg);\n\t\t\t\t\tpasswordField.tooltip({placement: 'bottom', trigger: 'manual'});\n\t\t\t\t\tpasswordField.tooltip('show');\n\t\t\t\t},\n\t\t\t\tsuccess: function(model, msg) {\n\t\t\t\t\tpasswordField.blur();\n\t\t\t\t\tpasswordField.attr('value', '');\n\t\t\t\t\tpasswordField.attr('placeholder', PASSWORD_PLACEHOLDER);\n\t\t\t\t\tloading.removeClass('inlineblock').addClass('hidden');\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tonPermissionChange: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\tvar permissions = OC.PERMISSION_READ;\n\n\t\t\tif (this.model.isFolder()) {\n\t\t\t\t// adjust checkbox states\n\t\t\t\tvar $checkboxes = $('.permissions', $li).not('input[name=\"edit\"]').not('input[name=\"share\"]');\n\t\t\t\tvar checked;\n\t\t\t\tif ($element.attr('name') === 'edit') {\n\t\t\t\t\tchecked = $element.is(':checked');\n\t\t\t\t\t// Check/uncheck Create, Update, and Delete checkboxes if Edit is checked/unck\n\t\t\t\t\t$($checkboxes).prop('checked', checked);\n\t\t\t\t\tif (checked) {\n\t\t\t\t\t\tpermissions |= OC.PERMISSION_CREATE | OC.PERMISSION_UPDATE | OC.PERMISSION_DELETE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar numberChecked = $checkboxes.filter(':checked').length;\n\t\t\t\t\tchecked = numberChecked === $checkboxes.length;\n\t\t\t\t\tvar $editCb = $('input[name=\"edit\"]', $li);\n\t\t\t\t\t$editCb.prop('checked', checked);\n\t\t\t\t\t$editCb.prop('indeterminate', !checked && numberChecked > 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($('input[name=\"edit\"]', $li).is(':checked')) {\n\t\t\t\t\tpermissions |= OC.PERMISSION_UPDATE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$('.permissions', $li).not('input[name=\"edit\"]').filter(':checked').each(function(index, checkbox) {\n\t\t\t\tpermissions |= $(checkbox).data('permissions');\n\t\t\t});\n\n\n\t\t\t/** disable checkboxes during save operation to avoid race conditions **/\n\t\t\t$li.find('input[type=checkbox]').prop('disabled', true);\n\t\t\tvar enableCb = function() {\n\t\t\t\t$li.find('input[type=checkbox]').prop('disabled', false);\n\t\t\t};\n\t\t\tvar errorCb = function(elem, msg) {\n\t\t\t\tOC.dialogs.alert(msg, t('core', 'Error while sharing'));\n\t\t\t\tenableCb();\n\t\t\t};\n\n\t\t\tthis.model.updateShare(shareId, {permissions: permissions}, {error: errorCb, success: enableCb});\n\n\t\t\tthis._renderPermissionChange = shareId;\n\t\t},\n\n\t\tonSecureDropChange: function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tvar $element = $(event.target);\n\t\t\tvar $li = $element.closest('li[data-share-id]');\n\t\t\tvar shareId = $li.data('share-id');\n\n\t\t\tvar permissions = OC.PERMISSION_CREATE | OC.PERMISSION_UPDATE | OC.PERMISSION_DELETE | OC.PERMISSION_READ;\n\t\t\tif ($element.is(':checked')) {\n\t\t\t\tpermissions = OC.PERMISSION_CREATE | OC.PERMISSION_UPDATE | OC.PERMISSION_DELETE;\n\t\t\t}\n\n\t\t\t/** disable checkboxes during save operation to avoid race conditions **/\n\t\t\t$li.find('input[type=checkbox]').prop('disabled', true);\n\t\t\tvar enableCb = function() {\n\t\t\t\t$li.find('input[type=checkbox]').prop('disabled', false);\n\t\t\t};\n\t\t\tvar errorCb = function(elem, msg) {\n\t\t\t\tOC.dialogs.alert(msg, t('core', 'Error while sharing'));\n\t\t\t\tenableCb();\n\t\t\t};\n\n\t\t\tthis.model.updateShare(shareId, {permissions: permissions}, {error: errorCb, success: enableCb});\n\n\t\t\tthis._renderPermissionChange = shareId;\n\t\t}\n\n\t});\n\n\tOC.Share.ShareDialogShareeListView = ShareDialogShareeListView;\n\n})();\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* globals Handlebars */\n\n(function() {\n\tif(!OC.Share) {\n\t\tOC.Share = {};\n\t}\n\n\t/**\n\t * @class OCA.Share.ShareDialogView\n\t * @member {OC.Share.ShareItemModel} model\n\t * @member {jQuery} $el\n\t * @memberof OCA.Sharing\n\t * @classdesc\n\t *\n\t * Represents the GUI of the share dialogue\n\t *\n\t */\n\tvar ShareDialogView = OC.Backbone.View.extend({\n\t\t/** @type {Object} **/\n\t\t_templates: {},\n\n\t\t/** @type {boolean} **/\n\t\t_showLink: true,\n\n\t\t_lookup: false,\n\n\t\t_lookupAllowed: false,\n\n\t\t/** @type {string} **/\n\t\ttagName: 'div',\n\n\t\t/** @type {OC.Share.ShareConfigModel} **/\n\t\tconfigModel: undefined,\n\n\t\t/** @type {object} **/\n\t\tresharerInfoView: undefined,\n\n\t\t/** @type {object} **/\n\t\tlinkShareView: undefined,\n\n\t\t/** @type {object} **/\n\t\tshareeListView: undefined,\n\n\t\t/** @type {object} **/\n\t\t_lastSuggestions: undefined,\n\n\t\t/** @type {object} **/\n\t\t_lastRecommendations: undefined,\n\n\t\t/** @type {int} **/\n\t\t_pendingOperationsCount: 0,\n\n\t\tevents: {\n\t\t\t'focus .shareWithField': 'onShareWithFieldFocus',\n\t\t\t'input .shareWithField': 'onShareWithFieldChanged',\n\t\t\t'click .shareWithConfirm': '_confirmShare'\n\t\t},\n\n\t\tinitialize: function(options) {\n\t\t\tvar view = this;\n\n\t\t\tthis.model.on('fetchError', function() {\n\t\t\t\tOC.Notification.showTemporary(t('core', 'Share details could not be loaded for this item.'));\n\t\t\t});\n\n\t\t\tif(!_.isUndefined(options.configModel)) {\n\t\t\t\tthis.configModel = options.configModel;\n\t\t\t} else {\n\t\t\t\tthrow 'missing OC.Share.ShareConfigModel';\n\t\t\t}\n\n\t\t\tthis.configModel.on('change:isRemoteShareAllowed', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\t\t\tthis.configModel.on('change:isRemoteGroupShareAllowed', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\t\t\tthis.model.on('change:permissions', function() {\n\t\t\t\tview.render();\n\t\t\t});\n\n\t\t\tthis.model.on('request', this._onRequest, this);\n\t\t\tthis.model.on('sync', this._onEndRequest, this);\n\n\t\t\tvar subViewOptions = {\n\t\t\t\tmodel: this.model,\n\t\t\t\tconfigModel: this.configModel\n\t\t\t};\n\n\t\t\tvar subViews = {\n\t\t\t\tresharerInfoView: 'ShareDialogResharerInfoView',\n\t\t\t\tlinkShareView: 'ShareDialogLinkShareView',\n\t\t\t\tshareeListView: 'ShareDialogShareeListView'\n\t\t\t};\n\n\t\t\tfor(var name in subViews) {\n\t\t\t\tvar className = subViews[name];\n\t\t\t\tthis[name] = _.isUndefined(options[name])\n\t\t\t\t\t? new OC.Share[className](subViewOptions)\n\t\t\t\t\t: options[name];\n\t\t\t}\n\n\t\t\t_.bindAll(this,\n\t\t\t\t'autocompleteHandler',\n\t\t\t\t'_onSelectRecipient',\n\t\t\t\t'onShareWithFieldChanged',\n\t\t\t\t'onShareWithFieldFocus'\n\t\t\t);\n\n\t\t\tOC.Plugins.attach('OC.Share.ShareDialogView', this);\n\t\t},\n\n\t\tonShareWithFieldChanged: function() {\n\t\t\tvar $el = this.$el.find('.shareWithField');\n\t\t\tif ($el.val().length < 2) {\n\t\t\t\t$el.removeClass('error').tooltip('hide');\n\t\t\t}\n\t\t},\n\n\t\t/* trigger search after the field was re-selected */\n\t\tonShareWithFieldFocus: function() {\n\t\t\tvar $shareWithField = this.$el.find('.shareWithField');\n\t\t\t$shareWithField.autocomplete(\"search\", $shareWithField.val());\n\t\t},\n\n\t\t_getSuggestions: function(searchTerm, perPage, model, lookup) {\n\t\t\tif (this._lastSuggestions &&\n\t\t\t\tthis._lastSuggestions.searchTerm === searchTerm &&\n\t\t\t\tthis._lastSuggestions.lookup === lookup &&\n\t\t\t\tthis._lastSuggestions.perPage === perPage &&\n\t\t\t\tthis._lastSuggestions.model === model) {\n\t\t\t\treturn this._lastSuggestions.promise;\n\t\t\t}\n\n\t\t\tvar deferred = $.Deferred();\n\t\t\tvar view = this;\n\n\t\t\t// query lookup GS by default if enabled\n\t\t\tvar capabilities = OC.getCapabilities()\n\t\t\tif (capabilities.files_sharing\n\t\t\t\t&& capabilities.files_sharing.sharee\n\t\t\t\t&& capabilities.files_sharing.sharee.query_lookup_default) {\n\t\t\t\t\tthis._lookup = true;\n\t\t\t}\n\n\t\t\t$.get(\n\t\t\t\tOC.linkToOCS('apps/files_sharing/api/v1') + 'sharees',\n\t\t\t\t{\n\t\t\t\t\tformat: 'json',\n\t\t\t\t\tsearch: searchTerm,\n\t\t\t\t\tlookup: lookup,\n\t\t\t\t\tperPage: perPage,\n\t\t\t\t\titemType: model.get('itemType')\n\t\t\t\t},\n\t\t\t\tfunction (result) {\n\t\t\t\t\tif (result.ocs.meta.statuscode === 100) {\n\t\t\t\t\t\tvar filter = function(users, groups, remotes, remote_groups, emails, circles, rooms) {\n\t\t\t\t\t\t\tif (typeof(emails) === 'undefined') {\n\t\t\t\t\t\t\t\temails = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof(circles) === 'undefined') {\n\t\t\t\t\t\t\t\tcircles = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof(rooms) === 'undefined') {\n\t\t\t\t\t\t\t\trooms = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar usersLength;\n\t\t\t\t\t\t\tvar groupsLength;\n\t\t\t\t\t\t\tvar remotesLength;\n\t\t\t\t\t\t\tvar remoteGroupsLength;\n\t\t\t\t\t\t\tvar emailsLength;\n\t\t\t\t\t\t\tvar circlesLength;\n\t\t\t\t\t\t\tvar roomsLength;\n\n\t\t\t\t\t\t\tvar i, j;\n\n\t\t\t\t\t\t\t//Filter out the current user\n\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\tfor (i = 0; i < usersLength; i++) {\n\t\t\t\t\t\t\t\tif (users[i].value.shareWith === OC.currentUser) {\n\t\t\t\t\t\t\t\t\tusers.splice(i, 1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Filter out the owner of the share\n\t\t\t\t\t\t\tif (model.hasReshare()) {\n\t\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\t\tfor (i = 0 ; i < usersLength; i++) {\n\t\t\t\t\t\t\t\t\tif (users[i].value.shareWith === model.getReshareOwner()) {\n\t\t\t\t\t\t\t\t\t\tusers.splice(i, 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar shares = model.get('shares');\n\t\t\t\t\t\t\tvar sharesLength = shares.length;\n\n\t\t\t\t\t\t\t// Now filter out all sharees that are already shared with\n\t\t\t\t\t\t\tfor (i = 0; i < sharesLength; i++) {\n\t\t\t\t\t\t\t\tvar share = shares[i];\n\n\t\t\t\t\t\t\t\tif (share.share_type === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < usersLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (users[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tusers.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\t\t\t\tgroupsLength = groups.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < groupsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (groups[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tgroups.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\t\t\t\t\t\tremotesLength = remotes.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < remotesLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (remotes[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tremotes.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\t\t\t\t\t\tremoteGroupsLength = remote_groups.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < remoteGroupsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (remote_groups[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tremote_groups.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\t\t\t\t\t\temailsLength = emails.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < emailsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (emails[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\temails.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\t\t\t\t\t\tcirclesLength = circles.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < circlesLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (circles[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tcircles.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\t\t\t\t\t\troomsLength = rooms.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < roomsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (rooms[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\trooms.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfilter(\n\t\t\t\t\t\t\tresult.ocs.data.exact.users,\n\t\t\t\t\t\t\tresult.ocs.data.exact.groups,\n\t\t\t\t\t\t\tresult.ocs.data.exact.remotes,\n\t\t\t\t\t\t\tresult.ocs.data.exact.remote_groups,\n\t\t\t\t\t\t\tresult.ocs.data.exact.emails,\n\t\t\t\t\t\t\tresult.ocs.data.exact.circles,\n\t\t\t\t\t\t\tresult.ocs.data.exact.rooms\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tvar exactUsers = result.ocs.data.exact.users;\n\t\t\t\t\t\tvar exactGroups = result.ocs.data.exact.groups;\n\t\t\t\t\t\tvar exactRemotes = result.ocs.data.exact.remotes;\n\t\t\t\t\t\tvar exactRemoteGroups = result.ocs.data.exact.remote_groups;\n\t\t\t\t\t\tvar exactEmails = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.emails) !== 'undefined') {\n\t\t\t\t\t\t\texactEmails = result.ocs.data.exact.emails;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar exactCircles = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.circles) !== 'undefined') {\n\t\t\t\t\t\t\texactCircles = result.ocs.data.exact.circles;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar exactRooms = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.rooms) !== 'undefined') {\n\t\t\t\t\t\t\texactRooms = result.ocs.data.exact.rooms;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactRemoteGroups).concat(exactEmails).concat(exactCircles).concat(exactRooms);\n\n\t\t\t\t\t\tfilter(\n\t\t\t\t\t\t\tresult.ocs.data.users,\n\t\t\t\t\t\t\tresult.ocs.data.groups,\n\t\t\t\t\t\t\tresult.ocs.data.remotes,\n\t\t\t\t\t\t\tresult.ocs.data.remote_groups,\n\t\t\t\t\t\t\tresult.ocs.data.emails,\n\t\t\t\t\t\t\tresult.ocs.data.circles,\n\t\t\t\t\t\t\tresult.ocs.data.rooms\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tvar users = result.ocs.data.users;\n\t\t\t\t\t\tvar groups = result.ocs.data.groups;\n\t\t\t\t\t\tvar remotes = result.ocs.data.remotes;\n\t\t\t\t\t\tvar remoteGroups = result.ocs.data.remote_groups;\n\t\t\t\t\t\tvar lookup = result.ocs.data.lookup;\n\t\t\t\t\t\tvar lookupEnabled = result.ocs.data.lookupEnabled;\n\t\t\t\t\t\tvar emails = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.emails) !== 'undefined') {\n\t\t\t\t\t\t\temails = result.ocs.data.emails;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar circles = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.circles) !== 'undefined') {\n\t\t\t\t\t\t\tcircles = result.ocs.data.circles;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar rooms = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.rooms) !== 'undefined') {\n\t\t\t\t\t\t\trooms = result.ocs.data.rooms;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);\n\n\t\t\t\t\t\tfunction dynamicSort(property) {\n\t\t\t\t\t\t\treturn function (a,b) {\n\t\t\t\t\t\t\t\tvar aProperty = '';\n\t\t\t\t\t\t\t\tvar bProperty = '';\n\t\t\t\t\t\t\t\tif (typeof a[property] !== 'undefined') {\n\t\t\t\t\t\t\t\t\taProperty = a[property];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (typeof b[property] !== 'undefined') {\n\t\t\t\t\t\t\t\t\tbProperty = b[property];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn (aProperty < bProperty) ? -1 : (aProperty > bProperty) ? 1 : 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Sort share entries by uuid to properly group them\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar grouped = suggestions.sort(dynamicSort('uuid'));\n\n\t\t\t\t\t\tvar previousUuid = null;\n\t\t\t\t\t\tvar groupedLength = grouped.length;\n\t\t\t\t\t\tvar result = [];\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * build the result array that only contains all contact entries from\n\t\t\t\t\t\t * merged contacts, if the search term matches its contact name\n\t\t\t\t\t\t */\n\t\t\t\t\t\tfor (var i = 0; i < groupedLength; i++) {\n\t\t\t\t\t\t\tif (typeof grouped[i].uuid !== 'undefined' && grouped[i].uuid === previousUuid) {\n\t\t\t\t\t\t\t\tgrouped[i].merged = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (searchTerm === grouped[i].name || typeof grouped[i].merged === 'undefined') {\n\t\t\t\t\t\t\t\tresult.push(grouped[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpreviousUuid = grouped[i].uuid;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar moreResultsAvailable =\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\toc_config['sharing.maxAutocompleteResults'] > 0\n\t\t\t\t\t\t\t\t&& Math.min(perPage, oc_config['sharing.maxAutocompleteResults'])\n\t\t\t\t\t\t\t\t\t<= Math.max(\n\t\t\t\t\t\t\t\t\t\tusers.length + exactUsers.length,\n\t\t\t\t\t\t\t\t\t\tgroups.length + exactGroups.length,\n\t\t\t\t\t\t\t\t\t\tremoteGroups.length + exactRemoteGroups.length,\n\t\t\t\t\t\t\t\t\t\tremotes.length + exactRemotes.length,\n\t\t\t\t\t\t\t\t\t\temails.length + exactEmails.length,\n\t\t\t\t\t\t\t\t\t\tcircles.length + exactCircles.length,\n\t\t\t\t\t\t\t\t\t\trooms.length + exactRooms.length,\n\t\t\t\t\t\t\t\t\t\tlookup.length\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!view._lookup && lookupEnabled) {\n\t\t\t\t\t\t\tresult.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: t('core', 'Search globally'),\n\t\t\t\t\t\t\t\t\tvalue: {},\n\t\t\t\t\t\t\t\t\tlookup: true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdeferred.resolve(result, exactMatches, moreResultsAvailable, lookupEnabled);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdeferred.reject(result.ocs.meta.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t).fail(function() {\n\t\t\t\tdeferred.reject();\n\t\t\t});\n\n\t\t\tthis._lastSuggestions = {\n\t\t\t\tsearchTerm: searchTerm,\n\t\t\t\tlookup: lookup,\n\t\t\t\tperPage: perPage,\n\t\t\t\tmodel: model,\n\t\t\t\tpromise: deferred.promise()\n\t\t\t};\n\n\t\t\treturn this._lastSuggestions.promise;\n\t\t},\n\n\t\t_getRecommendations: function(model) {\n\t\t\tif (this._lastRecommendations &&\n\t\t\t\tthis._lastRecommendations.model === model) {\n\t\t\t\treturn this._lastRecommendations.promise;\n\t\t\t}\n\n\t\t\tvar deferred = $.Deferred();\n\n\t\t\t$.get(\n\t\t\t\tOC.linkToOCS('apps/files_sharing/api/v1') + 'sharees_recommended',\n\t\t\t\t{\n\t\t\t\t\tformat: 'json',\n\t\t\t\t\titemType: model.get('itemType')\n\t\t\t\t},\n\t\t\t\tfunction (result) {\n\t\t\t\t\tif (result.ocs.meta.statuscode === 100) {\n\t\t\t\t\t\tvar filter = function(users, groups, remotes, remote_groups, emails, circles, rooms) {\n\t\t\t\t\t\t\tif (typeof(emails) === 'undefined') {\n\t\t\t\t\t\t\t\temails = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof(circles) === 'undefined') {\n\t\t\t\t\t\t\t\tcircles = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof(rooms) === 'undefined') {\n\t\t\t\t\t\t\t\trooms = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar usersLength;\n\t\t\t\t\t\t\tvar groupsLength;\n\t\t\t\t\t\t\tvar remotesLength;\n\t\t\t\t\t\t\tvar remoteGroupsLength;\n\t\t\t\t\t\t\tvar emailsLength;\n\t\t\t\t\t\t\tvar circlesLength;\n\t\t\t\t\t\t\tvar roomsLength;\n\n\t\t\t\t\t\t\tvar i, j;\n\n\t\t\t\t\t\t\t//Filter out the current user\n\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\tfor (i = 0; i < usersLength; i++) {\n\t\t\t\t\t\t\t\tif (users[i].value.shareWith === OC.currentUser) {\n\t\t\t\t\t\t\t\t\tusers.splice(i, 1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Filter out the owner of the share\n\t\t\t\t\t\t\tif (model.hasReshare()) {\n\t\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\t\tfor (i = 0 ; i < usersLength; i++) {\n\t\t\t\t\t\t\t\t\tif (users[i].value.shareWith === model.getReshareOwner()) {\n\t\t\t\t\t\t\t\t\t\tusers.splice(i, 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar shares = model.get('shares');\n\t\t\t\t\t\t\tvar sharesLength = shares.length;\n\n\t\t\t\t\t\t\t// Now filter out all sharees that are already shared with\n\t\t\t\t\t\t\tfor (i = 0; i < sharesLength; i++) {\n\t\t\t\t\t\t\t\tvar share = shares[i];\n\n\t\t\t\t\t\t\t\tif (share.share_type === OC.Share.SHARE_TYPE_USER) {\n\t\t\t\t\t\t\t\t\tusersLength = users.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < usersLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (users[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tusers.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\t\t\t\t\t\tgroupsLength = groups.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < groupsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (groups[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tgroups.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\t\t\t\t\t\tremotesLength = remotes.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < remotesLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (remotes[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tremotes.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\t\t\t\t\t\tremoteGroupsLength = remote_groups.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < remoteGroupsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (remote_groups[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tremote_groups.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\t\t\t\t\t\temailsLength = emails.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < emailsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (emails[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\temails.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\t\t\t\t\t\tcirclesLength = circles.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < circlesLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (circles[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\tcircles.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (share.share_type === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\t\t\t\t\t\troomsLength = rooms.length;\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < roomsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tif (rooms[j].value.shareWith === share.share_with) {\n\t\t\t\t\t\t\t\t\t\t\trooms.splice(j, 1);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfilter(\n\t\t\t\t\t\t\tresult.ocs.data.exact.users,\n\t\t\t\t\t\t\tresult.ocs.data.exact.groups,\n\t\t\t\t\t\t\tresult.ocs.data.exact.remotes,\n\t\t\t\t\t\t\tresult.ocs.data.exact.remote_groups,\n\t\t\t\t\t\t\tresult.ocs.data.exact.emails,\n\t\t\t\t\t\t\tresult.ocs.data.exact.circles,\n\t\t\t\t\t\t\tresult.ocs.data.exact.rooms\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tvar exactUsers = result.ocs.data.exact.users;\n\t\t\t\t\t\tvar exactGroups = result.ocs.data.exact.groups;\n\t\t\t\t\t\tvar exactRemotes = result.ocs.data.exact.remotes || [];\n\t\t\t\t\t\tvar exactRemoteGroups = result.ocs.data.exact.remote_groups || [];\n\t\t\t\t\t\tvar exactEmails = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.emails) !== 'undefined') {\n\t\t\t\t\t\t\texactEmails = result.ocs.data.exact.emails;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar exactCircles = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.circles) !== 'undefined') {\n\t\t\t\t\t\t\texactCircles = result.ocs.data.exact.circles;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar exactRooms = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.rooms) !== 'undefined') {\n\t\t\t\t\t\t\texactRooms = result.ocs.data.exact.rooms;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactRemoteGroups).concat(exactEmails).concat(exactCircles).concat(exactRooms);\n\n\t\t\t\t\t\tfilter(\n\t\t\t\t\t\t\tresult.ocs.data.users,\n\t\t\t\t\t\t\tresult.ocs.data.groups,\n\t\t\t\t\t\t\tresult.ocs.data.remotes,\n\t\t\t\t\t\t\tresult.ocs.data.remote_groups,\n\t\t\t\t\t\t\tresult.ocs.data.emails,\n\t\t\t\t\t\t\tresult.ocs.data.circles,\n\t\t\t\t\t\t\tresult.ocs.data.rooms\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tvar users = result.ocs.data.users;\n\t\t\t\t\t\tvar groups = result.ocs.data.groups;\n\t\t\t\t\t\tvar remotes = result.ocs.data.remotes || [];\n\t\t\t\t\t\tvar remoteGroups = result.ocs.data.remote_groups || [];\n\t\t\t\t\t\tvar lookup = result.ocs.data.lookup || [];\n\t\t\t\t\t\tvar emails = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.emails) !== 'undefined') {\n\t\t\t\t\t\t\temails = result.ocs.data.emails;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar circles = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.circles) !== 'undefined') {\n\t\t\t\t\t\t\tcircles = result.ocs.data.circles;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar rooms = [];\n\t\t\t\t\t\tif (typeof(result.ocs.data.rooms) !== 'undefined') {\n\t\t\t\t\t\t\trooms = result.ocs.data.rooms;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);\n\n\t\t\t\t\t\tfunction dynamicSort(property) {\n\t\t\t\t\t\t\treturn function (a,b) {\n\t\t\t\t\t\t\t\tvar aProperty = '';\n\t\t\t\t\t\t\t\tvar bProperty = '';\n\t\t\t\t\t\t\t\tif (typeof a[property] !== 'undefined') {\n\t\t\t\t\t\t\t\t\taProperty = a[property];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (typeof b[property] !== 'undefined') {\n\t\t\t\t\t\t\t\t\tbProperty = b[property];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn (aProperty < bProperty) ? -1 : (aProperty > bProperty) ? 1 : 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Sort share entries by uuid to properly group them\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar grouped = suggestions.sort(dynamicSort('uuid'));\n\n\t\t\t\t\t\tvar previousUuid = null;\n\t\t\t\t\t\tvar groupedLength = grouped.length;\n\t\t\t\t\t\tvar result = [];\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * build the result array that only contains all contact entries from\n\t\t\t\t\t\t * merged contacts, if the search term matches its contact name\n\t\t\t\t\t\t */\n\t\t\t\t\t\tfor (var i = 0; i < groupedLength; i++) {\n\t\t\t\t\t\t\tif (typeof grouped[i].uuid !== 'undefined' && grouped[i].uuid === previousUuid) {\n\t\t\t\t\t\t\t\tgrouped[i].merged = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof grouped[i].merged === 'undefined') {\n\t\t\t\t\t\t\t\tresult.push(grouped[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpreviousUuid = grouped[i].uuid;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdeferred.resolve(result, exactMatches, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdeferred.reject(result.ocs.meta.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t).fail(function() {\n\t\t\t\tdeferred.reject();\n\t\t\t});\n\n\t\t\tthis._lastRecommendations = {\n\t\t\t\tmodel: model,\n\t\t\t\tpromise: deferred.promise()\n\t\t\t};\n\n\t\t\treturn this._lastRecommendations.promise;\n\t\t},\n\n\t\trecommendationHandler: function (response) {\n\t\t\tvar view = this;\n\t\t\tvar $shareWithField = $('.shareWithField');\n\t\t\tthis._getRecommendations(\n\t\t\t\tview.model\n\t\t\t).done(function(suggestions) {\n\t\t\t\tconsole.info('recommendations', suggestions);\n\t\t\t\tif (suggestions.length > 0) {\n\t\t\t\t\t$shareWithField\n\t\t\t\t\t\t.autocomplete(\"option\", \"autoFocus\", true);\n\n\t\t\t\t\tresponse(suggestions);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.info('no sharing recommendations found');\n\t\t\t\t\tresponse();\n\t\t\t\t}\n\t\t\t}).fail(function(message) {\n\t\t\t\tconsole.error('could not load recommendations', message)\n\t\t\t});\n\t\t},\n\n\t\tautocompleteHandler: function (search, response) {\n\t\t\t// If nothing is entered we show recommendations instead of search\n\t\t\t// results\n\t\t\tif (search.term.length === 0) {\n\t\t\t\tconsole.info(search.term, 'empty search term -> using recommendations');\n\t\t\t\tthis.recommendationHandler(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar $shareWithField = $('.shareWithField'),\n\t\t\t\tview = this,\n\t\t\t\t$loading = this.$el.find('.shareWithLoading'),\n\t\t\t\t$confirm = this.$el.find('.shareWithConfirm');\n\n\t\t\tvar count = oc_config['sharing.minSearchStringLength'];\n\t\t\tif (search.term.trim().length < count) {\n\t\t\t\tvar title = n('core',\n\t\t\t\t\t'At least {count} character is needed for autocompletion',\n\t\t\t\t\t'At least {count} characters are needed for autocompletion',\n\t\t\t\t\tcount,\n\t\t\t\t\t{ count: count }\n\t\t\t\t);\n\t\t\t\t$shareWithField.addClass('error')\n\t\t\t\t\t.attr('data-original-title', title)\n\t\t\t\t\t.tooltip('hide')\n\t\t\t\t\t.tooltip({\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t})\n\t\t\t\t\t.tooltip('fixTitle')\n\t\t\t\t\t.tooltip('show');\n\t\t\t\tresponse();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$loading.removeClass('hidden');\n\t\t\t$loading.addClass('inlineblock');\n\t\t\t$confirm.addClass('hidden');\n\t\t\tthis._pendingOperationsCount++;\n\n\t\t\t$shareWithField.removeClass('error')\n\t\t\t\t.tooltip('hide');\n\n\t\t\tvar perPage = parseInt(oc_config['sharing.maxAutocompleteResults'], 10) || 200;\n\t\t\tthis._getSuggestions(\n\t\t\t\tsearch.term.trim(),\n\t\t\t\tperPage,\n\t\t\t\tview.model,\n\t\t\t\tview._lookup\n\t\t\t).done(function(suggestions, exactMatches, moreResultsAvailable) {\n\t\t\t\tview._pendingOperationsCount--;\n\t\t\t\tif (view._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\n\t\t\t\tif (suggestions.length > 0) {\n\t\t\t\t\t$shareWithField\n\t\t\t\t\t\t.autocomplete(\"option\", \"autoFocus\", true);\n\n\t\t\t\t\tresponse(suggestions);\n\n\t\t\t\t\t// show a notice that the list is truncated\n\t\t\t\t\t// this is the case if one of the search results is at least as long as the max result config option\n\t\t\t\t\tif(moreResultsAvailable) {\n\t\t\t\t\t\tvar message = t('core', 'This list is maybe truncated - please refine your search term to see more results.');\n\t\t\t\t\t\t$('.ui-autocomplete').append('' + message + ' ');\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tvar title = t('core', 'No users or groups found for {search}', {search: $shareWithField.val()});\n\t\t\t\t\tif (!view.configModel.get('allowGroupSharing')) {\n\t\t\t\t\t\ttitle = t('core', 'No users found for {search}', {search: $('.shareWithField').val()});\n\t\t\t\t\t}\n\t\t\t\t\t$shareWithField.addClass('error')\n\t\t\t\t\t\t.attr('data-original-title', title)\n\t\t\t\t\t\t.tooltip('hide')\n\t\t\t\t\t\t.tooltip({\n\t\t\t\t\t\t\tplacement: 'top',\n\t\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.tooltip('fixTitle')\n\t\t\t\t\t\t.tooltip('show');\n\t\t\t\t\tresponse();\n\t\t\t\t}\n\t\t\t}).fail(function(message) {\n\t\t\t\tview._pendingOperationsCount--;\n\t\t\t\tif (view._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'An error occurred (\"{message}\"). Please try again', { message: message }));\n\t\t\t\t} else {\n\t\t\t\t\tOC.Notification.showTemporary(t('core', 'An error occurred. Please try again'));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tautocompleteRenderItem: function(ul, item) {\n\t\t\tvar icon = 'icon-user';\n\t\t\tvar text = escapeHTML(item.label);\n\t\t\tvar description = '';\n\t\t\tvar type = '';\n\t\t\tvar getTranslatedType = function(type) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'HOME':\n\t\t\t\t\t\treturn t('core', 'Home');\n\t\t\t\t\tcase 'WORK':\n\t\t\t\t\t\treturn t('core', 'Work');\n\t\t\t\t\tcase 'OTHER':\n\t\t\t\t\t\treturn t('core', 'Other');\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn '' + type;\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (typeof item.type !== 'undefined' && item.type !== null) {\n\t\t\t\ttype = getTranslatedType(item.type) + ' ';\n\t\t\t}\n\n\t\t\tif (typeof item.name !== 'undefined') {\n\t\t\t\ttext = escapeHTML(item.name);\n\t\t\t}\n\t\t\tif (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) {\n\t\t\t\ticon = 'icon-contacts-dark';\n\t\t\t} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) {\n\t\t\t\ticon = 'icon-shared';\n\t\t\t\tdescription += item.value.shareWith;\n\t\t\t} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {\n\t\t\t\ttext = t('core', '{sharee} (remote group)', { sharee: text }, undefined, { escape: false });\n\t\t\t\ticon = 'icon-shared';\n\t\t\t\tdescription += item.value.shareWith;\n\t\t\t} else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) {\n\t\t\t\ticon = 'icon-mail';\n\t\t\t\tdescription += item.value.shareWith;\n\t\t\t} else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\ttext = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false});\n\t\t\t\ticon = 'icon-circle';\n\t\t\t} else if (item.value.shareType === OC.Share.SHARE_TYPE_ROOM) {\n\t\t\t\ticon = 'icon-talk';\n\t\t\t}\n\n\t\t\tvar insert = $(\"
\");\n\t\t\tif (item.merged) {\n\t\t\t\tinsert.addClass('merged');\n\t\t\t\ttext = item.value.shareWith;\n\t\t\t\tdescription = type;\n\t\t\t} else if (item.lookup) {\n\t\t\t\ttext = item.label;\n\t\t\t\ticon = false;\n\t\t\t\tinsert.append(' ');\n\t\t\t} else {\n\t\t\t\tvar avatar = $(\"
\").appendTo(insert);\n\t\t\t\tif (item.value.shareType === OC.Share.SHARE_TYPE_USER || item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) {\n\t\t\t\t\tavatar.avatar(item.value.shareWith, 32, undefined, undefined, undefined, item.label);\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof item.uuid === 'undefined') {\n\t\t\t\t\t\titem.uuid = text;\n\t\t\t\t\t}\n\t\t\t\t\tavatar.imageplaceholder(item.uuid, text, 32);\n\t\t\t\t}\n\t\t\t\tdescription = type + description;\n\t\t\t}\n\t\t\tif (description !== '') {\n\t\t\t\tinsert.addClass('with-description');\n\t\t\t}\n\n\t\t\t$(\"
\")\n\t\t\t\t.html(\n\t\t\t\t\ttext.replace(\n\t\t\t\t\tnew RegExp(this.term, \"gi\"),\n\t\t\t\t\t\"$& \")\n\t\t\t\t\t+ '' + description + ' '\n\t\t\t\t)\n\t\t\t\t.appendTo(insert);\n\t\t\tinsert.attr('title', item.value.shareWith);\n\t\t\tif (icon) {\n\t\t\t\tinsert.append(' ');\n\t\t\t}\n\t\t\tinsert = $(\"\")\n\t\t\t\t.append(insert);\n\t\t\treturn $(\"\")\n\t\t\t\t.addClass((item.value.shareType === OC.Share.SHARE_TYPE_GROUP) ? 'group' : 'user')\n\t\t\t\t.append(insert)\n\t\t\t\t.appendTo(ul);\n\t\t},\n\n\t\t_onSelectRecipient: function(e, s) {\n\t\t\tvar self = this;\n\n\t\t\tif (e.keyCode == 9) {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (typeof s.item.name !== 'undefined') {\n\t\t\t\t\te.target.value = s.item.name;\n\t\t\t\t} else {\n\t\t\t\t\te.target.value = s.item.label;\n\t\t\t\t}\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$(e.target).attr('disabled', false)\n\t\t\t\t\t\t.autocomplete('search', $(e.target).val());\n\t\t\t\t}, 0);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (s.item.lookup) {\n\t\t\t\t// Retrigger search but with global lookup this time\n\t\t\t\tthis._lookup = true;\n\t\t\t\tvar $shareWithField = this.$el.find('.shareWithField');\n\t\t\t\tvar val = $shareWithField.val();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tconsole.debug('searching again, but globally. search term: ' + val);\n\t\t\t\t\t$shareWithField.autocomplete(\"search\", val);\n\t\t\t\t}, 0);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\t// Ensure that the keydown handler for the input field is not\n\t\t\t// called; otherwise it would try to add the recipient again, which\n\t\t\t// would fail.\n\t\t\te.stopImmediatePropagation();\n\t\t\t$(e.target).attr('disabled', true)\n\t\t\t\t.val(s.item.label);\n\n\t\t\tvar $loading = this.$el.find('.shareWithLoading');\n\t\t\tvar $confirm = this.$el.find('.shareWithConfirm');\n\n\t\t\t$loading.removeClass('hidden');\n\t\t\t$loading.addClass('inlineblock');\n\t\t\t$confirm.addClass('hidden');\n\t\t\tthis._pendingOperationsCount++;\n\n\t\t\tthis.model.addShare(s.item.value, {success: function() {\n\t\t\t\t// Adding a share changes the suggestions.\n\t\t\t\tself._lastSuggestions = undefined;\n\n\t\t\t\t$(e.target).val('')\n\t\t\t\t\t.attr('disabled', false);\n\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\t\t\t}, error: function(obj, msg) {\n\t\t\t\tOC.Notification.showTemporary(msg);\n\t\t\t\t$(e.target).attr('disabled', false)\n\t\t\t\t\t.autocomplete('search', $(e.target).val());\n\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\t\t\t}});\n\t\t},\n\n\t\t_confirmShare: function() {\n\t\t\tvar self = this;\n\t\t\tvar $shareWithField = $('.shareWithField');\n\t\t\tvar $loading = this.$el.find('.shareWithLoading');\n\t\t\tvar $confirm = this.$el.find('.shareWithConfirm');\n\n\t\t\t$loading.removeClass('hidden');\n\t\t\t$loading.addClass('inlineblock');\n\t\t\t$confirm.addClass('hidden');\n\t\t\tthis._pendingOperationsCount++;\n\n\t\t\t$shareWithField.prop('disabled', true);\n\n\t\t\t// Disabling the autocompletion does not clear its search timeout;\n\t\t\t// removing the focus from the input field does, but only if the\n\t\t\t// autocompletion is not disabled when the field loses the focus.\n\t\t\t// Thus, the field has to be disabled before disabling the\n\t\t\t// autocompletion to prevent an old pending search result from\n\t\t\t// appearing once the field is enabled again.\n\t\t\t$shareWithField.autocomplete('close');\n\t\t\t$shareWithField.autocomplete('disable');\n\n\t\t\tvar restoreUI = function() {\n\t\t\t\tself._pendingOperationsCount--;\n\t\t\t\tif (self._pendingOperationsCount === 0) {\n\t\t\t\t\t$loading.addClass('hidden');\n\t\t\t\t\t$loading.removeClass('inlineblock');\n\t\t\t\t\t$confirm.removeClass('hidden');\n\t\t\t\t}\n\n\t\t\t\t$shareWithField.prop('disabled', false);\n\t\t\t\t$shareWithField.focus();\n\t\t\t};\n\n\t\t\tvar perPage = parseInt(oc_config['sharing.maxAutocompleteResults'], 10) || 200;\n\t\t\tthis._getSuggestions(\n\t\t\t\t$shareWithField.val(),\n\t\t\t\tperPage,\n\t\t\t\tthis.model,\n\t\t\t\tthis._lookup\n\t\t\t).done(function(suggestions, exactMatches) {\n\t\t\t\tif (suggestions.length === 0) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\t// There is no need to show an error message here; it will\n\t\t\t\t\t// be automatically shown when the autocomplete is activated\n\t\t\t\t\t// again (due to the focus on the field) and it finds no\n\t\t\t\t\t// matches.\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (exactMatches.length !== 1) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar actionSuccess = function() {\n\t\t\t\t\t// Adding a share changes the suggestions.\n\t\t\t\t\tself._lastSuggestions = undefined;\n\n\t\t\t\t\t$shareWithField.val('');\n\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\t\t\t\t};\n\n\t\t\t\tvar actionError = function(obj, msg) {\n\t\t\t\t\trestoreUI();\n\n\t\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t\tOC.Notification.showTemporary(msg);\n\t\t\t\t};\n\n\t\t\t\tself.model.addShare(exactMatches[0].value, {\n\t\t\t\t\tsuccess: actionSuccess,\n\t\t\t\t\terror: actionError\n\t\t\t\t});\n\t\t\t}).fail(function(message) {\n\t\t\t\trestoreUI();\n\n\t\t\t\t$shareWithField.autocomplete('enable');\n\n\t\t\t\t// There is no need to show an error message here; it will be\n\t\t\t\t// automatically shown when the autocomplete is activated again\n\t\t\t\t// (due to the focus on the field) and getting the suggestions\n\t\t\t\t// fail.\n\t\t\t});\n\t\t},\n\n\t\t_toggleLoading: function(state) {\n\t\t\tthis._loading = state;\n\t\t\tthis.$el.find('.subView').toggleClass('hidden', state);\n\t\t\tthis.$el.find('.loading').toggleClass('hidden', !state);\n\t\t},\n\n\t\t_onRequest: function() {\n\t\t\t// only show the loading spinner for the first request (for now)\n\t\t\tif (!this._loadingOnce) {\n\t\t\t\tthis._toggleLoading(true);\n\t\t\t}\n\t\t},\n\n\t\t_onEndRequest: function() {\n\t\t\tvar self = this;\n\t\t\tthis._toggleLoading(false);\n\t\t\tif (!this._loadingOnce) {\n\t\t\t\tthis._loadingOnce = true;\n\t\t\t}\n\t\t},\n\n\t\trender: function() {\n\t\t\tvar self = this;\n\t\t\tvar baseTemplate = OC.Share.Templates['sharedialogview'];\n\n\t\t\tthis.$el.html(baseTemplate({\n\t\t\t\tcid: this.cid,\n\t\t\t\tshareLabel: t('core', 'Share'),\n\t\t\t\tsharePlaceholder: this._renderSharePlaceholderPart(),\n\t\t\t\tisSharingAllowed: this.model.sharePermissionPossible()\n\t\t\t}));\n\n\t\t\tvar $shareField = this.$el.find('.shareWithField');\n\t\t\tif ($shareField.length) {\n\t\t\t\tvar shareFieldKeydownHandler = function(event) {\n\t\t\t\t\tif (event.keyCode !== 13) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tself._confirmShare();\n\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\n\t\t\t\t$shareField.autocomplete({\n\t\t\t\t\tminLength: 0,\n\t\t\t\t\tdelay: 750,\n\t\t\t\t\tfocus: function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tsource: this.autocompleteHandler,\n\t\t\t\t\tselect: this._onSelectRecipient,\n\t\t\t\t\topen: function() {\n\t\t\t\t\t\tvar autocomplete = $(this).autocomplete('widget');\n\t\t\t\t\t\tvar numberOfItems = autocomplete.find('li').size();\n\t\t\t\t\t\tautocomplete.removeClass('item-count-1');\n\t\t\t\t\t\tautocomplete.removeClass('item-count-2');\n\t\t\t\t\t\tif (numberOfItems <= 2) {\n\t\t\t\t\t\t\tautocomplete.addClass('item-count-' + numberOfItems);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem;\n\n\t\t\t\t$shareField.on('keydown', null, shareFieldKeydownHandler);\n\t\t\t}\n\n\t\t\tthis.resharerInfoView.$el = this.$el.find('.resharerInfoView');\n\t\t\tthis.resharerInfoView.render();\n\n\t\t\tthis.linkShareView.$el = this.$el.find('.linkShareView');\n\t\t\tthis.linkShareView.render();\n\n\t\t\tthis.shareeListView.$el = this.$el.find('.shareeListView');\n\t\t\tthis.shareeListView.render();\n\n\t\t\tthis.$el.find('.hasTooltip').tooltip();\n\n\t\t\treturn this;\n\t\t},\n\n\t\t/**\n\t\t * sets whether share by link should be displayed or not. Default is\n\t\t * true.\n\t\t *\n\t\t * @param {bool} showLink\n\t\t */\n\t\tsetShowLink: function(showLink) {\n\t\t\tthis._showLink = (typeof showLink === 'boolean') ? showLink : true;\n\t\t\tthis.linkShareView.showLink = this._showLink;\n\t\t},\n\n\t\t_renderSharePlaceholderPart: function () {\n\t\t\tvar allowRemoteSharing = this.configModel.get('isRemoteShareAllowed');\n\t\t\tvar allowMailSharing = this.configModel.get('isMailShareAllowed');\n\n\t\t\tif (!allowRemoteSharing && allowMailSharing) {\n\t\t\t\treturn t('core', 'Name or email address...');\n\t\t\t}\n\t\t\tif (allowRemoteSharing && !allowMailSharing) {\n\t\t\t\treturn t('core', 'Name or federated cloud ID...');\n\t\t\t}\n\t\t\tif (allowRemoteSharing && allowMailSharing) {\n\t\t\t\treturn t('core', 'Name, federated cloud ID or email address...');\n\t\t\t}\n\n\t\t\treturn \tt('core', 'Name...');\n\t\t},\n\n\t});\n\n\tOC.Share.ShareDialogView = ShareDialogView;\n\n})();\n","/* global escapeHTML */\n\n/**\n * @namespace\n */\nOC.Share = _.extend(OC.Share || {}, {\n\tSHARE_TYPE_USER:0,\n\tSHARE_TYPE_GROUP:1,\n\tSHARE_TYPE_LINK:3,\n\tSHARE_TYPE_EMAIL:4,\n\tSHARE_TYPE_REMOTE:6,\n\tSHARE_TYPE_CIRCLE:7,\n\tSHARE_TYPE_GUEST:8,\n\tSHARE_TYPE_REMOTE_GROUP:9,\n\tSHARE_TYPE_ROOM:10,\n\n\t/**\n\t * Regular expression for splitting parts of remote share owners:\n\t * \"user@example.com/path/to/owncloud\"\n\t * \"user@anotherexample.com@example.com/path/to/owncloud\n\t */\n\t_REMOTE_OWNER_REGEXP: new RegExp(\"^([^@]*)@(([^@]*)@)?([^/]*)([/](.*)?)?$\"),\n\n\t/**\n\t * @deprecated use OC.Share.currentShares instead\n\t */\n\titemShares:[],\n\t/**\n\t * Full list of all share statuses\n\t */\n\tstatuses:{},\n\t/**\n\t * Shares for the currently selected file.\n\t * (for which the dropdown is open)\n\t *\n\t * Key is item type and value is an array or\n\t * shares of the given item type.\n\t */\n\tcurrentShares: {},\n\t/**\n\t * Whether the share dropdown is opened.\n\t */\n\tdroppedDown:false,\n\t/**\n\t * Loads ALL share statuses from server, stores them in\n\t * OC.Share.statuses then calls OC.Share.updateIcons() to update the\n\t * files \"Share\" icon to \"Shared\" according to their share status and\n\t * share type.\n\t *\n\t * If a callback is specified, the update step is skipped.\n\t *\n\t * @param itemType item type\n\t * @param fileList file list instance, defaults to OCA.Files.App.fileList\n\t * @param callback function to call after the shares were loaded\n\t */\n\tloadIcons:function(itemType, fileList, callback) {\n\t\tvar path = fileList.dirInfo.path;\n\t\tif (path === '/') {\n\t\t\tpath = '';\n\t\t}\n\t\tpath += '/' + fileList.dirInfo.name;\n\n\t\t// Load all share icons\n\t\t$.get(\n\t\t\tOC.linkToOCS('apps/files_sharing/api/v1', 2) + 'shares',\n\t\t\t{\n\t\t\t\tsubfiles: 'true',\n\t\t\t\tpath: path,\n\t\t\t\tformat: 'json'\n\t\t\t}, function(result) {\n\t\t\t\tif (result && result.ocs.meta.statuscode === 200) {\n\t\t\t\t\tOC.Share.statuses = {};\n\t\t\t\t\t$.each(result.ocs.data, function(it, share) {\n\t\t\t\t\t\tif (!(share.item_source in OC.Share.statuses)) {\n\t\t\t\t\t\t\tOC.Share.statuses[share.item_source] = {link: false};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (share.share_type === OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\tOC.Share.statuses[share.item_source] = {link: true};\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (_.isFunction(callback)) {\n\t\t\t\t\t\tcallback(OC.Share.statuses);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tOC.Share.updateIcons(itemType, fileList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\t/**\n\t * Updates the files' \"Share\" icons according to the known\n\t * sharing states stored in OC.Share.statuses.\n\t * (not reloaded from server)\n\t *\n\t * @param itemType item type\n\t * @param fileList file list instance\n\t * defaults to OCA.Files.App.fileList\n\t */\n\tupdateIcons:function(itemType, fileList){\n\t\tvar item;\n\t\tvar $fileList;\n\t\tvar currentDir;\n\t\tif (!fileList && OCA.Files) {\n\t\t\tfileList = OCA.Files.App.fileList;\n\t\t}\n\t\t// fileList is usually only defined in the files app\n\t\tif (fileList) {\n\t\t\t$fileList = fileList.$fileList;\n\t\t\tcurrentDir = fileList.getCurrentDirectory();\n\t\t}\n\t\t// TODO: iterating over the files might be more efficient\n\t\tfor (item in OC.Share.statuses){\n\t\t\tvar iconClass = 'icon-shared';\n\t\t\tvar data = OC.Share.statuses[item];\n\t\t\tvar hasLink = data.link;\n\t\t\t// Links override shared in terms of icon display\n\t\t\tif (hasLink) {\n\t\t\t\ticonClass = 'icon-public';\n\t\t\t}\n\t\t\tif (itemType !== 'file' && itemType !== 'folder') {\n\t\t\t\t$('a.share[data-item=\"'+item+'\"] .icon').removeClass('icon-shared icon-public').addClass(iconClass);\n\t\t\t} else {\n\t\t\t\t// TODO: ultimately this part should be moved to files_sharing app\n\t\t\t\tvar file = $fileList.find('tr[data-id=\"'+item+'\"]');\n\t\t\t\tvar shareFolder = OC.imagePath('core', 'filetypes/folder-shared');\n\t\t\t\tvar img;\n\t\t\t\tif (file.length > 0) {\n\t\t\t\t\tthis.markFileAsShared(file, true, hasLink);\n\t\t\t\t} else {\n\t\t\t\t\tvar dir = currentDir;\n\t\t\t\t\tif (dir.length > 1) {\n\t\t\t\t\t\tvar last = '';\n\t\t\t\t\t\tvar path = dir;\n\t\t\t\t\t\t// Search for possible parent folders that are shared\n\t\t\t\t\t\twhile (path != last) {\n\t\t\t\t\t\t\tif (path === data.path && !data.link) {\n\t\t\t\t\t\t\t\tvar actions = $fileList.find('.fileactions .action[data-action=\"Share\"]');\n\t\t\t\t\t\t\t\tvar files = $fileList.find('.filename');\n\t\t\t\t\t\t\t\tvar i;\n\t\t\t\t\t\t\t\tfor (i = 0; i < actions.length; i++) {\n\t\t\t\t\t\t\t\t\t// TODO: use this.markFileAsShared()\n\t\t\t\t\t\t\t\t\timg = $(actions[i]).find('img');\n\t\t\t\t\t\t\t\t\tif (img.attr('src') !== OC.imagePath('core', 'actions/public')) {\n\t\t\t\t\t\t\t\t\t\timg.attr('src', image);\n\t\t\t\t\t\t\t\t\t\t$(actions[i]).addClass('permanent');\n\t\t\t\t\t\t\t\t\t\t$(actions[i]).html(' '+t('core', 'Shared')+' ').prepend(img);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(i = 0; i < files.length; i++) {\n\t\t\t\t\t\t\t\t\tif ($(files[i]).closest('tr').data('type') === 'dir') {\n\t\t\t\t\t\t\t\t\t\t$(files[i]).find('.thumbnail').css('background-image', 'url('+shareFolder+')');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlast = path;\n\t\t\t\t\t\t\tpath = OC.Share.dirname(path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tupdateIcon:function(itemType, itemSource) {\n\t\tvar shares = false;\n\t\tvar link = false;\n\t\tvar iconClass = '';\n\t\t$.each(OC.Share.itemShares, function(index) {\n\t\t\tif (OC.Share.itemShares[index]) {\n\t\t\t\tif (index == OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\tif (OC.Share.itemShares[index] == true) {\n\t\t\t\t\t\tshares = true;\n\t\t\t\t\t\ticonClass = 'icon-public';\n\t\t\t\t\t\tlink = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else if (OC.Share.itemShares[index].length > 0) {\n\t\t\t\t\tshares = true;\n\t\t\t\t\ticonClass = 'icon-shared';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (itemType != 'file' && itemType != 'folder') {\n\t\t\t$('a.share[data-item=\"'+itemSource+'\"] .icon').removeClass('icon-shared icon-public').addClass(iconClass);\n\t\t} else {\n\t\t\tvar $tr = $('tr').filterAttr('data-id', String(itemSource));\n\t\t\tif ($tr.length > 0) {\n\t\t\t\t// it might happen that multiple lists exist in the DOM\n\t\t\t\t// with the same id\n\t\t\t\t$tr.each(function() {\n\t\t\t\t\tOC.Share.markFileAsShared($(this), shares, link);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (shares) {\n\t\t\tOC.Share.statuses[itemSource] = OC.Share.statuses[itemSource] || {};\n\t\t\tOC.Share.statuses[itemSource].link = link;\n\t\t} else {\n\t\t\tdelete OC.Share.statuses[itemSource];\n\t\t}\n\t},\n\t/**\n\t * Format a remote address\n\t *\n\t * @param {String} shareWith userid, full remote share, or whatever\n\t * @param {String} shareWithDisplayName\n\t * @param {String} message\n\t * @return {String} HTML code to display\n\t */\n\t_formatRemoteShare: function(shareWith, shareWithDisplayName, message) {\n\t\tvar parts = this._REMOTE_OWNER_REGEXP.exec(shareWith);\n\t\tif (!parts) {\n\t\t\t// display avatar of the user\n\t\t\tvar avatar = ' ';\n\t\t\tvar hidden = '' + message + ' ' + escapeHTML(shareWithDisplayName) + ' ';\n\t\t\treturn avatar + hidden;\n\t\t}\n\n\t\tvar userName = parts[1];\n\t\tvar userDomain = parts[3];\n\t\tvar server = parts[4];\n\t\tvar tooltip = message + ' ' + userName;\n\t\tif (userDomain) {\n\t\t\ttooltip += '@' + userDomain;\n\t\t}\n\t\tif (server) {\n\t\t\tif (!userDomain) {\n\t\t\t\tuserDomain = '…';\n\t\t\t}\n\t\t\ttooltip += '@' + server;\n\t\t}\n\n\t\tvar html = '';\n\t\thtml += '' + escapeHTML(userName) + ' ';\n\t\tif (userDomain) {\n\t\t\thtml += '@' + escapeHTML(userDomain) + ' ';\n\t\t}\n\t\thtml += ' ';\n\t\treturn html;\n\t},\n\t/**\n\t * Loop over all recipients in the list and format them using\n\t * all kind of fancy magic.\n\t *\n\t * @param {Object} recipients array of all the recipients\n\t * @return {String[]} modified list of recipients\n\t */\n\t_formatShareList: function(recipients) {\n\t\tvar _parent = this;\n\t\trecipients = _.toArray(recipients);\n\t\trecipients.sort(function(a, b) {\n\t\t\treturn a.shareWithDisplayName.localeCompare(b.shareWithDisplayName);\n\t\t});\n\t\treturn $.map(recipients, function(recipient) {\n\t\t\treturn _parent._formatRemoteShare(recipient.shareWith, recipient.shareWithDisplayName, t('core', 'Shared with'));\n\t\t});\n\t},\n\t/**\n\t * Marks/unmarks a given file as shared by changing its action icon\n\t * and folder icon.\n\t *\n\t * @param $tr file element to mark as shared\n\t * @param hasShares whether shares are available\n\t * @param hasLink whether link share is available\n\t */\n\tmarkFileAsShared: function($tr, hasShares, hasLink) {\n\t\tvar action = $tr.find('.fileactions .action[data-action=\"Share\"]');\n\t\tvar type = $tr.data('type');\n\t\tvar icon = action.find('.icon');\n\t\tvar message, recipients, avatars;\n\t\tvar ownerId = $tr.attr('data-share-owner-id');\n\t\tvar owner = $tr.attr('data-share-owner');\n\t\tvar mountType = $tr.attr('data-mounttype');\n\t\tvar shareFolderIcon;\n\t\tvar iconClass = 'icon-shared';\n\t\taction.removeClass('shared-style');\n\t\t// update folder icon\n\t\tif (type === 'dir' && (hasShares || hasLink || ownerId)) {\n\t\t\tif (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType);\n\t\t\t} else if (hasLink) {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-public');\n\t\t\t} else {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-shared');\n\t\t\t}\n\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');\n\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t} else if (type === 'dir') {\n\t\t\tvar isEncrypted = $tr.attr('data-e2eencrypted');\n\t\t\t// FIXME: duplicate of FileList._createRow logic for external folder,\n\t\t\t// need to refactor the icon logic into a single code path eventually\n\t\t\tif (isEncrypted === 'true') {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted');\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t\t} else if (mountType && mountType.indexOf('external') === 0) {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir-external');\n\t\t\t\t$tr.attr('data-icon', shareFolderIcon);\n\t\t\t} else {\n\t\t\t\tshareFolderIcon = OC.MimeType.getIconUrl('dir');\n\t\t\t\t// back to default\n\t\t\t\t$tr.removeAttr('data-icon');\n\t\t\t}\n\t\t\t$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');\n\t\t}\n\t\t// update share action text / icon\n\t\tif (hasShares || ownerId) {\n\t\t\trecipients = $tr.data('share-recipient-data');\n\t\t\taction.addClass('shared-style');\n\n\t\t\tavatars = '' + t('core', 'Shared') + ' ';\n\t\t\t// even if reshared, only show \"Shared by\"\n\t\t\tif (ownerId) {\n\t\t\t\tmessage = t('core', 'Shared by');\n\t\t\t\tavatars = this._formatRemoteShare(ownerId, owner, message);\n\t\t\t} else if (recipients) {\n\t\t\t\tavatars = this._formatShareList(recipients);\n\t\t\t}\n\t\t\taction.html(avatars).prepend(icon);\n\n\t\t\tif (ownerId || recipients) {\n\t\t\t\tvar avatarElement = action.find('.avatar');\n\t\t\t\tavatarElement.each(function () {\n\t\t\t\t\t$(this).avatar($(this).data('username'), 32);\n\t\t\t\t});\n\t\t\t\taction.find('span[title]').tooltip({placement: 'top'});\n\t\t\t}\n\t\t} else {\n\t\t\taction.html('' + t('core', 'Shared') + ' ').prepend(icon);\n\t\t}\n\t\tif (hasLink) {\n\t\t\ticonClass = 'icon-public';\n\t\t}\n\t\ticon.removeClass('icon-shared icon-public').addClass(iconClass);\n\t},\n\tshowDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) {\n\t\tvar configModel = new OC.Share.ShareConfigModel();\n\t\tvar attributes = {itemType: itemType, itemSource: itemSource, possiblePermissions: possiblePermissions};\n\t\tvar itemModel = new OC.Share.ShareItemModel(attributes, {configModel: configModel});\n\t\tvar dialogView = new OC.Share.ShareDialogView({\n\t\t\tid: 'dropdown',\n\t\t\tmodel: itemModel,\n\t\t\tconfigModel: configModel,\n\t\t\tclassName: 'drop shareDropDown',\n\t\t\tattributes: {\n\t\t\t\t'data-item-source-name': filename,\n\t\t\t\t'data-item-type': itemType,\n\t\t\t\t'data-item-source': itemSource\n\t\t\t}\n\t\t});\n\t\tdialogView.setShowLink(link);\n\t\tvar $dialog = dialogView.render().$el;\n\t\t$dialog.appendTo(appendTo);\n\t\t$dialog.slideDown(OC.menuSpeed, function() {\n\t\t\tOC.Share.droppedDown = true;\n\t\t});\n\t\titemModel.fetch();\n\t},\n\thideDropDown:function(callback) {\n\t\tOC.Share.currentShares = null;\n\t\t$('#dropdown').slideUp(OC.menuSpeed, function() {\n\t\t\tOC.Share.droppedDown = false;\n\t\t\t$('#dropdown').remove();\n\t\t\tif (typeof FileActions !== 'undefined') {\n\t\t\t\t$('tr').removeClass('mouseOver');\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tcallback.call();\n\t\t\t}\n\t\t});\n\t},\n\tdirname:function(path) {\n\t\treturn path.replace(/\\\\/g,'/').replace(/\\/[^\\/]*$/, '');\n\t}\n});\n\n$(document).ready(function() {\n\tif(typeof monthNames != 'undefined'){\n\t\t// min date should always be the next day\n\t\tvar minDate = new Date();\n\t\tminDate.setDate(minDate.getDate()+1);\n\t\t$.datepicker.setDefaults({\n\t\t\tmonthNames: monthNames,\n\t\t\tmonthNamesShort: monthNamesShort,\n\t\t\tdayNames: dayNames,\n\t\t\tdayNamesMin: dayNamesMin,\n\t\t\tdayNamesShort: dayNamesShort,\n\t\t\tfirstDay: firstDay,\n\t\t\tminDate : minDate\n\t\t});\n\t}\n\n\t$(this).click(function(event) {\n\t\tvar target = $(event.target);\n\t\tvar isMatched = !target.is('.drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon')\n\t\t\t&& !target.closest('#ui-datepicker-div').length && !target.closest('.ui-autocomplete').length;\n\t\tif (OC.Share && OC.Share.droppedDown && isMatched && $('#dropdown').has(event.target).length === 0) {\n\t\t\tOC.Share.hideDropDown();\n\t\t}\n\t});\n\n\n\n});\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 81326cdb6c..4d3967e296 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -720,7 +720,7 @@
$editCb.prop('indeterminate', !checked && numberChecked > 0);
}
} else {
- if ($element.attr('name') === 'edit' && $element.is(':checked')) {
+ if ($('input[name="edit"]', $li).is(':checked')) {
permissions |= OC.PERMISSION_UPDATE;
}
}