Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move css and javascript to separate files

  • Loading branch information...
commit 8e6f247e73f3d81abd8d58ba1712bd1f83080136 1 parent 86920cf
@MarkLodato authored
View
52 index-en.html
@@ -3,56 +3,8 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>A Visual Git Reference</title>
- <style type='text/css'>
- .center {text-align: center;}
- #link-to-png, #link-to-svg {font-style: italic; display: none;}
- ol ol {list-style-type: lower-alpha;}
- </style>
-
- <script type="text/javascript">//<!--
- // Webkit browsers can't zoom properly with object tags.
- if (navigator.userAgent.indexOf("AppleWebKit") > -1) {
- replacePNG = function(img, src) {
- var h = img.height, w = img.width;
- img.src = src;
- img.height = h;
- img.width = w;
- return 0;
- }
- } else {
- replacePNG = function(img, src) {
- var p = img.parentNode;
- var obj = document.createElement('object');
- obj.type = 'image/svg+xml';
- obj.data = src;
- obj.width = img.width;
- obj.height = img.height;
- p.appendChild(obj);
- p.removeChild(img);
- return -1;
- }
- }
- var svg_disabled = window.location.search.indexOf("no-svg") > 0;
- // Replace all the PNGs with SVGs on browsers that support them.
- function replace_all_PNGs() {
- var hasSVG = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1");
- if (hasSVG) {
- if (svg_disabled) {
- document.getElementById('link-to-svg').style.display = 'block';
- return;
- }
- var images = document.getElementsByTagName('img');
- for (var i = 0; i < images.length; i++) {
- var img = images[i];
- var src = img.src.match(/^(.*\.svg)\.png$/)
- if (src)
- i += replacePNG(img, src[1]);
- }
- document.getElementById('link-to-png').style.display = 'block';
- }
- }
- //--></script>
-
+ <link rel='stylesheet' type='text/css' href='visual-git-guide.css'>
+ <script type="text/javascript" src='visual-git-guide.js'></script>
</head>
<body onload="replace_all_PNGs();">
<h1 id="top">A Visual Git Reference</h1>
View
52 index-ja.html
@@ -3,56 +3,8 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>図解 Git</title>
- <style type='text/css'>
- .center {text-align: center;}
- #link-to-png, #link-to-svg {font-style: italic; display: none;}
- ol ol {list-style-type: lower-alpha;}
- </style>
-
- <script type="text/javascript">//<!--
- // Webkit browsers can't zoom properly with object tags.
- if (navigator.userAgent.indexOf("AppleWebKit") > -1) {
- replacePNG = function(img, src) {
- var h = img.height, w = img.width;
- img.src = src;
- img.height = h;
- img.width = w;
- return 0;
- }
- } else {
- replacePNG = function(img, src) {
- var p = img.parentNode;
- var obj = document.createElement('object');
- obj.type = 'image/svg+xml';
- obj.data = src;
- obj.width = img.width;
- obj.height = img.height;
- p.appendChild(obj);
- p.removeChild(img);
- return -1;
- }
- }
- var svg_disabled = window.location.search.indexOf("no-svg") > 0;
- // Replace all the PNGs with SVGs on browsers that support them.
- function replace_all_PNGs() {
- var hasSVG = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1");
- if (hasSVG) {
- if (svg_disabled) {
- document.getElementById('link-to-svg').style.display = 'block';
- return;
- }
- var images = document.getElementsByTagName('img');
- for (var i = 0; i < images.length; i++) {
- var img = images[i];
- var src = img.src.match(/^(.*\.svg)\.png$/)
- if (src)
- i += replacePNG(img, src[1]);
- }
- document.getElementById('link-to-png').style.display = 'block';
- }
- }
- //--></script>
-
+ <link rel='stylesheet' type='text/css' href='visual-git-guide.css'>
+ <script type="text/javascript" src='visual-git-guide.js'></script>
</head>
<body onload="replace_all_PNGs();">
<h1 id="top">図解 Git</h1>
View
9 visual-git-guide.css
@@ -0,0 +1,9 @@
+.center {
+ text-align: center;
+}
+#link-to-png, #link-to-svg {
+ font-style: italic; display: none;
+}
+ol ol {
+ list-style-type: lower-alpha;
+}
View
41 visual-git-guide.js
@@ -0,0 +1,41 @@
+// Webkit browsers can't zoom properly with object tags.
+if (navigator.userAgent.indexOf("AppleWebKit") > -1) {
+ replacePNG = function(img, src) {
+ var h = img.height, w = img.width;
+ img.src = src;
+ img.height = h;
+ img.width = w;
+ return 0;
+ }
+} else {
+ replacePNG = function(img, src) {
+ var p = img.parentNode;
+ var obj = document.createElement('object');
+ obj.type = 'image/svg+xml';
+ obj.data = src;
+ obj.width = img.width;
+ obj.height = img.height;
+ p.appendChild(obj);
+ p.removeChild(img);
+ return -1;
+ }
+}
+var svg_disabled = window.location.search.indexOf("no-svg") > 0;
+// Replace all the PNGs with SVGs on browsers that support them.
+function replace_all_PNGs() {
+ var hasSVG = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1");
+ if (hasSVG) {
+ if (svg_disabled) {
+ document.getElementById('link-to-svg').style.display = 'block';
+ return;
+ }
+ var images = document.getElementsByTagName('img');
+ for (var i = 0; i < images.length; i++) {
+ var img = images[i];
+ var src = img.src.match(/^(.*\.svg)\.png$/)
+ if (src)
+ i += replacePNG(img, src[1]);
+ }
+ document.getElementById('link-to-png').style.display = 'block';
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.