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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
69bfbb92
Commit
69bfbb92
authored
Jan 17, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_xhtml_style/erp5_web_renderjs_ui] Update renderJS 0.17.0
parent
f27f9fde
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
316 additions
and
106 deletions
+316
-106
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
...js_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
+157
-52
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
...s_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
+2
-2
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
...TemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
+157
-52
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
View file @
69bfbb92
...
...
@@ -665,7 +665,58 @@ if (typeof document.contains !== 'function') {
return
this
.
documentElement
.
contains
(
node
);
}
}
;
/*! RenderJs */
;(
function
(
DOMParser
)
{
"
use strict
"
;
try
{
if
((
new
window
.
URL
(
"
../a
"
,
"
https://example.com/
"
)).
href
===
"
https://example.com/a
"
)
{
return
;
}
}
catch
(
ignore
)
{}
var
isAbsoluteOrDataURL
=
/^
(?:[
a-z
]
+:
)?\/\/
|data:/i
;
function
resolveUrl
(
url
,
base_url
)
{
var
doc
,
base
,
link
,
html
=
"
<!doctype><html><head></head></html>
"
;
if
(
url
&&
base_url
)
{
doc
=
(
new
DOMParser
()).
parseFromString
(
html
,
'
text/html
'
);
base
=
doc
.
createElement
(
'
base
'
);
link
=
doc
.
createElement
(
'
link
'
);
doc
.
head
.
appendChild
(
base
);
doc
.
head
.
appendChild
(
link
);
base
.
href
=
base_url
;
link
.
href
=
url
;
return
link
.
href
;
}
return
url
;
}
function
URL
(
url
,
base
)
{
if
(
base
!==
undefined
)
{
if
(
!
isAbsoluteOrDataURL
.
test
(
base
))
{
throw
new
TypeError
(
"
Failed to construct 'URL': Invalid base URL
"
);
}
url
=
resolveUrl
(
url
,
base
);
}
if
(
!
isAbsoluteOrDataURL
.
test
(
url
))
{
throw
new
TypeError
(
"
Failed to construct 'URL': Invalid URL
"
);
}
this
.
href
=
url
;
}
URL
.
prototype
.
href
=
""
;
if
(
window
.
URL
&&
window
.
URL
.
createObjectURL
)
{
URL
.
createObjectURL
=
window
.
URL
.
createObjectURL
;
}
if
(
window
.
URL
&&
window
.
URL
.
revokeObjectURL
)
{
URL
.
revokeObjectURL
=
window
.
URL
.
revokeObjectURL
;
}
window
.
URL
=
URL
;
}(
DOMParser
));;
/*! RenderJs */
/*jslint nomen: true*/
/*
...
...
@@ -809,6 +860,7 @@ if (typeof document.contains !== 'function') {
gadget_loading_klass_list
=
[],
renderJS
,
Monitor
,
Mutex
,
scope_increment
=
0
,
isAbsoluteOrDataURL
=
new
RegExp
(
'
^(?:[a-z]+:)?//|data:
'
,
'
i
'
),
is_page_unloaded
=
false
,
...
...
@@ -825,6 +877,64 @@ if (typeof document.contains !== 'function') {
is_page_unloaded
=
true
;
});
/////////////////////////////////////////////////////////////////
// Mutex
/////////////////////////////////////////////////////////////////
Mutex
=
function
createMutex
()
{
if
(
!
(
this
instanceof
Mutex
))
{
return
new
Mutex
();
}
this
.
_latest_defer
=
null
;
};
Mutex
.
prototype
=
{
constructor
:
Mutex
,
lock
:
function
lockMutex
()
{
var
previous_defer
=
this
.
_latest_defer
,
current_defer
=
RSVP
.
defer
(),
queue
=
new
RSVP
.
Queue
();
this
.
_latest_defer
=
current_defer
;
if
(
previous_defer
!==
null
)
{
queue
.
push
(
function
acquireMutex
()
{
return
previous_defer
.
promise
;
});
}
// Create a new promise (.then) not cancellable
// to allow external cancellation of the callback
// without breaking the mutex implementation
queue
.
fail
(
current_defer
.
resolve
.
bind
(
current_defer
));
return
queue
.
push
(
function
generateMutexUnlock
()
{
return
function
runAndUnlock
(
callback
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
executeMutexCallback
()
{
return
callback
();
})
.
push
(
function
releaseMutexAfterSuccess
(
result
)
{
current_defer
.
resolve
(
result
);
return
result
;
},
function
releaseMutexAfterError
(
error
)
{
current_defer
.
resolve
(
error
);
throw
error
;
});
};
});
},
lockAndRun
:
function
(
callback
)
{
return
this
.
lock
()
.
push
(
function
executeLockAndRunCallback
(
runAndUnlock
)
{
return
runAndUnlock
(
callback
);
});
}
};
/////////////////////////////////////////////////////////////////
// Helper functions
/////////////////////////////////////////////////////////////////
...
...
@@ -1251,15 +1361,26 @@ if (typeof document.contains !== 'function') {
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareMethod
/////////////////////////////////////////////////////////////////
RenderJSGadget
.
declareMethod
=
function
declareMethod
(
name
,
callback
)
{
RenderJSGadget
.
declareMethod
=
function
declareMethod
(
name
,
callback
,
options
)
{
this
.
prototype
[
name
]
=
function
triggerMethod
()
{
var
context
=
this
,
argument_list
=
arguments
;
argument_list
=
arguments
,
mutex_name
;
return
new
RSVP
.
Queue
()
.
push
(
function
waitForMethodCallback
()
{
function
waitForMethodCallback
()
{
return
callback
.
apply
(
context
,
argument_list
);
});
}
if
((
options
!==
undefined
)
&&
(
options
.
hasOwnProperty
(
'
mutex
'
)))
{
mutex_name
=
'
__mutex_
'
+
options
.
mutex
;
if
(
!
context
.
hasOwnProperty
(
mutex_name
))
{
context
[
mutex_name
]
=
new
Mutex
();
}
return
context
[
mutex_name
].
lockAndRun
(
waitForMethodCallback
);
}
return
new
RSVP
.
Queue
()
.
push
(
waitForMethodCallback
);
};
// Allow chain
return
this
;
...
...
@@ -1295,24 +1416,8 @@ if (typeof document.contains !== 'function') {
return
this
.
element
;
})
.
declareMethod
(
'
changeState
'
,
function
changeState
(
state_dict
)
{
var
next_onStateChange
=
new
RSVP
.
Queue
(),
previous_onStateCHange
,
context
=
this
;
if
(
context
.
hasOwnProperty
(
'
__previous_onStateChange
'
))
{
previous_onStateCHange
=
context
.
__previous_onStateChange
;
next_onStateChange
.
push
(
function
waitForPreviousStateChange
()
{
return
previous_onStateCHange
;
})
.
push
(
undefined
,
function
handlePreviousStateChangeError
()
{
// Run callback even if previous failed
return
;
});
}
context
.
__previous_onStateChange
=
next_onStateChange
;
return
next_onStateChange
.
push
(
function
checkStateModification
()
{
var
key
,
var
context
=
this
,
key
,
modified
=
false
,
previous_cancelled
=
context
.
hasOwnProperty
(
'
__modification_dict
'
),
modification_dict
;
...
...
@@ -1341,8 +1446,7 @@ if (typeof document.contains !== 'function') {
return
result
;
});
}
});
});
},
{
mutex
:
'
changestate
'
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareAcquiredMethod
...
...
@@ -2038,6 +2142,7 @@ if (typeof document.contains !== 'function') {
/////////////////////////////////////////////////////////////////
// global
/////////////////////////////////////////////////////////////////
renderJS
.
Mutex
=
Mutex
;
window
.
rJS
=
window
.
renderJS
=
renderJS
;
window
.
__RenderJSGadget
=
RenderJSGadget
;
window
.
__RenderJSEmbeddedGadget
=
RenderJSEmbeddedGadget
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
View file @
69bfbb92
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
2.24020.58652.57139
</string>
</value>
<value>
<string>
96
4.57262.9791.60330
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
08945098.52
</float>
<float>
15
16196938.48
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
View file @
69bfbb92
...
...
@@ -665,7 +665,58 @@ if (typeof document.contains !== 'function') {
return
this
.
documentElement
.
contains
(
node
);
}
}
;
/*! RenderJs */
;(
function
(
DOMParser
)
{
"
use strict
"
;
try
{
if
((
new
window
.
URL
(
"
../a
"
,
"
https://example.com/
"
)).
href
===
"
https://example.com/a
"
)
{
return
;
}
}
catch
(
ignore
)
{}
var
isAbsoluteOrDataURL
=
/^
(?:[
a-z
]
+:
)?\/\/
|data:/i
;
function
resolveUrl
(
url
,
base_url
)
{
var
doc
,
base
,
link
,
html
=
"
<!doctype><html><head></head></html>
"
;
if
(
url
&&
base_url
)
{
doc
=
(
new
DOMParser
()).
parseFromString
(
html
,
'
text/html
'
);
base
=
doc
.
createElement
(
'
base
'
);
link
=
doc
.
createElement
(
'
link
'
);
doc
.
head
.
appendChild
(
base
);
doc
.
head
.
appendChild
(
link
);
base
.
href
=
base_url
;
link
.
href
=
url
;
return
link
.
href
;
}
return
url
;
}
function
URL
(
url
,
base
)
{
if
(
base
!==
undefined
)
{
if
(
!
isAbsoluteOrDataURL
.
test
(
base
))
{
throw
new
TypeError
(
"
Failed to construct 'URL': Invalid base URL
"
);
}
url
=
resolveUrl
(
url
,
base
);
}
if
(
!
isAbsoluteOrDataURL
.
test
(
url
))
{
throw
new
TypeError
(
"
Failed to construct 'URL': Invalid URL
"
);
}
this
.
href
=
url
;
}
URL
.
prototype
.
href
=
""
;
if
(
window
.
URL
&&
window
.
URL
.
createObjectURL
)
{
URL
.
createObjectURL
=
window
.
URL
.
createObjectURL
;
}
if
(
window
.
URL
&&
window
.
URL
.
revokeObjectURL
)
{
URL
.
revokeObjectURL
=
window
.
URL
.
revokeObjectURL
;
}
window
.
URL
=
URL
;
}(
DOMParser
));;
/*! RenderJs */
/*jslint nomen: true*/
/*
...
...
@@ -809,6 +860,7 @@ if (typeof document.contains !== 'function') {
gadget_loading_klass_list
=
[],
renderJS
,
Monitor
,
Mutex
,
scope_increment
=
0
,
isAbsoluteOrDataURL
=
new
RegExp
(
'
^(?:[a-z]+:)?//|data:
'
,
'
i
'
),
is_page_unloaded
=
false
,
...
...
@@ -825,6 +877,64 @@ if (typeof document.contains !== 'function') {
is_page_unloaded
=
true
;
});
/////////////////////////////////////////////////////////////////
// Mutex
/////////////////////////////////////////////////////////////////
Mutex
=
function
createMutex
()
{
if
(
!
(
this
instanceof
Mutex
))
{
return
new
Mutex
();
}
this
.
_latest_defer
=
null
;
};
Mutex
.
prototype
=
{
constructor
:
Mutex
,
lock
:
function
lockMutex
()
{
var
previous_defer
=
this
.
_latest_defer
,
current_defer
=
RSVP
.
defer
(),
queue
=
new
RSVP
.
Queue
();
this
.
_latest_defer
=
current_defer
;
if
(
previous_defer
!==
null
)
{
queue
.
push
(
function
acquireMutex
()
{
return
previous_defer
.
promise
;
});
}
// Create a new promise (.then) not cancellable
// to allow external cancellation of the callback
// without breaking the mutex implementation
queue
.
fail
(
current_defer
.
resolve
.
bind
(
current_defer
));
return
queue
.
push
(
function
generateMutexUnlock
()
{
return
function
runAndUnlock
(
callback
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
executeMutexCallback
()
{
return
callback
();
})
.
push
(
function
releaseMutexAfterSuccess
(
result
)
{
current_defer
.
resolve
(
result
);
return
result
;
},
function
releaseMutexAfterError
(
error
)
{
current_defer
.
resolve
(
error
);
throw
error
;
});
};
});
},
lockAndRun
:
function
(
callback
)
{
return
this
.
lock
()
.
push
(
function
executeLockAndRunCallback
(
runAndUnlock
)
{
return
runAndUnlock
(
callback
);
});
}
};
/////////////////////////////////////////////////////////////////
// Helper functions
/////////////////////////////////////////////////////////////////
...
...
@@ -1251,15 +1361,26 @@ if (typeof document.contains !== 'function') {
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareMethod
/////////////////////////////////////////////////////////////////
RenderJSGadget
.
declareMethod
=
function
declareMethod
(
name
,
callback
)
{
RenderJSGadget
.
declareMethod
=
function
declareMethod
(
name
,
callback
,
options
)
{
this
.
prototype
[
name
]
=
function
triggerMethod
()
{
var
context
=
this
,
argument_list
=
arguments
;
argument_list
=
arguments
,
mutex_name
;
return
new
RSVP
.
Queue
()
.
push
(
function
waitForMethodCallback
()
{
function
waitForMethodCallback
()
{
return
callback
.
apply
(
context
,
argument_list
);
});
}
if
((
options
!==
undefined
)
&&
(
options
.
hasOwnProperty
(
'
mutex
'
)))
{
mutex_name
=
'
__mutex_
'
+
options
.
mutex
;
if
(
!
context
.
hasOwnProperty
(
mutex_name
))
{
context
[
mutex_name
]
=
new
Mutex
();
}
return
context
[
mutex_name
].
lockAndRun
(
waitForMethodCallback
);
}
return
new
RSVP
.
Queue
()
.
push
(
waitForMethodCallback
);
};
// Allow chain
return
this
;
...
...
@@ -1295,24 +1416,8 @@ if (typeof document.contains !== 'function') {
return
this
.
element
;
})
.
declareMethod
(
'
changeState
'
,
function
changeState
(
state_dict
)
{
var
next_onStateChange
=
new
RSVP
.
Queue
(),
previous_onStateCHange
,
context
=
this
;
if
(
context
.
hasOwnProperty
(
'
__previous_onStateChange
'
))
{
previous_onStateCHange
=
context
.
__previous_onStateChange
;
next_onStateChange
.
push
(
function
waitForPreviousStateChange
()
{
return
previous_onStateCHange
;
})
.
push
(
undefined
,
function
handlePreviousStateChangeError
()
{
// Run callback even if previous failed
return
;
});
}
context
.
__previous_onStateChange
=
next_onStateChange
;
return
next_onStateChange
.
push
(
function
checkStateModification
()
{
var
key
,
var
context
=
this
,
key
,
modified
=
false
,
previous_cancelled
=
context
.
hasOwnProperty
(
'
__modification_dict
'
),
modification_dict
;
...
...
@@ -1341,8 +1446,7 @@ if (typeof document.contains !== 'function') {
return
result
;
});
}
});
});
},
{
mutex
:
'
changestate
'
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareAcquiredMethod
...
...
@@ -2038,6 +2142,7 @@ if (typeof document.contains !== 'function') {
/////////////////////////////////////////////////////////////////
// global
/////////////////////////////////////////////////////////////////
renderJS
.
Mutex
=
Mutex
;
window
.
rJS
=
window
.
renderJS
=
renderJS
;
window
.
__RenderJSGadget
=
RenderJSGadget
;
window
.
__RenderJSEmbeddedGadget
=
RenderJSEmbeddedGadget
;
...
...
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