Skip to content

Commit 2949169

Browse files
committedSep 23, 2016
Added attribute selectors
1 parent e993ca8 commit 2949169

File tree

6 files changed

+924
-292
lines changed

6 files changed

+924
-292
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
*.log

‎NOTES.md

+65-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,55 @@
1-
##Where I left off
1+
** QA b4 Launch **
2+
* Check to make sure all levels work
3+
* Check that examples are correct
4+
5+
* QA the reset - it's wiggin out yo
6+
7+
**Possible Level updates?**
8+
9+
* selector: "plate:nth-of-type(2n+3)"
10+
* Make this level use apples instead of plates? Seems too big..
11+
12+
**Next update**
13+
14+
* Email signup better twitter engagement?
15+
* Visual enhancements
16+
17+
18+
**Ideas & Future**
19+
20+
* Tip jar / buy me a beer
21+
* Riddle of the day / week - that would be cool <- gives people a reason for engagement too,
22+
* Return customers so to speak.
23+
* Could be dope
24+
25+
**Final Attrib Rules**
26+
* has attribute
27+
* attribute value = something
28+
* attribute starts with
29+
* attribute ends with
30+
31+
**Maybes & Neat-o Improvements **
32+
33+
* css line 591 - highlight border to match the element color?
34+
* Commented out for now, but shoudl add again?
35+
* I can make them specific to the situation so they always show up nicely
36+
37+
**Attribute types I haven't used**
38+
39+
[attr~=value]
40+
value is a whitespace-separated list of words, one of which is exactly "value".
41+
42+
[attr|=value]
43+
Represents an element with an attribute name of attr. Its value can be exactly “value” or can begin with “value” immediately followed by “-” (U+002D). It can be used for language subcode matches.
44+
45+
[attr~=value]
46+
Represents an element with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly "value".
47+
248

349
**TO-DO**
450

51+
* Pull jquery from CDN?
52+
* Refactor
553
* Figure out CNAME setup for github
654
* Would be cool for it to always show up as cssdiner.com
755
* Figure out next steps to increase reach and use
@@ -24,6 +72,22 @@ What kind of new content could I have?
2472
* Sandbox mode
2573
* New levels
2674

75+
**Attribute selectors**
76+
77+
* has attribute [for]
78+
* has an attribute with exact value
79+
* ``[for=bob]``
80+
* has an attribute that starts with
81+
* ``[for^=bob]``
82+
* has an attribute that contains
83+
* ``[for*=bob]``
84+
* has an attribute that ends with
85+
* ``[for$=bob]``
86+
* has this value in a list of space-separated attributes ``for="bob mary"``
87+
* ``[for~=bob]``
88+
* has this value in a list of dash separated attributes ``for="bob-mary"``
89+
* ``[for~=bob]``
90+
2791

2892
####Figuring out hard levels
2993

‎css/style.css

+239-95
Large diffs are not rendered by default.

‎index.html

+34-16
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
<script src="js/jquery.mCustomScrollbar.min.js"></script>
99

1010
<link rel="icon" type="image/png" href="favicon.png">
11-
<link href='https://fonts.googleapis.com/css?family=Exo+2:200,400,600,400italic,600italic' rel='stylesheet' type='text/css'>
11+
<link href='https://fonts.googleapis.com/css?family=Exo+2:200,400,600,400italic,600italic' rel='stylesheet'>
12+
<link href="https://fonts.googleapis.com/css?family=Satisfy" rel="stylesheet">
1213
<link rel="stylesheet" href="css/jquery.mCustomScrollbar.css" type="text/css" media="screen" title="no title" charset="utf-8">
1314
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
1415

1516
<meta property="og:url" content="http://cssdiner.com" />
16-
<meta property="og:type" content="website" />
17-
<meta property="og:title" content="CSS Diner" />
18-
<meta property="og:description" content="A fun game to help you learn and practice CSS selectors." />
19-
<meta property="og:image" content="https://flukeout.github.io/images/fb-share.jpg" />
17+
<meta property="og:type" content="website" />
18+
<meta property="og:title" content="CSS Diner" />
19+
<meta property="og:description" content="A fun game to help you learn and practice CSS selectors." />
20+
<meta property="og:image" content="https://flukeout.github.io/images/fb-share.jpg" />
2021
</head>
2122

2223
<body>
@@ -51,17 +52,27 @@ <h4>Exhibit 1 - A CSS Rule</h4>
5152
margin-bottom: 12px;
5253
}</pre>
5354

54-
<p>Here, the "p" is the selector (selects all &lt;p&gt; elements) and applies the margin-bottom style.</p>
55-
<p>To play, type in a CSS selector in the editor below to select the correct items on the table.If you get it right, you'll advance to the next level.</p>
56-
<p>Hover over the items on the table to see their HTML markup.</p>
57-
<p>Get help with selectors on the right! &rarr;</p>
55+
<p>
56+
Here, the "p" is the selector (selects all &lt;p&gt; elements) and applies the margin-bottom style.
57+
</p>
58+
<p>
59+
To play, type in a CSS selector in the editor below to select the correct items on the table.If you get it right, you'll advance to the next level.
60+
</p>
61+
<p>
62+
Hover over the items on the table to see their HTML markup.
63+
</p>
64+
<p>
65+
Get help with selectors on the right! &rarr;
66+
</p>
5867
<a class="note-toggle" href="#">Ok, got it!</a>
5968
</div>
6069

6170
<a class="note-toggle" href="#">Help, I'm stuck!</a>
6271

6372
<div class="game-wrapper">
6473
<div class="table-wrapper">
74+
<div class="table-surface"></div>
75+
<div class="nametags"></div>
6576
<div class="table"></div>
6677
</div>
6778
<div class="table-edge">
@@ -94,6 +105,7 @@ <h4>Exhibit 1 - A CSS Rule</h4>
94105
</div>
95106
</div>
96107
</div>
108+
97109
<div class="editor-pane html-view">
98110
<div class="input-header">
99111
<div class="file-name">table.html</div>
@@ -107,20 +119,24 @@ <h4>Exhibit 1 - A CSS Rule</h4>
107119
</div>
108120

109121
<div class="what-is-this">
110-
<p>Made by <a href="http://www.twitter.com/flukeout">@flukeout</a> &mdash; come say hi!</p>
111-
<p>Have feedback? Please file an isssue on <a href="https://github.com/flukeout/css-diner/issues">the Github repo</a>.</p>
122+
<p>
123+
Made by <a href="http://www.twitter.com/flukeout">@flukeout</a> &mdash; come say hi!
124+
</p>
125+
<p>
126+
Have feedback or questions? Please file an isssue on <a href="https://github.com/flukeout/css-diner/issues">the Github repo</a>.
127+
</p>
112128
</div>
113129

114-
<div class="helper"></div><!-- This is the popup that floats over table elements -->
130+
<div class="helper"><!-- This is the popup that floats over table elements --></div>
115131

116132
</div><!-- /left col -->
117133

118134
<div class="right-col">
119135

120136
<div class="help-wrapper">
121137
<div class="level-nav">
122-
<a href="#">&lt;</a>
123-
<a href="#">&gt;</a>
138+
<a class="previous" href="#"></a>
139+
<a class="next" href="#"></a>
124140
</div>
125141
<h1 class="level-header">
126142
<span class="level-text"></span>
@@ -131,17 +147,19 @@ <h1 class="level-header">
131147

132148
<h3 class="selector-name"></h3>
133149
<h2 class="title"></h2>
134-
<h3 class="syntax"></h3>
135150

151+
<h3 class="syntax"></h3>
136152
<div class="hint"></div>
153+
<h4 class="examples-title">Examples</h4>
137154
<div class="examples"></div>
138-
<div class="selector"></div>
155+
139156
</div>
140157
</div>
141158

142159
<div class="level-menu">
143160
<h2>Choose a level</h2>
144161
<div class="levels"></div>
162+
<a class="reset-progress" href="#">Reset Progress</a>
145163
</div>
146164

147165
<div class="level-menu-toggle-wrapper">

‎js/levels.js

+398-79
Large diffs are not rendered by default.

‎js/restaurant.js

+186-100
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
/* This Source Code Form is subject to the terms of the Mozilla Public
2-
* License, v. 2.0. If a copy of the MPL was not distributed with this
3-
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
51
/*
62
Function Reference
73
==================
4+
85
loadLevel() - loads up the level
96
fireRule() - fires the css rule
107
updateProgressUI() - adds a checkmark to the level menu and header when a correct guess is made, removes it if incorrect
11-
..to be continued
8+
hideTooltip() - hides markup tooltip that hovers over the elements
9+
showHelp() - Loads help text & examples for each level
10+
11+
..to be continued!
1212
*/
1313

1414
var level; // Holds current level info
@@ -50,6 +50,7 @@ $(document).ready(function(){
5050
}
5151
});
5252

53+
// Custom scrollbar plugin
5354
$(".left-col, .level-menu").mCustomScrollbar({
5455
scrollInertia: 0,
5556
autoHideScrollbar: true
@@ -68,6 +69,37 @@ $(document).ready(function(){
6869
}
6970
});
7071

72+
$(".level-nav").on("click","a",function(){
73+
74+
var direction;
75+
if($(this).hasClass("next")) {
76+
direction = "next";
77+
}
78+
79+
addAnimation($(this),"link-jiggle");
80+
81+
if(direction == "next") {
82+
currentLevel++;
83+
if(currentLevel >= levels.length) {
84+
currentLevel = levels.length - 1;
85+
}
86+
} else {
87+
currentLevel--;
88+
if(currentLevel < 0) {
89+
currentLevel = 0;
90+
}
91+
}
92+
93+
loadLevel();
94+
return false;
95+
});
96+
97+
// Resets progress and progress indicators
98+
$(".reset-progress").on("click",function(){
99+
resetProgress();
100+
return false;
101+
})
102+
71103
//Handle inputs from the input box on enter
72104
$("input").on("keypress",function(e){
73105
e.stopPropagation();
@@ -106,13 +138,13 @@ $(document).ready(function(){
106138
e.stopPropagation();
107139
});
108140

109-
//Shows the tooltip on the table
141+
// Shows the tooltip on the table
110142
$(".markup").on("mouseout","*",function(e){
111143
e.stopPropagation();
112144
hideTooltip();
113145
});
114146

115-
$(".table").on("mouseout","*",function(e){
147+
$(".table").on("mouseout","*", function(e){
116148
hideTooltip();
117149
e.stopPropagation();
118150
});
@@ -129,9 +161,29 @@ $(document).ready(function(){
129161
loadLevel();
130162
$(".table-wrapper,.table-edge").css("opacity",1);
131163
},50);
132-
133164
});
134165

166+
function addAnimation(el, className){
167+
el.addClass("link-jiggle");
168+
el.one("animationend",function(e){
169+
$(e.target).removeClass("link-jiggle");
170+
})
171+
}
172+
173+
// Reset all progress!
174+
// Should also scroll the menu to the top...
175+
function resetProgress(){
176+
currentLevel = 0;
177+
progress = blankProgress;
178+
localStorage.setItem("progress",JSON.stringify(progress));
179+
180+
$(".completed").removeClass("completed");
181+
loadLevel();
182+
closeMenu(); // what does it do??
183+
$("#mCSB_2_container").css("top",0); // weird scroll reset - because of the
184+
}
185+
186+
135187
//Checks if the level is completed
136188

137189
function checkCompleted(levelNumber){
@@ -181,6 +233,7 @@ function hideTooltip(){
181233
}
182234

183235
function showTooltip(el){
236+
184237
if(finished){
185238
return;
186239
}
@@ -215,6 +268,12 @@ function showTooltip(el){
215268
helpertext = helpertext + ' class="' + elClass + '"';
216269
}
217270

271+
var elFor = el.attr("for");
272+
273+
if(elFor) {
274+
helpertext = helpertext + ' for="' + elFor + '"';
275+
}
276+
218277
var id = el.attr("id");
219278
if(id) {
220279
helpertext = helpertext + ' id="' + id + '"';
@@ -223,7 +282,6 @@ function showTooltip(el){
223282
helpertext = helpertext + '></' + elType + '>';
224283
helper.show();
225284
helper.text(helpertext);
226-
227285
}
228286

229287

@@ -244,18 +302,12 @@ function handleInput(text){
244302
loadLevel();
245303
return;
246304
}
247-
248-
if(text == "help") {
249-
showHelp();
250-
} else {
251-
fireRule(text);
252-
}
305+
fireRule(text);
253306
}
254307

255-
//Shows help
308+
// Loads up the help text & examples for each level
256309
function showHelp() {
257310

258-
$("input").val("");
259311
var helpTitle = level.helpTitle || "";
260312
var help = level.help || "";
261313
var examples = level.examples ||[];
@@ -269,11 +321,14 @@ function showHelp() {
269321
$(".display-help .selector-name").html(selectorName);
270322
$(".display-help .title").html(helpTitle);
271323
$(".display-help .examples").html("");
324+
$(".display-help .examples-title").hide(); // Hide the "Examples" heading
272325

273326
for(var i = 0; i < examples.length; i++){
274327
var example = $("<div class='example'>" + examples[i] + "</div>");
275328
$(".display-help .examples").append(example);
329+
$(".display-help .examples-title").show(); // Show it if there are examples
276330
}
331+
277332
$(".display-help .hint").html(help);
278333
$(".display-help .selector").text(selector);
279334
}
@@ -285,9 +340,12 @@ function resetTable(){
285340
$("input").addClass("input-strobe");
286341
$(".table *").each(function(){
287342
$(this).width($(this).width());
288-
$(this).removeAttr("style");
343+
// $(this).removeAttr("style");
344+
// TODO - needed?? Probably not, everything gets removed anyway
289345
});
290-
$(".table-edge").width($(".table").outerWidth());
346+
347+
var tableWidth = $(".table").outerWidth();
348+
$(".table-wrapper, .table-edge").width(tableWidth);
291349
}
292350

293351
function fireRule(rule) {
@@ -317,17 +375,24 @@ function fireRule(rule) {
317375
* Relatedly, watching that happen made me nearly spill my drink.
318376
*/
319377

320-
var baseTable = $('.table-wrapper > .table');
378+
// var baseTable = $('.table-wrapper > .table, .table-wrapper > .nametags, .table-wrapper > .table-surface');
379+
var baseTable = $('.table');
321380

322-
// var ruleSelected = $(".table-wrapper " + rule).not(baseTable);
323-
// var levelSelected = $(".table-wrapper " + level.selector).not(baseTable);
381+
// Check if jQuery will throw an error trying the mystery rule
382+
// If it errors out, change the rule to null so the wrong-guess animation will work
383+
try {
384+
$(".table").find(rule).not(baseTable);
385+
}
386+
catch(err) {
387+
rule = null;
388+
}
324389

325-
var ruleSelected = $(".table-wrapper").find(rule).not(baseTable);
326-
var levelSelected = $(".table-wrapper").find(level.selector).not(baseTable);
390+
var ruleSelected = $(".table").find(rule).not(baseTable); // What the correct rule finds
391+
var levelSelected = $(".table").find(level.selector).not(baseTable); // What the person finds
327392

328393
var win = false;
329394

330-
//If nothing is selected
395+
// If nothing is selected
331396
if(ruleSelected.length == 0) {
332397
$(".editor").addClass("shake");
333398
}
@@ -339,7 +404,6 @@ function fireRule(rule) {
339404
if(win){
340405
ruleSelected.removeClass("strobe");
341406
ruleSelected.addClass("clean");
342-
// $(".result").text("Good job!");
343407
$("input").val("");
344408
$(".input-wrapper").css("opacity",.2);
345409
updateProgressUI(currentLevel, true);
@@ -374,7 +438,8 @@ function fireRule(rule) {
374438
}
375439
}
376440

377-
441+
// Marks an individual number as completed or incompleted
442+
// Just in the level heading though, not the level list
378443
function updateProgressUI(levelNumber, completed){
379444
if(completed) {
380445
$(".levels a:nth-child("+ (levelNumber+1) + ")").addClass("completed");
@@ -385,7 +450,6 @@ function updateProgressUI(levelNumber, completed){
385450
}
386451

387452
function trackProgress(levelNumber, type){
388-
389453
if(!progress.guessHistory[levelNumber]) {
390454
progress.guessHistory[levelNumber] = {
391455
correct : false,
@@ -433,6 +497,7 @@ function sendEvent(category, action, label){
433497

434498
function winGame(){
435499
$(".table").html('<span class="winner"><strong>You did it!</strong><br>You rock at CSS.</span>');
500+
addNametags();
436501
finished = true;
437502
resetTable();
438503
}
@@ -444,72 +509,90 @@ function checkResults(ruleSelected,levelSelected,rule){
444509
return($(".table").html() == ruleTable.html());
445510
}
446511

512+
// Returns all formatted markup within an element...
513+
514+
function getMarkup(el){
515+
var hasChildren = el.children.length > 0 ? true : false;
516+
var elName = el.tagName.toLowerCase();
517+
var wrapperEl = $("<div/>");
518+
var attributeString = "";
519+
$.each(el.attributes, function() {
520+
if(this.specified) {
521+
attributeString = attributeString + ' ' + this.name + '="' + this.value + '"';
522+
}
523+
});
524+
var attributeSpace = "";
525+
if(attributeString.length > 0){
526+
attributeSpace = " ";
527+
}
528+
if(hasChildren) {
529+
wrapperEl.text("<" + elName + attributeSpace + attributeString + ">");
530+
$(el.children).each(function(i,el){
531+
wrapperEl.append(getMarkup(el));
532+
});
533+
wrapperEl.append("&lt;" + elName + "/&gt;");
534+
} else {
535+
wrapperEl.text("<" + elName + attributeSpace + attributeString + "/>");
536+
}
537+
return wrapperEl;
538+
}
539+
540+
//new board loader...
541+
447542
function loadBoard(){
448-
var boardString = level.board;
449-
boardMarkup = "";
450-
var tableMarkup = "";
451-
var markup = "";
543+
544+
var boardString = level.board; // just a placeholder to iterate over...
545+
boardMarkup = ""; // what is this
546+
var tableMarkup = ""; // what is this
547+
var editorMarkup = ""; // this is a string that represents the HTML
452548
showHelp();
453549

454-
for(var i = 0;i < boardString.length;i++){
455-
var c = boardString.charAt(i);
550+
var markupHolder = $("<div/>")
456551

457-
if(c == "C") {
458-
boardMarkup = boardMarkup + '<carrot/>\n'
459-
markup = markup + "<div>&ltcarrot/&gt</div>";
460-
}
461-
if(c == "A") {
462-
boardMarkup = boardMarkup + '<apple/>\n'
463-
markup = markup + "<div>&ltapple/&gt</div>";
552+
$(level.boardMarkup).each(function(i,el){
553+
if(el.nodeType == 1){
554+
var result = getMarkup(el);
555+
markupHolder.append(result);
464556
}
465-
if(c == "O") {
466-
boardMarkup = boardMarkup + '<orange/>\n'
467-
markup = markup + "<div>&ltorange/&gt</div>";
468-
}
469-
if(c == "P") {
470-
boardMarkup = boardMarkup + '<pickle/>\n'
471-
markup = markup + '<div>&ltpickle/&gt</div>';
472-
}
473-
if(c == "a") {
474-
boardMarkup = boardMarkup + '<apple class="small"/>\n'
475-
markup = markup + '<div>&ltapple class="small"/&gt</div>';
476-
}
477-
if(c == "o") {
478-
boardMarkup = boardMarkup + '<orange class="small"/>\n'
479-
markup = markup + '<div>&ltorange class="small"/&gt</div>';
480-
}
481-
if(c == "p") {
482-
boardMarkup = boardMarkup + '<pickle class="small"/>\n'
483-
markup = markup + '<div>&ltpickle class="small"/&gt</div>';
484-
}
485-
if(c == "{") {
486-
boardMarkup = boardMarkup + '<plate id="fancy">'
487-
markup = markup + '<div>&ltplate id="fancy"&gt';
488-
}
489-
if(c == "(") {
490-
boardMarkup = boardMarkup + '<plate>'
491-
markup = markup + '<div>&ltplate&gt'
492-
}
493-
if(c == ")" || c == "}") {
494-
boardMarkup = boardMarkup + '</plate>\n'
495-
markup = markup + '&lt/plate&gt</div>'
496-
}
497-
if(c == "[") {
498-
boardMarkup = boardMarkup + '<bento>'
499-
markup = markup + '<div>&ltbento&gt'
500-
}
501-
if(c == "]") {
502-
boardMarkup = boardMarkup + '</bento>\n'
503-
markup = markup + '&lt/bento&gt</div>'
557+
});
558+
559+
$(".table").html(level.boardMarkup);
560+
addNametags();
561+
$(".table *").addClass("pop");
562+
563+
564+
$(".markup").html('<div>&ltdiv class="table"&gt' + markupHolder.html() + '&lt/div&gt</div>');
565+
}
566+
567+
// Adds nametags to the items on the table
568+
function addNametags(){
569+
$(".nametags *").remove();
570+
$(".table-wrapper").css("transform","rotateX(0)");
571+
$(".table-wrapper").width($(".table-wrapper").width());
572+
573+
$(".table *").each(function(){
574+
if($(this).attr("for")){
575+
var pos = $(this).position();
576+
var width = $(this).width();
577+
var nameTag = $("<div class='nametag'>" + $(this).attr("for") + "</div>");
578+
$(".nametags").append(nameTag);
579+
var tagPos = pos.left + (width/2) - nameTag.width()/2 + 12;
580+
nameTag.css("left",tagPos);
504581
}
582+
});
505583

506-
}
507-
$(".table").html(boardMarkup);
508-
$(".markup").html('<div>&ltdiv class="table"&gt' + markup + '&lt/div&gt</div>');
584+
$(".table-wrapper").css("transform","rotateX(20deg)");
509585
}
510586

511-
//Loads up a level
587+
512588
function loadLevel(){
589+
// Make sure we dont' load something out of range
590+
if(currentLevel < 0 || currentLevel > levels.length - 1) {
591+
currentLevel = 0;
592+
}
593+
594+
hideTooltip();
595+
513596
level = levels[currentLevel];
514597

515598
// Show the help link only for the first three levels
@@ -537,31 +620,34 @@ function loadLevel(){
537620
$(".order").text(level.doThis);
538621
$("input").val("").focus();
539622

540-
541623
$(".input-wrapper").css("opacity",1);
542624
$(".result").text("");
543625

544626
//Strobe what's supposed to be selected
545-
$(".table " + level.selector).addClass("strobe");
546-
}
627+
setTimeout(function(){
628+
$(".table " + level.selector).addClass("strobe");
629+
$(".pop").removeClass("pop");
630+
},200);
547631

632+
}
548633

634+
// Popup positioning code from...
549635
// http://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen
550636

551637
function PopupCenter(url, title, w, h) {
552-
// Fixes dual-screen position Most browsers Firefox
553-
var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
554-
var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
638+
// Fixes dual-screen position Most browsers Firefox
639+
var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
640+
var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
555641

556-
var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
557-
var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
642+
var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
643+
var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
558644

559-
var left = ((width / 2) - (w / 2)) + dualScreenLeft;
560-
var top = ((height / 2) - (h / 2)) + dualScreenTop;
561-
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
645+
var left = ((width / 2) - (w / 2)) + dualScreenLeft;
646+
var top = ((height / 2) - (h / 2)) + dualScreenTop;
647+
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
562648

563-
// Puts focus on the newWindow
564-
if (window.focus) {
565-
newWindow.focus();
566-
}
567-
}
649+
// Puts focus on the newWindow
650+
if (window.focus) {
651+
newWindow.focus();
652+
}
653+
}

0 commit comments

Comments
 (0)
Please sign in to comment.