Perform the post request manually to be able to send the folder id with it

parent db0d5150
......@@ -20,14 +20,19 @@
:on-remove="handleRemove"
:on-success="handleSuccess"
:file-list="fileList"
:headers="requestHeaders"
:http-request="uploadFile"
style="display: inline-block; margin-right: 10px;">
<el-button size="small" type="primary" style="padding: 11px 9px;">Upload File</el-button>
</el-upload>
</template>
<script>
import axios from 'axios'
export default {
props: {
parentId: {type: Number}
},
data() {
return {
fileList: [],
......@@ -49,6 +54,16 @@
this.$events.emit('fileWasUploaded', response);
this.fileList = [];
},
uploadFile(event) {
let data = new FormData();
data.append('parent_id', this.parentId);
data.append('file', event.file);
axios.post(route('api.media.store'), data)
.then(response => {
this.fileList = [];
this.$events.emit('fileWasUploaded', response);
});
},
handleRemove() {},
},
mounted() {
......
......@@ -20642,6 +20642,309 @@ module.exports = function ( delay, atBegin, callback ) {
/***/ }),
/* 12 */
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
Modified by Evan You @yyx990803
*/
var hasDocument = typeof document !== 'undefined'
if (typeof DEBUG !== 'undefined' && DEBUG) {
if (!hasDocument) {
throw new Error(
'vue-style-loader cannot be used in a non-browser environment. ' +
"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
) }
}
var listToStyles = __webpack_require__(151)
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
type StyleObjectPart = {
css: string;
media: string;
sourceMap: ?string
}
*/
var stylesInDom = {/*
[id: number]: {
id: number,
refs: number,
parts: Array<(obj?: StyleObjectPart) => void>
}
*/}
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
var singletonElement = null
var singletonCounter = 0
var isProduction = false
var noop = function () {}
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
module.exports = function (parentId, list, _isProduction) {
isProduction = _isProduction
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
module.exports =
......@@ -21118,7 +21421,7 @@ module.exports =
/***/ 170:
/***/ function(module, exports) {
module.exports = __webpack_require__(13);
module.exports = __webpack_require__(15);
/***/ },
......@@ -21185,7 +21488,7 @@ module.exports =
/******/ });
/***/ }),
/* 13 */
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21212,7 +21515,7 @@ exports.default = function (target) {
;
/***/ }),
/* 14 */
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21402,7 +21705,7 @@ exports.default = {
};
/***/ }),
/* 15 */
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21447,7 +21750,7 @@ var scrollBarWidth = void 0;
;
/***/ }),
/* 16 */
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21642,7 +21945,7 @@ var removeResizeListener = exports.removeResizeListener = function removeResizeL
};
/***/ }),
/* 17 */
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21711,7 +22014,7 @@ var i18n = exports.i18n = function i18n(fn) {
exports.default = { use: use, t: t, i18n: i18n };
/***/ }),
/* 18 */
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21749,7 +22052,7 @@ exports["default"] = type;
module.exports = exports['default'];
/***/ }),
/* 19 */
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -21848,309 +22151,6 @@ module.exports = defaults;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(116)))
/***/ }),
/* 20 */
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
Modified by Evan You @yyx990803
*/
var hasDocument = typeof document !== 'undefined'
if (typeof DEBUG !== 'undefined' && DEBUG) {
if (!hasDocument) {
throw new Error(
'vue-style-loader cannot be used in a non-browser environment. ' +
"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
) }
}
var listToStyles = __webpack_require__(151)
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
type StyleObjectPart = {
css: string;
media: string;
sourceMap: ?string
}
*/
var stylesInDom = {/*
[id: number]: {
id: number,
refs: number,
parts: Array<(obj?: StyleObjectPart) => void>
}
*/}
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
var singletonElement = null
var singletonCounter = 0
var isProduction = false
var noop = function () {}
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
module.exports = function (parentId, list, _isProduction) {
isProduction = _isProduction
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
......@@ -22242,7 +22242,7 @@ var _vue = __webpack_require__(3);
var _vue2 = _interopRequireDefault(_vue);
var _merge = __webpack_require__(13);
var _merge = __webpack_require__(15);
var _merge2 = _interopRequireDefault(_merge);
......@@ -22250,7 +22250,7 @@ var _popupManager = __webpack_require__(51);
var _popupManager2 = _interopRequireDefault(_popupManager);
var _scrollbarWidth = __webpack_require__(15);
var _scrollbarWidth = __webpack_require__(17);
var _scrollbarWidth2 = _interopRequireDefault(_scrollbarWidth);
......@@ -22593,7 +22593,7 @@ module.exports =
/***/ 46:
/***/ function(module, exports) {
module.exports = __webpack_require__(16);
module.exports = __webpack_require__(18);
/***/ },
......@@ -22797,7 +22797,7 @@ module.exports =
/***/ 261:
/***/ function(module, exports) {
module.exports = __webpack_require__(15);
module.exports = __webpack_require__(17);
/***/ },
......@@ -23005,7 +23005,7 @@ function scrollIntoView(container, selected) {
exports.__esModule = true;
var _locale = __webpack_require__(17);
var _locale = __webpack_require__(19);
exports.default = {
methods: {
......@@ -42385,7 +42385,7 @@ var Component = __webpack_require__(2)(
/* script */
__webpack_require__(166),
/* template */
__webpack_require__(175),
__webpack_require__(177),
/* styles */
null,
/* scopeId */
......@@ -42421,7 +42421,7 @@ module.exports = Component.exports
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(46);
module.exports = __webpack_require__(183);
module.exports = __webpack_require__(185);
/***/ }),
......@@ -42488,7 +42488,7 @@ _vue2.default.component('ckeditor', __webpack_require__(148));
_vue2.default.component('DeleteButton', __webpack_require__(154));
_vue2.default.component('TagsInput', __webpack_require__(157));
_vue2.default.component('SingleMedia', __webpack_require__(160));
_vue2.default.component('MediaManager', __webpack_require__(180));
_vue2.default.component('MediaManager', __webpack_require__(182));
var currentLocale = window.AsgardCMS.currentLocale;
......@@ -48192,7 +48192,7 @@ module.exports =
/* 20 */
/***/ function(module, exports) {
module.exports = __webpack_require__(12);
module.exports = __webpack_require__(14);
/***/ },
/* 21 */
......@@ -48334,7 +48334,7 @@ module.exports =
/* 24 */
/***/ function(module, exports) {
module.exports = __webpack_require__(14);
module.exports = __webpack_require__(16);
/***/ },
/* 25 */
......@@ -50128,7 +50128,7 @@ module.exports =
/* 64 */
/***/ function(module, exports) {
module.exports = __webpack_require__(13);
module.exports = __webpack_require__(15);
/***/ },
/* 65 */
......@@ -53095,13 +53095,13 @@ module.exports =
/* 110 */
/***/ function(module, exports) {
module.exports = __webpack_require__(16);
module.exports = __webpack_require__(18);
/***/ },
/* 111 */
/***/ function(module, exports) {
module.exports = __webpack_require__(17);
module.exports = __webpack_require__(19);
/***/ },
/* 112 */
......@@ -55078,7 +55078,7 @@ module.exports =
/* 136 */
/***/ function(module, exports) {
module.exports = __webpack_require__(15);
module.exports = __webpack_require__(17);
/***/ },
/* 137 */
......@@ -74619,7 +74619,7 @@ module.exports =
/***/ 9:
/***/ function(module, exports) {
module.exports = __webpack_require__(12);
module.exports = __webpack_require__(14);
/***/ },
......@@ -74633,7 +74633,7 @@ module.exports =
/***/ 13:
/***/ function(module, exports) {
module.exports = __webpack_require__(14);
module.exports = __webpack_require__(16);
/***/ },
......@@ -74654,7 +74654,7 @@ module.exports =
/***/ 46:
/***/ function(module, exports) {
module.exports = __webpack_require__(16);
module.exports = __webpack_require__(18);
/***/ },
......@@ -74675,7 +74675,7 @@ module.exports =
/***/ 62:
/***/ function(module, exports) {
module.exports = __webpack_require__(17);
module.exports = __webpack_require__(19);
/***/ },
......@@ -79324,7 +79324,7 @@ module.exports =
/***/ 13:
/***/ function(module, exports) {
module.exports = __webpack_require__(14);
module.exports = __webpack_require__(16);
/***/ },
......@@ -80439,10 +80439,10 @@ module.exports = {
object: __webpack_require__(79),
"enum": __webpack_require__(80),
pattern: __webpack_require__(81),
email: __webpack_require__(18),
url: __webpack_require__(18),
email: __webpack_require__(20),
url: __webpack_require__(20),
date: __webpack_require__(82),
hex: __webpack_require__(18),
hex: __webpack_require__(20),
required: __webpack_require__(83)
};
......@@ -81556,7 +81556,7 @@ module.exports =
/***/ 9:
/***/ function(module, exports) {
module.exports = __webpack_require__(12);
module.exports = __webpack_require__(14);
/***/ },
......@@ -90030,7 +90030,7 @@ exports.default = {
var utils = __webpack_require__(4);
var bind = __webpack_require__(34);
var Axios = __webpack_require__(115);
var defaults = __webpack_require__(19);
var defaults = __webpack_require__(21);
/**
* Create an instance of Axios
......@@ -90113,7 +90113,7 @@ function isSlowBuffer (obj) {
"use strict";
var defaults = __webpack_require__(19);
var defaults = __webpack_require__(21);
var utils = __webpack_require__(4);
var InterceptorManager = __webpack_require__(125);
var dispatchRequest = __webpack_require__(126);
......@@ -90835,7 +90835,7 @@ module.exports = InterceptorManager;
var utils = __webpack_require__(4);
var transformData = __webpack_require__(127);
var isCancel = __webpack_require__(37);
var defaults = __webpack_require__(19);
var defaults = __webpack_require__(21);
/**
* Throws a `Cancel` if cancellation has been requested.
......@@ -93000,7 +93000,7 @@ var content = __webpack_require__(150);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(21)("1fbf6846", content, false);
var update = __webpack_require__(13)("1fbf6846", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
......@@ -93019,7 +93019,7 @@ if(false) {
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(20)(undefined);
exports = module.exports = __webpack_require__(12)(undefined);
// imports
......@@ -93482,7 +93482,7 @@ var Component = __webpack_require__(2)(
/* script */
__webpack_require__(161),
/* template */
__webpack_require__(179),
__webpack_require__(181),
/* styles */
null,
/* scopeId */
......@@ -93532,7 +93532,7 @@ var _MediaList = __webpack_require__(44);
var _MediaList2 = _interopRequireDefault(_MediaList);
var _StringHelpers = __webpack_require__(176);
var _StringHelpers = __webpack_require__(178);
var _StringHelpers2 = _interopRequireDefault(_StringHelpers);
......@@ -93650,7 +93650,7 @@ var content = __webpack_require__(163);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(21)("f4a30e42", content, false);
var update = __webpack_require__(13)("f4a30e42", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
......@@ -93669,7 +93669,7 @@ if(false) {
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(20)(undefined);
exports = module.exports = __webpack_require__(12)(undefined);
// imports
......@@ -93990,10 +93990,12 @@ exports.default = {
this.selectedMedia.length = 0;
this.fetchMediaData();
this.$events.listen('fileWasUploaded', function (eventData) {
_this2.fetchMediaData();
_this2.tableIsLoading = true;
_this2.queryServer({ folder_id: eventData.data.folder_id });
});
this.$events.listen('folderWasCreated', function (eventData) {
_this2.fetchMediaData();
_this2.tableIsLoading = true;
_this2.queryServer({ folder_id: eventData.data.folder_id });
});
}
};
......@@ -94053,7 +94055,7 @@ var content = __webpack_require__(169);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(21)("b7ea12f8", content, false);
var update = __webpack_require__(13)("b7ea12f8", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
......@@ -94072,7 +94074,7 @@ if(false) {
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(20)(undefined);
exports = module.exports = __webpack_require__(12)(undefined);
// imports
......@@ -94174,180 +94176,201 @@ exports.default = {
//
//
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', [_c('el-button', {
staticClass: "new-folder",
attrs: {
"type": "success"
},
on: {
"click": function($event) {
_vm.dialogFormVisible = true
}
}
}, [_c('i', {
staticClass: "el-icon-fa-plus"
}), _vm._v(" New Folder\n ")]), _vm._v(" "), _c('el-dialog', {
attrs: {
"title": "New Folder",
"visible": _vm.dialogFormVisible,
"size": "tiny"
},
on: {
"update:visible": function($event) {
_vm.dialogFormVisible = $event
}
}
}, [_c('el-form', {
directives: [{
name: "loading",
rawName: "v-loading.body",
value: (_vm.loading),
expression: "loading",
modifiers: {
"body": true
}
}],
attrs: {
"model": _vm.folder
}
}, [_c('el-form-item', {
class: {
'el-form-item is-error': _vm.form.errors.has('name')
},
attrs: {
"label": "Folder name"
}
}, [_c('el-input', {
attrs: {
"auto-complete": "off"
},
model: {
value: (_vm.folder.name),
callback: function($$v) {
_vm.folder.name = $$v
},
expression: "folder.name"
}
}), _vm._v(" "), (_vm.form.errors.has('name')) ? _c('div', {
staticClass: "el-form-item__error",
domProps: {
"textContent": _vm._s(_vm.form.errors.first('name'))
}
}) : _vm._e()], 1)], 1), _vm._v(" "), _c('span', {
staticClass: "dialog-footer",
slot: "footer"
}, [_c('el-button', {
on: {
"click": _vm.closeDialog
}
}, [_vm._v("Cancel")]), _vm._v(" "), _c('el-button', {
attrs: {
"type": "primary"
},
on: {
"click": function($event) {
_vm.onSubmit()
}
}
}, [_vm._v("Confirm")])], 1)], 1)], 1)
},staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-669eeea0", module.exports)
}
}
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(195)
}
var Component = __webpack_require__(2)(
/* script */
__webpack_require__(173),
/* template */
__webpack_require__(174),
/* styles */
injectStyle,
/* scopeId */
null,
/* moduleIdentifier (server only) */
null
)
Component.options.__file = "/Users/nicolaswidart/Sites/Asguard/Platform/Modules/Media/Assets/js/components/UploadButton.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] UploadButton.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-ce23c2de", Component.options)
} else {
hotAPI.reload("data-v-ce23c2de", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
module.exports = Component.exports
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', [_c('el-button', {
staticClass: "new-folder",
attrs: {
"type": "success"
},
on: {
"click": function($event) {
_vm.dialogFormVisible = true
}
}
}, [_c('i', {
staticClass: "el-icon-fa-plus"
}), _vm._v(" New Folder\n ")]), _vm._v(" "), _c('el-dialog', {
attrs: {
"title": "New Folder",
"visible": _vm.dialogFormVisible,
"size": "tiny"
},
on: {
"update:visible": function($event) {
_vm.dialogFormVisible = $event
}
}
}, [_c('el-form', {
directives: [{
name: "loading",
rawName: "v-loading.body",
value: (_vm.loading),
expression: "loading",
modifiers: {
"body": true
}
}],
attrs: {
"model": _vm.folder
}
}, [_c('el-form-item', {
class: {
'el-form-item is-error': _vm.form.errors.has('name')
},
attrs: {
"label": "Folder name"
}
}, [_c('el-input', {
attrs: {
"auto-complete": "off"
},
model: {
value: (_vm.folder.name),
callback: function($$v) {
_vm.folder.name = $$v
},
expression: "folder.name"
}
}), _vm._v(" "), (_vm.form.errors.has('name')) ? _c('div', {
staticClass: "el-form-item__error",
domProps: {
"textContent": _vm._s(_vm.form.errors.first('name'))
}
}) : _vm._e()], 1)], 1), _vm._v(" "), _c('span', {
staticClass: "dialog-footer",
slot: "footer"
}, [_c('el-button', {
on: {
"click": _vm.closeDialog
}
}, [_vm._v("Cancel")]), _vm._v(" "), _c('el-button', {
attrs: {
"type": "primary"
},
on: {
"click": function($event) {
_vm.onSubmit()
}
}
}, [_vm._v("Confirm")])], 1)], 1)], 1)
},staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-669eeea0", module.exports)
}
}
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(173)
}
var Component = __webpack_require__(2)(
/* script */
__webpack_require__(175),
/* template */
__webpack_require__(176),
/* styles */
injectStyle,
/* scopeId */
null,
/* moduleIdentifier (server only) */
null
)
Component.options.__file = "/Users/nicolaswidart/Sites/Asguard/Platform/Modules/Media/Assets/js/components/UploadButton.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] UploadButton.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-ce23c2de", Component.options)
} else {
hotAPI.reload("data-v-ce23c2de", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
module.exports = Component.exports
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(174);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(13)("73255f32", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-ce23c2de\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UploadButton.vue", function() {
var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-ce23c2de\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UploadButton.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(12)(undefined);
// imports
// module
exports.push([module.i, "\n.el-upload__input {\n display: none !important;\n}\n.el-upload--text {\n display: block;\n}\n.el-upload-dragger {\n width: 100%;\n}\n.media-upload {\n margin-bottom: 10px;\n}\n", ""]);
// exports
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _axios = __webpack_require__(7);
var _axios2 = _interopRequireDefault(_axios);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
props: {
parentId: { type: Number }
},
data: function data() {
return {
fileList: []
......@@ -94370,13 +94393,51 @@ exports.default = {
this.$events.emit('fileWasUploaded', response);
this.fileList = [];
},
uploadFile: function uploadFile(event) {
var _this = this;
var data = new FormData();
data.append('parent_id', this.parentId);
data.append('file', event.file);
_axios2.default.post(route('api.media.store'), data).then(function (response) {
_this.fileList = [];
_this.$events.emit('fileWasUploaded', response);
});
},
handleRemove: function handleRemove() {}
},
mounted: function mounted() {}
};
}; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/***/ }),
/* 174 */
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -94391,7 +94452,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
"on-remove": _vm.handleRemove,
"on-success": _vm.handleSuccess,
"file-list": _vm.fileList,
"headers": _vm.requestHeaders
"http-request": _vm.uploadFile
}
}, [_c('el-button', {
staticStyle: {
......@@ -94412,7 +94473,7 @@ if (false) {
}
/***/ }),
/* 175 */
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -94441,7 +94502,11 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
attrs: {
"parent-id": _vm.folderId
}
}), _vm._v(" "), _c('upload-button'), _vm._v(" "), _c('el-button-group', [_c('el-button', {
}), _vm._v(" "), _c('upload-button', {
attrs: {
"parent-id": _vm.folderId
}
}), _vm._v(" "), _c('el-button-group', [_c('el-button', {
attrs: {
"type": "primary",
"disabled": _vm.selectedMedia.length === 0
......@@ -94605,15 +94670,15 @@ if (false) {
}
/***/ }),
/* 176 */
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
var disposed = false
var Component = __webpack_require__(2)(
/* script */
__webpack_require__(177),
__webpack_require__(179),
/* template */
__webpack_require__(178),
__webpack_require__(180),
/* styles */
null,
/* scopeId */
......@@ -94645,7 +94710,7 @@ module.exports = Component.exports
/***/ }),
/* 177 */
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -94672,7 +94737,7 @@ exports.default = {
};
/***/ }),
/* 178 */
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -94687,7 +94752,7 @@ if (false) {
}
/***/ }),
/* 179 */
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -94763,15 +94828,15 @@ if (false) {
}
/***/ }),
/* 180 */
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
var disposed = false
var Component = __webpack_require__(2)(
/* script */
__webpack_require__(181),
__webpack_require__(183),
/* template */
__webpack_require__(182),
__webpack_require__(184),
/* styles */
null,
/* scopeId */
......@@ -94803,7 +94868,7 @@ module.exports = Component.exports
/***/ }),
/* 181 */
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -94844,7 +94909,7 @@ exports.default = {
};
/***/ }),
/* 182 */
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -94859,61 +94924,10 @@ if (false) {
}
/***/ }),
/* 183 */
/* 185 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 184 */,
/* 185 */,
/* 186 */,
/* 187 */,
/* 188 */,
/* 189 */,
/* 190 */,
/* 191 */,
/* 192 */,
/* 193 */,
/* 194 */,
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(196);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(21)("73255f32", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-ce23c2de\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UploadButton.vue", function() {
var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-ce23c2de\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UploadButton.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(20)(undefined);
// imports
// module
exports.push([module.i, "\n.el-upload__input {\n display: none !important;\n}\n.el-upload--text {\n display: block;\n}\n.el-upload-dragger {\n width: 100%;\n}\n.media-upload {\n margin-bottom: 10px;\n}\n", ""]);
// exports
/***/ })
/******/ ]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment