j1-template 2021.1.4 → 2021.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +7 -15
  3. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +9 -5
  4. data/_includes/themes/j1/modules/navigator/generator.html +2 -2
  5. data/_layouts/default.html +4 -7
  6. data/assets/data/cookieconsent.html +249 -0
  7. data/assets/data/quicklinks.html +18 -16
  8. data/assets/themes/j1/adapter/js/{cookiebar.js → cookieConsent.js} +102 -54
  9. data/assets/themes/j1/adapter/js/j1.js +40 -15
  10. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +2 -2
  11. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
  12. data/assets/themes/j1/core/js/template.js +3 -9
  13. data/assets/themes/j1/core/js/template.js.map +1 -1
  14. data/assets/themes/j1/core/js/template.min.js +3 -9
  15. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  16. data/assets/themes/j1/modules/cookieConsent/LICENSE +21 -0
  17. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +286 -0
  18. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +28 -0
  19. data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +4 -2
  20. data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +4 -3
  21. data/assets/themes/j1/modules/iframeResizer/examples/frame.hover.html +4 -2
  22. data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +4 -2
  23. data/assets/themes/j1/modules/iframeResizer/examples/frame.textarea.html +4 -2
  24. data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +4 -2
  25. data/assets/themes/j1/modules/iframeResizer/examples/index.html +2 -0
  26. data/assets/themes/j1/modules/iframeResizer/examples/two.html +4 -2
  27. data/assets/themes/j1/modules/util/js/domready.js +146 -0
  28. data/assets/themes/j1/modules/util/js/gtag-opt-in.js +1 -0
  29. data/lib/j1/version.rb +3 -3
  30. data/lib/starter_web/Gemfile +1 -1
  31. data/lib/starter_web/_config.yml +2 -1
  32. data/lib/starter_web/_data/_defaults/resources.yml +11 -8
  33. data/lib/starter_web/_data/modules/{cookiebar.yml → cookieconsent.yml} +4 -4
  34. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +135 -0
  35. data/lib/starter_web/_data/pages/builder.yml +7 -7
  36. data/lib/starter_web/_data/private.yml +6 -6
  37. data/lib/starter_web/_data/resources.yml +9 -7
  38. data/lib/starter_web/_includes/attributes.asciidoc +10 -1
  39. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  40. data/lib/starter_web/assets/images/modules/attics/{cookies-1920x1200-bw.jpg → cookies-1920x1200.jpg} +0 -0
  41. data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
  42. data/lib/starter_web/collections/posts/public/featured/_posts/2020-01-01-about-cookies.adoc +2 -2
  43. data/lib/starter_web/package.json +1 -1
  44. data/lib/starter_web/pages/public/cookieConsent.adoc +93 -0
  45. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +2 -1
  46. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +104 -209
  47. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  48. data/lib/starter_web/utilsrv/package.json +1 -1
  49. metadata +14 -13
  50. data/_includes/themes/j1/modules/navigator/generator.org.html +0 -232
  51. data/assets/data/cookiebar.html +0 -288
  52. data/assets/data/footer.new.1.html +0 -256
  53. data/assets/data/footer.new.2.html +0 -256
  54. data/assets/data/footer.org.html +0 -249
  55. data/assets/themes/j1/adapter/js/j1.new.js +0 -1878
  56. data/assets/themes/j1/adapter/js/j1.org.js +0 -1874
  57. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +0 -133
@@ -0,0 +1,286 @@
1
+ /*
2
+ # -----------------------------------------------------------------------------
3
+ # ~/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js
4
+ # Provides JS Core for J1 Module BS Cookie Consent
5
+ #
6
+ # Product/Info:
7
+ # https://shaack.com
8
+ # http://jekyll.one
9
+ #
10
+ # Copyright (C) 2020 Stefan Haack
11
+ # Copyright (C) 2021 Juergen Adams
12
+ #
13
+ # bootstrap-cookie-banner is licensed under MIT License.
14
+ # See: https://github.com/shaack/bootstrap-cookie-banner/blob/master/LICENSE
15
+ # J1 Template is licensed under MIT License.
16
+ # See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
17
+ # -----------------------------------------------------------------------------
18
+ # TODO:
19
+ #
20
+ # -----------------------------------------------------------------------------
21
+ # NOTE:
22
+ # BS Cookie Consent is an MODIFIED version of bootstrap-cookie-banner
23
+ # for the use with J1 Template. This modiefied version cannot be used
24
+ # outside of J1 Template!
25
+ # -----------------------------------------------------------------------------
26
+ */
27
+ 'use strict';
28
+
29
+ // -----------------------------------------------------------------------------
30
+ // ESLint shimming
31
+ // -----------------------------------------------------------------------------
32
+ /* eslint indent: "off" */
33
+ /* eslint no-unused-vars: "off" */
34
+ /* eslint no-undef: "off" */
35
+ /* eslint no-redeclare: "off" */
36
+ /* eslint indent: "off" */
37
+ /* eslint JSUnfilteredForInLoop: "off" */
38
+ // -----------------------------------------------------------------------------
39
+
40
+ function BootstrapCookieConsent(props) {
41
+ var logText;
42
+ var current_page;
43
+ var whitelisted;
44
+ var logger = log4javascript.getLogger('j1.core.bsCookieConsent');
45
+ var modalId = "bccs-modal"
46
+ var self = this
47
+ var detailedSettingsShown = false
48
+
49
+ this.props = {
50
+ autoShowDialog: true, // disable autoShowModal on the privacy policy and legal notice pages, to make these pages readable
51
+ language: navigator.language, // the language, in which the modal is shown
52
+ languages: ["en", "de"], // supported languages (in ./content/), defaults to first in array
53
+ contentURL: "./content", // this URL must contain the dialogs content in the needed languages
54
+ cookieName: "cookie-consent-settings", // the name of the cookie in which the configuration is stored as JSON
55
+ cookieStorageDays: 365, // the duration the cookie configuration is stored on the client
56
+ postSelectionCallback: undefined, // callback function, called after the user has made his selection
57
+ whitelisted: [], // pages NO consent modal page is issued
58
+ xhr_data_element: "" // container for the language-specific consent modal taken from /assets/data/cookieconsent.html
59
+ }
60
+
61
+ for (var property in props) {
62
+ this.props[property] = props[property];
63
+ }
64
+
65
+ this.language = this.props.language
66
+ if (this.language.indexOf("-") !== -1) {
67
+ this.language = this.language.split("-")[0];
68
+ }
69
+
70
+ if (!this.props.languages.includes(this.language)) {
71
+ this.language = this.props.languages[0]; // fallback on default language
72
+ }
73
+
74
+ var Cookie = {
75
+ set: function (name, value, days) {
76
+ var value_encoded = window.btoa(value);
77
+ var expires = "";
78
+ if (days) {
79
+ var date = new Date();
80
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
81
+ expires = "; expires=" + date.toUTCString();
82
+ }
83
+ document.cookie = name + "=" + (value_encoded || "") + expires + "; Path=/; SameSite=Strict;";
84
+ },
85
+ get: function (name) {
86
+ var nameEQ = name + "=";
87
+ var ca = document.cookie.split(';');
88
+ for (var i = 0; i < ca.length; i++) {
89
+ var c = ca[i];
90
+ while (c.charAt(0) === ' ') {
91
+ c = c.substring(1, c.length);
92
+ }
93
+ if (c.indexOf(nameEQ) === 0) {
94
+ var value_encoded = c.substring(nameEQ.length, c.length);
95
+ var value = window.atob(value_encoded);
96
+ return value;
97
+ }
98
+ }
99
+ return undefined
100
+ }
101
+ }
102
+
103
+ var Events = {
104
+ documentReady: function (onDocumentReady) {
105
+ if (document.readyState !== 'loading') {
106
+ onDocumentReady();
107
+ } else {
108
+ document.addEventListener('DOMContentLoaded', onDocumentReady);
109
+ }
110
+ }
111
+ }
112
+
113
+ function showDialog(options) {
114
+ Events.documentReady(function () {
115
+ self.modal = document.getElementById(modalId);
116
+
117
+ if (!self.modal) {
118
+ self.modal = document.createElement("div");
119
+ self.modal.id = modalId;
120
+ self.modal.setAttribute("class", "modal fade");
121
+ self.modal.setAttribute("tabindex", "-1");
122
+ self.modal.setAttribute("role", "dialog");
123
+ self.modal.setAttribute("aria-labelledby", modalId);
124
+ document.body.append(self.modal);
125
+ self.$modal = $(self.modal);
126
+
127
+ if (self.props.postSelectionCallback) {
128
+ self.$modal.on("hidden.bs.modal", function () {
129
+ self.props.postSelectionCallback();
130
+ });
131
+ }
132
+
133
+ // load modal content
134
+ //
135
+ var templateUrl = self.props.contentURL + '/' + 'index.html';
136
+ $.get(templateUrl)
137
+ .done(function (data) {
138
+ self.modal.innerHTML = data;
139
+ self.modal.innerHTML = $('#' + self.props.xhr_data_element).eq(0).html();
140
+
141
+ $(self.modal).modal({
142
+ backdrop: "static",
143
+ keyboard: false
144
+ });
145
+
146
+ self.$buttonDoNotAgree = $("#bccs-buttonDoNotAgree");
147
+ self.$buttonAgree = $("#bccs-buttonAgree");
148
+ self.$buttonSave = $("#bccs-buttonSave");
149
+ self.$buttonAgreeAll = $("#bccs-buttonAgreeAll");
150
+
151
+ updateButtons();
152
+ updateOptionsFromCookie();
153
+
154
+ $("#bccs-options").on("hide.bs.collapse", function () {
155
+ detailedSettingsShown = false;
156
+ updateButtons();
157
+ }).on("show.bs.collapse", function () {
158
+ detailedSettingsShown = true;
159
+ updateButtons();
160
+ });
161
+ self.$buttonDoNotAgree.click(function () {
162
+ doNotAgree();
163
+ });
164
+ self.$buttonAgree.click(function () {
165
+ agreeAll();
166
+ });
167
+ self.$buttonSave.click(function () {
168
+ $("#bccs-options").collapse('hide');
169
+ saveSettings();
170
+ updateOptionsFromCookie();
171
+ });
172
+ self.$buttonAgreeAll.click(function () {
173
+ $("#bccs-options").collapse('hide');
174
+ agreeAll();
175
+ updateOptionsFromCookie();
176
+ });
177
+ })
178
+ .fail(function () {
179
+ logger.error('You probably need to set `contentURL` in the props');
180
+ })
181
+ } else {
182
+ self.$modal.modal("show")
183
+ }
184
+ }.bind(this))
185
+ }
186
+
187
+ function updateOptionsFromCookie() {
188
+ var settings = self.getSettings();
189
+ if (settings) {
190
+ for (var setting in settings) {
191
+ var $checkbox = self.$modal.find("#bccs-options .bccs-option[data-name='" + setting + "'] input[type='checkbox']");
192
+ $checkbox.prop("checked", settings[setting]);
193
+ }
194
+ }
195
+ }
196
+
197
+ function updateButtons() {
198
+ if (detailedSettingsShown) {
199
+ self.$buttonDoNotAgree.hide();
200
+ self.$buttonAgree.hide();
201
+ self.$buttonSave.show();
202
+ self.$buttonAgreeAll.show();
203
+ } else {
204
+ self.$buttonDoNotAgree.show();
205
+ self.$buttonAgree.show();
206
+ self.$buttonSave.hide();
207
+ self.$buttonAgreeAll.hide();
208
+ }
209
+ }
210
+
211
+ function gatherOptions(setAllExceptNecessary) {
212
+ var $options = self.$modal.find("#bccs-options .bccs-option");
213
+ var options = {};
214
+ for (var i = 0; i < $options.length; i++) {
215
+ var option = $options[i];
216
+ var name = option.getAttribute("data-name");
217
+ if (name === "necessary") {
218
+ options[name] = true;
219
+ } else if (setAllExceptNecessary === undefined) {
220
+ var $checkbox = $(option).find("input[type='checkbox']");
221
+ options[name] = $checkbox.prop("checked");
222
+ } else {
223
+ options[name] = !!setAllExceptNecessary;
224
+ }
225
+ }
226
+ return options
227
+ }
228
+
229
+ function agreeAll() {
230
+ Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(true)), self.props.cookieStorageDays);
231
+ self.$modal.modal("hide");
232
+ }
233
+
234
+ function doNotAgree() {
235
+ Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(false)), self.props.cookieStorageDays);
236
+ logger.warn('delete cookie: j1.user.consent');
237
+ // j1.deleteCookie('j1.user.consent');
238
+ j1.deleteCookie('all');
239
+ self.$modal.modal('hide')
240
+ j1.goHome();
241
+ }
242
+
243
+ function saveSettings() {
244
+ Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions()), self.props.cookieStorageDays);
245
+ self.$modal.modal("hide");
246
+ }
247
+
248
+ // call consent dialog if no cookie found (except pages whitelisted)
249
+ //
250
+ whitelisted = (this.props.whitelisted.indexOf(window.location.pathname) > -1);
251
+ if (Cookie.get(this.props.cookieName) === undefined && this.props.autoShowDialog && !whitelisted) {
252
+ showDialog();
253
+ }
254
+
255
+ // API functions
256
+ // -------------------------------------------------------------------------
257
+
258
+ // show the consent dialog (modal)
259
+ // -------------------------------------------------------------------------
260
+ this.showDialog = function () {
261
+ whitelisted = (this.props.whitelisted.indexOf(window.location.pathname) > -1);
262
+ if (!whitelisted) {
263
+ showDialog();
264
+ }
265
+ }
266
+
267
+ // collect settings from consent cookie
268
+ // -------------------------------------------------------------------------
269
+ this.getSettings = function (optionName) {
270
+ var cookie = Cookie.get(self.props.cookieName);
271
+ if (cookie) {
272
+ var settings = JSON.parse(Cookie.get(self.props.cookieName));
273
+ if (optionName === undefined) {
274
+ return settings;
275
+ } else {
276
+ if (settings) {
277
+ return settings[optionName];
278
+ } else {
279
+ return false;
280
+ }
281
+ }
282
+ } else {
283
+ return undefined;
284
+ }
285
+ }
286
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ # -----------------------------------------------------------------------------
3
+ # ~/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js
4
+ # Provides JS Core for J1 Module BS Cookie Consent
5
+ #
6
+ # Product/Info:
7
+ # https://shaack.com
8
+ # http://jekyll.one
9
+ #
10
+ # Copyright (C) 2020 Stefan Haack
11
+ # Copyright (C) 2021 Juergen Adams
12
+ #
13
+ # bootstrap-cookie-banner is licensed under MIT License.
14
+ # See: https://github.com/shaack/bootstrap-cookie-banner/blob/master/LICENSE
15
+ # J1 Template is licensed under MIT License.
16
+ # See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
17
+ # -----------------------------------------------------------------------------
18
+ # TODO:
19
+ #
20
+ # -----------------------------------------------------------------------------
21
+ # NOTE:
22
+ # BS Cookie Consent is an MODIFIED version of bootstrap-cookie-banner
23
+ # for the use with J1 Template. This modiefied version cannot be used
24
+ # outside of J1 Template!
25
+ # -----------------------------------------------------------------------------
26
+ */
27
+
28
+ "use strict";function BootstrapCookieConsent(c){var g;var e;var q;var r=log4javascript.getLogger("j1.core.bsCookieConsent");var p="bccs-modal";var l=this;var n=false;this.props={autoShowDialog:true,language:navigator.language,languages:["en","de"],contentURL:"./content",cookieName:"cookie-consent-settings",cookieStorageDays:365,postSelectionCallback:undefined,whitelisted:[],xhr_data_element:""};for(var d in c){this.props[d]=c[d]}this.language=this.props.language;if(this.language.indexOf("-")!==-1){this.language=this.language.split("-")[0]}if(!this.props.languages.includes(this.language)){this.language=this.props.languages[0]}var f={set:function(u,v,x){var w=window.btoa(v);var s="";if(x){var t=new Date();t.setTime(t.getTime()+(x*24*60*60*1000));s="; expires="+t.toUTCString()}document.cookie=u+"="+(w||"")+s+"; Path=/; SameSite=Strict;"},get:function(t){var w=t+"=";var s=document.cookie.split(";");for(var u=0;u<s.length;u++){var y=s[u];while(y.charAt(0)===" "){y=y.substring(1,y.length)}if(y.indexOf(w)===0){var x=y.substring(w.length,y.length);var v=window.atob(x);return v}}return undefined}};var k={documentReady:function(s){if(document.readyState!=="loading"){s()}else{document.addEventListener("DOMContentLoaded",s)}}};function j(s){k.documentReady(function(){l.modal=document.getElementById(p);if(!l.modal){l.modal=document.createElement("div");l.modal.id=p;l.modal.setAttribute("class","modal fade");l.modal.setAttribute("tabindex","-1");l.modal.setAttribute("role","dialog");l.modal.setAttribute("aria-labelledby",p);document.body.append(l.modal);l.$modal=$(l.modal);if(l.props.postSelectionCallback){l.$modal.on("hidden.bs.modal",function(){l.props.postSelectionCallback()})}var t=l.props.contentURL+"/index.html";$.get(t).done(function(u){l.modal.innerHTML=u;l.modal.innerHTML=$("#"+l.props.xhr_data_element).eq(0).html();$(l.modal).modal({backdrop:"static",keyboard:false});l.$buttonDoNotAgree=$("#bccs-buttonDoNotAgree");l.$buttonAgree=$("#bccs-buttonAgree");l.$buttonSave=$("#bccs-buttonSave");l.$buttonAgreeAll=$("#bccs-buttonAgreeAll");i();h();$("#bccs-options").on("hide.bs.collapse",function(){n=false;i()}).on("show.bs.collapse",function(){n=true;i()});l.$buttonDoNotAgree.click(function(){b()});l.$buttonAgree.click(function(){m()});l.$buttonSave.click(function(){$("#bccs-options").collapse("hide");o();h()});l.$buttonAgreeAll.click(function(){$("#bccs-options").collapse("hide");m();h()})}).fail(function(){r.error("You probably need to set `contentURL` in the props")})}else{l.$modal.modal("show")}}.bind(this))}function h(){var u=l.getSettings();if(u){for(var t in u){var s=l.$modal.find("#bccs-options .bccs-option[data-name='"+t+"'] input[type='checkbox']");s.prop("checked",u[t])}}}function i(){if(n){l.$buttonDoNotAgree.hide();l.$buttonAgree.hide();l.$buttonSave.show();l.$buttonAgreeAll.show()}else{l.$buttonDoNotAgree.show();l.$buttonAgree.show();l.$buttonSave.hide();l.$buttonAgreeAll.hide()}}function a(t){var s=l.$modal.find("#bccs-options .bccs-option");var v={};for(var w=0;w<s.length;w++){var y=s[w];var u=y.getAttribute("data-name");if(u==="necessary"){v[u]=true}else{if(t===undefined){var x=$(y).find("input[type='checkbox']");v[u]=x.prop("checked")}else{v[u]=!!t}}}return v}function m(){f.set(l.props.cookieName,JSON.stringify(a(true)),l.props.cookieStorageDays);l.$modal.modal("hide")}function b(){f.set(l.props.cookieName,JSON.stringify(a(false)),l.props.cookieStorageDays);r.warn("delete cookie: j1.user.consent");j1.deleteCookie("all");l.$modal.modal("hide");j1.goHome()}function o(){f.set(l.props.cookieName,JSON.stringify(a()),l.props.cookieStorageDays);l.$modal.modal("hide")}q=(this.props.whitelisted.indexOf(window.location.pathname)>-1);if(f.get(this.props.cookieName)===undefined&&this.props.autoShowDialog&&!q){j()}this.showDialog=function(){q=(this.props.whitelisted.indexOf(window.location.pathname)>-1);if(!q){j()}};this.getSettings=function(t){var s=f.get(l.props.cookieName);if(s){var u=JSON.parse(f.get(l.props.cookieName));if(t===undefined){return u}else{if(u){return u[t]}else{return false}}}else{return undefined}}};
@@ -2,10 +2,12 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 1</title>
6
+ <meta name="description" content="iFrame message passing test 1" />
7
7
  <meta name="viewport" content="width=device-width" />
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+ <meta name="robots" content="noindex">
10
+ <meta name="robots" content="nofollow">
9
11
  <style>
10
12
  a.back {
11
13
  float: right;
@@ -2,10 +2,11 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 2</title>
6
+ <meta name="description" content="iFrame message passing test 2" />
7
7
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
-
8
+ <meta name="robots" content="noindex">
9
+ <meta name="robots" content="nofollow">
9
10
  <style>
10
11
  *,
11
12
  *:before,
@@ -2,9 +2,11 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 3</title>
6
+ <meta name="description" content="iFrame message passing test 3" />
7
7
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
+ <meta name="robots" content="noindex">
9
+ <meta name="robots" content="nofollow">
8
10
  <style>
9
11
  a {
10
12
  float: right;
@@ -2,10 +2,12 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 4</title>
6
+ <meta name="description" content="iFrame message passing test 4" />
7
7
  <meta name="viewport" content="width=device-width" />
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+ <meta name="robots" content="noindex">
10
+ <meta name="robots" content="nofollow">
9
11
  <style>
10
12
  *,
11
13
  *:before,
@@ -2,9 +2,11 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 5</title>
6
+ <meta name="description" content="iFrame message passing test 5" />
7
7
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
+ <meta name="robots" content="noindex">
9
+ <meta name="robots" content="nofollow">
8
10
  <style>
9
11
  a {
10
12
  float: right;
@@ -2,8 +2,10 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 6</title>
6
+ <meta name="description" content="iFrame message passing test 6" />
7
+ <meta name="robots" content="noindex">
8
+ <meta name="robots" content="nofollow">
7
9
  <style>
8
10
  a.back {
9
11
  float: right;
@@ -6,6 +6,8 @@
6
6
  <meta name="description" content="iFrame message passing test" />
7
7
  <meta name="viewport" content="width=device-width" />
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+ <meta name="robots" content="noindex">
10
+ <meta name="robots" content="nofollow">
9
11
  </head>
10
12
 
11
13
  <body>
@@ -2,10 +2,12 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>iFrame message passing test</title>
6
- <meta name="description" content="iFrame message passing test" />
5
+ <title>iFrame message passing test 7</title>
6
+ <meta name="description" content="iFrame message passing test 7" />
7
7
  <meta name="viewport" content="width=device-width" />
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+ <meta name="robots" content="noindex">
10
+ <meta name="robots" content="nofollow">
9
11
  </head>
10
12
 
11
13
  <body>
@@ -0,0 +1,146 @@
1
+ (function(){
2
+
3
+ var DomReady = window.DomReady = {};
4
+
5
+ // Everything that has to do with properly supporting our document ready event. Brought over from the most awesome jQuery.
6
+
7
+ var userAgent = navigator.userAgent.toLowerCase();
8
+
9
+ // Figure out what browser is being used
10
+ var browser = {
11
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
12
+ safari: /webkit/.test(userAgent),
13
+ opera: /opera/.test(userAgent),
14
+ msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )),
15
+ mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent))
16
+ };
17
+
18
+ var readyBound = false;
19
+ var isReady = false;
20
+ var readyList = [];
21
+
22
+ // Handle when the DOM is ready
23
+ function domReady() {
24
+ // Make sure that the DOM is not already loaded
25
+ if(!isReady) {
26
+ // Remember that the DOM is ready
27
+ isReady = true;
28
+
29
+ if(readyList) {
30
+ for(var fn = 0; fn < readyList.length; fn++) {
31
+ readyList[fn].call(window, []);
32
+ }
33
+
34
+ readyList = [];
35
+ }
36
+ }
37
+ };
38
+
39
+ // From Simon Willison. A safe way to fire onload w/o screwing up everyone else.
40
+ function addLoadEvent(func) {
41
+ var oldonload = window.onload;
42
+ if (typeof window.onload != 'function') {
43
+ window.onload = func;
44
+ } else {
45
+ window.onload = function() {
46
+ if (oldonload) {
47
+ oldonload();
48
+ }
49
+ func();
50
+ }
51
+ }
52
+ };
53
+
54
+ // does the heavy work of working through the browsers idiosyncracies (let's call them that) to hook onload.
55
+ function bindReady() {
56
+ if(readyBound) {
57
+ return;
58
+ }
59
+
60
+ readyBound = true;
61
+
62
+ // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
63
+ if (document.addEventListener && !browser.opera) {
64
+ // Use the handy event callback
65
+ document.addEventListener("DOMContentLoaded", domReady, false);
66
+ }
67
+
68
+ // If IE is used and is not in a frame
69
+ // Continually check to see if the document is ready
70
+ if (browser.msie && window == top) (function(){
71
+ if (isReady) return;
72
+ try {
73
+ // If IE is used, use the trick by Diego Perini
74
+ // http://javascript.nwbox.com/IEContentLoaded/
75
+ document.documentElement.doScroll("left");
76
+ } catch(error) {
77
+ setTimeout(arguments.callee, 0);
78
+ return;
79
+ }
80
+ // and execute any waiting functions
81
+ domReady();
82
+ })();
83
+
84
+ if(browser.opera) {
85
+ document.addEventListener( "DOMContentLoaded", function () {
86
+ if (isReady) return;
87
+ for (var i = 0; i < document.styleSheets.length; i++)
88
+ if (document.styleSheets[i].disabled) {
89
+ setTimeout( arguments.callee, 0 );
90
+ return;
91
+ }
92
+ // and execute any waiting functions
93
+ domReady();
94
+ }, false);
95
+ }
96
+
97
+ if(browser.safari) {
98
+ var numStyles;
99
+ (function(){
100
+ if (isReady) return;
101
+ if (document.readyState != "loaded" && document.readyState != "complete") {
102
+ setTimeout( arguments.callee, 0 );
103
+ return;
104
+ }
105
+ if (numStyles === undefined) {
106
+ var links = document.getElementsByTagName("link");
107
+ for (var i=0; i < links.length; i++) {
108
+ if(links[i].getAttribute('rel') == 'stylesheet') {
109
+ numStyles++;
110
+ }
111
+ }
112
+ var styles = document.getElementsByTagName("style");
113
+ numStyles += styles.length;
114
+ }
115
+ if (document.styleSheets.length != numStyles) {
116
+ setTimeout( arguments.callee, 0 );
117
+ return;
118
+ }
119
+
120
+ // and execute any waiting functions
121
+ domReady();
122
+ })();
123
+ }
124
+
125
+ // A fallback to window.onload, that will always work
126
+ addLoadEvent(domReady);
127
+ };
128
+
129
+ // This is the public function that people can use to hook up ready.
130
+ DomReady.ready = function(fn, args) {
131
+ // Attach the listeners
132
+ bindReady();
133
+
134
+ // If the DOM is already ready
135
+ if (isReady) {
136
+ // Execute the function immediately
137
+ fn.call(window, []);
138
+ } else {
139
+ // Add the function to the wait list
140
+ readyList.push( function() { return fn.call(window, []); } );
141
+ }
142
+ };
143
+
144
+ bindReady();
145
+
146
+ })();