Skip to content

Conversation

ses4j
Copy link

@ses4j ses4j commented Mar 28, 2012

I needed a "# of lines" estimation for when the tinymce text gets published into an output PDF report. Your plugin almost fit the bill, I just tweaked it slightly to add a "lineCount" and to be able to plug in my own status line template, like this:

....
s_textmetrics_on: true,
s_textmetrics_template: function (ed, t) { 
    return '<span>Using an estimated <span id="' + t.lcid + '">0</span> line(s) out of a recommended max ' + settings.recommendedmaxlines + '.</span>';
s_textmetrics_charsperline: 50,
s_textmetrics_updater: function (t, d, m) {
    var lines = m.lineCount;
    d.setHTML(t.lcid, (lines > MAX_LINES) ? ("<span style='color:red'>" + lines + "</span>") : lines);
},

Pull it if you want -- if you need me to tweak it for acceptance somehow I'm happy to, just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant