Permalink
Browse files

Merge branch 'master' of github.com:paulirish/w3fools

  • Loading branch information...
2 parents b76821d + b4313e7 commit 8b5d5198cd9ebeed72ccc460e95d1c2676245462 @bentruyman bentruyman committed Jan 14, 2011
View
@@ -35,6 +35,8 @@ a, a:visited, a:active { text-decoration: none; }
h2 { letter-spacing: 1px; }
+ol ul li { list-style: none; }
+
code {
font-size: 0.9em;
background-color: hsl(42, 21%, 75%);
@@ -66,11 +68,12 @@ header h2:before {
content: "✪ · ✪ · ✪ · ✪ · ✪";
text-shadow: none;
display: block;
+ text-align: center;
}
-.content, .intro p, .sucks li, .sucks .intro p, .sucks .intro blockquote, .intro small { min-width: 60%; max-width: 800px; margin: 0 auto; }
+.content, .intro p, .sucks li, .sucks .intro p, .intro .update, .sucks .intro blockquote { _width: 800px; min-width: 60%; max-width: 800px; margin: 0 auto; }
-.intro p + small { text-align: right; font-style: italic; display:block; }
+.intro p + small { text-align: right; font-style: italic; }
.belief { letter-spacing: 2px; }
#contributors { padding-left: 10em; position: relative; -moz-user-select: none; -webkit-user-select: none; user-select: none; }
@@ -143,17 +146,24 @@ pre code { width: 98%; padding: 0 2%; }
bottom: 0;
left: 0;
text-align: center;
- width: 100%;
+ width: 100%;
+ background: #ccc;
background: hsla(42, 21%, 75%, 0.95);
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, hsla(42, 21%, 65%, 0.95)), color-stop(1, hsla(42, 21%, 75%, 0.95)));
background: -moz-linear-gradient(center bottom, hsla(42, 21%, 65%, 0.95) 0%, hsla(42, 21%, 65%, 0.95), 100%);
border-top: 1px solid hsl(42, 21%, 65%);
+ padding: 0.75em 0;
+ _display: none;
+ font-family: "helvetica neue", helvetica, arial, sans-serif;
+ text-transform: uppercase;
}
+#toc a { display:inline-block; font-weight: bold; padding: 0 1em 0; text-shadow: 0px 1px 0px hsl(42, 21%, 25%); }
-.intro p.update { text-align: left; min-width: 100%; }
+.intro p.update { text-align: left; }
.intro p.update small { display:block; }
-#toc a { display:inline-block; padding: 0 1em 0; text-shadow: 0px 1px 0px hsl(42, 21%, 25%); }
+* html .heart { display: none; /* Bad bad IE 6 gets no luv! */ }
+
/*
COLORS!
@@ -205,7 +215,7 @@ h2 {
}
#main h2 { margin-top: 1.5em; }
-#contributors h2 { margin-top: 0.5em; }
+#contributors h2 { margin-top: 0.5em; _padding-left: -10em; _position: relative; }
h4 {
font-size: 1.2em;
@@ -270,15 +280,18 @@ footer {
}
blockquote,
-.intro small {
+.intro small,
+#toc a {
font-size: 0.8em;
line-height: 1.875;
margin-bottom: 1.875em;
padding-bottom: 0;
}
-.intro small { padding-bottom: 1.875em; margin-bottom: 0; }
+.intro p:last-child { padding-bottom: 1.5em; margin-bottom: 0; text-align: right; }
.sucks .intro p.update small { text-align: left; }
+
+#toc a { margin-bottom: 0; }
p + blockquote {
margin-top: -0.9375em;
@@ -291,21 +304,26 @@ p + blockquote {
margin-bottom: 0.3333em;
}
-.sucks .intro { margin-bottom: 1.5em; margin-top: 1.75em; }
+.sucks .intro { margin-bottom: 1.5em; margin-top: 1.5em; }
.sucks .intro blockquote { font-size: 1.5em; line-height: 1.5em; margin-top: 1.75em; margin-bottom: 1.75em; }
-.sucks .intro small { padding-bottom: 0.9375em; }
+.sucks .intro small { padding-bottom: 0.9375em; margin-bottom: 0; }
.sucks .intro p { padding-bottom: 1.5em; }
.sucks .intro + nav { margin-bottom: 0; }
.quiz ul ul {
column-rule: hsla(42, 21%, 55%, 0.5) dotted 1px;
margin: 1.5em 0 0 0;
}
+
+.quiz p { _text-align: center; }
+.quiz li p { _text-align: left; }
.quiz li li { padding: 0 0 1.5em 0; position: static; }
.quiz li li:after { content: none; border: 0;}
-#toc { padding: 0.75em 0; }
+
+/* no love for IE6.. LITERALLY */
+li.heart { _display: none;}
#certificate p {
margin: auto;
View
@@ -0,0 +1,241 @@
+
+<div id="log">
+</div>
+
+
+<script type="text/javascript" src="jquery-1.4.2.js"></script>
+
+<script>
+var synced = false;
+
+function set_sync_name(name)
+{
+ window.localStorage.setItem("sync_name", name);
+};
+
+function get_setup_complete()
+{
+ if (window.localStorage.getItem("setup_complete"))
+ {
+ return true;
+ }
+ return false;
+};
+
+function set_setup_complete(value)
+{
+ value = value || true
+ window.localStorage.setItem("setup_complete", value);
+};
+
+function get_sync_name()
+{
+ var sync_name = window.localStorage.getItem("sync_name");
+ if (sync_name && sync_name.length > 0)
+ {
+ return sync_name;
+ }
+ return false;
+};
+
+function has_synced(value)
+{
+ return synced;
+};
+
+function set_synced(value)
+{
+ if (value)
+ {
+ synced = value;
+ return;
+ }
+};
+
+function update_filters(newline_separated, callback)
+{
+ var urls = newline_separated.split("\n");
+ var new_urls = new Array();
+ for (i = 0; i < urls.length; i++)
+ {
+ var temp_url = urls[i];
+ temp_url = $.trim(temp_url);
+ if (temp_url.length > 0)
+ {
+ new_urls.push(temp_url);
+ }
+ }
+ window.localStorage.setItem("filter_urls", JSON.stringify(new_urls));
+ update_filters_online(callback);
+};
+
+function get_sync_url()
+{
+ return 'http://clobapi.heroku.com/clob/' + encodeURI(get_sync_name());
+};
+
+function get_filters_online(callback, force)
+{
+ if (!get_sync_name())
+ {
+ get_filters();
+ if (callback)
+ {
+ callback();
+ }
+ return;
+ }
+ if (has_synced() && !force)
+ {
+ if (callback)
+ {
+ callback();
+ }
+ return;
+ }
+ $.ajax({
+ url: get_sync_url(),
+ success: function(data) {
+ update_filters(data);
+ synced = true;
+ if (callback)
+ {
+ callback();
+ }
+ },
+ error: function() {
+ update_filters("");
+ update_filters_online(function () {
+ synced = true;
+ if (callback)
+ {
+ callback();
+ }
+ });
+ }
+ });
+};
+
+function update_filters_online(callback)
+{
+ if (!get_sync_name())
+ {
+ if (callback)
+ {
+ callback();
+ }
+ return false;
+ }
+ $.ajax({
+ type: 'PUT',
+ url: get_sync_url(),
+ data: { body: get_filters_raw() },
+ success: callback
+ });
+};
+
+function get_filters()
+{
+ if (window.localStorage.getItem("filter_urls"))
+ {
+ return JSON.parse(window.localStorage.getItem("filter_urls"));
+ }
+ else
+ {
+ var array = new Array();
+ return array;
+ }
+};
+
+function get_filters_raw()
+{
+ return get_filters().join("\n");
+};
+
+function should_filter(url)
+{
+ var filters = get_filters();
+ var action = null;
+ var current_filter = null;
+ for (i = 0; i < filters.length; i++)
+ {
+ current_filter = filters[i].toLowerCase();
+ action = 'hide'; // default action
+ if (current_filter.indexOf('#') === 0)
+ {
+ continue;
+ }
+ if (current_filter.indexOf('+') === 0)
+ {
+ action = 'amplify';
+ current_filter = $.trim(current_filter.slice(1));
+ }
+ if (url.toLowerCase().indexOf(current_filter) != -1)
+ {
+ return action;
+ }
+ }
+ return false;
+};
+
+
+function on_request(request, sender, sendResponse)
+{
+ var response = {}
+ if (request.should_filter)
+ {
+ //switch (should_filter(request.should_filter))
+ switch ('notanything')
+ {
+ case 'hide':
+ response.action = 'hide';
+ break;
+ case 'amplify':
+ response.action = 'amplify';
+ break;
+ case false:
+ // do nothing
+ break;
+ }
+ }
+ sendResponse(response); // snub them.
+};
+
+function on_tab_updated(tab_id, change_info, tab)
+{
+ if (tab.url.indexOf('www.google.') != -1 && tab.url.indexOf('www.google.com/reader') == -1 && tab.url.indexOf('www.google.com/calendar') == -1)
+ {
+ chrome.pageAction.show(tab_id);
+ }
+ else
+ {
+ chrome.pageAction.hide(tab_id);
+ }
+};
+
+//chrome.extension.onRequest.addListener(on_request);
+chrome.extension.onConnect.addListener(function(port) {
+ port.onMessage.addListener(function(request) {
+ var response = {}
+ if (request.should_filter)
+ {
+ switch (should_filter(request.should_filter))
+ {
+ case 'hide':
+ response.action = 'hide';
+ break;
+ case 'amplify':
+ response.action = 'amplify';
+ break;
+ case false:
+ // do nothing
+ break;
+ }
+ }
+ response.href = request.should_filter;
+ port.postMessage(response);
+ });
+});
+
+chrome.tabs.onUpdated.addListener(on_tab_updated);
+</script>
Binary file not shown.
@@ -0,0 +1,5 @@
+.amplified_result
+{
+ padding: 5px;
+ background-color: #C8FFDE; /* very light #E8FFE9 */
+}
Oops, something went wrong.

0 comments on commit 8b5d519

Please sign in to comment.