├── .gitignore ├── static ├── bifocal │ ├── images │ │ ├── bg-body.jpg │ │ ├── footer.png │ │ ├── steps.png │ │ ├── title.png │ │ ├── twitter.png │ │ ├── badge-video.png │ │ ├── bg-settings.png │ │ ├── email-head.gif │ │ ├── email-head.png │ │ ├── footer-arc90.png │ │ ├── icon-typekit.png │ │ ├── read-email.png │ │ ├── read-kindle.png │ │ ├── read-print.png │ │ ├── read-refresh.png │ │ ├── readability.png │ │ ├── tab-example.png │ │ ├── title-small.png │ │ ├── typekit-icon.png │ │ ├── bg-settings-es.png │ │ ├── es │ │ │ └── readability.png │ │ ├── footer-thanks.png │ │ ├── icon-flourish.png │ │ ├── arc90-logo-large.png │ │ ├── arc90-logo-small.png │ │ ├── badge-readability.png │ │ ├── badge-whats_this.png │ │ ├── email-readability.gif │ │ ├── logo-arc90-large.png │ │ ├── logo-arc90-small.png │ │ ├── readability-drag.png │ │ ├── arc90lab-logo-small.png │ │ ├── fancybox │ │ │ ├── fancy_left.png │ │ │ ├── fancy_right.png │ │ │ ├── fancy_closebox.png │ │ │ ├── fancy_progress.png │ │ │ ├── fancy_shadow_e.png │ │ │ ├── fancy_shadow_n.png │ │ │ ├── fancy_shadow_ne.png │ │ │ ├── fancy_shadow_nw.png │ │ │ ├── fancy_shadow_s.png │ │ │ ├── fancy_shadow_se.png │ │ │ ├── fancy_shadow_sw.png │ │ │ ├── fancy_shadow_w.png │ │ │ ├── fancy_title_left.png │ │ │ ├── fancy_title_main.png │ │ │ └── fancy_title_right.png │ │ ├── footer-readability.png │ │ ├── kindling-logo-small.gif │ │ ├── logo-arc90lab-small.png │ │ ├── sprite-readability.png │ │ ├── logo-readability-large.png │ │ ├── logo-readability-small.png │ │ ├── readability-logo-small.png │ │ ├── icon-readability-favicon.png │ │ ├── kindling_250px_dark_trans.png │ │ └── logo-readability-es-large.png │ ├── js │ │ ├── bifocal-bookmarklet.js │ │ ├── es │ │ │ └── readability-start.js │ │ ├── readability-start.js │ │ ├── readability-0.1-debug.js │ │ ├── jquery.fancybox-1.2.6.pack.js │ │ ├── jquery-1.3.1.min.js │ │ └── bifocal.js │ ├── css │ │ ├── bifocal-print.css │ │ ├── readability-print.css │ │ ├── es │ │ │ └── readability-home.css │ │ ├── fancybox.css │ │ ├── bifocal.css │ │ ├── readability.css │ │ └── readability-home.css │ └── inject.js └── test.html ├── package.json ├── article-fetch.js ├── server.js └── bifocal.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /static/bifocal/images/bg-body.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/bg-body.jpg -------------------------------------------------------------------------------- /static/bifocal/images/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/footer.png -------------------------------------------------------------------------------- /static/bifocal/images/steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/steps.png -------------------------------------------------------------------------------- /static/bifocal/images/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/title.png -------------------------------------------------------------------------------- /static/bifocal/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/twitter.png -------------------------------------------------------------------------------- /static/bifocal/images/badge-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/badge-video.png -------------------------------------------------------------------------------- /static/bifocal/images/bg-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/bg-settings.png -------------------------------------------------------------------------------- /static/bifocal/images/email-head.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/email-head.gif -------------------------------------------------------------------------------- /static/bifocal/images/email-head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/email-head.png -------------------------------------------------------------------------------- /static/bifocal/images/footer-arc90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/footer-arc90.png -------------------------------------------------------------------------------- /static/bifocal/images/icon-typekit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/icon-typekit.png -------------------------------------------------------------------------------- /static/bifocal/images/read-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/read-email.png -------------------------------------------------------------------------------- /static/bifocal/images/read-kindle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/read-kindle.png -------------------------------------------------------------------------------- /static/bifocal/images/read-print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/read-print.png -------------------------------------------------------------------------------- /static/bifocal/images/read-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/read-refresh.png -------------------------------------------------------------------------------- /static/bifocal/images/readability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/readability.png -------------------------------------------------------------------------------- /static/bifocal/images/tab-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/tab-example.png -------------------------------------------------------------------------------- /static/bifocal/images/title-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/title-small.png -------------------------------------------------------------------------------- /static/bifocal/images/typekit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/typekit-icon.png -------------------------------------------------------------------------------- /static/bifocal/images/bg-settings-es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/bg-settings-es.png -------------------------------------------------------------------------------- /static/bifocal/images/es/readability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/es/readability.png -------------------------------------------------------------------------------- /static/bifocal/images/footer-thanks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/footer-thanks.png -------------------------------------------------------------------------------- /static/bifocal/images/icon-flourish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/icon-flourish.png -------------------------------------------------------------------------------- /static/bifocal/images/arc90-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/arc90-logo-large.png -------------------------------------------------------------------------------- /static/bifocal/images/arc90-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/arc90-logo-small.png -------------------------------------------------------------------------------- /static/bifocal/images/badge-readability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/badge-readability.png -------------------------------------------------------------------------------- /static/bifocal/images/badge-whats_this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/badge-whats_this.png -------------------------------------------------------------------------------- /static/bifocal/images/email-readability.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/email-readability.gif -------------------------------------------------------------------------------- /static/bifocal/images/logo-arc90-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-arc90-large.png -------------------------------------------------------------------------------- /static/bifocal/images/logo-arc90-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-arc90-small.png -------------------------------------------------------------------------------- /static/bifocal/images/readability-drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/readability-drag.png -------------------------------------------------------------------------------- /static/bifocal/images/arc90lab-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/arc90lab-logo-small.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_left.png -------------------------------------------------------------------------------- /static/bifocal/images/footer-readability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/footer-readability.png -------------------------------------------------------------------------------- /static/bifocal/images/kindling-logo-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/kindling-logo-small.gif -------------------------------------------------------------------------------- /static/bifocal/images/logo-arc90lab-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-arc90lab-small.png -------------------------------------------------------------------------------- /static/bifocal/images/sprite-readability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/sprite-readability.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_right.png -------------------------------------------------------------------------------- /static/bifocal/images/logo-readability-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-readability-large.png -------------------------------------------------------------------------------- /static/bifocal/images/logo-readability-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-readability-small.png -------------------------------------------------------------------------------- /static/bifocal/images/readability-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/readability-logo-small.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_closebox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_closebox.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_progress.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_e.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_n.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_ne.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_nw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_nw.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_s.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_se.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_sw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_sw.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_shadow_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_shadow_w.png -------------------------------------------------------------------------------- /static/bifocal/images/icon-readability-favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/icon-readability-favicon.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_title_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_title_left.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_title_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_title_main.png -------------------------------------------------------------------------------- /static/bifocal/images/fancybox/fancy_title_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/fancybox/fancy_title_right.png -------------------------------------------------------------------------------- /static/bifocal/images/kindling_250px_dark_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/kindling_250px_dark_trans.png -------------------------------------------------------------------------------- /static/bifocal/images/logo-readability-es-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/bfserv/master/static/bifocal/images/logo-readability-es-large.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bfserv", 3 | "version": "0.1.0", 4 | "author" : "Andris Reinman", 5 | "maintainers":[ 6 | { 7 | "name":"andris", 8 | "email":"andris@node.ee" 9 | } 10 | ], 11 | "dependencies": { 12 | "node-static": "*", 13 | "node-gearman":"*", 14 | "optimist":"*" 15 | } 16 | } -------------------------------------------------------------------------------- /static/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |12 | Tegin oma statistikamootori mooduli source avalikuks, selle leiab GitHubist. Täpsemalt näiteks kodeeringute statistika skripti leiab näidete kataloogist 13 |
14 |15 | Tegu on siis node.js skriptiga. Käivitamisel hakkab skript master protsessiks ning tellib vastava arvu forke kes hakkavad siis etteantud aadresse läbi vaatama. Kui feilib (ühendust ei saada, tundmatu nimi, fork lendab õhku vms.) siis saadetakse veateade Kui õnnestub, siis saadetakse lehe kohta metainfo. 16 |
17 |[\s\u0000]*(?=
)/g, ""). // empty P
60 | replace(/<([A-Za-z][^> ]*)[^>]*>[\s\u0000]*<\/([A-Za-z][^> ]*)[^>]*>/g,function(original, startTag, endTag){
61 | startTag = (startTag || "").toLowerCase();
62 | endTag = (endTag || "").toLowerCase();
63 | if(startTag == endTag){
64 | return "";
65 | }else{
66 | return original;
67 | }
68 | }). //empty nodes
69 | replace(/\u0000/g, "\n").
70 | trim();
71 |
72 | return html;
73 | }
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var staticServer = require("node-static"),
2 | pathlib = require("path"),
3 | Gearman = require("node-gearman"),
4 | articleFetch = require("./article-fetch");
5 |
6 | // STATIC SERVER
7 | var file = new(staticServer.Server)(pathlib.join(__dirname, 'static'));
8 |
9 | require('http').createServer(function (request, response) {
10 | request.addListener('end', function () {
11 | file.serve(request, response);
12 | });
13 | }).listen(8080);
14 |
15 | var counter = 0;
16 |
17 | // GEARMAN WORKER
18 | var gearman = new Gearman("localhost");
19 | gearman.registerWorker("article", function(payload, worker){
20 | console.log("Received JOB #"+(++counter));
21 | if(!payload){
22 | worker.error();
23 | return;
24 | }
25 | var url = (payload || "").toString().trim();
26 | console.log("URL: "+url);
27 | articleFetch(url, function(err, article){
28 | if(err){
29 | // try one more time in a 1s delay
30 | setTimeout(function(){
31 | articleFetch(url, function(err, article){
32 | if(err){
33 |
34 | // try mode
35 | setTimeout(function(){
36 | articleFetch(url, function(err, article){
37 | if(err){
38 | // try one more time in a 10s delay
39 | setTimeout(function(){
40 | articleFetch(url, function(err, article){
41 | if(err){
42 | console.log("ERROR: "+err.message);
43 | worker.error();
44 | }else{
45 | console.log("SUCCESS");
46 | worker.end(article);
47 | }
48 | });
49 | }, 10000);
50 | console.log("ERROR: "+err.message);
51 | worker.error();
52 | }else{
53 | console.log("SUCCESS");
54 | worker.end(article);
55 | }
56 | });
57 | }, 5000);
58 |
59 |
60 | }else{
61 | console.log("SUCCESS");
62 | worker.end(article);
63 | }
64 | });
65 | }, 1000);
66 | console.log("ERROR: "+err.message);
67 | worker.error();
68 | }else{
69 | console.log("SUCCESS");
70 | worker.end(article);
71 | }
72 | });
73 | });
74 |
--------------------------------------------------------------------------------
/static/bifocal/js/es/readability-start.js:
--------------------------------------------------------------------------------
1 | var style = "style-newspaper";
2 | var size = "size-medium";
3 | var margin = "margin-wide";
4 |
5 | var baseHref = window.location.toString().match(/.*\//);
6 | if (baseHref[0].match(/es\//i)) {
7 | baseHref = baseHref[0].replace(/es\//i, '');
8 | }
9 | var linkStringStart = "javascript:(function(){";
10 | var linkStringEnd = "';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='" + baseHref + "js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='" + baseHref + "css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='" + baseHref + "css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();";
11 |
12 | $(document).ready(function() {
13 |
14 | if($.browser.msie) {
15 | $("#browser-instruction-placer").hide();
16 | $("#browser-instruction-ie").fadeIn('100');
17 | $("#bookmarkletLink").css("cursor","pointer");
18 | $("#video-instruction").attr("href","#video-ie");
19 | }
20 | else {
21 | $("#browser-instruction-placer").hide();
22 | $("#browser-instruction").fadeIn('100');
23 | }
24 |
25 | $("#bookmarkletLink").attr("href", linkStringStart + "readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd);
26 |
27 | function applyChange(s,y) {
28 | var example = document.getElementById("example");
29 | var article = document.getElementById("articleContent");
30 |
31 | switch(s){
32 | case "style":
33 | style = y;
34 | break;
35 | case "size":
36 | size = y;
37 | break;
38 | case "margin":
39 | margin = y;
40 | break;
41 | }
42 | example.className = style;
43 | article.className = margin + " " + size;
44 | $("#bookmarkletLink").attr("href", linkStringStart + "readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd);
45 | }
46 |
47 | $("#settings input").bind("click", function(){
48 | applyChange(this.name, this.value);
49 | });
50 | $("#settings input").bind("click", function(){
51 | applyChange(this.name, this.value);
52 | });
53 | $("#bookmarkletLink").bind("click", function(){
54 | if($.browser.msie){
55 | alert("Para empezar a usar Readability, click derecho y selecciona 'Agrega a favoritos...' para guardar este link en la barra de marcadores de tu navegador.");
56 | }
57 | else {
58 | alert("Para empezar a usar Readability, arrastra este link a la barra de marcadores de tu navegador.");
59 | }
60 | return false;
61 | });
62 |
63 | $('.video').fancybox({
64 | zoomSpeedIn: 0,
65 | zoomSpeedOut: 0,
66 | overlayShow: true,
67 | overlayOpacity: 0.85,
68 | overlayColor: "#091824",
69 | hideOnContentClick: false,
70 | frameWidth: 480,
71 | frameHeight: 360
72 | });
73 |
74 | $('#footnote-details').fancybox({
75 | zoomSpeedIn: 0,
76 | zoomSpeedOut: 0,
77 | overlayShow: true,
78 | overlayOpacity: 0.85,
79 | overlayColor: "#091824",
80 | hideOnContentClick: true,
81 | frameWidth: 480
82 | });
83 | });
--------------------------------------------------------------------------------
/static/bifocal/css/es/readability-home.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /* CSS Document */
3 |
4 | body {
5 | background: #1E4E74;
6 | color: #ddd;
7 | }
8 | img {
9 | border: none;
10 | }
11 | #container {
12 | margin-top: 10px;
13 | margin-right:auto;
14 | margin-left:auto;
15 | width: 980px;
16 | height: 1125px;
17 | padding: 10px;
18 | background: url(../../images/es/readability.png) no-repeat;
19 | overflow: hidden;
20 | }
21 | #footer {
22 | margin-top: 40px;
23 | text-align: right;
24 | }
25 | div#arcLinks {
26 | float: right;
27 | }
28 | div#kindlingAd {
29 | width: 250px;
30 | float: right;
31 | margin-right: 150px;
32 | text-align: center;
33 | }
34 | div#kindlingAd p {
35 | color: #fff;
36 | font-size: .8em;
37 | line-height: 0px;
38 | }
39 | a.www-link {
40 | margin: 0 8px 0 30px;
41 | }
42 | #arc90 {
43 | display: block;
44 | text-align: right;
45 | margin-top: 60px;
46 | }
47 | #arc90 img {
48 | margin-right: 10px;
49 | }
50 | #arc90 a.twitter {
51 | color: #ddd;
52 | text-decoration: none;
53 | font-size: .8em;
54 | font-weight: bolder;
55 | margin-top: 10px;
56 | border-bottom: 1px solid #fff;
57 | }
58 | #settings {
59 | margin-top: 165px;
60 | padding: 0 1.5em;
61 | display: block;
62 | width: 900px;
63 | height: 160px;
64 | }
65 | div.settings-box, div#bookmarklet {
66 | float: left;
67 | }
68 | div#bookmarklet {
69 | width: 200px;
70 | margin-top: 16px;
71 | margin-left: 140px;
72 | text-align: center;
73 | }
74 | div#style {
75 | width: 175px;
76 | margin-left: 20px;
77 | }
78 | div#size {
79 | width: 165px;
80 | }
81 | div#margin {
82 | width: 160px;
83 | }
84 | .settings-box label {
85 | margin-left: .5em;
86 | cursor: pointer;
87 | }
88 | .settings-box p {
89 | margin: .1em 0;
90 | }
91 | #readHiddenContent {
92 | display: none;
93 | }
94 | #example {
95 | display: block;
96 | margin-left: 30px;
97 | margin-top: 24px;
98 | width: 888px;
99 | height: 454px;
100 | left: 30px;
101 | padding: 1em 2em;
102 | overflow: auto;
103 | }
104 | #articleContent {
105 | text-align: left;
106 | line-height: 1.4em;
107 | margin: 1em auto;
108 | }
109 | /* ---------------- USER-CONFIGURABLE STYLING --------------------- */
110 | /* ---------------- USER-CONFIGURABLE STYLING --------------------- */
111 | /* Size options */
112 | .size-small {
113 | font-size: 12px;
114 | }
115 | .size-medium {
116 | font-size: 18px;
117 | }
118 | .size-large {
119 | font-size: 26px;
120 | }
121 | .size-x-large {
122 | font-size: 34px;
123 | }
124 | /* Style options */
125 | .style-novel {
126 | font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
127 | background: #F4F3DB;
128 | color: #222;
129 | }
130 | .style-ebook {
131 | font-family:Arial, Helvetica, sans-serif;
132 | background: #eee;
133 | color: #333;
134 | }
135 | .style-ebook h1 {
136 | font-family: "Arial Black", Gadget, sans-serif;
137 | font-weight: normal;
138 | }
139 | .style-newspaper {
140 | font-family:"Times New Roman", Times, serif;
141 | background: #F7F7F7;
142 | color: #222;
143 | }
144 | .style-newspaper h1 {
145 | text-transform:capitalize;
146 | font-family: Georgia, "Times New Roman", Times, serif;
147 | }
148 | .style-terminal {
149 | font-family: "Lucida Console", Monaco, monospace;
150 | background: #1D4E2C;
151 | color: #C6FFC6;
152 | }
153 | /* Margin Options */
154 | /* Margin Options */
155 |
156 | .margin-x-wide {
157 | width: 35%;
158 | }
159 | .margin-wide {
160 | width: 55%;
161 | }
162 | .margin-medium {
163 | width: 75%;
164 | }
165 | .margin-narrow {
166 | width: 95%;
167 | }
168 | /* ---------------- USER-CONFIGURABLE STYLING --------------------- */
169 | /* ---------------- USER-CONFIGURABLE STYLING --------------------- */
170 |
171 |
172 |
173 | /* LOCK IN H1 SIZING */
174 | #articleContent h1 {
175 | font-size: 1.2em !important;
176 | display: block;
177 | text-transform:capitalize;
178 | }
179 | #articleContent {
180 | line-height: 1.4em;
181 | }
182 |
--------------------------------------------------------------------------------
/static/bifocal/css/fancybox.css:
--------------------------------------------------------------------------------
1 | div#fancy_overlay{position:fixed;top:0;left:0;width:100%;height:100%;display:none;z-index:30;}
2 | div#fancy_loading{position:absolute;height:40px;width:40px;cursor:pointer;display:none;overflow:hidden;background:transparent;z-index:100;}
3 | div#fancy_loading div{position:absolute;top:0;left:0;width:40px;height:480px;background:transparent url("../images/fancybox/fancy_progress.png") no-repeat;}
4 | div#fancy_outer{position:absolute;top:0;left:0;z-index:90;background:transparent;display:none;margin:0;padding:20px 20px 40px;}
5 | div#fancy_inner{position:relative;width:100%;height:100%;background:#FFF;}
6 | div#fancy_content{z-index:100;position:absolute;margin:0;}
7 | div#fancy_div{color:#222;height:100%;width:100%;z-index:100;}
8 | div#fancy_div h2{text-align:center;font-variant:small-caps;margin:-15px 0 20px;padding:0 0 30px;background:#fff url("../images/icon-flourish.png") no-repeat center bottom;}
9 | img#fancy_img{position:absolute;top:0;left:0;border:0;z-index:100;width:100%;height:100%;margin:0;padding:0;}
10 | div#fancy_close{position:absolute;top:-12px;right:-15px;height:30px;width:30px;background:url("../images/fancybox/fancy_closebox.png") top left no-repeat;cursor:pointer;z-index:181;display:none;}
11 | #fancy_frame{position:relative;width:100%;height:100%;display:none;}
12 | #fancy_ajax{width:100%;height:100%;overflow:auto;}
13 | a#fancy_left,a#fancy_right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;z-index:111;display:none;background-image:url("../images/fancybox/data:image/gif;base64,AAAA");outline:none;overflow:hidden;}
14 | a#fancy_left{left:0;}
15 | a#fancy_right{right:0;}
16 | span.fancy_ico{position:absolute;top:50%;margin-top:-15px;width:30px;height:30px;z-index:112;cursor:pointer;display:block;}
17 | span#fancy_left_ico{left:-9999px;background:transparent url("../images/fancybox/fancy_left.png") no-repeat;}
18 | span#fancy_right_ico{right:-9999px;background:transparent url("../images/fancybox/fancy_right.png") no-repeat;}
19 | a#fancy_left:hover,a#fancy_right:hover{visibility:visible;background-color:transparent;}
20 | a#fancy_left:hover span{left:20px;}
21 | a#fancy_right:hover span{right:20px;}
22 | #fancy_bigIframe{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;}
23 | div#fancy_bg{position:absolute;top:0;left:0;width:100%;height:100%;z-index:70;border:0;margin:0;padding:0;}
24 | div.fancy_bg{position:absolute;display:block;z-index:70;border:0;margin:0;padding:0;}
25 | div#fancy_bg_n{top:-20px;left:0;width:100%;height:20px;background:transparent url("../images/fancybox/fancy_shadow_n.png") repeat-x;}
26 | div#fancy_bg_ne{top:-20px;right:-20px;width:20px;height:20px;background:transparent url("../images/fancybox/fancy_shadow_ne.png") no-repeat;}
27 | div#fancy_bg_e{right:-20px;height:100%;width:20px;background:transparent url("../images/fancybox/fancy_shadow_e.png") repeat-y;}
28 | div#fancy_bg_se{bottom:-20px;right:-20px;width:20px;height:20px;background:transparent url("../images/fancybox/fancy_shadow_se.png") no-repeat;}
29 | div#fancy_bg_s{bottom:-20px;left:0;width:100%;height:20px;background:transparent url("../images/fancybox/fancy_shadow_s.png") repeat-x;}
30 | div#fancy_bg_sw{bottom:-20px;left:-20px;width:20px;height:20px;background:transparent url("../images/fancybox/fancy_shadow_sw.png") no-repeat;}
31 | div#fancy_bg_w{left:-20px;height:100%;width:20px;background:transparent url("../images/fancybox/fancy_shadow_w.png") repeat-y;}
32 | div#fancy_bg_nw{top:-20px;left:-20px;width:20px;height:20px;background:transparent url("../images/fancybox/fancy_shadow_nw.png") no-repeat;}
33 | div#fancy_title{position:absolute;z-index:100;display:none;}
34 | div#fancy_title div{color:#FFF;font:bold 12px Arial;padding-bottom:3px;white-space:nowrap;}
35 | div#fancy_title table{margin:0 auto;}
36 | div#fancy_title table td{vertical-align:middle;padding:0;}
37 | td#fancy_title_left{height:32px;width:15px;background:transparent url("../images/fancybox/fancy_title_left.png") repeat-x;}
38 | td#fancy_title_main{height:32px;background:transparent url("../images/fancybox/fancy_title_main.png") repeat-x;}
39 | td#fancy_title_right{height:32px;width:15px;background:transparent url("../images/fancybox/fancy_title_right.png") repeat-x;}
--------------------------------------------------------------------------------
/static/bifocal/js/readability-start.js:
--------------------------------------------------------------------------------
1 | var style = "style-newspaper",
2 | size = "size-medium",
3 | margin = "margin-wide",
4 | footnotes = false,
5 | iOS = (navigator.userAgent.match(/safari/i) && navigator.userAgent.match(/mobile/i)) ? true : false;
6 |
7 | var baseHref = window.location.toString().match(/.*\//);
8 | var linkStringStart = "javascript:(function(){";
9 | var linkStringEnd = "';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='" + baseHref + "js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='" + baseHref + "css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='" + baseHref + "css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();";
10 |
11 | $(document).ready(function() {
12 | /* Prepare content instructions for specific browsers, */
13 | if($.browser.msie) {
14 | $('#bookmarkletLink').html('
');
15 | $("#browser-instruction-placer").hide();
16 | $("#browser-instruction-ie").fadeIn('100');
17 | $("#bookmarkletLink").css("cursor","pointer");
18 | $("#video-instruction").attr("href","#video-ie");
19 | }
20 | else if (iOS) {
21 | $("#browser-instruction-placer,#bookmarkletLink").hide();
22 | $("#browser-instruction-ios").fadeIn('100');
23 | $("#bookmarklet p:last-child").before('')
24 | }
25 | else {
26 | $("#browser-instruction-placer").hide();
27 | $("#browser-instruction").fadeIn('100');
28 | }
29 |
30 | $("#footer").after('
' + navigator.userAgent + '
'); 31 | 32 | $("#bookmarkletLink").attr("href", linkStringStart + "readConvertLinksToFootnotes=" + footnotes + ";readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd); 33 | 34 | /* Apply the user's styles to the demonstration. */ 35 | function applyChange(s,y) { 36 | var example = $('#example'), 37 | article = $('#articleContent'), 38 | references = $('#references'); 39 | 40 | switch(s){ 41 | case "style": 42 | style = y; 43 | break; 44 | case "size": 45 | size = y; 46 | break; 47 | case "margin": 48 | margin = y; 49 | break; 50 | case "footnotes": 51 | footnotes = y; 52 | } 53 | example.attr('className', style); 54 | article.attr('className', margin + " " + size); 55 | example.toggleClass('showNotes', footnotes); 56 | 57 | if (iOS) { 58 | $("#bookmarklet textarea").val(linkStringStart + "readConvertLinksToFootnotes=" + (footnotes ? 'true' : 'false') + ";readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd); 59 | } 60 | else { 61 | $("#bookmarkletLink").attr("href", linkStringStart + "readConvertLinksToFootnotes=" + (footnotes ? 'true' : 'false') + ";readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd); 62 | } 63 | } 64 | 65 | $("#settings input[type='radio']").bind("click", function(){ 66 | applyChange(this.name, this.value); 67 | }); 68 | 69 | $("#settings input[type='checkbox']").bind("click", function() { 70 | applyChange(this.name, this.checked); 71 | }); 72 | 73 | $("#bookmarkletLink").bind("click", function(){ 74 | if($.browser.msie){ 75 | alert("To start using Readability, right-click and select 'Add To Favorites...' to save this link to your browser's bookmarks toolbar."); 76 | } 77 | else { 78 | alert("To start using Readability, drag this link to your browser's bookmarks toolbar."); 79 | } 80 | return false; 81 | }); 82 | 83 | /* Modal Windows */ 84 | $('.video').fancybox({ 85 | zoomSpeedIn: 0, 86 | zoomSpeedOut: 0, 87 | overlayShow: true, 88 | overlayOpacity: 0.85, 89 | overlayColor: "#091824", 90 | hideOnContentClick: false, 91 | frameWidth: 480, 92 | frameHeight: 360 93 | }); 94 | $('#footnote-details').fancybox({ 95 | zoomSpeedIn: 0, 96 | zoomSpeedOut: 0, 97 | overlayShow: true, 98 | overlayOpacity: 0.85, 99 | overlayColor: "#091824", 100 | padding: 40, 101 | hideOnContentClick: false, 102 | frameHeight: 240 103 | }); 104 | }); -------------------------------------------------------------------------------- /static/bifocal/css/bifocal.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* Document */ 3 | body{font-size:10px;line-height:1;} 4 | #bifocal-logo,#arc90-logo,.footer-twitterLink,#readTools a,a.rdbTK-powered span{background-color:transparent!important;background-image:url(http://tahvel.info/bifocal/images/sprite-readability.png)!important;background-repeat:no-repeat!important;} 5 | #readOverlay{text-rendering:optimizeLegibility;display:block;position:absolute;top:0;left:0;width:100%;} 6 | #readInner{max-width:800px;margin:1em auto;} 7 | #readInner a{color:#039;text-decoration:none;} 8 | #readInner a:hover,#readInner a:focus{text-decoration:underline;} 9 | #readInner img{float:left;clear:both;margin:0 12px 12px 0;} 10 | #readInner img.blockImage{clear:both;float:none;display:block;margin-left:auto;margin-right:auto;} 11 | #readInner h1{display:block;width:100%;border-bottom:1px solid #333;font-size:1.2em;padding-bottom:.5em;margin-bottom:.75em;} 12 | #readInner sup{line-height:.8em;} 13 | #readInner .page-separator{clear:both;display:block;font-size:.85em;filter:alpha(opacity=20);opacity:.20;text-align:center;} 14 | .style-apertura #readInner h1{border-bottom-color:#ededed;} 15 | .style-terminal #readInner h1{border-bottom-color:#c6ffc6;} 16 | #readInner blockquote{margin-left:3em;margin-right:3em;} 17 | #bifocal-inner *{margin-bottom:16px;border:none;background:none;} 18 | #bifocal-footnotes{clear:both;} 19 | /* Footer */ 20 | #rdb-footer-wrapper{display:block;border-top:1px solid #333;clear:both;overflow:hidden;margin:2em 0;} 21 | .style-apertura #rdb-footer-wrapper{border-top-color:#ededed;} 22 | .style-terminal #rdb-footer-wrapper{border-top-color:#c6ffc6;} 23 | #rdb-footer-left{display:inline;float:left;margin-top:15px;width:285px;background-position:0 -36px;} 24 | .rdbTypekit #rdb-footer-left{width:475px;} 25 | #rdb-footer-left a,#rdb-footer-left a:link{float:left;} 26 | #bifocal-logo{display:inline;background-position:0 -36px;height:29px;width:189px;text-indent:-9000px;} 27 | #arc90-logo{display:inline;background-position:right -36px;height:29px;width:96px;text-indent:-9000px;} 28 | .style-apertura #bifocal-logo,.style-terminal #bifocal-logo{background-position:0 -67px;} 29 | .style-apertura #arc90-logo,.style-terminal #arc90-logo{background-position:right -67px;} 30 | #rdb-footer-right{display:inline;float:right;text-align:right;font-size:.75em;margin-top:18px;} 31 | #rdb-footer-right a{display:inline-block;float:left;overflow:visible;line-height:16px;vertical-align:baseline;} 32 | .footer-twitterLink{height:20px;margin-left:20px;background-position:0 -123px;font-size:12px;padding:4px 0 0 28px;} 33 | #rdb-footer-left .footer-twitterLink{display:none;margin-top:1px;padding-top:2px;} 34 | .rdbTypekit #rdb-footer-left .footer-twitterLink{display:inline-block!important;} 35 | a.rdbTK-powered,a.rdbTK-powered:link,a.rdbTK-powered:hover{font-size:16px;color:#858789!important;text-decoration:none!important;} 36 | a.rdbTK-powered span{display:inline-block;height:22px;margin-left:2px;background-position:0 -146px!important;padding:4px 0 0 26px;} 37 | .style-apertura #rdb-inverse,.style-athelas #rdb-athelas{display:block;} 38 | #rdb-footer-print,#bifocal-url,.rdbTypekit #rdb-footer-right .footer-twitterLink,span.version{display:none;} 39 | /* Tools */ 40 | #readTools{width:34px;height:150px;position:fixed;z-index:100;top:10px;left:10px;} 41 | #readTools a{overflow:hidden;margin-bottom:8px;display:block;opacity:.4;text-indent:-99999px;height:34px;width:34px;text-decoration:none;filter:alpha(opacity=40);} 42 | #reload-page{background-position:0 0;} 43 | #print-page{background-position:-36px 0;} 44 | #email-page{background-position:-72px 0;} 45 | #kindle-page{background-position:-108px 0;} 46 | #readTools a:hover,#readTools a:focus{opacity:1;filter:alpha(opacity=100);} 47 | /* @group User Styles */ 48 | /* Size */ 49 | .size-x-small{font-size:1.1em;line-height:1.5em;} 50 | .size-small{font-size:1.4em;line-height:1.5em;} 51 | .size-medium{font-size:1.7em;line-height:1.48em;} 52 | .size-large{font-size:2em;line-height:1.47em;} 53 | .size-x-large{font-size:2.5em;line-height:1.43em;} 54 | .size-x-small h1,.size-small h1,.size-medium h1,.size-large h1{font-size:1.6em;line-height:1.5em;} 55 | .size-x-large h1{font-size:1.6em;line-height:1.3em;} 56 | /* Style */ 57 | .style-newspaper {font-family:Georgia,"Times New Roman", Times, serif;background:#fbfbfb;color:#080000;} 58 | .style-newspaper h1 {text-transform:capitalize;font-family:Georgia, "Times New Roman", Times, serif;} 59 | .style-newspaper #readInner a {color:#0924e1;} 60 | .style-novel {font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;background:#f4eed9;color:#1d1916;} 61 | .style-novel #readInner a {color:#1856ba;} 62 | .style-ebook {font-family:Arial, Helvetica, sans-serif;background:#edebe8;color:#2c2d32;} 63 | .style-ebook #readInner a {color:#187dc9;} 64 | .style-ebook h1 {font-family:"Arial Black", Gadget, sans-serif;font-weight:400;} 65 | .style-terminal {font-family:"Lucida Console", Monaco, monospace;background:#1d4e2c;color:#c6ffc6;} 66 | .style-terminal #readInner a {color:#093;} 67 | /* Typekit */ 68 | .style-apertura{font-family:apertura-1,apertura-2,sans-serif;background-color:#2d2828;color:#eae8e9;} 69 | .style-apertura #readInner a{color:#58b0ff;} 70 | .style-athelas{font-family:athelas-1,athelas-2,"Palatino Linotype","Book Antiqua",Palatino,serif;background-color:#f7f7f7;color:#2b373d;} 71 | .style-athelas #readInner a{color:#1e83cb;} 72 | /* Margin */ 73 | .margin-x-narrow{width:95%;} 74 | .margin-narrow{width:85%;} 75 | .margin-medium{width:75%;} 76 | .margin-wide{width:55%;} 77 | .margin-x-wide{width:35%;} 78 | /* @end User Styles */ 79 | /* -- DEBUG -- */ 80 | .bug-green{background:#bbf9b0;border:4px solid green;} 81 | .bug-red{background:red;} 82 | .bug-yellow{background:#ffff8e;} 83 | .bug-blue{background:#bfdfff;} 84 | /* -- EMAIL / KINDLE POP UP -- */ 85 | #kindle-container,#email-container{position:fixed;top:60px;left:50%;width:500px;height:490px;border:solid 3px #666;background-color:#fff;z-index:100!important;overflow:hidden;margin:0 0 0 -240px;padding:0;} 86 | /* Override html styling attributes */ 87 | table,tr,td{background-color:transparent!important;} 88 | -------------------------------------------------------------------------------- /static/bifocal/js/readability-0.1-debug.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var objOverlay = document.createElement("div"); 3 | var objinnerDiv = document.createElement("div"); 4 | var debugControls = document.createElement("div"); 5 | var mainDiv; 6 | 7 | objOverlay.id = "readOverlay"; 8 | objinnerDiv.id = "readInner"; 9 | 10 | // Apply user-selected styling: 11 | document.body.className = style; 12 | objOverlay.className = style; 13 | objinnerDiv.className = margin + " " + size; 14 | 15 | debugControls.className = "debug-controls"; 16 | debugControls.innerHTML = " "; 17 | document.body.insertBefore(debugControls, document.body.firstChild); 18 | 19 | // objinnerDiv.appendChild(grabArticle()); // Get the article and place it inside the inner Div 20 | // objOverlay.appendChild(objinnerDiv); // Insert the inner div into the overlay 21 | 22 | // This removes everything else on the page. Requires a page refresh to undo it. 23 | // I tried the damn overlay on top - but had rendering issues: 24 | // document.body.innerHTML = ""; 25 | 26 | // Inserts the new content : 27 | // document.body.insertBefore(objOverlay, document.body.firstChild); 28 | })() 29 | 30 | 31 | function grabArticle() { 32 | var allParagraphs = document.getElementsByTagName("p"); 33 | var topDivCount = 0; 34 | var topDiv; 35 | var topDivParas; 36 | 37 | var articleContent = document.createElement("DIV"); 38 | var articleTitle = document.createElement("H1"); 39 | var articleFooter = document.createElement("DIV"); 40 | 41 | // Replace all doubled-up tags :
42 | var pattern = new RegExp ("
[ \r\n\s]*
", "g");
43 | document.body.innerHTML = document.body.innerHTML.replace(pattern, "
"); 44 | 45 | // Grab the title from the
's and keep it: 50 | for (var j=0; j < allParagraphs.length; j++) { 51 | var tempParas = allParagraphs[j].parentNode.getElementsByTagName("p"); 52 | if ( tempParas.length > topDivCount && allParagraphs[j].parentNode.textContent.split(',').length >= tempParas.length ) { 53 | topDivCount = tempParas.length; 54 | topDiv = allParagraphs[j].parentNode; 55 | topDiv.className = "bug-yellow"; 56 | } 57 | } 58 | topDiv.className = "bug-green"; 59 | 60 | /* 61 | // REMOVES ALL STYLESHEETS ... 62 | for (var k=0;k < document.styleSheets.length; k++) { 63 | if (document.styleSheets[k].href != null && document.styleSheets[k].href.lastIndexOf("arc90.com") == -1) { 64 | document.styleSheets[k].disabled = true; 65 | } 66 | } 67 | */ 68 | 69 | // cleanStyles(topDiv); // Removes all style attributes 70 | // topDiv = killDivs(topDiv); // Goes in and removes DIV's that have more non
stuff than
stuff
71 |
72 | // Cleans out junk from the topDiv just in case:
73 | /*
74 | topDiv = clean(topDiv, "form");
75 | topDiv = clean(topDiv, "object");
76 | topDiv = clean(topDiv, "table");
77 | topDiv = clean(topDiv, "h1");
78 | topDiv = clean(topDiv, "h2");
79 | topDiv = clean(topDiv, "iframe");
80 | */
81 | // Add the footer and contents:
82 |
83 | /*
84 | articleFooter.id = "readFooter";
85 | articleFooter.innerHTML = " "+list[0].innerHTML+" "+(sissejuhatus.innerHTML || "")+"
";
86 |
87 | articleContent.appendChild(topDiv);
88 | articleContent.appendChild(articleFooter);
89 |
90 | return topDiv;
91 | */
92 | mainDiv = topDiv;
93 |
94 | }
95 |
96 | function cleanAll() {
97 | mainDiv = clean(mainDiv, "form");
98 | mainDiv = clean(mainDiv, "object");
99 | mainDiv = clean(mainDiv, "table");
100 | mainDiv = clean(mainDiv, "h1");
101 | mainDiv = clean(mainDiv, "h2");
102 | mainDiv = clean(mainDiv, "iframe");
103 |
104 | }
105 |
106 | function cleanStyles( e ) {
107 | e = e || document;
108 | var cur = e.firstChild;
109 |
110 | // Go until there are no more child nodes
111 | while ( cur != null ) {
112 | if ( cur.nodeType == 1 ) {
113 | // Remove style attribute(s) :
114 | cur.removeAttribute("style");
115 | cleanStyles( cur );
116 | }
117 | cur = cur.nextSibling;
118 | }
119 | }
120 |
121 | function killDivs ( e ) {
122 | var divsList = e.getElementsByTagName( "div" );
123 | var curDivLength = divsList.length;
124 |
125 | // Gather counts for other typical elements embedded within :
126 | for (var i=0; i < curDivLength; i ++) {
127 | var p = divsList[i].getElementsByTagName("p").length;
128 | var img = divsList[i].getElementsByTagName("img").length;
129 | var li = divsList[i].getElementsByTagName("li").length;
130 | var a = divsList[i].getElementsByTagName("a").length;
131 | var embed = divsList[i].getElementsByTagName("embed").length;
132 |
133 | // If the number of commas is less than 10 (bad sign) ...
134 | if (divsList[i].textContent.split(',').length < 10) {
135 | // And the number of non-paragraph elements is more than paragraphs
136 | // or other ominous signs :
137 | if ( img > p || li > p || a > p || p == 0 || embed > 0) {
138 | divsList[i].className = "bug-red";
139 | divsList[i].color = "red";
140 | // divsList[i].style.display = "none";
141 | }
142 | }
143 | }
144 |
145 | return e;
146 | }
147 |
148 | function clean(e, tags, minWords) {
149 | var targetList = e.getElementsByTagName( tags );
150 | minWords = minWords || 1000000;
151 |
152 | for (var y=0; y < targetList.length; y++) {
153 | // If the text content isn't laden with words, remove the child:
154 | if (targetList[y].textContent.split(' ').length < minWords) {
155 | targetList[y].className = "bug-red";
156 | // targetList[y].parentNode.removeChild(targetList[y]);
157 | }
158 | }
159 | return e;
160 | }
--------------------------------------------------------------------------------
/static/bifocal/css/readability.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /* Document */
3 | body{font-size:10px;line-height:1;}
4 | #readability-logo,#arc90-logo,.footer-twitterLink,#readTools a,a.rdbTK-powered span{background-color:transparent!important;background-image:url(http://lab.arc90.com/experiments/readability/images/sprite-readability.png)!important;background-repeat:no-repeat!important;}
5 | #readOverlay{text-rendering:optimizeLegibility;display:block;position:absolute;top:0;left:0;width:100%;}
6 | #readInner{max-width:800px;margin:1em auto;}
7 | #readInner a{color:#039;text-decoration:none;}
8 | #readInner a:hover,#readInner a:focus{text-decoration:underline;}
9 | #readInner img{float:left;clear:both;margin:0 12px 12px 0;}
10 | #readInner img.blockImage{clear:both;float:none;display:block;margin-left:auto;margin-right:auto;}
11 | #readInner h1{display:block;width:100%;border-bottom:1px solid #333;font-size:1.2em;padding-bottom:.5em;margin-bottom:.75em;}
12 | #readInner sup{line-height:.8em;}
13 | #readInner .page-separator{clear:both;display:block;font-size:.85em;filter:alpha(opacity=20);opacity:.20;text-align:center;}
14 | .style-apertura #readInner h1{border-bottom-color:#ededed;}
15 | .style-terminal #readInner h1{border-bottom-color:#c6ffc6;}
16 | #readInner blockquote{margin-left:3em;margin-right:3em;}
17 | #readability-inner *{margin-bottom:16px;border:none;background:none;}
18 | #readability-footnotes{clear:both;}
19 | /* Footer */
20 | #rdb-footer-wrapper{display:block;border-top:1px solid #333;clear:both;overflow:hidden;margin:2em 0;}
21 | .style-apertura #rdb-footer-wrapper{border-top-color:#ededed;}
22 | .style-terminal #rdb-footer-wrapper{border-top-color:#c6ffc6;}
23 | #rdb-footer-left{display:inline;float:left;margin-top:15px;width:285px;background-position:0 -36px;}
24 | .rdbTypekit #rdb-footer-left{width:475px;}
25 | #rdb-footer-left a,#rdb-footer-left a:link{float:left;}
26 | #readability-logo{display:inline;background-position:0 -36px;height:29px;width:189px;text-indent:-9000px;}
27 | #arc90-logo{display:inline;background-position:right -36px;height:29px;width:96px;text-indent:-9000px;}
28 | .style-apertura #readability-logo,.style-terminal #readability-logo{background-position:0 -67px;}
29 | .style-apertura #arc90-logo,.style-terminal #arc90-logo{background-position:right -67px;}
30 | #rdb-footer-right{display:inline;float:right;text-align:right;font-size:.75em;margin-top:18px;}
31 | #rdb-footer-right a{display:inline-block;float:left;overflow:visible;line-height:16px;vertical-align:baseline;}
32 | .footer-twitterLink{height:20px;margin-left:20px;background-position:0 -123px;font-size:12px;padding:4px 0 0 28px;}
33 | #rdb-footer-left .footer-twitterLink{display:none;margin-top:1px;padding-top:2px;}
34 | .rdbTypekit #rdb-footer-left .footer-twitterLink{display:inline-block!important;}
35 | a.rdbTK-powered,a.rdbTK-powered:link,a.rdbTK-powered:hover{font-size:16px;color:#858789!important;text-decoration:none!important;}
36 | a.rdbTK-powered span{display:inline-block;height:22px;margin-left:2px;background-position:0 -146px!important;padding:4px 0 0 26px;}
37 | .style-apertura #rdb-inverse,.style-athelas #rdb-athelas{display:block;}
38 | #rdb-footer-print,#readability-url,.rdbTypekit #rdb-footer-right .footer-twitterLink,span.version{display:none;}
39 | /* Tools */
40 | #readTools{width:34px;height:150px;position:fixed;z-index:100;top:10px;left:10px;}
41 | #readTools a{overflow:hidden;margin-bottom:8px;display:block;opacity:.4;text-indent:-99999px;height:34px;width:34px;text-decoration:none;filter:alpha(opacity=40);}
42 | #reload-page{background-position:0 0;}
43 | #print-page{background-position:-36px 0;}
44 | #email-page{background-position:-72px 0;}
45 | #kindle-page{background-position:-108px 0;}
46 | #readTools a:hover,#readTools a:focus{opacity:1;filter:alpha(opacity=100);}
47 | /* @group User Styles */
48 | /* Size */
49 | .size-x-small{font-size:1.1em;line-height:1.5em;}
50 | .size-small{font-size:1.4em;line-height:1.5em;}
51 | .size-medium{font-size:1.7em;line-height:1.48em;}
52 | .size-large{font-size:2em;line-height:1.47em;}
53 | .size-x-large{font-size:2.5em;line-height:1.43em;}
54 | .size-x-small h1,.size-small h1,.size-medium h1,.size-large h1{font-size:1.6em;line-height:1.5em;}
55 | .size-x-large h1{font-size:1.6em;line-height:1.3em;}
56 | /* Style */
57 | .style-newspaper {font-family:Georgia,"Times New Roman", Times, serif;background:#fbfbfb;color:#080000;}
58 | .style-newspaper h1 {text-transform:capitalize;font-family:Georgia, "Times New Roman", Times, serif;}
59 | .style-newspaper #readInner a {color:#0924e1;}
60 | .style-novel {font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;background:#f4eed9;color:#1d1916;}
61 | .style-novel #readInner a {color:#1856ba;}
62 | .style-ebook {font-family:Arial, Helvetica, sans-serif;background:#edebe8;color:#2c2d32;}
63 | .style-ebook #readInner a {color:#187dc9;}
64 | .style-ebook h1 {font-family:"Arial Black", Gadget, sans-serif;font-weight:400;}
65 | .style-terminal {font-family:"Lucida Console", Monaco, monospace;background:#1d4e2c;color:#c6ffc6;}
66 | .style-terminal #readInner a {color:#093;}
67 | /* Typekit */
68 | .style-apertura{font-family:apertura-1,apertura-2,sans-serif;background-color:#2d2828;color:#eae8e9;}
69 | .style-apertura #readInner a{color:#58b0ff;}
70 | .style-athelas{font-family:athelas-1,athelas-2,"Palatino Linotype","Book Antiqua",Palatino,serif;background-color:#f7f7f7;color:#2b373d;}
71 | .style-athelas #readInner a{color:#1e83cb;}
72 | /* Margin */
73 | .margin-x-narrow{width:95%;}
74 | .margin-narrow{width:85%;}
75 | .margin-medium{width:75%;}
76 | .margin-wide{width:55%;}
77 | .margin-x-wide{width:35%;}
78 | /* @end User Styles */
79 | /* -- DEBUG -- */
80 | .bug-green{background:#bbf9b0;border:4px solid green;}
81 | .bug-red{background:red;}
82 | .bug-yellow{background:#ffff8e;}
83 | .bug-blue{background:#bfdfff;}
84 | /* -- EMAIL / KINDLE POP UP -- */
85 | #kindle-container,#email-container{position:fixed;top:60px;left:50%;width:500px;height:490px;border:solid 3px #666;background-color:#fff;z-index:100!important;overflow:hidden;margin:0 0 0 -240px;padding:0;}
86 | /* Override html styling attributes */
87 | table,tr,td{background-color:transparent!important;}
88 |
--------------------------------------------------------------------------------
/static/bifocal/inject.js:
--------------------------------------------------------------------------------
1 | console.log("Injected Main");
2 |
3 | (function() {
4 | try{
5 | console.log("FINAL URL: " + window.location.href);
6 |
7 | console.log("Run Main script");
8 |
9 | readConvertLinksToFootnotes = false;
10 | readStyle = 'style-newspaper';
11 | readSize = 'size-medium';
12 | readMargin = 'margin-medium';
13 |
14 | bifocalScript = document.createElement('script');
15 | bifocalScript.type = 'text/javascript';
16 | bifocalScript.src = 'http://127.0.0.1:8080/bifocal/js/bifocal.js?x='+ (Math.random());
17 | document.getElementsByTagName('head')[0].appendChild(bifocalScript);
18 |
19 | bifocalCss = document.createElement('LINK');
20 | bifocalCss.rel = 'stylesheet';
21 | bifocalCss.href = 'http://127.0.0.1:8080/bifocal/css/bifocal.css';
22 | bifocalCss.type = 'text/css';
23 | bifocalCss.media = 'all';
24 | document.getElementsByTagName('head')[0].appendChild(bifocalCss);
25 |
26 | bifocalPrintCss = document.createElement('LINK');
27 | bifocalPrintCss.rel = 'stylesheet';
28 | bifocalPrintCss.href = 'http://127.0.0.1:8080/bifocal/css/bifocal-print.css';
29 | bifocalPrintCss.media = 'print';
30 | bifocalPrintCss.type = 'text/css';
31 | document.getElementsByTagName('head')[0].appendChild(bifocalPrintCss);
32 | }catch(E){
33 | console.log("MAIN ERR: "+E.message);
34 | }
35 | })();
36 |
37 | function __PHANTOM_RESPONSE(){
38 | console.log("Response from Bifocal");
39 |
40 | var article = document.querySelector('#bifocal-content .page'),
41 | title = document.querySelector('#readInner h1'),
42 | warning = document.querySelector('#bifocal-warning'),
43 | response = {bifocal:true, url: window.location.href};
44 |
45 | if(!warning){
46 |
47 | if(article){
48 | sanitizeDOM(article);
49 | response.article = article.innerHTML.trim();
50 | }
51 |
52 | if(title){
53 | sanitizeDOM(title);
54 | response.title = title.innerHTML.trim();
55 | }
56 |
57 |
58 | }
59 | console.log(JSON.stringify(response));
60 |
61 | function sanitizeDOM(element){
62 |
63 | /*
64 | // should replace bold spans with strongs.... but does not :S
65 | var elements = Array.prototype.slice.call(element.querySelectorAll("span")),
66 | attr, href, style, fontWeight, elm;
67 |
68 | for(var i = elements.length - 1; i>=0; i--){
69 | if(elements[i].tagName == "SPAN"){
70 | style = window.getComputedStyle(elements[i]);
71 |
72 | fontWeight = (style.getPropertyValue("font-weight")).toString().toLowerCase();
73 | if(fontWeight == "bold" || fontWeight == "700"){
74 | elm = document.createElement("strong");
75 | elm.innerHTML = elements[i].innerHTML;
76 | try{
77 | elements[i].parentNode.insertBefore(elm, elements[i]);
78 | elements[i].parentNode.removeChild(elements[i]);
79 | elements[i] = elm;
80 | }catch(E){}
81 | }
82 | }
83 | }
84 | */
85 |
86 | //remove script tags
87 | var elements = element.getElementsByTagName("script");
88 | for(var i=elements.length-1; i>=0; i--){
89 | try{
90 | elements[i].parentNode.removeChild(elements[i]);
91 | }catch(E){}
92 | }
93 |
94 | //remove style tags
95 | var elements = element.getElementsByTagName("style");
96 | for(var i=elements.length-1; i>=0; i--){
97 | try{
98 | elements[i].parentNode.removeChild(elements[i]);
99 | }catch(E){}
100 | }
101 |
102 | //remove meta tags
103 | var elements = element.getElementsByTagName("meta");
104 | for(var i=elements.length-1; i>=0; i--){
105 | try{
106 | elements[i].parentNode.removeChild(elements[i]);
107 | }catch(E){}
108 | }
109 |
110 | // sanitize nodes by removing all attributes except for href
111 | var elements = Array.prototype.slice.call(element.querySelectorAll("*")),
112 | attr, href,
113 | removeList = [];
114 |
115 | for(var i=0, len = elements.length; i","
"]||!O.indexOf("",""]||(!O.indexOf(" "," "]||!O.indexOf(""&&O.indexOf("=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E
=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;YS[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="a';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("").append(M.responseText.replace(/