You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

111 lines
3.1 KiB

/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
'use strict';
var _avatar_upload = __webpack_require__(29);
$(function () {
(0, _avatar_upload.avatarUploadInit)();
});
/***/ },
/***/ 29:
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
// Live image avatar (single) upload ---------------------------------
var LIVE_IMAGE_UPLOAD_URL = '/common/live-image-upload/create/';
function avatarUploadInit() {
var $container = $('.-live-image-avatar-upload-container').first();
var $avatarImage = $container.find('.-avatar-image').first();
var $liveImageUpload = $container.find('.-live-image-upload').first();
var $liveImageId = $container.find('.-live-image-id').first();
var $liveImageDelete = $container.find('.-live-image-delete').first();
$avatarImage.attr('orig-src', $avatarImage.attr('src'));
$liveImageUpload.fileupload({
url: LIVE_IMAGE_UPLOAD_URL,
dataType: 'json',
done: function done($evt, data) {
var image = data.result;
$avatarImage.attr('src', image.thumbnailUrl);
$liveImageId.val(image.id);
$liveImageDelete.data('url', image.deleteUrl);
$liveImageDelete.css('display', 'block');
}
});
$liveImageDelete.on('click', function ($evt) {
var $that = $(this);
$.post($that.data('url')).then(function (res) {
if (res.status == 'success') {
$avatarImage.attr('src', $avatarImage.attr('orig-src') || STUB_IMAGE_URL);
$liveImageId.val('');
$that.css('display', 'none');
}
});
});
}
exports.avatarUploadInit = avatarUploadInit;
/***/ }
/******/ });