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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
325676db
Commit
325676db
authored
May 14, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor jslint fixes.
Add generic InteractionGadget implementation.
parent
a22605a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
8 deletions
+63
-8
bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml
..._skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml
+62
-7
bt5/erp5_jquery_plugin_renderjs/bt/revision
bt5/erp5_jquery_plugin_renderjs/bt/revision
+1
-1
No files found.
bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml
View file @
325676db
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<value>
<string>
ts36
733337.13
</string>
</value>
<value>
<string>
ts36
978119.57
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
__name__
</string>
</key>
<key>
<string>
__name__
</string>
</key>
...
@@ -26,10 +26,17 @@
...
@@ -26,10 +26,17 @@
<key>
<string>
data
</string>
</key>
<key>
<string>
data
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
// fallback for IE\n
if (typeof console === "undefined" || typeof console.log === "undefined") {\n
console = {};\n
console.log = function() {};\n
}\n
\n
/*\n
/*\n
* Generic cache implementation that can fall back to local namespace storage\n
* Generic cache implementation that can fall back to local namespace storage\n
* if no "modern" storage like localStorage is available\n
* if no "modern" storage like localStorage is available\n
*/\n
*/\n
var is_ready;\n
is_ready = false; // dirty flag to be removed (indicates if ready event has been handled)\n
is_ready = false; // dirty flag to be removed (indicates if ready event has been handled)\n
\n
\n
var NameSpaceStorageCachePlugin = {\n
var NameSpaceStorageCachePlugin = {\n
...
@@ -505,7 +512,7 @@ var GadgetIndex = {\n
...
@@ -505,7 +512,7 @@ var GadgetIndex = {\n
\n
\n
gadget_list: [],\n
gadget_list: [],\n
\n
\n
getGadgetList: function(
gadget
) {\n
getGadgetList: function() {\n
/*\n
/*\n
* Return list of registered gadgets\n
* Return list of registered gadgets\n
*/\n
*/\n
...
@@ -530,7 +537,7 @@ var GadgetIndex = {\n
...
@@ -530,7 +537,7 @@ var GadgetIndex = {\n
gadget = undefined;\n
gadget = undefined;\n
$(this.getGadgetList()).each(\n
$(this.getGadgetList()).each(\n
function (index, value) {\n
function (index, value) {\n
if (value.
id
===gadget_id) {\n
if (value.
getId()
===gadget_id) {\n
gadget = value;\n
gadget = value;\n
}});\n
}});\n
return gadget;\n
return gadget;\n
...
@@ -556,10 +563,58 @@ var GadgetIndex = {\n
...
@@ -556,10 +563,58 @@ var GadgetIndex = {\n
}\n
}\n
});\n
});\n
return result;\n
return result;\n
}\n
}
,
\n
\n
\n
getSelf: function (){\n
/*\n
* Return Gadget\'s Javascript representation\n
*/\n
// XXX:\n
}\n
};\n
};\n
\n
\n
\n
/*\n
* Basic gadget interaction gadget implementation.\n
*/\n
var InteractionGadget = {\n
\n
bind: function (dom){\n
/*\n
* Bind event between gadgets.\n
*/\n
dom.find("connect").each(function (key, value){\n
source = $(value).attr("source").split(".");\n
source_gadget_id = source[0];\n
source_method_id = source[1];\n
source_gadget = GadgetIndex.getGadgetById(source_gadget_id);\n
\n
destination = $(value).attr("destination").split(".");\n
destination_gadget_id = destination[0];\n
destination_method_id = destination[1];\n
destination_gadget = GadgetIndex.getGadgetById(destination_gadget_id);\n
\n
if (source_gadget.hasOwnProperty(source_method_id)){\n
// direct javascript use case\n
func_body = \'GadgetIndex.getGadgetById("\' + source_gadget_id + \'")["original_\' + source_method_id + \'"]();\';\n
func_body = func_body + \'\\nGadgetIndex.getGadgetById("\' + destination_gadget_id + \'")["\' + destination_method_id + \'"]();\';\n
func = new Function(func_body);\n
source_gadget["original_" + source_method_id] = source_gadget[source_method_id];\n
source_gadget[source_method_id] = func;\n
}\n
else{\n
// this is a custom event attached to HTML gadget representation\n
func_body = \'GadgetIndex.getGadgetById("\' + destination_gadget_id + \'")["\' + destination_method_id + \'"]();\';\n
func = new Function(func_body);\n
source_gadget.dom.bind(source_method_id, func);\n
}\n
console.log(source_gadget_id, \'.\', source_method_id, \'-->\', destination_gadget_id, \'.\', destination_method_id);\n
}\n
);\n
}\n
}\n
\n
\n
/*\n
/*\n
* Generic Gadget library renderer\n
* Generic Gadget library renderer\n
*/\n
*/\n
...
@@ -591,7 +646,7 @@ var RenderJs = {\n
...
@@ -591,7 +646,7 @@ var RenderJs = {\n
\n
\n
loadGadgetFromUrl: function(gadget) {\n
loadGadgetFromUrl: function(gadget) {\n
/* Load gadget\'s SPECs from URL */\n
/* Load gadget\'s SPECs from URL */\n
var url, gadget_id, gadget_property, cacheable, cache_id, app_cache, data;\n
var url, gadget_id, gadget_property, cacheable, cache_id, app_cache, data
, gadget_js
;\n
url = gadget.attr("gadget");\n
url = gadget.attr("gadget");\n
gadget_id = gadget.attr("id");\n
gadget_id = gadget.attr("id");\n
\n
\n
...
@@ -671,7 +726,7 @@ var RenderJs = {\n
...
@@ -671,7 +726,7 @@ var RenderJs = {\n
}\n
}\n
is_ready = true;\n
is_ready = true;\n
}\n
}\n
return is_gadget_list_loaded\n
return is_gadget_list_loaded
;
\n
},\n
},\n
\n
\n
update: function (root) {\n
update: function (root) {\n
...
@@ -710,7 +765,7 @@ var RenderJs = {\n
...
@@ -710,7 +765,7 @@ var RenderJs = {\n
</item>
</item>
<item>
<item>
<key>
<string>
size
</string>
</key>
<key>
<string>
size
</string>
</key>
<value>
<int>
2
3425
</int>
</value>
<value>
<int>
2
5312
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_jquery_plugin_renderjs/bt/revision
View file @
325676db
10
11
\ No newline at end of file
\ No newline at end of file
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