nextcloud/apps/systemtags/js/systemtags.js.map

1 line
52 KiB
Plaintext

{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/systemtags/src/systemtags.js","webpack:///./apps/systemtags/src/app.js","webpack:///./apps/systemtags/src/systemtagsfilelist.js","webpack:///./apps/systemtags/src/filesplugin.js","webpack:///./apps/systemtags/src/systemtagsinfoview.js","webpack:///./apps/systemtags/src/systemtagsinfoviewtoggleview.js","webpack:///./apps/systemtags/src/css/systemtagsfilelist.scss?69bd","webpack:///./apps/systemtags/src/css/systemtagsfilelist.scss","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.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","window","OCA","SystemTags","App","initFileList","$el","this","_fileList","FileList","id","fileActions","_createFileActions","config","Files","getFilesConfig","shown","appName","removeFileList","$fileList","empty","FileActions","registerDefaultActions","merge","_globalActionsInitialized","_onActionsUpdated","_","on","register","OC","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","ev","action","registerAction","defaultAction","mime","destroy","off","$","document","ready","e","target","options","initialize","extend","_systemTagIds","_lastUsedTags","_clientSideSort","_allowSelection","_filterField","apply","arguments","initialized","systemTagIds","Plugins","attach","$controls","find","defer","_getLastUsedTags","_initFilterField","$filterField","remove","self","ajax","type","url","generateUrl","success","response","$container","append","select2","placeholder","allowClear","multiple","toggleSelect","separator","query","_queryTagsAutocomplete","tag","initSelection","element","callback","val","trim","tagIds","split","tags","collection","fetch","each","tagId","isUndefined","push","toJSON","formatResult","getDescriptiveTag","formatSelection","outerHTML","sortResults","results","sort","a","b","aLastUsed","indexOf","bLastUsed","Util","naturalSortCompare","escapeMarkup","formatNoMatches","_onTagsChanged","filterByName","term","invoke","_onUrlChanged","dir","filter","reload","trigger","jQuery","Event","join","updateEmptyContent","getCurrentDirectory","length","html","toggleClass","isEmpty","getDirectoryPermissions","PERMISSION_DELETE","updateStorageStatistics","_setCurrentDir","setFiles","Deferred","resolve","_selectedFiles","_selectionSummary","clear","_currentFileModel","prop","showMask","_reloadCall","filesClient","getFilteredFiles","properties","_getWebdavProperties","_detailsView","_updateDetailsView","callBack","reloadCallback","then","status","result","unshift","FilesPlugin","ignoreLists","systemTagsInfoView","SystemTagsInfoView","registerDetailView","getRegisteredDetailViews","detailView","MainFileInfoDetailView","systemTagsInfoViewToggleView","SystemTagsInfoViewToggleView","render","listenTo","detach","modelToSelection","model","data","isUserAdmin","canAssign","locked","DetailFileInfoView","_rendered","className","_inputView","SystemTagsInputField","allowActions","allowCreate","isAdmin","selectedTagsCollection","map","SystemTagsMappingCollection","objectType","_onTagRenamedGlobally","_onTagDeletedGlobally","_onSelectTag","_onDeselectTag","changedTag","selectedTagMapping","set","setFileInfo","fileInfo","setObjectId","fetched","appliedTags","setData","show","hide","isVisible","hasClass","removeClass","addClass","openDropdown","Backbone","View","tagName","events","_systemTagsInfoView","template","click","content","locals","useSourceMap","list","toString","item","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","concat","sourceURLs","sources","source","sourceRoot","cssWithMappingToString","mediaQuery","alreadyImportedModules","_i","memo","stylesInDom","isOldIE","Boolean","all","atob","getTarget","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","listToStyles","styles","newStyles","base","part","css","media","parts","addStylesToDom","domStyle","j","refs","addStyle","insertStyleElement","style","createElement","attributes","nonce","keys","forEach","setAttribute","insert","Error","appendChild","textStore","replaceText","index","replacement","applyToSingletonTag","obj","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","firstChild","singleton","singletonCounter","update","styleIndex","parentNode","removeStyleElement","newObj","newList","mayRemove","_domStyle"],"mappings":"aACE,IAAIA,EAAmB,GA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I6D,EAAYD,EAAU5D,GAE1B,GAAuB,IAAnB6D,EAAUrC,KAAY,CACxB,IAAK,IAAID,EAAI,EAAGA,EAAIsC,EAAUzC,MAAMnI,OAAQsI,IAC1CsC,EAAUzC,MAAMG,YAGXrB,EAAY2D,EAAU3S","file":"systemtags.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 = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import './app'\nimport './systemtagsfilelist'\nimport './filesplugin'\nimport './systemtagsinfoview'\nimport './systemtagsinfoviewtoggleview'\nimport './css/systemtagsfilelist.scss'\n\nwindow.OCA.SystemTags = OCA.SystemTags;\n","/*\n * Copyright (c) 2015 Vincent Petry <pvince81@owncloud.com>\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 (!OCA.SystemTags) {\n\t\t/**\n\t\t * @namespace\n\t\t */\n\t\tOCA.SystemTags = {};\n\t}\n\n\tOCA.SystemTags.App = {\n\n\t\tinitFileList: function($el) {\n\t\t\tif (this._fileList) {\n\t\t\t\treturn this._fileList;\n\t\t\t}\n\n\t\t\tthis._fileList = new OCA.SystemTags.FileList(\n\t\t\t\t$el,\n\t\t\t\t{\n\t\t\t\t\tid: 'systemtags',\n\t\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t\t// The file list is created when a \"show\" event is handled,\n\t\t\t\t\t// so it should be marked as \"shown\" like it would have been\n\t\t\t\t\t// done if handling the event with the file list already\n\t\t\t\t\t// created.\n\t\t\t\t\tshown: true\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis._fileList.appName = t('systemtags', 'Tags');\n\t\t\treturn this._fileList;\n\t\t},\n\n\t\tremoveFileList: function() {\n\t\t\tif (this._fileList) {\n\t\t\t\tthis._fileList.$fileList.empty();\n\t\t\t}\n\t\t},\n\n\t\t_createFileActions: function() {\n\t\t\t// inherit file actions from the files app\n\t\t\tvar fileActions = new OCA.Files.FileActions();\n\t\t\t// note: not merging the legacy actions because legacy apps are not\n\t\t\t// compatible with the sharing overview and need to be adapted first\n\t\t\tfileActions.registerDefaultActions();\n\t\t\tfileActions.merge(OCA.Files.fileActions);\n\n\t\t\tif (!this._globalActionsInitialized) {\n\t\t\t\t// in case actions are registered later\n\t\t\t\tthis._onActionsUpdated = _.bind(this._onActionsUpdated, this);\n\t\t\t\tOCA.Files.fileActions.on('setDefault.app-systemtags', this._onActionsUpdated);\n\t\t\t\tOCA.Files.fileActions.on('registerAction.app-systemtags', this._onActionsUpdated);\n\t\t\t\tthis._globalActionsInitialized = true;\n\t\t\t}\n\n\t\t\t// when the user clicks on a folder, redirect to the corresponding\n\t\t\t// folder in the files app instead of opening it directly\n\t\t\tfileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {\n\t\t\t\tOCA.Files.App.setActiveView('files', {silent: true});\n\t\t\t\tOCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true);\n\t\t\t});\n\t\t\tfileActions.setDefault('dir', 'Open');\n\t\t\treturn fileActions;\n\t\t},\n\n\t\t_onActionsUpdated: function(ev) {\n\t\t\tif (!this._fileList) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (ev.action) {\n\t\t\t\tthis._fileList.fileActions.registerAction(ev.action);\n\t\t\t} else if (ev.defaultAction) {\n\t\t\t\tthis._fileList.fileActions.setDefault(\n\t\t\t\t\tev.defaultAction.mime,\n\t\t\t\t\tev.defaultAction.name\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Destroy the app\n\t\t */\n\t\tdestroy: function() {\n\t\t\tOCA.Files.fileActions.off('setDefault.app-systemtags', this._onActionsUpdated);\n\t\t\tOCA.Files.fileActions.off('registerAction.app-systemtags', this._onActionsUpdated);\n\t\t\tthis.removeFileList();\n\t\t\tthis._fileList = null;\n\t\t\tdelete this._globalActionsInitialized;\n\t\t}\n\t};\n\n})();\n\n$(document).ready(function() {\n\t$('#app-content-systemtagsfilter').on('show', function(e) {\n\t\tOCA.SystemTags.App.initFileList($(e.target));\n\t});\n\t$('#app-content-systemtagsfilter').on('hide', function() {\n\t\tOCA.SystemTags.App.removeFileList();\n\t});\n});\n","/*\n * Copyright (c) 2016 Vincent Petry <pvince81@owncloud.com>\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(function() {\n\t/**\n\t * @class OCA.SystemTags.FileList\n\t * @augments OCA.Files.FileList\n\t *\n\t * @classdesc SystemTags file list.\n\t * Contains a list of files filtered by system tags.\n\t *\n\t * @param $el container element with existing markup for the #controls\n\t * and a table\n\t * @param [options] map of options, see other parameters\n\t * @param {Array.<string>} [options.systemTagIds] array of system tag ids to\n\t * filter by\n\t */\n\tvar FileList = function($el, options) {\n\t\tthis.initialize($el, options);\n\t};\n\tFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,\n\t\t/** @lends OCA.SystemTags.FileList.prototype */ {\n\t\tid: 'systemtagsfilter',\n\t\tappName: t('systemtags', 'Tagged files'),\n\n\t\t/**\n\t\t * Array of system tag ids to filter by\n\t\t *\n\t\t * @type Array.<string>\n\t\t */\n\t\t_systemTagIds: [],\n\t\t_lastUsedTags: [],\n\n\t\t_clientSideSort: true,\n\t\t_allowSelection: false,\n\n\t\t_filterField: null,\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tinitialize: function($el, options) {\n\t\t\tOCA.Files.FileList.prototype.initialize.apply(this, arguments);\n\t\t\tif (this.initialized) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (options && options.systemTagIds) {\n\t\t\t\tthis._systemTagIds = options.systemTagIds;\n\t\t\t}\n\n\t\t\tOC.Plugins.attach('OCA.SystemTags.FileList', this);\n\n\t\t\tvar $controls = this.$el.find('#controls').empty();\n\n\t\t\t_.defer(_.bind(this._getLastUsedTags, this));\n\t\t\tthis._initFilterField($controls);\n\t\t},\n\t\t\n\t\tdestroy: function() {\n\t\t\tthis.$filterField.remove();\n\n\t\t\tOCA.Files.FileList.prototype.destroy.apply(this, arguments);\n\t\t},\n\n\t\t_getLastUsedTags: function() {\n\t\t\tvar self = this;\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: OC.generateUrl('/apps/systemtags/lastused'),\n\t\t\t\tsuccess: function (response) {\n\t\t\t\t\tself._lastUsedTags = response;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_initFilterField: function($container) {\n\t\t\tvar self = this;\n\t\t\tthis.$filterField = $('<input type=\"hidden\" name=\"tags\"/>');\n\t\t\t$container.append(this.$filterField);\n\t\t\tthis.$filterField.select2({\n\t\t\t\tplaceholder: t('systemtags', 'Select tags to filter by'),\n\t\t\t\tallowClear: false,\n\t\t\t\tmultiple: true,\n\t\t\t\ttoggleSelect: true,\n\t\t\t\tseparator: ',',\n\t\t\t\tquery: _.bind(this._queryTagsAutocomplete, this),\n\n\t\t\t\tid: function(tag) {\n\t\t\t\t\treturn tag.id;\n\t\t\t\t},\n\n\t\t\t\tinitSelection: function(element, callback) {\n\t\t\t\t\tvar val = $(element).val().trim();\n\t\t\t\t\tif (val) {\n\t\t\t\t\t\tvar tagIds = val.split(','),\n\t\t\t\t\t\t\ttags = [];\n\n\t\t\t\t\t\tOC.SystemTags.collection.fetch({\n\t\t\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\t\t\t_.each(tagIds, function(tagId) {\n\t\t\t\t\t\t\t\t\tvar tag = OC.SystemTags.collection.get(tagId);\n\t\t\t\t\t\t\t\t\tif (!_.isUndefined(tag)) {\n\t\t\t\t\t\t\t\t\t\ttags.push(tag.toJSON());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tcallback(tags);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback([]);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tformatResult: function (tag) {\n\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag);\n\t\t\t\t},\n\n\t\t\t\tformatSelection: function (tag) {\n\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag)[0].outerHTML;\n\t\t\t\t},\n\n\t\t\t\tsortResults: function(results) {\n\t\t\t\t\tresults.sort(function(a, b) {\n\t\t\t\t\t\tvar aLastUsed = self._lastUsedTags.indexOf(a.id);\n\t\t\t\t\t\tvar bLastUsed = self._lastUsedTags.indexOf(b.id);\n\n\t\t\t\t\t\tif (aLastUsed !== bLastUsed) {\n\t\t\t\t\t\t\tif (bLastUsed === -1) {\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aLastUsed === -1) {\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn aLastUsed < bLastUsed ? -1 : 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Both not found\n\t\t\t\t\t\treturn OC.Util.naturalSortCompare(a.name, b.name);\n\t\t\t\t\t});\n\t\t\t\t\treturn results;\n\t\t\t\t},\n\n\t\t\t\tescapeMarkup: function(m) {\n\t\t\t\t\t// prevent double markup escape\n\t\t\t\t\treturn m;\n\t\t\t\t},\n\t\t\t\tformatNoMatches: function() {\n\t\t\t\t\treturn t('systemtags', 'No tags found');\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.$filterField.on('change', _.bind(this._onTagsChanged, this));\n\t\t\treturn this.$filterField;\n\t\t},\n\n\t\t/**\n\t\t * Autocomplete function for dropdown results\n\t\t *\n\t\t * @param {Object} query select2 query object\n\t\t */\n\t\t_queryTagsAutocomplete: function(query) {\n\t\t\tOC.SystemTags.collection.fetch({\n\t\t\t\tsuccess: function() {\n\t\t\t\t\tvar results = OC.SystemTags.collection.filterByName(query.term);\n\n\t\t\t\t\tquery.callback({\n\t\t\t\t\t\tresults: _.invoke(results, 'toJSON')\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 * Event handler for when the URL changed\n\t\t */\n\t\t_onUrlChanged: function(e) {\n\t\t\tif (e.dir) {\n\t\t\t\tvar tags = _.filter(e.dir.split('/'), function(val) { return val.trim() !== ''; });\n\t\t\t\tthis.$filterField.select2('val', tags || []);\n\t\t\t\tthis._systemTagIds = tags;\n\t\t\t\tthis.reload();\n\t\t\t}\n\t\t},\n\n\t\t_onTagsChanged: function(ev) {\n\t\t\tvar val = $(ev.target).val().trim();\n\t\t\tif (val !== '') {\n\t\t\t\tthis._systemTagIds = val.split(',');\n\t\t\t} else {\n\t\t\t\tthis._systemTagIds = [];\n\t\t\t}\n\n\t\t\tthis.$el.trigger(jQuery.Event('changeDirectory', {\n\t\t\t\tdir: this._systemTagIds.join('/')\n\t\t\t}));\n\t\t\tthis.reload();\n\t\t},\n\n\t\tupdateEmptyContent: function() {\n\t\t\tvar dir = this.getCurrentDirectory();\n\t\t\tif (dir === '/') {\n\t\t\t\t// root has special permissions\n\t\t\t\tif (!this._systemTagIds.length) {\n\t\t\t\t\t// no tags selected\n\t\t\t\t\tthis.$el.find('#emptycontent').html('<div class=\"icon-systemtags\"></div>' +\n\t\t\t\t\t\t'<h2>' + t('systemtags', 'Please select tags to filter by') + '</h2>');\n\t\t\t\t} else {\n\t\t\t\t\t// tags selected but no results\n\t\t\t\t\tthis.$el.find('#emptycontent').html('<div class=\"icon-systemtags\"></div>' +\n\t\t\t\t\t\t'<h2>' + t('systemtags', 'No files found for the selected tags') + '</h2>');\n\t\t\t\t}\n\t\t\t\tthis.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);\n\t\t\t\tthis.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments);\n\t\t\t}\n\t\t},\n\n\t\tgetDirectoryPermissions: function() {\n\t\t\treturn OC.PERMISSION_READ | OC.PERMISSION_DELETE;\n\t\t},\n\n\t\tupdateStorageStatistics: function() {\n\t\t\t// no op because it doesn't have\n\t\t\t// storage info like free space / used space\n\t\t},\n\n\t\treload: function() {\n\t\t\t// there is only root\n\t\t\tthis._setCurrentDir('/', false);\n\n\t\t\tif (!this._systemTagIds.length) {\n\t\t\t\t// don't reload\n\t\t\t\tthis.updateEmptyContent();\n\t\t\t\tthis.setFiles([]);\n\t\t\t\treturn $.Deferred().resolve();\n\t\t\t}\n\n\t\t\tthis._selectedFiles = {};\n\t\t\tthis._selectionSummary.clear();\n\t\t\tif (this._currentFileModel) {\n\t\t\t\tthis._currentFileModel.off();\n\t\t\t}\n\t\t\tthis._currentFileModel = null;\n\t\t\tthis.$el.find('.select-all').prop('checked', false);\n\t\t\tthis.showMask();\n\t\t\tthis._reloadCall = this.filesClient.getFilteredFiles(\n\t\t\t\t{\n\t\t\t\t\tsystemTagIds: this._systemTagIds\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: this._getWebdavProperties()\n\t\t\t\t}\n\t\t\t);\n\t\t\tif (this._detailsView) {\n\t\t\t\t// close sidebar\n\t\t\t\tthis._updateDetailsView(null);\n\t\t\t}\n\t\t\tvar callBack = this.reloadCallback.bind(this);\n\t\t\treturn this._reloadCall.then(callBack, callBack);\n\t\t},\n\n\t\treloadCallback: function(status, result) {\n\t\t\tif (result) {\n\t\t\t\t// prepend empty dir info because original handler\n\t\t\t\tresult.unshift({});\n\t\t\t}\n\n\t\t\treturn OCA.Files.FileList.prototype.reloadCallback.call(this, status, result);\n\t\t}\n\t});\n\n\tOCA.SystemTags.FileList = FileList;\n})();\n","/*\n * Copyright (c) 2015 Vincent Petry <pvince81@owncloud.com>\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\tOCA.SystemTags = _.extend({}, OCA.SystemTags);\n\tif (!OCA.SystemTags) {\n\t\t/**\n\t\t * @namespace\n\t\t */\n\t\tOCA.SystemTags = {};\n\t}\n\n\t/**\n\t * @namespace\n\t */\n\tOCA.SystemTags.FilesPlugin = {\n\t\tignoreLists: [\n\t\t\t'trashbin',\n\t\t\t'files.public'\n\t\t],\n\n\t\tattach: function(fileList) {\n\t\t\tif (this.ignoreLists.indexOf(fileList.id) >= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView();\n\t\t\tfileList.registerDetailView(systemTagsInfoView);\n\n\t\t\t_.each(fileList.getRegisteredDetailViews(), function(detailView) {\n\t\t\t\tif (detailView instanceof OCA.Files.MainFileInfoDetailView) {\n\t\t\t\t\tvar systemTagsInfoViewToggleView =\n\t\t\t\t\t\tnew OCA.SystemTags.SystemTagsInfoViewToggleView({\n\t\t\t\t\t\t\tsystemTagsInfoView: systemTagsInfoView\n\t\t\t\t\t\t});\n\t\t\t\t\tsystemTagsInfoViewToggleView.render();\n\n\t\t\t\t\t// The toggle view element is detached before the\n\t\t\t\t\t// MainFileInfoDetailView is rendered to prevent its event\n\t\t\t\t\t// handlers from being removed.\n\t\t\t\t\tsystemTagsInfoViewToggleView.listenTo(detailView, 'pre-render', function() {\n\t\t\t\t\t\tsystemTagsInfoViewToggleView.$el.detach();\n\t\t\t\t\t});\n\t\t\t\t\tsystemTagsInfoViewToggleView.listenTo(detailView, 'post-render', function() {\n\t\t\t\t\t\tdetailView.$el.find('.file-details').append(systemTagsInfoViewToggleView.$el);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n})();\n\nOC.Plugins.register('OCA.Files.FileList', OCA.SystemTags.FilesPlugin);\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(function(OCA) {\n\n\tfunction modelToSelection(model) {\n\t\tvar data = model.toJSON();\n\t\tif (!OC.isUserAdmin() && !data.canAssign) {\n\t\t\tdata.locked = true;\n\t\t}\n\t\treturn data;\n\t}\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsInfoView\n\t * @classdesc\n\t *\n\t * Displays a file's system tags\n\t *\n\t */\n\tvar SystemTagsInfoView = OCA.Files.DetailFileInfoView.extend(\n\t\t/** @lends OCA.SystemTags.SystemTagsInfoView.prototype */ {\n\n\t\t_rendered: false,\n\n\t\tclassName: 'systemTagsInfoView hidden',\n\n\t\t/**\n\t\t * @type OC.SystemTags.SystemTagsInputField\n\t\t */\n\t\t_inputView: null,\n\n\t\tinitialize: function(options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\n\t\t\tthis._inputView = new OC.SystemTags.SystemTagsInputField({\n\t\t\t\tmultiple: true,\n\t\t\t\tallowActions: true,\n\t\t\t\tallowCreate: true,\n\t\t\t\tisAdmin: OC.isUserAdmin(),\n\t\t\t\tinitSelection: function(element, callback) {\n\t\t\t\t\tcallback(self.selectedTagsCollection.map(modelToSelection));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedTagsCollection = new OC.SystemTags.SystemTagsMappingCollection([], {objectType: 'files'});\n\n\t\t\tthis._inputView.collection.on('change:name', this._onTagRenamedGlobally, this);\n\t\t\tthis._inputView.collection.on('remove', this._onTagDeletedGlobally, this);\n\n\t\t\tthis._inputView.on('select', this._onSelectTag, this);\n\t\t\tthis._inputView.on('deselect', this._onDeselectTag, this);\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was selected\n\t\t */\n\t\t_onSelectTag: function(tag) {\n\t\t\t// create a mapping entry for this tag\n\t\t\tthis.selectedTagsCollection.create(tag.toJSON());\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag gets deselected.\n\t\t * Removes the selected tag from the mapping collection.\n\t\t *\n\t\t * @param {string} tagId tag id\n\t\t */\n\t\t_onDeselectTag: function(tagId) {\n\t\t\tthis.selectedTagsCollection.get(tagId).destroy();\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was renamed globally.\n\t\t *\n\t\t * This will automatically adjust the tag mapping collection to\n\t\t * container the new name.\n\t\t *\n\t\t * @param {OC.Backbone.Model} changedTag tag model that has changed\n\t\t */\n\t\t_onTagRenamedGlobally: function(changedTag) {\n\t\t\t// also rename it in the selection, if applicable\n\t\t\tvar selectedTagMapping = this.selectedTagsCollection.get(changedTag.id);\n\t\t\tif (selectedTagMapping) {\n\t\t\t\tselectedTagMapping.set(changedTag.toJSON());\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was deleted globally.\n\t\t *\n\t\t * This will automatically adjust the tag mapping collection to\n\t\t * container the new name.\n\t\t *\n\t\t * @param {OC.Backbone.Model} tagId tag model that has changed\n\t\t */\n\t\t_onTagDeletedGlobally: function(tagId) {\n\t\t\t// also rename it in the selection, if applicable\n\t\t\tthis.selectedTagsCollection.remove(tagId);\n\t\t},\n\n\t\tsetFileInfo: function(fileInfo) {\n\t\t\tvar self = this;\n\t\t\tif (!this._rendered) {\n\t\t\t\tthis.render();\n\t\t\t}\n\n\t\t\tif (fileInfo) {\n\t\t\t\tthis.selectedTagsCollection.setObjectId(fileInfo.id);\n\t\t\t\tthis.selectedTagsCollection.fetch({\n\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\tcollection.fetched = true;\n\n\t\t\t\t\t\tvar appliedTags = collection.map(modelToSelection);\n\t\t\t\t\t\tself._inputView.setData(appliedTags);\n\n\t\t\t\t\t\tif (appliedTags.length !== 0) {\n\t\t\t\t\t\t\tself.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.hide();\n\t\t},\n\n\t\t/**\n\t\t * Renders this details view\n\t\t */\n\t\trender: function() {\n\t\t\tvar self = this;\n\n\t\t\tthis.$el.append(this._inputView.$el);\n\t\t\tthis._inputView.render();\n\t\t},\n\n\t\tisVisible: function() {\n\t\t\treturn !this.$el.hasClass('hidden');\n\t\t},\n\n\t\tshow: function() {\n\t\t\tthis.$el.removeClass('hidden');\n\t\t},\n\n\t\thide: function() {\n\t\t\tthis.$el.addClass('hidden');\n\t\t},\n\n\t\topenDropdown: function() {\n\t\t\tthis.$el.find('.systemTagsInputField').select2('open');\n\t\t},\n\n\t\tremove: function() {\n\t\t\tthis._inputView.remove();\n\t\t}\n\t});\n\n\tOCA.SystemTags.SystemTagsInfoView = SystemTagsInfoView;\n\n})(OCA);\n\n","/**\n *\n * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)\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 <http://www.gnu.org/licenses/>.\n *\n */\n\n(function(OCA) {\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsInfoViewToggleView\n\t * @classdesc\n\t *\n\t * View to toggle the visibility of a SystemTagsInfoView.\n\t *\n\t * This toggle view must be explicitly rendered before it is used.\n\t */\n\tvar SystemTagsInfoViewToggleView = OC.Backbone.View.extend(\n\t\t/** @lends OC.Backbone.View.prototype */ {\n\n\t\ttagName: 'span',\n\n\t\tclassName: 'tag-label',\n\n\t\tevents: {\n\t\t\t'click': 'click'\n\t\t},\n\n\t\t/**\n\t\t * @type OCA.SystemTags.SystemTagsInfoView\n\t\t */\n\t\t_systemTagsInfoView: null,\n\n\t\ttemplate: function(data) {\n\t\t\treturn '<span class=\"icon icon-tag\"/>' + t('systemtags', 'Tags');\n\t\t},\n\n\t\t/**\n\t\t * Initialize this toggle view.\n\t\t *\n\t\t * The options must provide a systemTagsInfoView parameter that\n\t\t * references the SystemTagsInfoView to associate to this toggle view.\n\t\t */\n\t\tinitialize: function(options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\n\t\t\tthis._systemTagsInfoView = options.systemTagsInfoView;\n\t\t\tif (!this._systemTagsInfoView) {\n\t\t\t\tthrow 'Missing required parameter \"systemTagsInfoView\"';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggles the visibility of the associated SystemTagsInfoView.\n\t\t *\n\t\t * When the systemTagsInfoView is shown its dropdown is also opened.\n\t\t */\n\t\tclick: function() {\n\t\t\tif (this._systemTagsInfoView.isVisible()) {\n\t\t\t\tthis._systemTagsInfoView.hide();\n\t\t\t} else {\n\t\t\t\tthis._systemTagsInfoView.show();\n\t\t\t\tthis._systemTagsInfoView.openDropdown();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Renders this toggle view.\n\t\t *\n\t\t * @return OCA.SystemTags.SystemTagsInfoViewToggleView this object.\n\t\t */\n\t\trender: function() {\n\t\t\tthis.$el.html(this.template());\n\n\t\t\treturn this;\n\t\t},\n\n\t});\n\n\tOCA.SystemTags.SystemTagsInfoViewToggleView = SystemTagsInfoViewToggleView;\n\n})(OCA);\n","var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./systemtagsfilelist.scss\");\n\nif (typeof content === 'string') {\n content = [[module.id, content, '']];\n}\n\nvar options = {}\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\")(content, options);\n\nif (content.locals) {\n module.exports = content.locals;\n}\n","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"#app-content-systemtagsfilter .select2-container{width:30%;margin-left:10px}#app-sidebar .mainFileInfoView .tag-label{cursor:pointer;padding:13px}#app-sidebar .mainFileInfoView .icon-tag{opacity:.5;vertical-align:middle}\\n\", \"\"]);\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \"{\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = modules[_i]; // skip already imported module\n // this implementation is not 100% perfect for weird media query combinations\n // when a module is imported multiple times with different media queries.\n // I hope this will never occur (Hey this way we have smaller bundles)\n\n if (item[0] == null || !alreadyImportedModules[item[0]]) {\n if (mediaQuery && !item[2]) {\n item[2] = mediaQuery;\n } else if (mediaQuery) {\n item[2] = \"(\".concat(item[2], \") and (\").concat(mediaQuery, \")\");\n }\n\n list.push(item);\n }\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot).concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","\"use strict\";\n\nvar stylesInDom = {};\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nfunction listToStyles(list, options) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n var part = {\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n\n if (!newStyles[id]) {\n styles.push(newStyles[id] = {\n id: id,\n parts: [part]\n });\n } else {\n newStyles[id].parts.push(part);\n }\n }\n\n return styles;\n}\n\nfunction addStylesToDom(styles, options) {\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i];\n var domStyle = stylesInDom[item.id];\n var j = 0;\n\n if (domStyle) {\n domStyle.refs++;\n\n for (; j < domStyle.parts.length; j++) {\n domStyle.parts[j](item.parts[j]);\n }\n\n for (; j < item.parts.length; j++) {\n domStyle.parts.push(addStyle(item.parts[j], options));\n }\n } else {\n var parts = [];\n\n for (; j < item.parts.length; j++) {\n parts.push(addStyle(item.parts[j], options));\n }\n\n stylesInDom[item.id] = {\n id: item.id,\n refs: 1,\n parts: parts\n };\n }\n }\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n\n if (typeof options.attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n options.attributes.nonce = nonce;\n }\n }\n\n Object.keys(options.attributes).forEach(function (key) {\n style.setAttribute(key, options.attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n }\n\n if (sourceMap && btoa) {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {};\n options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n var styles = listToStyles(list, options);\n addStylesToDom(styles, options);\n return function update(newList) {\n var mayRemove = [];\n\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i];\n var domStyle = stylesInDom[item.id];\n\n if (domStyle) {\n domStyle.refs--;\n mayRemove.push(domStyle);\n }\n }\n\n if (newList) {\n var newStyles = listToStyles(newList, options);\n addStylesToDom(newStyles, options);\n }\n\n for (var _i = 0; _i < mayRemove.length; _i++) {\n var _domStyle = mayRemove[_i];\n\n if (_domStyle.refs === 0) {\n for (var j = 0; j < _domStyle.parts.length; j++) {\n _domStyle.parts[j]();\n }\n\n delete stylesInDom[_domStyle.id];\n }\n }\n };\n};"],"sourceRoot":""}