added hooks to contentcollector.js

pull/992/head
Gedion 2012-09-08 12:11:04 -05:00
parent a2c8d21240
commit 6d1cba2259
1 changed files with 15 additions and 2 deletions

View File

@ -376,6 +376,18 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
{ {
var txt = dom.nodeValue(node); var txt = dom.nodeValue(node);
var tname = dom.nodeAttr(node.parentNode,"name"); var tname = dom.nodeAttr(node.parentNode,"name");
/*
* Called from: src/static/js/contentcollector.js
*
* Context -
* cc - the contentcollector object
* state - the current state of the change being made
* tname - the tag name of this node currently being processed
* text - the text for that line
* This hook allows you to validate/manipulate the text before it sent to the server side.
* The return value should the validate/manipulated text.
*
*/
var txtFromHook = hooks.callAll('collectContentLineText', { var txtFromHook = hooks.callAll('collectContentLineText', {
cc: this, cc: this,
state: state, state: state,
@ -453,14 +465,15 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
var tname = (dom.nodeTagName(node) || "").toLowerCase(); var tname = (dom.nodeTagName(node) || "").toLowerCase();
if (tname == "br") if (tname == "br")
/* /*
*Called from: src/static/js/contentcollector.js * Called from: src/static/js/contentcollector.js
* *
* Context -
* cc - the contentcollector object * cc - the contentcollector object
* state - the current state of the change being made * state - the current state of the change being made
* tname - the tag name of this node currently being processed * tname - the tag name of this node currently being processed
* *
* This hook is provided to allow Whether the br tag should induce a new magic domline or not. * This hook is provided to allow Whether the br tag should induce a new magic domline or not.
* The return value should be either true(break the line) or values. * The return value should be either true(break the line) or false.
* *
*/ */
{ {