-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
372 lines (303 loc) · 13.7 KB
/
Copy pathindex.html
File metadata and controls
372 lines (303 loc) · 13.7 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<title>Google SERP Snippet Optimization Tool</title>
<meta name="description" content="This tool replicates the appearance of a snippet in Google SERPs, which allows SEOs to optimize a page title and description for maximum click-through rate." />
<!-- Inline styles from Google SERPs -->
<link type="text/css" rel="stylesheet" href="css/google.css" />
<!-- Kendo UI Web styles -- http://www.kendoui.com/ -->
<link type="text/css" rel="stylesheet" href="lib/kendoui/styles/kendo.common.min.css" />
<link type="text/css" rel="stylesheet" href="lib/kendoui/styles/kendo.blueopal.min.css" />
<!-- Mofo styles -->
<link type="text/css" rel="stylesheet" href="css/snip.css" />
<!-- Kendo UI Web scripts -- http://www.kendoui.com/ -->
<script type="text/javascript" src="lib/kendoui/js/jquery.min.js"></script>
<script type="text/javascript" src="lib/kendoui/js/kendo.web.min.js"></script>
<!-- KnockOut.js -- http://knockoutjs.com/ -->
<script type="text/javascript" src="lib/knockout/knockout-2.1.0.js"></script>
</head>
<body>
<div id="mofo_splitter">
<div id="mofo_header">
<div class="mofo_page">
<div id="mofo_intro">
<h1>SERP Optimizer</h1>
</div>
<div id="mofo_main_form">
</div>
</div>
</div>
<div id="mofo_body">
<!-- BEGIN GOOGLE CONTENT -->
<div id="gsr" class="vsh"> <!-- Originally the body tag in SERP -->
<div id="pocs"></div>
<div id="mngb"></div>
<div id="main">
<div>
<div id="cnt" class="big">
<div class="mw">
<div id="sfcnt"></div>
<div id="srchdsc"></div>
<div id="sdb"></div>
<div id="subform_ctrl"></div>
</div>
<div id="appbar"></div>
<div class="mw" id="ucs"></div>
<div class="mw">
<div id="arcntc"></div>
<div id="rcnt">
<div id="leftnavc"></div>
<div id="center_col">
<div id="bst"></div>
<span id="taw">
<div class="med"></div>
<div class="c" id="tads"></div>
</span>
<div class="med" id="res" role="main">
<div id="topstuff"></div>
<div id="search">
<h2 class="hd">Search Results</h2>
<div id="ires">
<ol id="rso" data-bind="foreach: listings">
<li class="g">
<!-- showEdit -->
<div data-bind="visible: showingEdit" class="mofo_show_edit">
<span class="mofo_icon mofo_icon_left_arrow"></span>
<div class="mofo_click_to_edit">
<span class="mofo_icon mofo_icon_edit"></span>
Click to edit
</div>
</div>
<!-- BEGIN Form -->
<div data-bind="slideVisible: showingListingForm, slideDuration:600" class="mofo_listing_form">
<div class="mofo_form_header k-header">
<div class="mofo_form_header_title">
<span class="mofo_window_title">EDIT SERP LISTING</span>
</div>
<div class="mofo_close_button">
<div class="k-window-actions">
<a href="#" data-bind="click: toggleListingForm" class="k-window-action k-link"><span class="k-icon k-close">Close</span></a>
</div>
</div>
</div>
<div class="mofo_form_body">
<!-- Title input -->
<div class="mofo_title_container">
<div class="mofo_col1">
<textarea data-bind="value: titleIn, valueUpdate: 'afterkeydown'" rows="2" cols="70" class="mofo_title_blurred" onfocus="this.setAttribute('class','mofo_title_focused')" onblur="this.setAttribute('class','mofo_title_blurred')">This is an Example of a Title Tag that is Seventy Characters in Length</textarea>
</div>
<div class="mofo_col2">
<div data-bind="text: titleCount" id="mofo_title_count"></div>
</div>
<div style="clear:both"></div>
</div>
<!-- URL input -->
<div class="mofo_url_container">
<div class="mofo_col1">
<textarea data-bind="value: urlIn, valueUpdate: 'afterkeydown'" rows="1" cols="70" class="mofo_url_blurred" onfocus="this.setAttribute('class','mofo_url_focused')" onblur="this.setAttribute('class','mofo_url_blurred')">www.seomofo.com/snippet-optimizer.html</textarea>
</div>
<div class="mofo_col2">
<!--<div data-bind="html: titleCount" id="mofo_title_count"></div>-->
</div>
<div style="clear:both"></div>
</div>
<!-- Description input -->
<div class="mofo_description_container">
<div class="mofo_col1">
<textarea data-bind="value: descriptionIn, valueUpdate: 'afterkeydown'" rows="3" cols="70" class="mofo_description_blurred" onfocus="this.setAttribute('class','mofo_description_focused')" onblur="this.setAttribute('class','mofo_description_blurred')">Here is an example of what a snippet looks like in Google's SERPs. The content that appears here is usually taken from the Meta Description tag if relevant.</textarea>
</div>
<div class="mofo_col2">
<div data-bind="text: snippetCount" id="mofo_snippet_count"></div>
</div>
<div style="clear:both"></div>
</div>
<!-- Date input -->
<div class="mofo_date_container">
<input data-bind="value: dateIn, valueUpdate: 'afterkeydown'" class="mofo_date_picker" />
</div>
<!-- Add listing / delete listing -->
<div class="mofo_buttons_container">
<div class="mofo_add_listing">
<button data-bind="click: $root.addListing" class="k-button"><span class="mofo_button_icon mofo_icon_plus"></span>Add a Listing</button>
</div>
<div class="mofo_delete_listing">
<button data-bind="click: $root.deleteListing" class="k-button"><span class="mofo_button_icon mofo_icon_minus"></span>Delete this Listing</button>
</div>
<div style="clear:both"></div>
</div>
<div class="mofo_arrow mofo_icon mofo_icon_down_arrow"></div>
</div>
</div>
<!-- END Form -->
<!-- BEGIN Listing -->
<div class="vsc" data-bind="event: {mouseover: showEdit, mouseout: hideEdit}, click: toggleListingForm">
<h3 class="r"><a href="javascript:return false;" class="l"><span data-bind="text: titleIn">This is an Example of a Title Tag that is Seventy Characters in Length</span></a></h3>
<div class="vspib" aria-label="Result details" role="button" tabindex="0">
<div class="vspii">
<div class="vspiic"></div>
</div>
</div>
<div class="s">
<div class="f kv">
<cite><span data-bind="text: urlIn">www.seomofo.com/snippet-optimizer.html</span></cite>
<span class="vshid"><a href="#">Cached</a> - <a href="#">Similar</a></span>
</div>
<span class="st"><span data-bind="html: dateComputed" class="f"></span><span data-bind="text: descriptionIn">Here is an example of what a snippet looks like in Google's SERPs. The content that appears here is usually taken from the Meta Description tag if relevant.</span></span>
</div>
</div>
<!-- END Listing -->
</li>
</ol>
</div>
</div>
</div>
<div id="bottomads"></div>
<div class="med" id="extrares"></div>
</div>
<div id="rhscol"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END GOOGLE CONTENT -->
</div>
<div id="mofo_footer">
</div>
</div>
<script type="text/javascript">
//<![CDATA[
// Initialize KendoUI widgets
$(document).ready(function() {
$('#mofo_splitter').kendoSplitter({
panes: [
{ // Header
collapsible: true,
resizable: true,
size: '120px'
},
{ // Body (Google SERP content)
collapsible: false,
resizable: true,
},
{ // Footer
collapsible: true,
resizable: true,
size: '160px'
}
],
orientation: 'vertical'
});
$('.mofo_date_picker').kendoDatePicker({
value: '',
format: 'MMM d, yyyy'
});
});
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
// Custom binding for animated visibility transitions
// http://knockoutjs.com/documentation/custom-bindings.html
ko.bindingHandlers.slideVisible = {
update: function(element, valueAccessor, allBindingsAccessor) {
// First get the latest data that we're bound to
var value = valueAccessor(), allBindings = allBindingsAccessor();
// Next, whether or not the supplied model property is observable, get its current value
var valueUnwrapped = ko.utils.unwrapObservable(value);
// Grab some more data from another binding property
var duration = allBindings.slideDuration || 400; // 400ms is default duration unless otherwise specified
// Now manipulate the DOM element
if (valueUnwrapped == true)
$(element).slideDown(duration); // Make the element visible
else
$(element).slideUp(duration); // Make the element invisible
}
};
function SerpListing() {
var self = this;
// Title
self.titleIn = ko.observable("This is an Example of a Title Tag that is Seventy Characters in Length");
self.titleCount = ko.computed(function() {
return self.titleIn().replace(/^\s+|\s+$/g,'').length;
}, this);
// URL
self.urlIn = ko.observable("www.seomofo.com/snippet-optimizer.html");
// Date
self.dateIn = ko.observable('');
self.dateComputed = ko.computed(function() {
if (this.dateIn().replace(/\s/g,'') != '') {
return this.dateIn() + ' – ';
}
else {
return '';
}
}, this);
// Description
self.descriptionIn = ko.observable("Here is an example of what a snippet looks like in Google's SERPs. The content that appears here is usually taken from the Meta Description tag if relevant.");
// Snippet
self.snippet = ko.computed(function() {
return self.dateComputed() + self.descriptionIn();
}, this);
self.snippetVisible = ko.computed(function() {
if (self.snippet().length <= 156) {
return self.snippet();
}
else {
var snippetSpace = self.snippet().lastIndexOf(" ", (self.snippet().length - 3));
return self.snippet().substring(0,snippetSpace).concat(' ...'.bold());
}
}, this);
self.snippetCount = ko.computed(function() {
return self.snippet().length;
}, this);
// ListingForm visibility
self.showingListingForm = ko.observable(true);
self.toggleListingForm = function() {
if (self.showingListingForm()) {
self.showingListingForm(false);
}
else {
self.showingListingForm(true);
self.showingEdit(false);
}
};
// showEdit visibility
self.showingEdit = ko.observable(false);
self.showEdit = function() {
if (self.showingListingForm() == false) {
self.showingEdit(true);
}
};
self.hideEdit = function() {
if (self.showingListingForm() == false) {
self.showingEdit(false);
}
};
}
// Overall viewmodel for this screen, along with initial state
function SerpViewModel() {
var self = this;
self.listings = ko.observableArray([
new SerpListing()
]);
self.addListing = function() {
self.listings.push(new SerpListing());
// KendoUI datePicker widget has to be reinitialized for each new instance
$('.mofo_date_picker').last().kendoDatePicker({
value: '',
format: 'MMM d, yyyy'
});
};
self.deleteListing = function(listing) {
$(listing).slideUp('slow');
self.listings.remove(listing);
};
}
ko.applyBindings(new SerpViewModel());
//]]>
</script>
</body>
</html>