-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·221 lines (191 loc) · 7.72 KB
/
Copy pathindex.html
File metadata and controls
executable file
·221 lines (191 loc) · 7.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ad Builders v4</title>
<style>
* { font: .95em sans-serif; margin: 0; padding: 0;}
a { color: #fff; text-decoration: none; }
#prepopData { clear: both; margin: 5px 0; }
table {
height: 100%;
border: 0;
border-collapse: collapse;
}
td {
padding: 10px 5px;
text-align: center;
border: 1px solid #fff;
border-top: 0px solid #fff;
background: #225588; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(#225588, #003366); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(#225588, #003366); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#225588, #003366); /* For Firefox 3.6 to 15 */
background: linear-gradient(#225588, #003366); /* Standard syntax (must be last) */
}
.tabOn {
background: #aaa; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(#aaa, #fefefe); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(#aaa, #fefefe); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#aaa, #fefefe); /* For Firefox 3.6 to 15 */
background: linear-gradient(#aaa, #fefefe); /* Standard syntax (must be last) */
}
.tabOn a {
color: #262626;
font-weight: bold;
}
#builders {
width: 100%;
height: 650px;
border: 0;
}
h1 {
font-size: 2.5em;
margin-top: 25px;
margin-bottom: 20px;
line-height: 0px;
}
#caravanPaths {
position: fixed;
bottom: 0px;
width: 100%;
cursor: pointer;
}
#caravanConverter {
height: 500px;
border: 1px solid #000;
background: #fff;
display: none;
}
#caravanHeader {
text-align: center;
width: 200px;
color: #fff;
background: #258;
border: 1px solid #000;
border-bottom: 0;
position: fixed;
bottom: 0;
}
#caravanFrame {
height: 500px;
width: 100%;
border: 0;
box-shadow: 0 -5px 50px #000;
}
#leftPanel {
float: left;
width: 6%;
}
#rightPanel {
float: right;
width: 93%;
}
</style>
<script src="./bin/jquery.js"></script>
<script>
function updateHeader(i) {
$( "td" ).removeClass( "tabOn" );
$( '#tab' + i ).addClass( "tabOn" );
$( "#header" ).html(pageURLs[i].name);
}
function UrlExist(url){
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
console.log(url + " :: " + http.status + " {OK}");
return http.status;
}
function buildLinks(bool){
var output = "<table cellpadding=0 border>";
var testLinks = "";
if (bool)
testLinks = "?test=true";
var pageLinks = "";
var iframeSrc = document.getElementById("builders").contentWindow.location.href;
iframeSrcArr = iframeSrc.split("?test");
iframeSrc = iframeSrcArr[0];
console.log (iframeSrc);
for (i=0; i<pageURLs.length; i++){
var pageName = iframeSrc.split("/");
console.log(pageName[pageName.length-2]);
if (pageName[pageName.length-2] == pageURLs[i].url)
var activeTab = true;
else
var activeTab = false;
pageLinks = linkBase + pageURLs[i].url + "/index.html";
output += '<tr><td id="tab' + [i] + '" ' + (activeTab ? "class='tabOn'" : "") + ' style="width: ' + 100/pageURLs.length + '%;"><a href="' + pageLinks + testLinks + '" target="builders" onclick="javascript:updateHeader(\'' + i + '\')">' + pageURLs[i].name + '</a></td></tr>';
}
output += "</tr></table>";
$("#links").html(output);
// refresh iframe content when pre-populated checkbox toggled
document.getElementById("builders").contentWindow.location.href = iframeSrc + testLinks;
}
$(function() {
$("#caravanHeader").click(function(){
console.log( $("#caravanHeader").html() == "Convert Caravan FTP paths ▲" );
if ($("#caravanHeader").html() == "Convert Caravan FTP paths ▲"){
$("#caravanHeader").html("Convert Caravan FTP paths ▼");
$("#caravanConverter").slideToggle();
$("#caravanHeader").animate({bottom: "+=502"});
} else {
$("#caravanHeader").html("Convert Caravan FTP paths ▲");
$("#caravanConverter").slideToggle();
$("#caravanHeader").animate({bottom: "-=502"});
}
})
});
$(function(){
$("#testLinks").click(function(){
if ($("#testLinks").prop("checked"))
buildLinks(true);
else
buildLinks(false);
});
});
var linkBase = "http://adops.autotrader.int/Web/newProductBuilders/";
//linkBase = "file:///Volumes/Toshiba%20500GB%20HDD/Users/Jeff/Google%20Drive/Work/2016/development/newProductBuilders/";
// check remote source
try { UrlExist(linkBase); }
// fail back to local source
catch(e) { console.log( linkBase + " :: 404 {Resource not available}" ); linkBase = "./"; }
var pageURLs = [
{name: "Homepage Hero Image", url: "HomepageHeroImage"},
{name: "Homepage Make/Model Search Links", url: "HomepageMakeModelSearchLinks"},
{name: "Segment Selector", url: "SegmentSelector"},
{name: "Mobile Make Search Link <br><span style='font-size: 10px;'>(Mobile Flyout)</span>", url: "MobileMakeSearchLink"},
{name: "Mobile Model Search Link<br><span style='font-size: 10px;'>(Mobile Flyout)</span>", url: "MobileModelSearchLink"},
{name: "Mobile Segment Selector", url: "MobileSegmentSelector"},
{name: "Homepage Compare (250x390)", url: "HomepageCompare"},
{name: "Homepage Certified (250x391)", url: "HomepageCertified"},
{name: "Video Inline Promo", url: "../VideoInlinePromo"},
{name: "Make/Style Header", url: "ComingSoon"}
];
$(function (){
buildLinks(false);
});
</script>
</head>
<body>
<div id="leftPanel">
<div id="links"></div>
<div>
<form id="prepopData">
<input type="checkbox" id="testLinks"> Preload forms with sample content
</form>
</div>
</div>
<div id="rightPanel">
<div id="frameContent">
<div><h1 id="header"></h1></div>
<iframe id="builders" name="builders" src=""></iframe>
</div>
<div id="caravanPaths">
<div id="caravanConverter">
<iframe id="caravanFrame" src="./caravanPaths/index.html"></iframe>
</div>
<div id="caravanHeader">Convert Caravan FTP paths ▲</div>
</div>
</div>
</body>
</html>