Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
2e007394
Commit
2e007394
authored
Aug 06, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renderjs_interfaces: two text editors rendered from one gadget.
parent
2122a688
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
394 additions
and
50 deletions
+394
-50
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_bootstrap3_wysiwyg_html.xml
...teItem/web_page_module/editor_bootstrap3_wysiwyg_html.xml
+9
-15
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_gadget_bootstrap3-wysiwyg.js.xml
...m/web_page_module/editor_gadget_bootstrap3-wysiwyg.js.xml
+351
-0
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_html.xml
...hTemplateItem/web_page_module/editor_test_gadget_html.xml
+18
-4
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_js.xml
...athTemplateItem/web_page_module/editor_test_gadget_js.xml
+16
-31
No files found.
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_bootstrap3_wysiwyg_html.xml
View file @
2e007394
...
@@ -123,9 +123,9 @@
...
@@ -123,9 +123,9 @@
\n
\n
</head>
\n
</head>
\n
<body>
\n
<body>
\n
<div
class=
"container"
style=
"
margin: 10px; padding: 4px; width: 1858px
; height: 600px;"
>
\n
<div
class=
"container"
style=
"
width: 100%
; height: 600px;"
>
\n
<div
class=
"jumbotron"
style=
"margin-left:0px"
>
\n
<div
class=
"jumbotron"
style=
"margin-left:0px
; height: 600px;
"
>
\n
<textarea
class=
"textarea"
placeholder=
"Enter text ..."
style=
"width: 100%; height:
2
00px; font-size: 14px; line-height: 18px;"
></textarea>
\n
<textarea
class=
"textarea"
placeholder=
"Enter text ..."
style=
"width: 100%; height:
4
00px; font-size: 14px; line-height: 18px;"
></textarea>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
\n
\n
...
@@ -135,15 +135,9 @@
...
@@ -135,15 +135,9 @@
<script
src=
"bootstrap.min.js"
></script>
\n
<script
src=
"bootstrap.min.js"
></script>
\n
<script
src=
"handlebars.runtime.min.js"
></script>
\n
<script
src=
"handlebars.runtime.min.js"
></script>
\n
<script
src=
"bootstrap3-wysihtml5.min.js"
></script>
\n
<script
src=
"bootstrap3-wysihtml5.min.js"
></script>
\n
\n
<script
src=
"rsvp.js"
></script>
\n
<script>
\n
<script
src=
"renderjs.js"
></script>
\n
$(\'.textarea\').wysihtml5({\n
<script
src=
"gadget_bootstrap3-wysiwyg.js"
></script>
\n
toolbar: {\n
fa: true\n
}\n
});\n
</script>
\n
\n
</body>
\n
</body>
\n
</html>
\n
</html>
\n
...
@@ -269,7 +263,7 @@
...
@@ -269,7 +263,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
1
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -283,7 +277,7 @@
...
@@ -283,7 +277,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.5
4809.19650.59255
</string>
</value>
<value>
<string>
944.5
6196.65369.51899
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -301,7 +295,7 @@
...
@@ -301,7 +295,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1438
694025.97
</float>
<float>
1438
777350.44
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_gadget_bootstrap3-wysiwyg.js.xml
0 → 100644
View file @
2e007394
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_bootstrap3-wysiwyg.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
editor_gadget_bootstrap3-wysiwyg.js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string>
/*jslint indent: 2 */\n
/*global window, jQuery, rJS*/\n
"use strict";\n
\n
(function (window, $, rJS) {\n
\n
rJS(window).\n
declareMethod(\'getContent\', function () {\n
return rJS(this).editor.html();\n
})\n
.declareMethod(\'setContent\', function (content) {\n
rJS(this).editor.html(content);\n
})\n
.declareMethod(\'clearContent\', function () {\n
rJS(this).editor.html(\'\');\n
})\n
.ready(function (g) {\n
g.editor = $(\'.textarea\');\n
g.editor.wysihtml5({\n
toolbar: {\n
fa: true\n
}\n
});\n
});\n
\n
}(window, jQuery, rJS));
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Editor Gadget Bootstrap3 wysiwyg JS
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope1
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1438768024.7
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.56186.56926.29952
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1438777746.45
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
empty
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1438767532.07
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_html.xml
View file @
2e007394
...
@@ -130,8 +130,22 @@
...
@@ -130,8 +130,22 @@
</head>
\n
</head>
\n
<body>
\n
<body>
\n
<div
data-role=
"page"
id=
"document"
>
\n
<div
data-role=
"page"
id=
"document"
>
\n
<div
class=
"ui-content"
>
\n
<div
class=
"ui-grid-a ui-responsive"
>
\n
<div
class=
"ui-block-a"
style=
"width:60%"
>
\n
<div
class=
"ui-content"
></div>
\n
</div>
\n
</div>
\n
<div
class=
"ui-block-b"
style=
"width:30%"
>
\n
<form
class=
"gadget-select-form"
>
\n
<div
data-role=
"fieldcontain"
>
\n
<label
for=
"gadget_selector"
class=
"select"
></label>
\n
<select
name=
"gadget_selector"
>
\n
<option
value=
"https://softinst60317.host.vifib.net/erp5/web_site_module/editor_demo/bootstrap-wysiwyg.html"
>
Text Editor 1
</option>
\n
<option
value=
"https://softinst60317.host.vifib.net/erp5/web_site_module/editor_demo/bootstrap3-wysiwyg.html"
>
Text Editor 2
</option>
\n
</select>
\n
</div>
\n
</form>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
</body>
\n
</body>
\n
</html>
\n
</html>
\n
...
@@ -273,7 +287,7 @@
...
@@ -273,7 +287,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.5
3477.50307.41949
</string>
</value>
<value>
<string>
944.5
6298.5921.30532
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -291,7 +305,7 @@
...
@@ -291,7 +305,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1438
615471.6
6
</float>
<float>
1438
783361.3
6
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_editor_demo/PathTemplateItem/web_page_module/editor_test_gadget_js.xml
View file @
2e007394
...
@@ -104,8 +104,8 @@
...
@@ -104,8 +104,8 @@
(function (window, document, rJS) {\n
(function (window, document, rJS) {\n
"use strict";\n
"use strict";\n
\n
\n
var EDITOR_GADGET = "./bootstrap-wysiwyg.html";\n
var EDITOR_GADGET
_1
= "./bootstrap-wysiwyg.html";\n
// var EDITOR_GADGET
= "./bootstrap3-wysiwyg.html";\n
var EDITOR_GADGET_2
= "./bootstrap3-wysiwyg.html";\n
// block JQM auto-start\n
// block JQM auto-start\n
$(document)\n
$(document)\n
.on("mobileinit", function () {\n
.on("mobileinit", function () {\n
...
@@ -115,8 +115,6 @@
...
@@ -115,8 +115,6 @@
rJS(window)\n
rJS(window)\n
\n
\n
.ready(function (g) {\n
.ready(function (g) {\n
g.state_parameter_dict = {};\n
console.log("calling render");\n
})\n
})\n
\n
\n
.declareMethod(\'render\', function () {\n
.declareMethod(\'render\', function () {\n
...
@@ -124,40 +122,27 @@
...
@@ -124,40 +122,27 @@
\n
\n
gadget = this;\n
gadget = this;\n
page_list = document.body.querySelectorAll("[data-role=page]");\n
page_list = document.body.querySelectorAll("[data-role=page]");\n
console.log("page_list", page_list);\n
page = page_list[page_list.length - 1];\n
page = page_list[page_list.length - 1];\n
console.log("page", page);\n
\n
\n
// helper: declare edtior\n
// helper: declare edtior\n
function declareEditorGadget() {\n
function declareEditorGadget(
editor_g
) {\n
return gadget.declareGadget(
EDITOR_GADGET
, {\n
return gadget.declareGadget(
editor_g
, {\n
sandbox: \'iframe\',\n
sandbox: \'iframe\',\n
element: page.querySelector("div.ui-content"),\n
element: page.querySelector("div.ui-content"),\n
scope: "editor"\n
scope: "editor"\n
});\n
});\n
}\n
}\n
\n
\n
// helper: set Editor Gadget\n
function setEditorGadget() {\n
var iframe, editor;\n
\n
iframe = gadget.__element.getElementsByTagName("IFRAME")[0];\n
editor = iframe.contentDocument.getElementById("editor");\n
editor.style.overflow = "auto";\n
return gadget.editor_setContent(gadget.state_parameter_dict.temp);\n
}\n
\n
// helper: run chain - separate method to make the chain callable\n
function runChain() {\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function() {\n
.push(function() {\n
return declareEditorGadget(this);\n
console.log("first gadget");\n
return declareEditorGadget(EDITOR_GADGET_1);\n
})\n
.push(function(){\n
page.querySelector("div.ui-content").innerHTML = "";\n
return declareEditorGadget(EDITOR_GADGET_2);\n
});\n
});\n
\n
\n
}\n
\n
// START: fetch document\n
return runChain(); \n
})\n
})\n
\n
\n
/* ============================ EDITOR =============================== */\n
/* ============================ EDITOR =============================== */\n
...
@@ -301,7 +286,7 @@
...
@@ -301,7 +286,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
1
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -315,7 +300,7 @@
...
@@ -315,7 +300,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.5
4775.35271.2508
</string>
</value>
<value>
<string>
944.5
6235.17061.26624
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -333,7 +318,7 @@
...
@@ -333,7 +318,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1438
693295.63
</float>
<float>
1438
780043.78
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment