Commit 2e007394 authored by Vivek's avatar Vivek

renderjs_interfaces: two text editors rendered from one gadget.

parent 2122a688
...@@ -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: 200px; font-size: 14px; line-height: 18px;"></textarea>\n <textarea class="textarea" placeholder="Enter text ..." style="width: 100%; height: 400px; 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>zope1</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.54809.19650.59255</string> </value> <value> <string>944.56196.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>1438694025.97</float> <float>1438777350.44</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -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>\n <div class="ui-block-a" style="width:60%">\n
<div class="ui-content"></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.53477.50307.41949</string> </value> <value> <string>944.56298.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>1438615471.66</float> <float>1438783361.36</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -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 return new RSVP.Queue()\n
function setEditorGadget() {\n .push(function() {\n
var iframe, editor;\n console.log("first gadget");\n
\n return declareEditorGadget(EDITOR_GADGET_1);\n
iframe = gadget.__element.getElementsByTagName("IFRAME")[0];\n })\n
editor = iframe.contentDocument.getElementById("editor");\n .push(function(){\n
editor.style.overflow = "auto";\n page.querySelector("div.ui-content").innerHTML = "";\n
return gadget.editor_setContent(gadget.state_parameter_dict.temp);\n return declareEditorGadget(EDITOR_GADGET_2);\n
}\n });\n
\n
// helper: run chain - separate method to make the chain callable\n
function runChain() {\n
return new RSVP.Queue()\n
.push(function() {\n
return declareEditorGadget(this);\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>zope1</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.54775.35271.2508</string> </value> <value> <string>944.56235.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>1438693295.63</float> <float>1438780043.78</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment