www.webdeveloper.com
Results 1 to 3 of 3

Thread: Problema Generazione Colori Editor BBCODE

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    5

    Problema Generazione Colori Editor BBCODE

    Salve Gente,

    Ho installato un editor BBCODE (sceditor) sulla webview di un applicazione per iphone/android che sto realizzando, ho un piccolo problemino, il tasto font color basato sulla scala RGB dei colori con i gradienti, ma non va bene per l'utilizzo che devo farne io vi inserisco qui la funzioncina e vi spiego sotto cosa dovrei fare.

    Codice:
    color: {
    _dropDown: function (editor, caller, callback) {
    var i, x, color, colors, genColor = {
    r : 255,
    g : 255,
    b : 255
    }, content = $("<div />"),
    colorColumns = editor.opts.colors ? editor.opts.colors.split("|") : Array(4),
    html = [],
    cmd = $.sceditor.command.get("color");
    if (!cmd._htmlCache) {
    for (i = 0; colorColumns.length > i; ++i) {
    for (colors = colorColumns[i] ? colorColumns[i].split(",") : Array(4), html.push('<div class="sceditor-color-column">'), x = 0; colors.length > x; ++x) color = colors[x] || "#" + genColor.r.toString(16) + genColor.g.toString(16) + genColor.b.toString(16), html.push('<a href="#" class="sceditor-color-option" style="background-color: ' + color + '" data-color="' + color + '"></a>'), 0 === x % 5 ? (genColor.g -= 150, genColor.b = 155) : genColor.b = 51;
    html.push("</div>"), 0 === i % 5 ? (genColor.r = 99, genColor.g = 255, genColor.b = 255) : (genColor.g = 255, genColor.b = 255)
    }
    cmd._htmlCache = html.join("")
    }
    content.append(cmd._htmlCache).find("a").click(function (e) {
    callback($(this).attr("data-color")), editor.closeDropDown(!0), e.preventDefault()
    }), editor.createDropDown(caller, "color-picker", content)
    },
    exec: function (caller) {
    var editor = this;
    $.sceditor.command.get("color")._dropDown(editor, caller, function (color) {
    editor.execCommand("forecolor", color)
    })
    },
    tooltip: "Font Color"
    Dovrei differenziare i colori senza vedere una scala come ora avendo a disposizione 16 quadratini (4*4) di 20px, ovvero rosso, giallo, blu con graduazioni visibili fra loro come nell'editor di questo sito.

    Mi potete aiutare?

    Grazie anticipatamente.

  2. #2
    Join Date
    Apr 2013
    Posts
    5
    ENGLISH:

    Hello Folks,

    I installed an editor BBCODE (sceditor) on the webview of an application for iphone / android that I'm making, I have a little problem, the key is based on the font color scale RGB colors with gradients, but not good for the use that I make it I will insert here the funzioncina and I'll explain below what I should do.

    color: {
    _dropDown: function (editor, caller, callback) {
    var i, x, color, colors, genColor = {
    r : 255,
    g : 255,
    b : 255
    }, content = $("<div />"),
    colorColumns = editor.opts.colors ? editor.opts.colors.split("|") : Array(4),
    html = [],
    cmd = $.sceditor.command.get("color");
    if (!cmd._htmlCache) {
    for (i = 0; colorColumns.length > i; ++i) {
    for (colors = colorColumns[i] ? colorColumns[i].split(",") : Array(4), html.push('<div class="sceditor-color-column">'), x = 0; colors.length > x; ++x) color = colors[x] || "#" + genColor.r.toString(16) + genColor.g.toString(16) + genColor.b.toString(16), html.push('<a href="#" class="sceditor-color-option" style="background-color: ' + color + '" data-color="' + color + '"></a>'), 0 === x % 5 ? (genColor.g -= 150, genColor.b = 155) : genColor.b = 51;
    html.push("</div>"), 0 === i % 5 ? (genColor.r = 99, genColor.g = 255, genColor.b = 255) : (genColor.g = 255, genColor.b = 255)
    }
    cmd._htmlCache = html.join("")
    }
    content.append(cmd._htmlCache).find("a").click(function (e) {
    callback($(this).attr("data-color")), editor.closeDropDown(!0), e.preventDefault()
    }), editor.createDropDown(caller, "color-picker", content)
    },
    exec: function (caller) {
    var editor = this;
    $.sceditor.command.get("color")._dropDown(editor, caller, function (color) {
    editor.execCommand("forecolor", color)
    })
    },
    tooltip: "Font Color"
    I should differentiate colors without seeing a scale as it is now having a total of 16 squares (4 * 4) of 20px, which is red, yellow, blue with black markings visible between them is as the editor of this site.

    Can you help me?

    Thanks in advance.

  3. #3
    Join Date
    Apr 2013
    Posts
    5
    Bump!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles