Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
cf8cb98a
Commit
cf8cb98a
authored
Jun 07, 2011
by
Francois Marier
Committed by
Gerrit Code Review
Jun 07, 2011
Browse files
Merge "text block: add option for larger tinymce editor"
parents
83381911
1b231d76
Changes
4
Show whitespace changes
Inline
Side-by-side
htdocs/blocktype/textbox/lib.php
View file @
cf8cb98a
...
@@ -72,12 +72,16 @@ class PluginBlocktypeTextbox extends SystemBlocktype {
...
@@ -72,12 +72,16 @@ class PluginBlocktypeTextbox extends SystemBlocktype {
public
static
function
instance_config_form
(
$instance
)
{
public
static
function
instance_config_form
(
$instance
)
{
$configdata
=
$instance
->
get
(
'configdata'
);
$configdata
=
$instance
->
get
(
'configdata'
);
if
(
!
$height
=
get_config
(
'blockeditorheight'
))
{
$cfheight
=
param_integer
(
'cfheight'
,
0
);
$height
=
$cfheight
?
$cfheight
*
0.7
:
150
;
}
return
array
(
return
array
(
'text'
=>
array
(
'text'
=>
array
(
'type'
=>
'wysiwyg'
,
'type'
=>
'wysiwyg'
,
'title'
=>
get_string
(
'blockcontent'
,
'blocktype.textbox'
),
'title'
=>
get_string
(
'blockcontent'
,
'blocktype.textbox'
),
'width'
=>
'100%'
,
'width'
=>
'100%'
,
'height'
=>
'150
px'
,
'height'
=>
$height
.
'
px'
,
'defaultvalue'
=>
isset
(
$configdata
[
'text'
])
?
$configdata
[
'text'
]
:
''
,
'defaultvalue'
=>
isset
(
$configdata
[
'text'
])
?
$configdata
[
'text'
]
:
''
,
'rules'
=>
array
(
'maxlength'
=>
65536
),
'rules'
=>
array
(
'maxlength'
=>
65536
),
),
),
...
...
htdocs/js/views.js
View file @
cf8cb98a
...
@@ -295,6 +295,11 @@ function ViewManager() {
...
@@ -295,6 +295,11 @@ function ViewManager() {
var
contentDiv
=
getFirstElementByTagAndClassName
(
'
div
'
,
'
blockinstance-content
'
,
blockinstance
);
var
contentDiv
=
getFirstElementByTagAndClassName
(
'
div
'
,
'
blockinstance-content
'
,
blockinstance
);
var
pd
=
{
'
id
'
:
$
(
'
viewid
'
).
value
,
'
change
'
:
1
};
var
pd
=
{
'
id
'
:
$
(
'
viewid
'
).
value
,
'
change
'
:
1
};
if
(
config
.
blockeditormaxwidth
)
{
// Shouldn't have to pass browser window dimensions here, but can't find
// another way to get tinymce elements to use up the available height.
pd
[
'
cfheight
'
]
=
getViewportDimensions
().
h
-
100
;
}
pd
[
getNodeAttribute
(
button
,
'
name
'
)]
=
1
;
pd
[
getNodeAttribute
(
button
,
'
name
'
)]
=
1
;
var
oldContent
=
contentDiv
.
innerHTML
;
var
oldContent
=
contentDiv
.
innerHTML
;
...
@@ -384,6 +389,7 @@ function ViewManager() {
...
@@ -384,6 +389,7 @@ function ViewManager() {
var
w
=
Math
.
max
(
d
.
w
,
500
);
var
w
=
Math
.
max
(
d
.
w
,
500
);
if
(
config
.
blockeditormaxwidth
&&
getFirstElementByTagAndClassName
(
'
textarea
'
,
'
wysiwyg
'
,
newblock
))
{
if
(
config
.
blockeditormaxwidth
&&
getFirstElementByTagAndClassName
(
'
textarea
'
,
'
wysiwyg
'
,
newblock
))
{
w
=
vpdim
.
w
-
80
;
w
=
vpdim
.
w
-
80
;
style
.
height
=
h
+
'
px
'
;
}
}
var
tborder
=
parseFloat
(
getStyle
(
newblock
,
'
border-top-width
'
));
var
tborder
=
parseFloat
(
getStyle
(
newblock
,
'
border-top-width
'
));
...
@@ -1020,6 +1026,9 @@ function ViewManager() {
...
@@ -1020,6 +1026,9 @@ function ViewManager() {
'
change
'
:
1
,
'
change
'
:
1
,
'
blocktype
'
:
getFirstElementByTagAndClassName
(
'
input
'
,
'
blocktype-radio
'
,
self
.
currentlyMovingObject
).
value
'
blocktype
'
:
getFirstElementByTagAndClassName
(
'
input
'
,
'
blocktype-radio
'
,
self
.
currentlyMovingObject
).
value
};
};
if
(
config
.
blockeditormaxwidth
)
{
pd
[
'
cfheight
'
]
=
getViewportDimensions
().
h
-
100
;
}
pd
[
'
action_addblocktype_column_
'
+
whereTo
[
'
column
'
]
+
'
_order_
'
+
whereTo
[
'
order
'
]]
=
true
;
pd
[
'
action_addblocktype_column_
'
+
whereTo
[
'
column
'
]
+
'
_order_
'
+
whereTo
[
'
order
'
]]
=
true
;
sendjsonrequest
(
config
[
'
wwwroot
'
]
+
'
view/blocks.json.php
'
,
pd
,
'
POST
'
,
function
(
data
)
{
sendjsonrequest
(
config
[
'
wwwroot
'
]
+
'
view/blocks.json.php
'
,
pd
,
'
POST
'
,
function
(
data
)
{
var
div
=
DIV
();
var
div
=
DIV
();
...
...
htdocs/lib/config-defaults.php
View file @
cf8cb98a
...
@@ -223,10 +223,14 @@ $cfg->leapovermnetloglevel = 0;
...
@@ -223,10 +223,14 @@ $cfg->leapovermnetloglevel = 0;
// This should normally be set to http://www.gravatar.com/avatar/
// This should normally be set to http://www.gravatar.com/avatar/
//$cfg->remoteavatarbaseurl = 'http://www.gravatar.com/avatar/';
//$cfg->remoteavatarbaseurl = 'http://www.gravatar.com/avatar/';
// Option for width of wysiwyg editor in block configuration
// Option
s
for width
/height
of wysiwyg editor in block configuration
// forms. Workaround for current lack of tinymce fullscreen button.
// forms. Workaround for current lack of tinymce fullscreen button.
//
//
// Make the block config form expand to the full width of browser window
// Make the block config form expand to the full width of browser window
// whenever it contains a tinymce (also increases editor height in
// whenever it contains a tinymce (also increases editor height in
// textbox blocktype):
// textbox blocktype):
// $cfg->blockeditormaxwidth = true;
// $cfg->blockeditormaxwidth = true;
//
// Set a fixed height in pixels for the tinymce editor (currently only
// affects the textbox blocktype):
// $cfg->blockeditorheight = 550;
htdocs/theme/views.css
View file @
cf8cb98a
...
@@ -242,6 +242,10 @@ html>body #column-container {
...
@@ -242,6 +242,10 @@ html>body #column-container {
width
:
100%
;
width
:
100%
;
}
}
.blockinstance.configure
.mceEditor
{
width
:
100%
;
}
/* header */
/* header */
.blockinstance-header
{
.blockinstance-header
{
width
:
100%
;
width
:
100%
;
...
...
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