diff --git a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsBook.xml b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsBook.xml index 0445d9afef85c2e4d4b4344cf6d3a430cfe3277c..38e864952fd234576723f3aef93a83170c844f5d 100644 --- a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsBook.xml +++ b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsBook.xml @@ -55,7 +55,7 @@ cleanForPrince();\n return false;\n });\n - convertBook(\'getTextContent\', $(\'body\'));\n + convertBook(\'index_html?format=html\', $(\'body\'));\n });\n </script>\n <title>View as Book</title>\n diff --git a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsChapter.xml b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsChapter.xml index 9d0bfaf485b29133753db837edec9090c804d379..10b459775a153ffcbc8975831745556c6fd8293c 100644 --- a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsChapter.xml +++ b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/TestPage_viewAsChapter.xml @@ -53,7 +53,7 @@ cleanForPrince();\n return false;\n });\n - convertChapter(\'getTextContent\', $(\'body\'), true, true, 1, 1);\n + convertChapter(\'index_html?format=html\', $(\'body\'), true, true, 1, 1);\n });\n </script>\n <title>View as Chapter</title>\n diff --git a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/book_converter.js.xml b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/book_converter.js.xml index 9a144f444c299f2d2446a76b7e487eead102f349..32632c311bc5f61e242d4eb0b5943f0cfeefae55 100644 --- a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/book_converter.js.xml +++ b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/book_converter.js.xml @@ -53,7 +53,7 @@ function convertBook(linkToBook, container){\n $(function() {\n //Getting the html content\n $.get(linkToBook, function(data, textStatus, jqXHR){\n - linkToBook = linkToBook.replace(\'getTextContent\',\'\');\n + linkToBook = linkToBook.replace(\'index_html?format=html\',\'\');\n var tocContainer = $(\'<div>\').html(data);\n var sections = tocContainer.children();\n body = $(\'<body>\');\n @@ -71,7 +71,7 @@ function convertBook(linkToBook, container){\n for(var j = 0; j < p; j++){\n var newChapter = $(\'<div>\').addClass(\'chapter\').attr(\'id\',\'chapter-h-\' + partCounter + \'-\' + (j+1));\n partContainer.append(newChapter);\n - convertChapter($(\'> a\', chapterTitles.eq(j)).attr(\'href\') + \'/getTextContent\', newChapter, false, false);\n + convertChapter($(\'> a\', chapterTitles.eq(j)).attr(\'href\') + \'/index_html?format=html\', newChapter, false, false);\n }\n body.append(partContainer);\n firstChapter = false;\n @@ -91,7 +91,7 @@ function convertBook(linkToBook, container){\n newMatter.addClass(\'endmatter\').attr("id","endmatter-h-" + matterCounter);\n body.append(newMatter);\n matterCounter++;\n - convertChapter(link.attr(\'href\') + \'/getTextContent\', newMatter, false, false);\n + convertChapter(link.attr(\'href\') + \'/index_html?format=html\', newMatter, false, false);\n }\n else{\n partCounter++;\n diff --git a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/chapter_converter.js.xml b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/chapter_converter.js.xml index 9ee849a18c289deeee97e14248addf4a618f79e2..89f39dd6b4c8d5d81e5f0bb5136d4661d887efc0 100644 --- a/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/chapter_converter.js.xml +++ b/bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/chapter_converter.js.xml @@ -52,12 +52,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n var temp = $(\'iframe\', parent.document).contents().children().clone();\n $(\'script\', temp).remove();\n $(\'style, meta:not([name=author])\', temp).remove();\n + $(\'head\', temp).prepend($(\'<meta>\').attr(\'http-equiv\',\'content-type\').attr(\'content\', \'text/html; charset=utf-8\'));\n var images = $(\'img\', temp);\n n = images.length;\n for(var i = 0; i < n; i++){\n var img = images.eq(i);\n var src = img.attr(\'src\').split(\'?format\')[0].split(\'/\');\n -\n var extension = img.attr(\'type\');\n if(extension == undefined)\n extension = "png";\n @@ -67,10 +67,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n }\n var text = temp.html();\n var result = "", tagName = "", c = "", chr = "";\n + var n = text.length;\n if (text == null) {\n return false;\n }\n - var n = text.length;\n var tag = false, tagNameParsing = false;\n for(var i = 0; i < n; i++){\n chr = text[i];\n @@ -186,7 +186,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n titleObj.text(title);\n else\n $(\'head\').append($(\'<title>\').text(title));\n - $(\'head\').append($(\'<meta>\').attr(\'name\',\'author\').attr(\'content\', authors));\n + $(\'head\').prepend($(\'<meta>\').attr(\'name\',\'author\').attr(\'content\', authors));\n titleObj = $(\'<h1>\').text(title);\n var subtitle = $(\'<h2>\').text(description);\n var edition = $(\'<h3>\').text(shortTitle);\n @@ -210,7 +210,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n //Getting the html content\n $.get(link, function(data, textStatus, jqXHR){\n var chapterContainer = $(\'<div>\').addClass(\'chapter\').attr(\'id\', \'chapter-h-\' + partCounter + \'-\' + chapterCounter).html(data);\n - link = link.replace("getTextContent","");\n + link = link.replace("index_html?format=html","");\n var sections = $(\'section\', chapterContainer);\n $(\'base,meta,link,title\', chapterContainer).remove();\n changeTag($(\'footer\', chapterContainer), \'p\');\n @@ -224,7 +224,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n var img = images[j];\n var div = $(\'<div>\');\n var caption = $(\'<p>\').addClass(\'caption\');\n - $(img).attr(\'src\', link + $(img).attr(\'src\'));\n + if((/^http/).test($(img).attr(\'src\')) == false) {\n + $(img).attr(\'src\', link + $(img).attr(\'src\'));\n + }\n $(img).before(div);\n var imgToAppend = $(img);\n var imgWidth = $(img).attr(\'width\');\n @@ -236,7 +238,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n var p = otherImages.length;\n for(var j = 0; j < p; j++){\n var img = otherImages[j];\n - $(img).attr(\'src\', link + $(img).attr(\'src\'));\n + if((/^http/).test($(img).attr(\'src\')) == false) {\n + $(img).attr(\'src\', link + $(img).attr(\'src\'));\n + }\n }\n if(first && i == 0)\n element.attr(\'style\',\'counter-reset: page 1;\');\n diff --git a/bt5/erp5_run_my_doc/bt/revision b/bt5/erp5_run_my_doc/bt/revision index 7273c0fa8c522b7eed7762a353d46f7768e9b6f2..6f4247a6255c99f420d1df558d68745592862ff7 100644 --- a/bt5/erp5_run_my_doc/bt/revision +++ b/bt5/erp5_run_my_doc/bt/revision @@ -1 +1 @@ -25 +26