1 |
schoenebeck |
2737 |
/* |
2 |
|
|
CrudeDoc Java Script (for previewing an article on a local machine) |
3 |
|
|
Copyright (c) 2015 Christian Schoenebeck. All rights reserved. |
4 |
|
|
http://www.crudebyte.com |
5 |
|
|
*/ |
6 |
|
|
|
7 |
|
|
function crdLoadScript(url) { |
8 |
|
|
var head = document.getElementsByTagName("head")[0]; |
9 |
|
|
var script = document.createElement("script"); |
10 |
|
|
script.type = "text/javascript"; |
11 |
|
|
script.src = url; |
12 |
|
|
head.appendChild(script); |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
function crdDetectFeatures() { |
16 |
|
|
if ($.support["transform"]) { |
17 |
|
|
$("body").addClass("hasTransform"); |
18 |
|
|
} |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
$(function() { |
22 |
|
|
crdLoadScript("jquery-1.11.2.js"); |
23 |
|
|
crdLoadScript("jquery-ui.js"); |
24 |
|
|
crdLoadScript("jquery.transform2d.js"); |
25 |
|
|
|
26 |
|
|
crdDetectFeatures(); |
27 |
|
|
$(document).tooltip(); |
28 |
|
|
$("img[caption]").each(function() { |
29 |
|
|
$(this).after( |
30 |
|
|
"<div class='imgcptn'>" + |
31 |
|
|
$(this).attr("caption") + "</div>" |
32 |
|
|
); |
33 |
|
|
}); |
34 |
|
|
}); |