Lines Matching full:data
21 * This is a sample implementation for a custom Data Processor for basic BBCode.
27 * Returns a string representing the HTML format of "data". The returned
31 * @param {String} data The data to be converted in the
34 ConvertToHtml : function( data ) argument
37 data = data.replace( /</g, '<' ) ;
38 data = data.replace( />/g, '>' ) ;
41 data = data.replace( /(?:\r\n|\n|\r)/g, '<br>' ) ;
44 data = data.replace( /\[url\](.+?)\[\/url]/gi, '<a href="$1">$1</a>' ) ;
45 data = data.replace( /\[url\=([^\]]+)](.+?)\[\/url]/gi, '<a href="$1">$2</a>' ) ;
48 data = data.replace( /\[b\](.+?)\[\/b]/gi, '<b>$1</b>' ) ;
51 data = data.replace( /\[i\](.+?)\[\/i]/gi, '<i>$1</i>' ) ;
54 data = data.replace( /\[u\](.+?)\[\/u]/gi, '<u>$1</u>' ) ;
56 return '<html><head><title></title></head><body>' + data + '</body></html>' ;
60 * Converts a DOM (sub-)tree to a string in the data format.
62 * converted to the data format.
65 * @param {Boolean} format Indicates that the data must be formatted
66 * for human reading. Not all Data Processors may provide it.
70 var data = rootNode.innerHTML ;
73 data = data.replace( /<br(?=[ \/>]).*?>/gi, '\r\n') ;
76 data = data.replace( /<a .*?href=(["'])(.+?)\1.*?>(.+?)<\/a>/gi, '[url=$2]$3[/url]') ;
79 data = data.replace( /<(?:b|strong)>/gi, '[b]') ;
80 data = data.replace( /<\/(?:b|strong)>/gi, '[/b]') ;
83 data = data.replace( /<(?:i|em)>/gi, '[i]') ;
84 data = data.replace( /<\/(?:i|em)>/gi, '[/i]') ;
87 data = data.replace( /<u>/gi, '[u]') ;
88 data = data.replace( /<\/u>/gi, '[/u]') ;
91 data = data.replace( /<[^>]+>/g, '') ;
93 return data ;
107 // This Data Processor doesn't support <p>, so let's use <br>.
117 // Let's enforce the toolbar to the limits of this Data Processor. A custom