Skip to content

Commit

Permalink
MDL-40770 TinyMCE - Implement new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr committed Sep 17, 2013
1 parent f0b7b95 commit efba9f9
Show file tree
Hide file tree
Showing 15 changed files with 418 additions and 27 deletions.
3 changes: 1 addition & 2 deletions lib/editor/tinymce/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ protected function get_init_params($elementid, array $options=null) {
'plugin_insertdate_dateFormat ' => $strdate,
'plugin_insertdate_timeFormat ' => $strtime,
'theme' => "advanced",
'skin' => "o2k7",
'skin_variant' => "silver",
'skin' => "moodle",
'apply_source_formatting' => true,
'remove_script_host' => false,
'entity_encoding' => "raw",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
ed.addButton('moodleemoticon', {
title : 'moodleemoticon.desc',
cmd : 'mceMoodleEmoticon',
image : url + '/img/moodleemoticon.gif'
image : url + '/img/moodleemoticon.png'
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Register buttons.
ed.addButton('moodlemedia', {
title : 'moodlemedia.desc',
image : url + '/img/icon.gif',
image : url + '/img/icon.png',
cmd : 'mceMoodleMedia'});

},
Expand Down
Binary file removed lib/editor/tinymce/plugins/pdw/pix/icon.gif
Binary file not shown.
Binary file added lib/editor/tinymce/plugins/pdw/pix/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 23 additions & 23 deletions lib/editor/tinymce/plugins/pdw/tinymce/editor_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* PDW Toggle Toolbars v1.2
* Url: http://www.neele.name
* Author: Guido Neele
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -21,10 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* Based on TinyMCE Wordpress plugin (Kitchen Sink)
*
*
* Changes V1.1.1 --> V1.2
*
* heeae made some modifications and posted his work on Sourceforge. I thought the cookie support
*
* heeae made some modifications and posted his work on Sourceforge. I thought the cookie support
* was really handy so I updated the script.
* http://sourceforge.net/tracker/?func=detail&atid=738747&aid=2904683&group_id=103281
*
Expand All @@ -33,7 +33,7 @@
* 3. Bug fix of fire ifr.clientHeight in FF 3 ( to DOM.getStyles)
*
* Thanks heeae!
*
*
* Changes V1.1 --> V1.1.1
*
* Bugfix for Firefox 3.6. Caused error while loading script.
Expand All @@ -57,13 +57,13 @@
* }
*
* Thanks Anton for fixing this bug
*
*
*/

(function() {
var DOM = tinymce.DOM;
tinymce.PluginManager.requireLangPack('pdw');

tinymce.create('tinymce.plugins.pdw', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
Expand All @@ -75,34 +75,34 @@
*/
init : function(ed, url) {
var t = this, tbIds = new Array(), toolbars = new Array(), i;

// Split toolbars
toolbars = (ed.settings.pdw_toggle_toolbars).split(',');

for(i = 0; i < toolbars.length; i++){
tbIds[i] = ed.getParam('', 'toolbar' + (toolbars[i]).replace(' ',''));
}

// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mcePDWToggleToolbars', function() {

var cm = ed.controlManager, id, j, Cookie = tinymce.util.Cookie, Toggle_PDW, Toggle = Cookie.getHash("TinyMCE_toggle") || new Object();
for(j = 0; j < tbIds.length; j++){

obj = ed.controlManager.get(tbIds[j]);
if(typeof obj =="undefined") {
continue;
}
id = obj.id;

if (DOM.isHidden(id)) {
Toggle_PDW = 0;
var e = document.getElementById(id);
if (e) {
e.style.display = 'table';
t._resizeIframe(ed, tbIds[j], -26);
}

} else {
Toggle_PDW = 1;
var e = document.getElementById(id);
Expand All @@ -117,30 +117,30 @@
Toggle[ed.id] = Toggle_PDW;
Cookie.setHash("TinyMCE_toggle", Toggle);
});

// Register pdw_toggle button
ed.addButton('pdw_toggle', {
title : ed.getLang('pdw.desc', 0),
cmd : 'mcePDWToggleToolbars',
image : url + '/img/toolbars.gif'
image : url + '/img/toolbars.png'
});

ed.onPostRender.add(function(){
var toggle = tinymce.util.Cookie.getHash("TinyMCE_toggle") || new Object();
var run = false;

// Check if value is stored in cookie
if(toggle[ed.id] == null){
// No cookie so check if the setting pdw_toggle_on is set to 1 then hide toolbars and set button active
run = ed.settings.pdw_toggle_on == 1 ? true : false;
} else if(toggle[ed.id] == 1){
run = true;
}

if (run) {

var cm = ed.controlManager, tdId, id;

for(i = 0; i < toolbars.length; i++){
tbId = ed.getParam('', 'toolbar' + (toolbars[i]).replace(' ',''));
id = ed.controlManager.get(tbId).id;
Expand All @@ -151,7 +151,7 @@
}
});
},

// Resizes the iframe by a relative height value
_resizeIframe : function(ed, tb_id, dy) {
var ifr = ed.getContentAreaContainer().firstChild;
Expand Down
Binary file removed lib/editor/tinymce/plugins/pdw/tinymce/img/toolbars.gif
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
body.mceForceColors {background:#FFF; color:#000;}
h1 {font-size: 2em}
h2 {font-size: 1.5em}
h3 {font-size: 1.17em}
h4 {font-size: 1em}
h5 {font-size: .83em}
h6 {font-size: .75em}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through}
cite {border-bottom:1px dashed blue}
acronym {border-bottom:1px dotted #CCC; cursor:help}
abbr {border-bottom:1px dashed #CCC; cursor:help}

/* IE */
* html body {
scrollbar-3dlight-color:#F0F0EE;
scrollbar-arrow-color:#676662;
scrollbar-base-color:#F0F0EE;
scrollbar-darkshadow-color:#DDD;
scrollbar-face-color:#E0E0DD;
scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
}

img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
font[face=mceinline] {font-family:inherit !important}
*[contentEditable]:focus {outline:0}

.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
.mceItemShockWave {background-image:url(../../img/shockwave.gif)}
.mceItemFlash {background-image:url(../../img/flash.gif)}
.mceItemQuickTime {background-image:url(../../img/quicktime.gif)}
.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
.mceItemVideo {background-image:url(../../img/video.gif)}
.mceItemAudio {background-image:url(../../img/video.gif)}
.mceItemIframe {background-image:url(../../img/iframe.gif)}
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/* Generic */
body {
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
scrollbar-3dlight-color:#F0F0EE;
scrollbar-arrow-color:#676662;
scrollbar-base-color:#F0F0EE;
scrollbar-darkshadow-color:#DDDDDD;
scrollbar-face-color:#E0E0DD;
scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
background:#F0F0EE;
padding:0;
margin:8px 8px 0 8px;
}

html {background:#F0F0EE;}
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
textarea {resize:none;outline:none;}
a:link, a:visited {color:black;}
a:hover {color:#2B6FB6;}
.nowrap {white-space: nowrap}

/* Forms */
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
legend {color:#2B6FB6; font-weight:bold;}
label.msg {display:none;}
label.invalid {color:#EE0000; display:inline;}
input.invalid {border:1px solid #EE0000;}
input {background:#FFF; border:1px solid #CCC;}
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
input, select, textarea {border:1px solid #808080;}
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
.input_noborder {border:0;}

/* Buttons */
#insert, #cancel, input.button, .updateButton {
border:0; margin:0; padding:0;
font-weight:bold;
width:94px; height:26px;
background:url(../default/img/buttons.png) 0 -26px;
cursor:pointer;
padding-bottom:2px;
float:left;
}

#insert {background:url(../default/img/buttons.png) 0 -52px}
#cancel {background:url(../default/img/buttons.png) 0 0; float:right}

/* Browse */
a.pickcolor, a.browse {text-decoration:none}
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
.mceOldBoxModel a.browse span {width:22px; height:20px;}
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
a.pickcolor:hover span {background-color:#B2BBD0;}
a.pickcolor:hover span.disabled {}

/* Charmap */
table.charmap {border:1px solid #AAA; text-align:center}
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
#charmap a {display:block; color:#000; text-decoration:none; border:0}
#charmap a:hover {background:#CCC;color:#2B6FB6}
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}

/* Source */
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
.mceActionPanel {margin-top:5px;}

/* Tabs classes */
.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
.tabs ul {margin:0; padding:0; list-style:none;}
.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}

/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}

/* Columns */
.column {float:left;}
.properties {width:100%;}
.properties .column1 {}
.properties .column2 {text-align:left;}

/* Titles */
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
h3 {font-size:14px;}
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}

/* Dialog specific */
#link .panel_wrapper, #link div.current {height:125px;}
#image .panel_wrapper, #image div.current {height:200px;}
#plugintable thead {font-weight:bold; background:#DDD;}
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
#plugintable {width:96%; margin-top:10px;}
#pluginscontainer {height:290px; overflow:auto;}
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
#colorpicker #light div {overflow:hidden;}
#colorpicker .panel_wrapper div.current {height:175px;}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
#colorpicker #colornamecontainer {margin-top:5px;}
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/editor/tinymce/tiny_mce/3.5.8/themes/advanced/skins/moodle/img/text_color.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit efba9f9

Please sign in to comment.