Commit e918bbd4 authored by Xavier Hardy's avatar Xavier Hardy

using img tags title attribute rather than description of the Zope Image...

using img tags title attribute rather than description of the Zope Image object for caption in RunMyDoc's Books
parent 125b81ba
...@@ -213,8 +213,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n ...@@ -213,8 +213,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
var n = sections.length;\n var n = sections.length;\n
for(var i = 0; i < n; i++){\n for(var i = 0; i < n; i++){\n
element = changeTag(sections.eq(i), \'div\');\n element = changeTag(sections.eq(i), \'div\');\n
var images = $(\'> img\', element);\n var images = $(\'> img, details > img\', element);\n
var otherImages = $(\'img:not(> img)\', element);\n var otherImages = $(\'img:not(> img, details > img)\', element);\n
var p = images.length;\n var p = images.length;\n
for(var j = 0; j < p; j++){\n for(var j = 0; j < p; j++){\n
var img = images[j];\n var img = images[j];\n
...@@ -222,8 +222,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n ...@@ -222,8 +222,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
var caption = $(\'<p>\').addClass(\'caption\');\n var caption = $(\'<p>\').addClass(\'caption\');\n
$(img).attr(\'src\', link + $(img).attr(\'src\'));\n $(img).attr(\'src\', link + $(img).attr(\'src\'));\n
$(img).before(div);\n $(img).before(div);\n
div.addClass(\'figure\').append(caption).append($(\'<p>\').addClass(\'art\').append($(img).attr(\'width\',\'90%\')));\n var imgToAppend = $(img);\n
caption.load(link + img.src.split(\'?\')[0].split(\'/\').pop() + \'/getDescription\');\n var imgWidth = $(img).attr(\'width\');\n
if( imgWidth == undefined || imgWidth == \'\')\n
imgToAppend.attr(\'width\',\'90%\');\n
div.addClass(\'figure\').append(caption).append($(\'<p>\').addClass(\'art\').append(imgToAppend));\n
caption.text($(img).attr(\'title\'));\n
}\n }\n
var p = otherImages.length;\n var p = otherImages.length;\n
for(var j = 0; j < p; j++){\n for(var j = 0; j < p; j++){\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment