Browse Source

publish muk_web_utils - 12.0

pull/35/head
MuK IT GmbH 6 years ago
parent
commit
70f26f7b9e
  1. 2
      muk_web_utils/__manifest__.py
  2. 65
      muk_web_utils/static/src/js/core/dialog.js
  3. 8
      muk_web_utils/static/src/js/fields/image.js
  4. 1
      muk_web_utils/static/src/scss/dropzone.scss
  5. 1
      muk_web_utils/template/assets.xml

2
muk_web_utils/__manifest__.py

@ -20,7 +20,7 @@
{ {
"name": "MuK Web Utils", "name": "MuK Web Utils",
"summary": """Utility Features""", "summary": """Utility Features""",
"version": "12.0.2.4.8",
"version": "12.0.2.4.10",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"author": "MuK IT", "author": "MuK IT",

65
muk_web_utils/static/src/js/core/dialog.js

@ -0,0 +1,65 @@
/**********************************************************************************
*
* Copyright (C) 2017 MuK IT GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**********************************************************************************/
odoo.define('muk_web_utils.Dialog', function (require) {
"use strict";
var core = require('web.core');
var Dialog = require('web.Dialog');
var QWeb = core.qweb;
var _t = core._t;
Dialog.input = function (owner, title, options) {
var $content = $('<main/>');
var $input = $('<input/>', {
type: 'text',
class: options && options.input && options.input.class,
value: options && options.input && options.input.value,
});
$content.append($input);
var confirm = function(event) {
if(options && options.confirm_callback) {
options.confirm_callback.call(self, event, $input.val());
}
}
var buttons = [
{
text: _t("Save"),
classes: 'btn-primary',
close: true,
click: confirm,
},
{
text: _t("Cancel"),
close: true,
click: options && options.cancel_callback
}
];
return new Dialog(owner, _.extend({
size: 'medium',
buttons: buttons,
$content: $content,
title: title,
}, options)).open({shouldFocusButtons:true});
};
});

8
muk_web_utils/static/src/js/fields/image.js

@ -55,12 +55,8 @@ fields.FieldBinaryImage.include({
this.nodeOptions.size[0] : this.attrs.width; this.nodeOptions.size[0] : this.attrs.width;
var height = this.nodeOptions.size ? var height = this.nodeOptions.size ?
this.nodeOptions.size[1] : this.attrs.height; this.nodeOptions.size[1] : this.attrs.height;
if(width) {
$wrapper.css('min-width', width + 'px');
}
if(height) {
$wrapper.css('min-height', height + 'px');
}
$wrapper.css('min-width', (width || 50) + 'px');
$wrapper.css('min-height', (height || 50) + 'px');
}, },
}); });

1
muk_web_utils/static/src/scss/dropzone.scss

@ -18,6 +18,7 @@
**********************************************************************************/ **********************************************************************************/
.mk_dropzone { .mk_dropzone {
position: relative;
&:before { &:before {
display:flex; display:flex;
z-index: 1052; z-index: 1052;

1
muk_web_utils/template/assets.xml

@ -45,6 +45,7 @@
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/utils.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/core/utils.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/files.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/core/files.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dropzone.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/core/dropzone.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dialog.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/services/notification_service.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/services/notification_service.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/widgets/notification.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/widgets/notification.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/image.js" /> <script type="text/javascript" src="/muk_web_utils/static/src/js/fields/image.js" />

Loading…
Cancel
Save