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
5b28e0ba
Commit
5b28e0ba
authored
Jun 09, 2014
by
Son Nguyen
Committed by
Gerrit Code Review
Jun 09, 2014
Browse files
Merge "Altering the toobar button layout to be more like moodle (Bug #1282341)"
parents
db24d6e9
2c490a70
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/js/tinymce/plugins/tooltoggle/img/toolbars.gif
0 → 100644
View file @
5b28e0ba
260 Bytes
htdocs/js/tinymce/plugins/tooltoggle/plugin.js
0 → 100644
View file @
5b28e0ba
/**
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
/*global tinymce:true */
tinymce
.
PluginManager
.
add
(
'
tooltoggle
'
,
function
(
editor
)
{
var
tooltoggleState
=
false
,
DOM
=
tinymce
.
DOM
;
editor
.
addButton
(
'
toolbar_toggle
'
,
{
icon
:
'
icon tooltoggle-icon
'
,
tooltip
:
get_string
(
'
toggletoolbarson
'
),
onclick
:
function
(
e
)
{
jQuery
(
e
.
target
).
closest
(
'
.mce-toolbar
'
).
siblings
().
toggleClass
(
'
hidden
'
);
tooltoggleState
=
!
tooltoggleState
;
editor
.
fire
(
'
ToolToggleStateChanged
'
,
{
state
:
tooltoggleState
});
},
onPostRender
:
function
()
{
var
self
=
this
;
editor
.
on
(
'
ToolToggleStateChanged
'
,
function
(
e
)
{
if
(
e
.
state
)
{
e
.
target
.
buttons
.
toolbar_toggle
.
tooltip
=
get_string
(
'
toggletoolbarsoff
'
);
}
else
{
e
.
target
.
buttons
.
toolbar_toggle
.
tooltip
=
get_string
(
'
toggletoolbarson
'
);
}
self
.
active
(
e
.
state
);
});
}
});
});
htdocs/lang/en.utf8/mahara.php
View file @
5b28e0ba
...
...
@@ -47,6 +47,8 @@ $string['closehelp'] = 'Close help';
$string
[
'applychanges'
]
=
'Apply changes'
;
$string
[
'general'
]
=
'General'
;
$string
[
'units'
]
=
'Units'
;
$string
[
'toggletoolbarson'
]
=
'Toggle toolbars on. Show full list of buttons'
;
$string
[
'toggletoolbarsoff'
]
=
'Toggle toolbars off. Show basic buttons'
;
// Objectionable strings.
$string
[
'complaint'
]
=
'Complaint'
;
$string
[
'notifyadministrator'
]
=
'Notify administrator'
;
...
...
htdocs/lib/web.php
View file @
5b28e0ba
...
...
@@ -150,9 +150,10 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
}
$toolbar
=
array
(
'"undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | link unlink | fullscreen"'
,
'"fontselect | fontsizeselect | formatselect | bold italic underline strikethrough | forecolor backcolor"'
,
'"undo redo | cut copy paste | alignleft aligncenter alignright alignjustify | hr emoticons image image2 spellchecker | link unlink | bullist numlist | table"'
,
null
,
'"toolbar_toggle | formatselect | bold italic | bullist numlist | link unlink | image | undo redo"'
,
'"underline strikethrough subscript superscript | alignleft aligncenter alignright alignjustify | outdent indent | forecolor backcolor | ltr rtl | fullscreen"'
,
'"fontselect | fontsizeselect | emoticons nonbreaking charmap | spellchecker | table | removeformat pastetext | code"'
,
);
// For right-to-left langs, reverse button order & align controls right.
...
...
@@ -166,9 +167,10 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
if
(
$check
[
$key
]
==
'tinymce'
)
{
$tinymceconfig
=
<<<EOF
theme: "modern",
plugins: "textcolor,
hr,
link,image,table,emoticons,spellchecker,paste,code,fullscreen",
plugins: "
tooltoggle,
textcolor,link,image,table,emoticons,spellchecker,paste,code,fullscreen
,directionality,searchreplace,nonbreaking,charmap
",
toolbar1: {$toolbar[1]},
toolbar2: {$toolbar[2]},
toolbar3: {$toolbar[3]},
menubar: false,
fix_list_elements: true,
image_advtab: true,
...
...
@@ -203,6 +205,10 @@ tinyMCE.init({
ed.focus();
}
});
ed.on('LoadContent', function(e) {
// Hide all the 2nd/3rd row menu buttons
jQuery('.mce-toolbar.mce-first').siblings().toggleClass('hidden');
});
{$extrasetup}
}
});
...
...
@@ -994,6 +1000,8 @@ function jsstrings() {
'Help'
,
'closehelp'
,
'tabs'
,
'toggletoolbarson'
,
'toggletoolbarsoff'
,
),
'pieforms'
=>
array
(
'element.calendar.opendatepicker'
...
...
htdocs/theme/raw/static/style/style.css
View file @
5b28e0ba
...
...
@@ -769,6 +769,13 @@ input.calendar.required {
#mce_fullscreen_container
.mceEditor
{
display
:
block
;
}
.mce-widget.mce-btn
i
.tooltoggle-icon
{
background-image
:
url(../../../../js/tinymce/plugins/tooltoggle/img/toolbars.gif)
;
}
.mce-stack-layout-item
.hidden
{
display
:
none
;
}
/* files */
a
.btn-addfile
{
display
:
inline-block
;
...
...
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