Latest topics
» IconSkouliki Graphics
by skouliki Fri 20 Oct 2017, 05:08

» "Edit this page" feature
by skouliki Fri 20 Oct 2017, 01:37

» Dark Mode + Another Question
by Haggis Thu 19 Oct 2017, 10:36

» [GAME] Count to 1000 using even numbers Van-Helsing Edition
by Van-Helsing Tue 17 Oct 2017, 15:07

» [GAME] What are you thinking right now?
by Ace 1 Tue 17 Oct 2017, 08:09

» [GAME] Count to One Million!
by Ace 1 Tue 17 Oct 2017, 08:07

» [GAME] Last Letter Game
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] World Snake
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Never have I ever..
by Ace 1 Tue 17 Oct 2017, 08:06

» [GAME] Animal Game
by universecat Mon 16 Oct 2017, 21:43

» [GAME] Post a random picture
by SLGray Mon 16 Oct 2017, 16:28

» Hi everyone!
by skouliki Mon 16 Oct 2017, 02:01

» Hai Guys~
by skouliki Mon 16 Oct 2017, 01:59

» Add a login popup for the toolbar
by Ape Sun 15 Oct 2017, 13:51

» Mobile Usability Test
by Ange Tuteur Sat 14 Oct 2017, 11:20

Recent Tutorials
Who is online?
In total there are 6 users online :: 0 Registered, 0 Hidden and 6 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

SCEditor Color Picker [Color Cubes]

View previous topic View next topic Go down

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sat 08 Mar 2014, 00:52

Hello,

This color picker was developed for the editor I am working on, but I've reworked it for use with the SCEditor. The color picker button is added after the original color button.


Hovering over the colors will show their hex values in the input field. Additionally the color is also displayed at a larger scale next to the input. You can also type the color you want in the input field and click enter to insert the color into the editor. All colors present in the color cubes are web safe.

To install and test it :
Administration Panel > Modules > Javascript codes management > Create a new script

Title : Color picker
Placement : In all the pages
Code:
$(function() {$(function() {
    var colorPicker = '<div id="colorCubePopup"><style>#colorCubePopup {display:none;position:absolute;color:#333;font-size:10px;background:#fff;border:1px solid #ccc;padding:0;box-shadow:1px 2px 4px rgba(0,0,0,0.2);z-index:9999} #colorCubePopup div { margin:0; } .paletteColor {height:10px;width:10px;border:1px solid #fff;display:inline-block;cursor:pointer;} .paletteColor:hover {border-color:#333;} .marginR {margin-right:10px !important;} .colorPanel {padding:3px !important;border-bottom:1px solid #CCC;} #colorResult {width:48px;height:18px;border:1px solid #CCC;display:inline-block} #hexColor {margin:0 3px !important;vertical-align:top;padding:2px;cursor:text;} </style><div class="colorPanel"><div id="colorResult"></div><input id="hexColor" type="text" placeholder="#" size="8"></div><div id="colorCube" class="paletteColor marginR" style="background:#000000;"></div><div id="colorCube" class="paletteColor" style="background:#000000;"></div><div id="colorCube" class="paletteColor" style="background:#003300;"></div><div id="colorCube" class="paletteColor" style="background:#006600;"></div><div id="colorCube" class="paletteColor" style="background:#009900;"></div><div id="colorCube" class="paletteColor" style="background:#00CC00;"></div><div id="colorCube" class="paletteColor" style="background:#00FF00;"></div><div id="colorCube" class="paletteColor" style="background:#330000;"></div><div id="colorCube" class="paletteColor" style="background:#333300;"></div><div id="colorCube" class="paletteColor" style="background:#336600;"></div><div id="colorCube" class="paletteColor" style="background:#339900;"></div><div id="colorCube" class="paletteColor" style="background:#33CC00;"></div><div id="colorCube" class="paletteColor" style="background:#33FF00;"></div><div id="colorCube" class="paletteColor" style="background:#660000;"></div><div id="colorCube" class="paletteColor" style="background:#663300;"></div><div id="colorCube" class="paletteColor" style="background:#666600;"></div><div id="colorCube" class="paletteColor" style="background:#669900;"></div><div id="colorCube" class="paletteColor" style="background:#66CC00;"></div><div id="colorCube" class="paletteColor" style="background:#66FF00;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#333333;"></div><div id="colorCube" class="paletteColor" style="background:#000033;"></div><div id="colorCube" class="paletteColor" style="background:#003333;"></div><div id="colorCube" class="paletteColor" style="background:#006633;"></div><div id="colorCube" class="paletteColor" style="background:#009933;"></div><div id="colorCube" class="paletteColor" style="background:#00CC33;"></div><div id="colorCube" class="paletteColor" style="background:#00FF33;"></div><div id="colorCube" class="paletteColor" style="background:#330033;"></div><div id="colorCube" class="paletteColor" style="background:#333333;"></div><div id="colorCube" class="paletteColor" style="background:#336633;"></div><div id="colorCube" class="paletteColor" style="background:#339933;"></div><div id="colorCube" class="paletteColor" style="background:#33CC33;"></div><div id="colorCube" class="paletteColor" style="background:#33FF33;"></div><div id="colorCube" class="paletteColor" style="background:#660033;"></div><div id="colorCube" class="paletteColor" style="background:#663333;"></div><div id="colorCube" class="paletteColor" style="background:#666633;"></div><div id="colorCube" class="paletteColor" style="background:#669933;"></div><div id="colorCube" class="paletteColor" style="background:#66CC33;"></div><div id="colorCube" class="paletteColor" style="background:#66FF33;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#666666;"></div><div id="colorCube" class="paletteColor" style="background:#000066;"></div><div id="colorCube" class="paletteColor" style="background:#003366;"></div><div id="colorCube" class="paletteColor" style="background:#006666;"></div><div id="colorCube" class="paletteColor" style="background:#009966;"></div><div id="colorCube" class="paletteColor" style="background:#00CC66;"></div><div id="colorCube" class="paletteColor" style="background:#00FF66;"></div><div id="colorCube" class="paletteColor" style="background:#330066;"></div><div id="colorCube" class="paletteColor" style="background:#333366;"></div><div id="colorCube" class="paletteColor" style="background:#336666;"></div><div id="colorCube" class="paletteColor" style="background:#339966;"></div><div id="colorCube" class="paletteColor" style="background:#33CC66;"></div><div id="colorCube" class="paletteColor" style="background:#33FF66;"></div><div id="colorCube" class="paletteColor" style="background:#660066;"></div><div id="colorCube" class="paletteColor" style="background:#663366;"></div><div id="colorCube" class="paletteColor" style="background:#666666;"></div><div id="colorCube" class="paletteColor" style="background:#669966;"></div><div id="colorCube" class="paletteColor" style="background:#66CC66;"></div><div id="colorCube" class="paletteColor" style="background:#66FF66;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#999999;"></div><div id="colorCube" class="paletteColor" style="background:#000099;"></div><div id="colorCube" class="paletteColor" style="background:#003399;"></div><div id="colorCube" class="paletteColor" style="background:#006699;"></div><div id="colorCube" class="paletteColor" style="background:#009999;"></div><div id="colorCube" class="paletteColor" style="background:#00CC99;"></div><div id="colorCube" class="paletteColor" style="background:#00FF99;"></div><div id="colorCube" class="paletteColor" style="background:#330099;"></div><div id="colorCube" class="paletteColor" style="background:#333399;"></div><div id="colorCube" class="paletteColor" style="background:#336699;"></div><div id="colorCube" class="paletteColor" style="background:#339999;"></div><div id="colorCube" class="paletteColor" style="background:#33CC99;"></div><div id="colorCube" class="paletteColor" style="background:#33FF99;"></div><div id="colorCube" class="paletteColor" style="background:#660099;"></div><div id="colorCube" class="paletteColor" style="background:#663399;"></div><div id="colorCube" class="paletteColor" style="background:#666699;"></div><div id="colorCube" class="paletteColor" style="background:#669999;"></div><div id="colorCube" class="paletteColor" style="background:#66CC99;"></div><div id="colorCube" class="paletteColor" style="background:#66FF99;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#CCCCCC;"></div><div id="colorCube" class="paletteColor" style="background:#0000CC;"></div><div id="colorCube" class="paletteColor" style="background:#0033CC;"></div><div id="colorCube" class="paletteColor" style="background:#0066CC;"></div><div id="colorCube" class="paletteColor" style="background:#0099CC;"></div><div id="colorCube" class="paletteColor" style="background:#00CCCC;"></div><div id="colorCube" class="paletteColor" style="background:#00FFCC;"></div><div id="colorCube" class="paletteColor" style="background:#3300CC;"></div><div id="colorCube" class="paletteColor" style="background:#3333CC;"></div><div id="colorCube" class="paletteColor" style="background:#3366CC;"></div><div id="colorCube" class="paletteColor" style="background:#3399CC;"></div><div id="colorCube" class="paletteColor" style="background:#33CCCC;"></div><div id="colorCube" class="paletteColor" style="background:#33FFCC;"></div><div id="colorCube" class="paletteColor" style="background:#6600CC;"></div><div id="colorCube" class="paletteColor" style="background:#6633CC;"></div><div id="colorCube" class="paletteColor" style="background:#6666CC;"></div><div id="colorCube" class="paletteColor" style="background:#6699CC;"></div><div id="colorCube" class="paletteColor" style="background:#66CCCC;"></div><div id="colorCube" class="paletteColor" style="background:#66FFCC;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#FFFFFF;"></div><div id="colorCube" class="paletteColor" style="background:#0000FF;"></div><div id="colorCube" class="paletteColor" style="background:#0033FF;"></div><div id="colorCube" class="paletteColor" style="background:#0066FF;"></div><div id="colorCube" class="paletteColor" style="background:#0099FF;"></div><div id="colorCube" class="paletteColor" style="background:#00CCFF;"></div><div id="colorCube" class="paletteColor" style="background:#00FFFF;"></div><div id="colorCube" class="paletteColor" style="background:#3300FF;"></div><div id="colorCube" class="paletteColor" style="background:#3333FF;"></div><div id="colorCube" class="paletteColor" style="background:#3366FF;"></div><div id="colorCube" class="paletteColor" style="background:#3399FF;"></div><div id="colorCube" class="paletteColor" style="background:#33CCFF;"></div><div id="colorCube" class="paletteColor" style="background:#33FFFF;"></div><div id="colorCube" class="paletteColor" style="background:#6600FF;"></div><div id="colorCube" class="paletteColor" style="background:#6633FF;"></div><div id="colorCube" class="paletteColor" style="background:#6666FF;"></div><div id="colorCube" class="paletteColor" style="background:#6699FF;"></div><div id="colorCube" class="paletteColor" style="background:#66CCFF;"></div><div id="colorCube" class="paletteColor" style="background:#66FFFF;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#FF0000;"></div><div id="colorCube" class="paletteColor" style="background:#990000;"></div><div id="colorCube" class="paletteColor" style="background:#993300;"></div><div id="colorCube" class="paletteColor" style="background:#996600;"></div><div id="colorCube" class="paletteColor" style="background:#999900;"></div><div id="colorCube" class="paletteColor" style="background:#99CC00;"></div><div id="colorCube" class="paletteColor" style="background:#99FF00;"></div><div id="colorCube" class="paletteColor" style="background:#CC0000;"></div><div id="colorCube" class="paletteColor" style="background:#CC3300;"></div><div id="colorCube" class="paletteColor" style="background:#CC6600;"></div><div id="colorCube" class="paletteColor" style="background:#CC9900;"></div><div id="colorCube" class="paletteColor" style="background:#CCCC00;"></div><div id="colorCube" class="paletteColor" style="background:#CCFF00;"></div><div id="colorCube" class="paletteColor" style="background:#FF0000;"></div><div id="colorCube" class="paletteColor" style="background:#FF3300;"></div><div id="colorCube" class="paletteColor" style="background:#FF6600;"></div><div id="colorCube" class="paletteColor" style="background:#FF9900;"></div><div id="colorCube" class="paletteColor" style="background:#FFCC00;"></div><div id="colorCube" class="paletteColor" style="background:#FFFF00;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#00FF00;"></div><div id="colorCube" class="paletteColor" style="background:#990033;"></div><div id="colorCube" class="paletteColor" style="background:#993333;"></div><div id="colorCube" class="paletteColor" style="background:#996633;"></div><div id="colorCube" class="paletteColor" style="background:#999933;"></div><div id="colorCube" class="paletteColor" style="background:#99CC33;"></div><div id="colorCube" class="paletteColor" style="background:#99FF33;"></div><div id="colorCube" class="paletteColor" style="background:#CC0033;"></div><div id="colorCube" class="paletteColor" style="background:#CC3333;"></div><div id="colorCube" class="paletteColor" style="background:#CC6633;"></div><div id="colorCube" class="paletteColor" style="background:#CC9933;"></div><div id="colorCube" class="paletteColor" style="background:#CCCC33;"></div><div id="colorCube" class="paletteColor" style="background:#CCFF33;"></div><div id="colorCube" class="paletteColor" style="background:#FF0033;"></div><div id="colorCube" class="paletteColor" style="background:#FF3333;"></div><div id="colorCube" class="paletteColor" style="background:#FF6633;"></div><div id="colorCube" class="paletteColor" style="background:#FF9933;"></div><div id="colorCube" class="paletteColor" style="background:#FFCC33;"></div><div id="colorCube" class="paletteColor" style="background:#FFFF33;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#0000FF;"></div><div id="colorCube" class="paletteColor" style="background:#990066;"></div><div id="colorCube" class="paletteColor" style="background:#993366;"></div><div id="colorCube" class="paletteColor" style="background:#996666;"></div><div id="colorCube" class="paletteColor" style="background:#999966;"></div><div id="colorCube" class="paletteColor" style="background:#99CC66;"></div><div id="colorCube" class="paletteColor" style="background:#99FF66;"></div><div id="colorCube" class="paletteColor" style="background:#CC0066;"></div><div id="colorCube" class="paletteColor" style="background:#CC3366;"></div><div id="colorCube" class="paletteColor" style="background:#CC6666;"></div><div id="colorCube" class="paletteColor" style="background:#CC9966;"></div><div id="colorCube" class="paletteColor" style="background:#CCCC66;"></div><div id="colorCube" class="paletteColor" style="background:#CCFF66;"></div><div id="colorCube" class="paletteColor" style="background:#FF0066;"></div><div id="colorCube" class="paletteColor" style="background:#FF3366;"></div><div id="colorCube" class="paletteColor" style="background:#FF6666;"></div><div id="colorCube" class="paletteColor" style="background:#FF9966;"></div><div id="colorCube" class="paletteColor" style="background:#FFCC66;"></div><div id="colorCube" class="paletteColor" style="background:#FFFF66;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#FFFF00;"></div><div id="colorCube" class="paletteColor" style="background:#990099;"></div><div id="colorCube" class="paletteColor" style="background:#993399;"></div><div id="colorCube" class="paletteColor" style="background:#996699;"></div><div id="colorCube" class="paletteColor" style="background:#999999;"></div><div id="colorCube" class="paletteColor" style="background:#99CC99;"></div><div id="colorCube" class="paletteColor" style="background:#99FF99;"></div><div id="colorCube" class="paletteColor" style="background:#CC0099;"></div><div id="colorCube" class="paletteColor" style="background:#CC3399;"></div><div id="colorCube" class="paletteColor" style="background:#CC6699;"></div><div id="colorCube" class="paletteColor" style="background:#CC9999;"></div><div id="colorCube" class="paletteColor" style="background:#CCCC99;"></div><div id="colorCube" class="paletteColor" style="background:#CCFF99;"></div><div id="colorCube" class="paletteColor" style="background:#FF0099;"></div><div id="colorCube" class="paletteColor" style="background:#FF3399;"></div><div id="colorCube" class="paletteColor" style="background:#FF6699;"></div><div id="colorCube" class="paletteColor" style="background:#FF9999;"></div><div id="colorCube" class="paletteColor" style="background:#FFCC99;"></div><div id="colorCube" class="paletteColor" style="background:#FFFF99;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#00FFFF;"></div><div id="colorCube" class="paletteColor" style="background:#9900CC;"></div><div id="colorCube" class="paletteColor" style="background:#9933CC;"></div><div id="colorCube" class="paletteColor" style="background:#9966CC;"></div><div id="colorCube" class="paletteColor" style="background:#9999CC;"></div><div id="colorCube" class="paletteColor" style="background:#99CCCC;"></div><div id="colorCube" class="paletteColor" style="background:#99FFCC;"></div><div id="colorCube" class="paletteColor" style="background:#CC00CC;"></div><div id="colorCube" class="paletteColor" style="background:#CC33CC;"></div><div id="colorCube" class="paletteColor" style="background:#CC66CC;"></div><div id="colorCube" class="paletteColor" style="background:#CC99CC;"></div><div id="colorCube" class="paletteColor" style="background:#CCCCCC;"></div><div id="colorCube" class="paletteColor" style="background:#CCFFCC;"></div><div id="colorCube" class="paletteColor" style="background:#FF00CC;"></div><div id="colorCube" class="paletteColor" style="background:#FF33CC;"></div><div id="colorCube" class="paletteColor" style="background:#FF66CC;"></div><div id="colorCube" class="paletteColor" style="background:#FF99CC;"></div><div id="colorCube" class="paletteColor" style="background:#FFCCCC;"></div><div id="colorCube" class="paletteColor" style="background:#FFFFCC;"></div><br/><div id="colorCube" class="paletteColor marginR" style="background:#FF00FF;"></div><div id="colorCube" class="paletteColor" style="background:#9900FF;"></div><div id="colorCube" class="paletteColor" style="background:#9933FF;"></div><div id="colorCube" class="paletteColor" style="background:#9966FF;"></div><div id="colorCube" class="paletteColor" style="background:#9999FF;"></div><div id="colorCube" class="paletteColor" style="background:#99CCFF;"></div><div id="colorCube" class="paletteColor" style="background:#99FFFF;"></div><div id="colorCube" class="paletteColor" style="background:#CC00FF;"></div><div id="colorCube" class="paletteColor" style="background:#CC33FF;"></div><div id="colorCube" class="paletteColor" style="background:#CC66FF;"></div><div id="colorCube" class="paletteColor" style="background:#CC99FF;"></div><div id="colorCube" class="paletteColor" style="background:#CCCCFF;"></div><div id="colorCube" class="paletteColor" style="background:#CCFFFF;"></div><div id="colorCube" class="paletteColor" style="background:#FF00FF;"></div><div id="colorCube" class="paletteColor" style="background:#FF33FF;"></div><div id="colorCube" class="paletteColor" style="background:#FF66FF;"></div><div id="colorCube" class="paletteColor" style="background:#FF99FF;"></div><div id="colorCube" class="paletteColor" style="background:#FFCCFF;"></div><div id="colorCube" class="paletteColor" style="background:#FFFFFF;"></div></div>';
    var hideCube = function() { if ($('#colorCubePopup').css('display') !== 'none') { $('#colorCubePopup').hide() } };
    
    $('.sceditor-button-color').after('<a class="sceditor-button sceditor-button-cube" title="Color Cubes"><div style="background-image:url(http://i56.servimg.com/u/f56/18/45/41/65/color10.png);"></div></a>');
    $('body').append(colorPicker);    
    $(document).on('click','.sceditor-button-cube',function() {
        if ($('#colorCubePopup').css('display') == 'none') {
            var X = $('.sceditor-button-cube').offset().left;
            var Y = $('.sceditor-button-cube').offset().top + 25;
            
            $('#colorCubePopup').css('left',X + 'px').css('top',Y + 'px').show();
        }
        else { hideCube() }
    });
    
    $(document).on('mouseover','#colorCube',function() {
        var color = $(this).attr('style').replace(/background:(.*?);/,'$1');
        $('#colorResult').attr('style','background:'+color+';');
        $('#hexColor').val(color);
    });
    
    $(document).on('click','#colorCube',function() {
       var color = $(this).attr('style').replace(/background:(.*?);/,'$1');
       $('#text_editor_textarea').sceditor('instance').insertText('[color='+color+']','[/color]');
       hideCube();
    });

    $(document).on('keypress','#hexColor',function(e) {
        setTimeout(function() {
            var updateColor = $('#hexColor').val();
            $('#colorResult').attr('style','background:'+updateColor+';')
        },200);
        
        if (e.keyCode == 13) {
           var color = $('#hexColor').val();
           $('#text_editor_textarea').sceditor('instance').insertText('[color='+color+']','[/color]');
           hideCube();
           return false;
        }
    });
    
    $('.sceditor-button-source').click(function() { $('.sceditor-button-cube').removeClass('disabled') });
    $('.sceditor-button').not('.sceditor-button-cube').click(function() { hideCube() });
    $('.sceditor-container textarea').focus(function() { hideCube() });
    $('.sceditor-container iframe').contents().mousedown(function() { hideCube() });
})});

If you want to hide the original color picker, add this to your CSS :
Display > Colors > CSS stylesheet

Code:
.sceditor-button-color { display:none !important; }

If you encounter any bugs, or have feedback, you can leave it here.

Thank you and enjoy ! Very Happy

Version simple :
Ange Tuteur wrote:This is similar to the one I made, but less space. I used the color picker from the chatbox.

Instructions :
Administration Panel > Modules > JavaScript Code Management > Create a new script

Title : Color Cubes
Placement : In all the pages
Code:
$(function(){$(function(){
  if ($("#text_editor_textarea").length < 1) return;
  $.sceditor.command.get('color')._menu  = function (editor, caller, callback) {
    editor.createDropDown(caller, 'color-picker', '<iframe id="colorFrame" src="/chatbox/chatbox_selectcolor.htm" style="height:165px;width:250px;border:none;"></iframe>');
    $('#colorFrame').load(function(){$('#colorFrame').contents().find('table[bgcolor="#000000"]').find('td').click(function(){callback($(this).attr('bgcolor'));editor.closeDropDown(true)})});
  }
})});

Result :


Note : Simple color palette must be enabled
( Administration Panel > General > Messages and emails > Configuration > Type of the editor colors palette )


Last edited by Ange Tuteur on Tue 14 Oct 2014, 10:15; edited 5 times in total
avatar
Rhino.Freak

Title :
Lord of the 7 kingdoms and protector of the realm
Gender : Male
Age : 21
Posts : 275
Points : 1880
Reputation : 86
Location : India!
Language : English, Hindi
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://tokyoghoular.foruns.com.pt/

PostRhino.Freak on Sat 08 Mar 2014, 03:54

Wow!! Ill add it right away.. Thank you so much for sharing, you are the Best!!

I have a question, is it possible to add a real color picker (like in MS paint with Eyedropper symbol) ? Just asking if its possible.. :3
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sat 08 Mar 2014, 14:54

Thank you Smile

I'm sure it is possible however, I haven't tried, yet.
avatar
masesm
Member
Title :
Gender : Male
Posts : 10
Points : 1366
Reputation : 11
Location : United States of America
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postmasesm on Mon 10 Mar 2014, 02:05

Error detected: Upon pressing the color button, and then press another button in the editor, the color window does not seems to disappear. Unlike the rest of the button, where when you click on one button, and then click on the other, the first window disappears and the other appears. Not really a big error, but I thought I would mention it  Wink 
avatar
masesm
Member
Title :
Gender : Male
Posts : 10
Points : 1366
Reputation : 11
Location : United States of America
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

Postmasesm on Mon 10 Mar 2014, 02:08

Error 2 detected: The color changer does not seem to detect the editor mode change. It does BBcode even if the editor is not on bbcode. Not sure if it was developed that way.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Mon 10 Mar 2014, 04:14

Hi,

Thanks for the info.

For the popup, currently it only closes when a color is chosen, or the button is pressed again. I will have to look into the SCEditor to find the proper way for closing the popups.

It was not primarily developed for mode WYSIWYG, but after looking at the switched mode I forgot to remove the disabled class from the button. I will try to improve that.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sun 16 Mar 2014, 07:17

Hello,

The following has been fixed for the color picker.

1. ) Drop down now closes when an editor button, or textarea is clicked.
2. ) The button should no longer be disabled while in mode WYSIWYG

The following are still present.

1. ) Tags display in mode WYSIWYG

You can find the updated code in the first post.

Many thanks for you feedback.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 08 Apr 2014, 08:09

Hello,

The color cubes color picker code has been updated. This update has fixed a bug where the color picker would go to the bottom left corner of the screen while composing an MP. It should now display properly under its sceditor button.

You can find the updated code in the first post.
avatar
Typlo
New Member
Title :
Gender : Unspecified
Posts : 3
Points : 1316
Reputation : 2
Language : Portuguese
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

PostTyplo on Sat 12 Apr 2014, 16:13

Is to switch to this? http://www.colorpicker.com/ ??
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Sun 13 Apr 2014, 09:40

Typlo wrote:Is to switch to this? http://www.colorpicker.com/ ??
Ooh that is nice. Very Happy

I'd have to figure out how I could do something like that.  study
avatar
Typlo
New Member
Title :
Gender : Unspecified
Posts : 3
Points : 1316
Reputation : 2
Language : Portuguese
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile

PostTyplo on Sun 13 Apr 2014, 10:19

Very Happy Thanks by reply dear!
avatar
Rhino.Freak

Title :
Lord of the 7 kingdoms and protector of the realm
Gender : Male
Age : 21
Posts : 275
Points : 1880
Reputation : 86
Location : India!
Language : English, Hindi
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://tokyoghoular.foruns.com.pt/

PostRhino.Freak on Thu 08 May 2014, 23:37

The color button has suddenly disappeared from my forum Sad


http//onepiecea-edition.yoo7.com

infact a lot of scripts have started to not work... scratch


sorry .. not an issue with your script, but mine..
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Fri 09 May 2014, 08:01

^ check your most recent script. Also check your console for any errors, that can help you pinpoint which script it is usually.
avatar
Rhino.Freak

Title :
Lord of the 7 kingdoms and protector of the realm
Gender : Male
Age : 21
Posts : 275
Points : 1880
Reputation : 86
Location : India!
Language : English, Hindi
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://tokyoghoular.foruns.com.pt/

PostRhino.Freak on Fri 09 May 2014, 11:46

Yeah i fixed the problem ^^
avatar
Michael_vx

Title :
Gender : Male
Age : 25
Posts : 301
Points : 1716
Reputation : 75
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
Awards :
View all awards
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Mon 09 Jun 2014, 03:37

hi its looks fine
the only thing i might look at as a problem is the collor show after send the post
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 11 Jun 2014, 00:37

If the color is invalid it may not parse correctly. Shorthand hex(#000) isn't supported for text colors in the bbcode.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 09 Jul 2014, 04:54

Small update made to the script show that it shows without having to wait for the entire page to load.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 14 Oct 2014, 10:14

This is similar to the one I made, but less space. I used the color picker from the chatbox.

Instructions :
Administration Panel > Modules > JavaScript Code Management > Create a new script

Title : Color Cubes
Placement : In all the pages
Code:
$(function(){$(function(){
  if ($("#text_editor_textarea").length < 1 || !$.sceditor) return;
  $.sceditor.command.get('color')._menu  = function (editor, caller, callback) {
    editor.createDropDown(caller, 'color-picker', '<iframe id="colorFrame" src="/chatbox/selectcolor" style="height:165px;width:250px;border:none;"></iframe>');
    $('#colorFrame').load(function(){$('#colorFrame').contents().find('table[bgcolor="#000000"]').find('td').click(function(){callback($(this).attr('bgcolor'));editor.closeDropDown(true)})});
  }
})});

Result :


Note : Simple color palette must be enabled
( Administration Panel > General > Messages and emails > Configuration > Type of the editor colors palette )
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4698
Points : 9540
Reputation : 2337
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Fri 06 Feb 2015, 15:34

If you were using the following script for the colorpicker and it's not working, it's due to the chatbox update. I've updated the code below, so you can have the colorpicker back.
Ange Tuteur wrote:This is similar to the one I made, but less space. I used the color picker from the chatbox.

Instructions :
Administration Panel > Modules > JavaScript Code Management > Create a new script

Title : Color Cubes
Placement : In all the pages
Code:
$(function(){$(function(){
  if ($("#text_editor_textarea").length < 1 || !$.sceditor) return;
  $.sceditor.command.get('color')._menu  = function (editor, caller, callback) {
    editor.createDropDown(caller, 'color-picker', '<iframe id="colorFrame" src="/chatbox/selectcolor" style="height:165px;width:250px;border:none;"></iframe>');
    $('#colorFrame').load(function(){$('#colorFrame').contents().find('table[bgcolor="#000000"]').find('td').click(function(){callback($(this).attr('bgcolor'));editor.closeDropDown(true)})});
  }
})});

Result :


Note : Simple color palette must be enabled
( Administration Panel > General > Messages and emails > Configuration > Type of the editor colors palette )

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum