Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
w2pext
plugin_dbui
Commits
68baa080
Commit
68baa080
authored
14 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
The MathJax librairy is detected and loaded by the framework.
parent
732ddb58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
controllers/plugin_dbui.py
+7
-3
7 additions, 3 deletions
controllers/plugin_dbui.py
static/plugin_dbui/lib/appbase.js
+14
-0
14 additions, 0 deletions
static/plugin_dbui/lib/appbase.js
static/plugin_dbui/lib/apppanelmathjax.js
+8
-22
8 additions, 22 deletions
static/plugin_dbui/lib/apppanelmathjax.js
with
29 additions
and
25 deletions
controllers/plugin_dbui.py
+
7
−
3
View file @
68baa080
...
...
@@ -77,12 +77,16 @@ def index():
path
=
os
.
path
.
join
(
server_path
,
'
static
'
,
'
plugin_extjs
'
)
if
not
os
.
path
.
exists
(
path
):
raise
HTTP
(
500
,
'
The plugin extjs is not install !
'
)
# is the plugin MatJax ?
path
=
os
.
path
.
join
(
server_path
,
'
static
'
,
'
plugin_mathjax
'
)
withMathJax
=
(
True
if
os
.
path
.
exists
(
path
)
else
False
)
# option debug
debug
=
"
debug
"
in
request
.
get_vars
# option script
script
=
(
request
.
get_
vars
.
script
if
"
script
"
in
request
.
get_
vars
else
"
default
"
)
script
=
(
request
.
vars
.
script
if
"
script
"
in
request
.
vars
else
"
default
"
)
if
not
script
.
endswith
(
"
.js
"
):
script
=
'
%s.js
'
%
script
...
...
@@ -124,7 +128,7 @@ def index():
response
.
files
.
append
(
os
.
path
.
join
(
jpath
,
'
filter
'
,
'
NumericFilter.js
'
))
response
.
files
.
append
(
os
.
path
.
join
(
jpath
,
'
filter
'
,
'
StringFilter.js
'
))
# internationalization or localization
# internationalization or localization
(fr, fr-fr, fr-ca, ...)
lg
=
T
.
accepted_language
if
len
(
lg
)
==
5
and
lg
[
0
:
2
]
==
lg
[
3
:
5
]:
lg
=
lg
[
0
:
2
]
response
.
files
.
append
(
os
.
path
.
join
(
extjs
,
'
src
'
,
'
locale
'
,
'
ext-lang-%s.js
'
%
lg
))
...
...
@@ -145,7 +149,7 @@ def index():
# page view
response
.
view
=
plugins
.
dbui
.
page_view
return
dict
(
debug
=
debug
)
return
dict
(
debug
=
debug
,
withMathJax
=
withMathJax
)
def
database
():
...
...
This diff is collapsed.
Click to expand it.
static/plugin_dbui/lib/appbase.js
+
14
−
0
View file @
68baa080
...
...
@@ -29,6 +29,12 @@ Ext.namespace('App');
*/
App
.
dburl
=
'
/
'
+
App
.
name
+
'
/plugin_dbui/database
'
;
/**
* @cfg {Boolean} App.withMathJax
* The plugin plugin MathJax is present
* This constants is defined by the server.
*/
/**
* @cfg {Object} App.cfgSvcMethods
* Ext.direct.Provider exposing methods for a web service.
...
...
@@ -45,4 +51,12 @@ App.cfgSvcMethods = {
}
};
/**
* Helper function to load the MathJax librairy
* @param {Object} callback
*/
App
.
loadMathJax
=
function
(
callback
){
var
path
=
'
/
'
+
App
.
name
+
'
/static/plugin_mathjax/MathJax.js
'
;
Ext
.
Loader
.
load
([
path
],
callback
);
};
This diff is collapsed.
Click to expand it.
static/plugin_dbui/lib/apppanelmathjax.js
+
8
−
22
View file @
68baa080
/**
* Plugin to render mathematics formula.
* Plugin to render mathematics formula
embeded in html content
.
* The processing is performed by MathJax.
*
* @version $Id$
...
...
@@ -12,39 +12,25 @@
init
:
function
(
panel
){
// load MathJs and wait
try
{
MathJax
;
}
catch
(
ReferenceError
)
{
var
task
=
new
Ext
.
util
.
DelayedTask
();
Ext
.
Loader
.
load
([
'
/
'
+
App
.
name
+
'
/static/plugin_mathjax/MathJax.js
'
],
function
(){
task
.
cancel
();
});
task
.
delay
(
5000
);
}
// register a new listener when the panel is rendered for the first time
// register an handler which is activated only once
// when the panel is rendered for the first time
panel
.
on
(
'
render
'
,
this
.
onPanelRender
,
this
,
{
single
:
true
});
},
/**
* Handler to register a listener when the panel is rendered
* for the first time. The listener activates the MathJax processing
* Handler to activates the MathJax processing
* when the html content of the panel is loaded.
*
* @param {
Object} p an
Ext.Panel
* @param {Ext.Panel
} panel
*/
onPanelRender
:
function
(
p
){
var
updater
=
p
.
body
.
getUpdater
();
onPanelRender
:
function
(
p
anel
){
var
updater
=
p
anel
.
body
.
getUpdater
();
updater
.
on
(
'
update
'
,
this
.
onProcess
);
},
/**
* Handler to run the mathJax processing
* @param {
Object} el
Ext.Element
* @param {Ext.Element
} el
* @param {Object} o the response object
*/
onProcess
:
function
(
e
,
o
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment