Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Core: pick up renderers automatically (#284).

A plugin's renderers are picked up automatically:
    - page renderers
    - simple renderers
    - multi renderers

So, the plugin developer must no longer load hers renderers manually by calling these methods:
    - dm4c.load_page_renderer(...)
    - dm4c.load_simple_renderer(...)
    - dm4c.load_multi_renderer(...)
These methods are dropped.

Instead the plugin developer must respect the fixed file structure (as mentioned previously):

script/
    renderers/
        page_renderers/
        simple_renderers/
        multi_renderers/
        canvas_renderers/

IMPORTANT: plugin developers must adapt the plugins which provide renderers accordingly.

Picking up canvas renderers is pending.

See ticket 284.
  • Loading branch information...
commit 19aca819a50de7314dc38c937f433b83a1cd4a94 1 parent 5b245bd
@jri authored
View
2  modules/dm4-core/src/main/java/de/deepamehta/core/impl/service/PluginInfoImpl.java
@@ -37,7 +37,7 @@
renderers.put("page_renderers", getRenderers("page_renderers"));
renderers.put("simple_renderers", getRenderers("simple_renderers"));
renderers.put("multi_renderers", getRenderers("multi_renderers"));
- renderers.put("canvas_renderers", getRenderers("canvas_renderers"));
+ // ### renderers.put("canvas_renderers", getRenderers("canvas_renderers"));
pluginInfo.put("renderers", renderers);
//
} catch (Exception e) {
View
3  modules/dm4-files/src/main/resources/web/script/plugin.js
@@ -1,8 +1,5 @@
dm4c.add_plugin("de.deepamehta.files", function() {
- dm4c.load_simple_renderer("/de.deepamehta.files/script/renderers/simple_renderers/file_content_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.files/script/renderers/simple_renderers/folder_content_renderer.js")
-
// === REST Client Extension ===
dm4c.restc.create_file_topic = function(path) {
View
1  modules/dm4-iconpicker/src/main/resources/web/script/plugin.js
@@ -1,6 +1,5 @@
dm4c.add_plugin("de.deepamehta.iconpicker", function() {
- dm4c.load_simple_renderer("/de.deepamehta.iconpicker/script/renderers/simple_renderers/icon_renderer.js")
dm4c.load_stylesheet("/de.deepamehta.iconpicker/style/iconpicker.css")
// === Webclient Listeners ===
View
1  modules/dm4-typeeditor/src/main/resources/web/script/plugin.js
@@ -1,6 +1,5 @@
dm4c.add_plugin("de.deepamehta.typeeditor", function() {
- dm4c.load_page_renderer("/de.deepamehta.typeeditor/script/renderers/page_renderers/topictype_renderer.js")
dm4c.load_stylesheet("/de.deepamehta.typeeditor/style/typeeditor.css")
// Note: no "uri" is set here. A new topic type gets its default URI at server-side.
View
2  modules/dm4-webbrowser/src/main/resources/web/script/plugin.js
@@ -1,7 +1,5 @@
dm4c.add_plugin("de.deepamehta.webbrowser", function() {
- dm4c.load_page_renderer("/de.deepamehta.webbrowser/script/renderers/page_renderers/webpage_renderer.js")
-
// === Webclient Listeners ===
dm4c.add_listener("topic_commands", function(topic) {
View
46 modules/dm4-webclient/src/main/resources/docs/events.txt
@@ -0,0 +1,46 @@
+// ### TODO: move to wiki documentation.
+var hook_names = [
+ // Plugin
+ "init",
+ // Commands
+ "topic_commands",
+ "association_commands",
+ "canvas_commands",
+ // Storage (DB updates)
+ "post_create_topic",
+ "post_update_topic",
+ "post_update_association",
+ "post_delete_topic",
+ "post_delete_association",
+ // Selection (client model updates)
+ "post_select_topic",
+ "post_select_association",
+ "post_reset_selection",
+ // Show/Hide (view updates)
+ "pre_show_topic",
+ "post_show_topic",
+ "post_show_association",
+ "post_hide_topic",
+ "post_hide_association",
+ // Toolbar
+ "searchmode_widget",
+ "search",
+ "post_refresh_create_menu",
+ // Page Panel
+ "pre_render_page",
+ "pre_render_form",
+ "post_destroy_form",
+ "default_page_rendering",
+ // Canvas
+ "topic_doubleclicked",
+ "post_move_topic",
+ "post_move_canvas",
+ "pre_draw_canvas",
+ "process_drop",
+ // History
+ "pre_push_history",
+ "pre_pop_history",
+ // Permissions
+ "has_write_permission",
+ "has_create_permission"
+]
View
16 modules/dm4-webclient/src/main/resources/web/script/internal_plugins/default_plugin.js
@@ -5,22 +5,6 @@ dm4c.add_plugin("de.deepamehta.webclient.default", function() {
var type_menu
- dm4c.load_page_renderer("/de.deepamehta.webclient/script/renderers/page_renderers/topic_renderer.js")
- dm4c.load_page_renderer("/de.deepamehta.webclient/script/renderers/page_renderers/association_renderer.js")
-
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/text_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/number_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/boolean_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/html_renderer.js")
- // ### dm4c.load_field_renderer("/script/field_renderers/date_field_renderer.js")
- // ### dm4c.load_field_renderer("/script/field_renderers/reference_field_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/title_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/body_text_renderer.js")
- dm4c.load_simple_renderer("/de.deepamehta.webclient/script/renderers/simple_renderers/search_result_renderer.js")
-
- dm4c.load_multi_renderer("/de.deepamehta.webclient/script/renderers/multi_renderers/default_multi_renderer.js")
- dm4c.load_multi_renderer("/de.deepamehta.webclient/script/renderers/multi_renderers/checkbox_renderer.js")
-
// === Webclient Listeners ===
dm4c.add_listener("init", function() {
View
275 modules/dm4-webclient/src/main/resources/web/script/plugin_manager.js
@@ -1,109 +1,48 @@
function PluginManager(config) {
- var plugin_sources = []
var plugins = {} // key: plugin URI, value: plugin instance
- var plugins_complete = 0
-
- var page_renderer_sources = []
var page_renderers = {} // key: page renderer URI, value: object with "render_page", "render_form", "page_css"
-
- var simple_renderer_sources = []
var simple_renderers = {} // key: simple renderer URI, value: object with "render_info", "render_form"
-
- var multi_renderer_sources = []
var multi_renderers = {} // key: multi renderer URI, value: object with "render_info", "render_form"
var css_stylesheets = []
+ var items_to_load
+ var items_complete = 0
+
// key: hook name (string), value: registered listeners (array of functions)
var listener_registry = {}
- // ### FIXME: drop this. Not in use. Only here for documentation purposes.
- // ### TODO: move to wiki documentation.
- var hook_names = [
- // Plugin
- "init",
- // Commands
- "topic_commands",
- "association_commands",
- "canvas_commands",
- // Storage (DB updates)
- "post_create_topic",
- "post_update_topic",
- "post_update_association",
- "post_delete_topic",
- "post_delete_association",
- // Selection (client model updates)
- "post_select_topic",
- "post_select_association",
- "post_reset_selection",
- // Show/Hide (view updates)
- "pre_show_topic",
- "post_show_topic",
- "post_show_association",
- "post_hide_topic",
- "post_hide_association",
- // Toolbar
- "searchmode_widget",
- "search",
- "post_refresh_create_menu",
- // Page Panel
- "pre_render_page",
- "pre_render_form",
- "post_destroy_form",
- "default_page_rendering",
- // Canvas
- "topic_doubleclicked",
- "post_move_topic",
- "post_move_canvas",
- "pre_draw_canvas",
- "process_drop",
- // History
- "pre_push_history",
- "pre_pop_history",
- // Permissions
- "has_write_permission",
- "has_create_permission"
- ]
-
// ------------------------------------------------------------------------------------------------------ Public API
this.load_plugins = function() {
- register_internal_plugins(config.internal_plugins)
- register_plugins()
- load_plugins()
+ // retrieve list of installed plugins from server
+ var plugins = dm4c.restc.get_plugins()
+ //
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Plugins installed at server-side: " + plugins.length)
+ //
+ items_to_load = count_items_to_load(plugins) + config.internal_plugins.length
+ //
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Total items to load: " + items_to_load)
+ //
+ load_internal_plugins(config.internal_plugins)
+ //
+ for (var i = 0, plugin; plugin = plugins[i]; i++) {
+ load_plugin(plugin)
+ }
}
this.add_plugin = function(plugin_uri, plugin_func) {
- // 1) instantiate
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log(".......... instantiating \"" + plugin_uri + "\"")
// error check
if (plugins[plugin_uri]) {
throw "PluginManagerError: plugin URI clash with \"" + plugin_uri + "\""
}
//
- plugins[plugin_uri] = create_plugin()
- // 2) all plugins complete?
- plugins_complete++
- if (plugins_complete == plugin_sources.length) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("PLUGINS COMPLETE!")
- all_plugins_loaded()
- }
-
- function create_plugin() {
- var plugin = {}
- plugin_func.call(plugin)
- return plugin
- }
-
- function all_plugins_loaded() {
- load_page_renderers()
- load_simple_renderers()
- load_multi_renderers()
- load_stylesheets()
- //
- config.post_load_plugins()
- }
+ var plugin = {}
+ plugin_func.call(plugin)
+ plugins[plugin_uri] = plugin
+ //
+ track_load_state("plugin \"" + plugin_uri + "\"");
}
this.get_plugin = function(plugin_uri) {
@@ -118,20 +57,28 @@ function PluginManager(config) {
// ---
- this.add_simple_renderer = function(renderer_uri, renderer) {
+ this.add_page_renderer = function(renderer_uri, renderer) {
// error check
- if (simple_renderers[renderer_uri]) {
- throw "PluginManagerError: simple renderer URI clash with \"" + renderer_uri + "\""
+ if (page_renderers[renderer_uri]) {
+ throw "PluginManagerError: page renderer URI clash with \"" + renderer_uri + "\""
}
//
- simple_renderers[renderer_uri] = renderer
+ page_renderers[renderer_uri] = renderer
+ //
+ track_load_state("page renderer \"" + renderer_uri + "\"");
}
- this.get_simple_renderer = function(renderer_uri) {
- var renderer = simple_renderers[renderer_uri]
+ this.get_page_renderer = function(topic_or_association_or_renderer_uri) {
+ if (typeof(topic_or_association_or_renderer_uri) == "string") {
+ var renderer_uri = topic_or_association_or_renderer_uri
+ } else {
+ var type = topic_or_association_or_renderer_uri.get_type()
+ var renderer_uri = type.get_page_renderer_uri()
+ }
+ var renderer = page_renderers[renderer_uri]
// error check
if (!renderer) {
- throw "PluginManagerError: simple renderer \"" + renderer_uri + "\" is unknown"
+ throw "PluginManagerError: page renderer \"" + renderer_uri + "\" is unknown"
}
//
return renderer
@@ -139,20 +86,22 @@ function PluginManager(config) {
// ---
- this.add_multi_renderer = function(renderer_uri, renderer) {
+ this.add_simple_renderer = function(renderer_uri, renderer) {
// error check
- if (multi_renderers[renderer_uri]) {
- throw "PluginManagerError: multi renderer URI clash with \"" + renderer_uri + "\""
+ if (simple_renderers[renderer_uri]) {
+ throw "PluginManagerError: simple renderer URI clash with \"" + renderer_uri + "\""
}
//
- multi_renderers[renderer_uri] = renderer
+ simple_renderers[renderer_uri] = renderer
+ //
+ track_load_state("simple renderer \"" + renderer_uri + "\"");
}
- this.get_multi_renderer = function(renderer_uri) {
- var renderer = multi_renderers[renderer_uri]
+ this.get_simple_renderer = function(renderer_uri) {
+ var renderer = simple_renderers[renderer_uri]
// error check
if (!renderer) {
- throw "PluginManagerError: multi renderer \"" + renderer_uri + "\" is unknown"
+ throw "PluginManagerError: simple renderer \"" + renderer_uri + "\" is unknown"
}
//
return renderer
@@ -160,26 +109,22 @@ function PluginManager(config) {
// ---
- this.add_page_renderer = function(renderer_uri, renderer) {
+ this.add_multi_renderer = function(renderer_uri, renderer) {
// error check
- if (page_renderers[renderer_uri]) {
- throw "PluginManagerError: page renderer URI clash with \"" + renderer_uri + "\""
+ if (multi_renderers[renderer_uri]) {
+ throw "PluginManagerError: multi renderer URI clash with \"" + renderer_uri + "\""
}
//
- page_renderers[renderer_uri] = renderer
+ multi_renderers[renderer_uri] = renderer
+ //
+ track_load_state("multi renderer \"" + renderer_uri + "\"");
}
- this.get_page_renderer = function(topic_or_association_or_renderer_uri) {
- if (typeof(topic_or_association_or_renderer_uri) == "string") {
- var renderer_uri = topic_or_association_or_renderer_uri
- } else {
- var type = topic_or_association_or_renderer_uri.get_type()
- var renderer_uri = type.get_page_renderer_uri()
- }
- var renderer = page_renderers[renderer_uri]
+ this.get_multi_renderer = function(renderer_uri) {
+ var renderer = multi_renderers[renderer_uri]
// error check
if (!renderer) {
- throw "PluginManagerError: page renderer \"" + renderer_uri + "\" is unknown"
+ throw "PluginManagerError: multi renderer \"" + renderer_uri + "\" is unknown"
}
//
return renderer
@@ -187,20 +132,6 @@ function PluginManager(config) {
// ---
- this.register_page_renderer = function(source_path) {
- page_renderer_sources.push(source_path)
- }
-
- this.register_simple_renderer = function(source_path) {
- simple_renderer_sources.push(source_path)
- }
-
- this.register_multi_renderer = function(source_path) {
- multi_renderer_sources.push(source_path)
- }
-
- // ---
-
this.register_css_stylesheet = function(css_path) {
css_stylesheets.push(css_path)
}
@@ -248,33 +179,30 @@ function PluginManager(config) {
// ----------------------------------------------------------------------------------------------- Private Functions
- function register_internal_plugins(plugins) {
- for (var i = 0, plugin; plugin = plugins[i]; i++) {
- register_plugin("/de.deepamehta.webclient/script/internal_plugins/" + plugin)
- }
- }
-
- /**
- * Retrieves the list of installed plugins and registers those which have a client component.
- */
- function register_plugins() {
- // retrieve list
- var plugins = dm4c.restc.get_plugins()
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Plugins installed at server-side: " + plugins.length)
- // register
+ function count_items_to_load(plugins) {
+ var count = 0
for (var i = 0, plugin; plugin = plugins[i]; i++) {
+ // count plugin file
if (plugin.has_client_component) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... plugin \"" + plugin.plugin_uri +
- "\" -- has client component")
- register_plugin("/" + plugin.plugin_uri + "/script/plugin.js")
- } else {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... plugin \"" + plugin.plugin_uri + "\"")
+ count++
+ }
+ // count renderers
+ for (var renderer_type in plugin.renderers) {
+ count += plugin.renderers[renderer_type].length
}
}
+ return count
}
- function register_plugin(source_path) {
- plugin_sources.push(source_path)
+ function track_load_state(item) {
+ items_complete++
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + item + " complete (" +
+ items_complete + "/" + items_to_load + ")")
+ if (items_complete == items_to_load) {
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("PLUGINS COMPLETE!")
+ load_stylesheets()
+ config.post_load_plugins()
+ }
}
// ---
@@ -289,45 +217,46 @@ function PluginManager(config) {
// ---
- /**
- * Loads all registered plugins.
- */
- function load_plugins() {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + plugin_sources.length + " plugins:")
- for (var i = 0, plugin_source; plugin_source = plugin_sources[i]; i++) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + plugin_source)
- dm4c.load_script(plugin_source, function() {}) // load plugin asynchronously
+ function load_internal_plugins(plugins) {
+ for (var i = 0, plugin; plugin = plugins[i]; i++) {
+ load_plugin_file("/de.deepamehta.webclient/script/internal_plugins/" + plugin)
}
}
- function load_page_renderers() {
-
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + page_renderer_sources.length + " page renderers:")
- for (var i = 0, page_renderer_src; page_renderer_src = page_renderer_sources[i]; i++) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + page_renderer_src)
- // load page renderer synchronously (Note: synchronous is required for displaying initial topic)
- dm4c.load_script(page_renderer_src)
+ function load_plugin(plugin) {
+ // 1) load plugin file
+ if (plugin.has_client_component) {
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... plugin \"" + plugin.plugin_uri +
+ "\" -- has client component")
+ var plugin_file = "/" + plugin.plugin_uri + "/script/plugin.js"
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + plugin_file)
+ load_plugin_file(plugin_file)
+ } else {
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... plugin \"" + plugin.plugin_uri + "\"")
}
+ //
+ // 2) load renderers
+ load_renderers(plugin.plugin_uri, "page_renderers", plugin.renderers.page_renderers)
+ load_renderers(plugin.plugin_uri, "simple_renderers", plugin.renderers.simple_renderers)
+ load_renderers(plugin.plugin_uri, "multi_renderers", plugin.renderers.multi_renderers)
+ // ### load_renderers(plugin.plugin_uri, "canvas_renderers", plugin.renderers.canvas_renderers)
}
- function load_simple_renderers() {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + simple_renderer_sources.length + " simple renderers:")
- for (var i = 0, simple_renderer_source; simple_renderer_source = simple_renderer_sources[i]; i++) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + simple_renderer_source)
- // load simple renderer synchronously (Note: synchronous is required for displaying initial topic)
- dm4c.load_script(simple_renderer_source)
+ function load_renderers(plugin_uri, renderer_type, renderer_files) {
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + renderer_files.length + " " + renderer_type + ":")
+ for (var i = 0, renderer_file; renderer_file = renderer_files[i]; i++) {
+ if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + renderer_file)
+ // load renderer synchronously (Note: synchronous is required for displaying initial topic) ### FIXME
+ dm4c.load_script("/" + plugin_uri + "/script/renderers/" + renderer_type + "/" + renderer_file)
}
}
- function load_multi_renderers() {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + multi_renderer_sources.length + " multi renderers:")
- for (var i = 0, multi_renderer_source; multi_renderer_source = multi_renderer_sources[i]; i++) {
- if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("..... " + multi_renderer_source)
- // load multi renderer synchronously (Note: synchronous is required for displaying initial topic)
- dm4c.load_script(multi_renderer_source)
- }
+ function load_plugin_file(plugin_file) {
+ dm4c.load_script(plugin_file, function() {}) // load plugin asynchronously
}
+ // ---
+
function load_stylesheets() {
if (dm4c.LOG_PLUGIN_LOADING) dm4c.log("Loading " + css_stylesheets.length + " CSS stylesheets:")
for (var i = 0, css_stylesheet; css_stylesheet = css_stylesheets[i]; i++) {
View
4 modules/dm4-webclient/src/main/resources/web/script/renderers/simple_renderers/body_text_renderer.js
@@ -4,5 +4,7 @@ dm4c.add_simple_renderer("dm4.webclient.body_text_renderer", {
parent_element.append(page_model.value)
},
- render_form: dm4c.get_simple_renderer("dm4.webclient.html_renderer").render_form
+ render_form: function(page_model, parent_element) {
+ return dm4c.get_simple_renderer("dm4.webclient.html_renderer").render_form(page_model, parent_element)
+ }
})
View
27 modules/dm4-webclient/src/main/resources/web/script/renderers/simple_renderers/date_field_renderer.js
@@ -1,27 +0,0 @@
-// ### TODO: adapt to new FieldRenderer API.
-function DateFieldRenderer(field) {
-
- this.render_field = function() {
- // field label
- dm4c.render.field_label(field_model)
- // field value
- return js.format_date(field_model.value)
- }
-
- this.render_form_element = function() {
- var input = $("<input>").attr({type: "hidden", "field-uri": field_model.uri, value: field_model.value})
- input.change(function() {
- $("span", $(this).parent()).text(js.format_date(this.value))
- })
- var date_div = $("<div>")
- date_div.append($("<span>").css("margin-right", "1em").text(js.format_date(field_model.value)))
- date_div.append(input)
- input.datepicker({firstDay: 1, showAnim: "fadeIn", showOtherMonths: true, showOn: "button",
- buttonImage: "images/calendar.gif", buttonImageOnly: true, buttonText: "Choose Date"})
- return date_div
- }
-
- this.read_form_value = function() {
- return $("[field-uri=" + field_model.uri + "]").val()
- }
-}
View
56 modules/dm4-webclient/src/main/resources/web/script/renderers/simple_renderers/reference_field_renderer.js
@@ -1,56 +0,0 @@
-// ### FIXME: not in use
-function ReferenceFieldRenderer(topic, field, rel_topics) {
-
- this.render_field = function() {
- // field label
- dm4c.render.field_label(field)
- // field value
- return dm4c.render_topic_list(rel_topics)
- }
-
- this.render_form_element = function() {
- switch (field.editor) {
- case "checkboxes":
- var topics = dm4c.restc.get_topics(field.ref_topic_type_uri)
- var relation_div = $("<div>")
- for (var i = 0, topic; topic = topics[i]; i++) {
- var attr = {type: "checkbox", id: topic.id, name: "relation_" + field.uri}
- if (js.includes(rel_topics, function(t) {
- return t.id == topic.id
- })) {
- attr.checked = "checked"
- }
- relation_div.append($("<label>").append($("<input>").attr(attr)).append(topic.label))
- }
- return relation_div
- }
- }
-
- this.read_form_value = function() {
- // TODO: updating reference fields should run at server-side (in a transaction)
- switch (field.editor) {
- case "checkboxes":
- $("input:checkbox[name=relation_" + field.uri + "]").each(
- function() {
- var checkbox = this
- var was_checked_before = js.includes(dm4c.get_page_renderer(topic).topic_buffer[field.uri],
- function(topic) {
- return topic.id == checkbox.id
- }
- )
- if (checkbox.checked) {
- if (!was_checked_before) {
- dm4c.create_relation("RELATION", topic.id, checkbox.id)
- }
- } else {
- if (was_checked_before) {
- dm4c.delete_association(dm4c.restc.get_relation(topic.id, checkbox.id).id)
- }
- }
- }
- )
- // prevent this field from being updated
- return null
- }
- }
-}
View
8 modules/dm4-webclient/src/main/resources/web/script/renderers/simple_renderers/title_renderer.js
@@ -1,10 +1,10 @@
dm4c.add_simple_renderer("dm4.webclient.title_renderer", {
render_info: function(page_model, parent_element) {
- parent_element.append($("<h1>")
- .text(js.render_text(page_model.value))
- )
+ parent_element.append($("<h1>").text(js.render_text(page_model.value)))
},
- render_form: dm4c.get_simple_renderer("dm4.webclient.text_renderer").render_form
+ render_form: function(page_model, parent_element) {
+ return dm4c.get_simple_renderer("dm4.webclient.text_renderer").render_form(page_model, parent_element)
+ }
})
View
12 modules/dm4-webclient/src/main/resources/web/script/webclient.js
@@ -696,18 +696,6 @@ function Webclient() {
pm.register_css_stylesheet(css_path)
}
- this.load_page_renderer = function(source_path) {
- pm.register_page_renderer(source_path)
- }
-
- this.load_simple_renderer = function(source_path) {
- pm.register_simple_renderer(source_path)
- }
-
- this.load_multi_renderer = function(source_path) {
- pm.register_multi_renderer(source_path)
- }
-
// ---
this.add_listener = function(hook_name, listener) {
Please sign in to comment.
Something went wrong with that request. Please try again.