mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[15.0][MIG] web_widget_bokeh_chart
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import basicFields from "web.basic_fields";
|
||||
import fieldRegistry from "web.field_registry";
|
||||
|
||||
const BokehChartWidget = basicFields.FieldChar.extend({
|
||||
jsLibs: [
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js",
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js",
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js",
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js",
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js",
|
||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js",
|
||||
],
|
||||
_renderReadonly: function () {
|
||||
try {
|
||||
const val = JSON.parse(this.value);
|
||||
this.$el.html(val.div);
|
||||
const script = document.createElement("script");
|
||||
script.setAttribute("type", "text/javascript");
|
||||
if ("textContent" in script) script.textContent = val.script;
|
||||
else script.text = val.script;
|
||||
$("head").append(script);
|
||||
} catch (error) {
|
||||
return this._super(...arguments);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
fieldRegistry.add("bokeh_chart", BokehChartWidget);
|
||||
|
||||
export default BokehChartWidget;
|
||||
@@ -1,17 +0,0 @@
|
||||
odoo.define("web_widget_bokeh_chart", function (require) {
|
||||
"use strict";
|
||||
|
||||
var fieldRegistry = require("web.field_registry");
|
||||
var AbstractField = require("web.AbstractField");
|
||||
|
||||
var BokehChartWidget = AbstractField.extend({
|
||||
_renderReadonly: function () {
|
||||
var val = this.value;
|
||||
this.$el.html(val);
|
||||
},
|
||||
});
|
||||
fieldRegistry.add("bokeh_chart", BokehChartWidget);
|
||||
return {
|
||||
BokehChartWidget: BokehChartWidget,
|
||||
};
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
596
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js
vendored
Normal file
596
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
53
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js
vendored
Normal file
53
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
74
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js
vendored
Normal file
74
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
328
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js
vendored
Normal file
328
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
132
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js
vendored
Normal file
132
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
118
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js
vendored
Normal file
118
web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user