Hi,
I am trying to invoke a method from prettify.js the method looks like
this....
my jsni method:-
public native String getPrettifiedOutput(String result)
/*-{
var prettyPrintingJob = {
sourceCodeHtml: result,
langExtension: '.java',
};
$wnd.applyDecorator(prettyPrintingJob);
return prettyPrintingJob.prettyPrintedHtml;
}-*/;
///---------------------------------------------------------------------------
method definition in the js file is :-
http://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify.js#1382
function applyDecorator(job) {
var sourceCodeHtml = job.sourceCodeHtml;
var opt_langExtension = job.langExtension;
// Prepopulate output in case processing fails with an exception.
job.prettyPrintedHtml = sourceCodeHtml;
try {
// Extract tags, and convert the source code to plain text.
var sourceAndExtractedTags = extractTags(sourceCodeHtml);
/** Plain text. @type {string} */
var source = sourceAndExtractedTags.source;
job.source = source;
job.basePos = 0;
///---------------------------------------------------------------------------
Am I invoking the method properly?
Please let me know for the changes I need to make.....
Thanks,
Komal