Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
abf91883
Commit
abf91883
authored
Feb 01, 2012
by
tux091
Browse files
Find a solution to run scroll bar in panelWithSelector and to run MathJax
parent
def14b3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
31 deletions
+55
-31
modules/plugin_dbui/navtree.py
modules/plugin_dbui/navtree.py
+3
-5
static/plugin_dbui/src/apppanelwithurlselector.js
static/plugin_dbui/src/apppanelwithurlselector.js
+52
-26
No files found.
modules/plugin_dbui/navtree.py
View file @
abf91883
...
...
@@ -51,17 +51,15 @@ def to_panelWithUrlSelector(formItems,
cfg
=
{
'baseUrl'
:
url
,
'ctrlField'
:
ctrlField
,
'isMathJax'
:
is_mathjax
(),
'panelCfg'
:
None
,
'selectorCfg'
:
None
,
'xtype'
:
'xpanelwithurlselector'
}
# configuration of the
main
panel displaying URL
# configuration of the
child
panel displaying URL
cfg
[
'panelCfg'
]
=
{
'plugins'
:
[],
'xtype'
:
'panel'
}
if
is_mathjax
:
cfg
[
'panelCfg'
][
'plugins'
].
append
(
'pPanelMathJax'
)
# configuration of the selector
cfg
[
'selectorCfg'
]
=
{
'defaults'
:
{
'anchor'
:
'99%'
},
'items'
:
formItems
,
...
...
static/plugin_dbui/src/apppanelwithurlselector.js
View file @
abf91883
/**
* A panel displaying an url content with a
n
collpasible selector.
*
t
he selector allow to setup the url parameters and to launch the
* A panel displaying an url content with a collpasible selector.
*
T
he selector allow
s
to setup the url parameters and to launch the
* request to the server.
*
* The url is build as baseUrl or baseUrl/CtrlFieldValue if ctrlField
is defined.
* The value of the other field are pass as Field1=Field1Value
,Field2=Field2Value
*
in a
POST transfert
* The url is build as baseUrl or baseUrl/CtrlFieldValue if ctrlField
*
is defined.
The value of the other field
s
are pass as Field1=Field1Value
,
*
Field2=Field2Value via the
POST transfert
*
* Mathematical symbols will be interpreted, if the javascript library
* mathjax is load. Use the isMathJax property.
*
* The type of this component is xpanelwithurlselector.
*
* @extend: App.PanelWithSelector
...
...
@@ -27,6 +30,11 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, {
*/
ctrlField
:
null
,
/**
* @param {Boolean} isMathJax
*/
isMathJax
:
false
,
/**
* Private attributes for internationalization
*/
...
...
@@ -36,28 +44,14 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, {
* Require by the ExtJS model
*/
initComponent
:
function
()
{
App
.
PanelWithUrlSelector
.
superclass
.
initComponent
.
call
(
this
);
// connect the buttons
this
.
goButton
.
on
(
'
click
'
,
this
.
onGo
,
this
);
this
.
resetButton
.
on
(
'
click
'
,
this
.
onReset
,
this
);
},
/**
* Handler to catch HTTP error (see Ext.Update.update)
* @param {Ext.Element} el the element being update
* @param {boolean} success true for succes false for failure
* @param {XMLHttpRequest} response
* @param {Object} options
*/
onError
:
function
(
el
,
success
,
response
,
options
)
{
if
(
success
===
false
)
{
el
.
updateManager
.
abort
();
el
.
update
(
response
.
responseText
);
}
},
/**
* handler to build the URL and to load it in the panel
*/
...
...
@@ -65,11 +59,14 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, {
var
fields
,
i
,
p
anel
=
this
.
getComponent
(
'
mainPanel
'
),
mainP
anel
=
this
.
getComponent
(
'
mainPanel
'
),
params
=
{},
selector
=
this
.
getComponent
(
'
selectorPanel
'
),
url
=
this
.
baseUrl
;
// activate the autoscrolling
mainPanel
.
setAutoScroll
(
true
);
// basic fields
fields
=
selector
.
findByType
(
'
field
'
);
for
(
i
=
0
;
i
<
fields
.
length
;
i
+=
1
)
{
...
...
@@ -88,15 +85,44 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, {
});
}
p
anel
.
load
({
callback
:
this
.
on
Error
,
mainP
anel
.
load
({
callback
:
this
.
on
Load
,
params
:
params
,
url
:
url
,
scope
:
this
,
text
:
this
.
textLoad
,
url
:
url
,
timeout
:
30
});
},
/**
* Handler call when the web page is load in the panel.
* It is usefeul to detect HTTP error and to perform post
* processing (MathJax).
*
* Arguments ares those of the Ext.Update.update.
* @param {Ext.Element} el the element being update
* @param {boolean} success true for succes false for failure
* @param {XMLHttpRequest} response
* @param {Object} options
*/
onLoad
:
function
(
el
,
success
,
response
,
options
)
{
var
panelWithSelector
=
this
;
// errors detection
if
(
success
===
false
)
{
el
.
updateManager
.
abort
();
el
.
update
(
response
.
responseText
);
}
// post processing
if
(
panelWithSelector
.
isMathJax
)
{
MathJax
.
Hub
.
PreProcess
();
MathJax
.
Hub
.
Process
();
}
},
/**
* Handler to reset the selector
*/
...
...
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