Permalink
Browse files

Initial Commit of html5mashups

  • Loading branch information...
0 parents commit 837d0832651f9da0a411f836994bc553fc109f88 @marinosbern committed May 11, 2012
@@ -0,0 +1 @@
+AddType text/cache-manifest .manifest
@@ -0,0 +1,5 @@
+-Filters
+-Drag and Drop
+-Databases
+-Offline Mode
+-History
@@ -0,0 +1,75 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+
+/*
+ * Returns an new XMLHttpRequest object, or false if the browser
+ * doesn't support it
+ */
+function newXMLHttpRequest() {
+
+ var xmlreq = false;
+
+ // Create XMLHttpRequest object in non-Microsoft browsers
+ if (window.XMLHttpRequest) {
+ xmlreq = new XMLHttpRequest();
+
+ } else if (window.ActiveXObject) {
+
+ try {
+ // Try to create XMLHttpRequest in later versions
+ // of Internet Explorer
+
+ xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
+
+ } catch (e1) {
+
+ // Failed to create required ActiveXObject
+
+ try {
+ // Try version supported by older versions
+ // of Internet Explorer
+
+ xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
+
+ } catch (e2) {
+
+ // Unable to create an XMLHttpRequest by any means
+ xmlreq = false;
+ }
+ }
+ }
+
+return xmlreq;
+}
+
+ /*
+ * Returns a function that waits for the specified XMLHttpRequest
+ * to complete, then passes it XML response to the given handler function.
+ * req - The XMLHttpRequest whose state is changing
+ * responseXmlHandler - Function to pass the XML response to
+ */
+ function getReadyStateHandler(req, responseXmlHandler) {
+
+ // Return an anonymous function that listens to the XMLHttpRequest instance
+ return function () {
+
+ // If the request's status is "complete"
+ if (req.readyState == 4) {
+
+ // Check that we received a successful response from the server
+ if (req.status == 200) {
+
+ // Pass the XML payload of the response to the handler function.
+ responseXmlHandler(req.responseXML);
+
+ } else {
+
+ // An HTTP problem has occurred
+ handleAjaxError("HTTP error "+req.status+": "+req.statusText);
+ }
+ }
+ }
+ }
@@ -0,0 +1,18 @@
+CACHE MANIFEST
+
+#v25
+
+CACHE:
+ajax1.js
+delete.png
+dropbox.png
+html5utils.js
+index.html
+loading.gif
+mashups.js
+refresh.png
+trash.png
+style.css
+
+NETWORK:
+proxy.php
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1 @@
+[24-Feb-2011 13:29:01] PHP Warning: fopen() [<a href='function.fopen'>function.fopen</a>]: Filename cannot be empty in /home/bernitsa/public_html/dev/mashups/proxy.php on line 11
@@ -0,0 +1,65 @@
+// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
+/*@cc_on'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/
+
+var addEvent = (function () {
+ if (document.addEventListener) {
+ return function (el, type, fn) {
+ if (el && el.nodeName || el === window) {
+ el.addEventListener(type, fn, false);
+ } else if (el && el.length) {
+ for (var i = 0; i < el.length; i++) {
+ addEvent(el[i], type, fn);
+ }
+ }
+ };
+ } else {
+ return function (el, type, fn) {
+ if (el && el.nodeName || el === window) {
+ el.attachEvent('on' + type, function () { return fn.call(el, window.event); });
+ } else if (el && el.length) {
+ for (var i = 0; i < el.length; i++) {
+ addEvent(el[i], type, fn);
+ }
+ }
+ };
+ }
+})();
+
+(function () {
+
+var pre = document.createElement('pre');
+pre.id = "view-source"
+
+// private scope to avoid conflicts with demos
+addEvent(window, 'click', function (event) {
+ if (event.target.hash == '#view-source') {
+ // event.preventDefault();
+ if (!document.getElementById('view-source')) {
+ // pre.innerHTML = ('<!DOCTYPE html>\n<html>\n' + document.documentElement.innerHTML + '\n</html>').replace(/[<>]/g, function (m) { return {'<':'&lt;','>':'&gt;'}[m]});
+ var xhr = new XMLHttpRequest();
+
+ // original source - rather than rendered source
+ xhr.onreadystatechange = function () {
+ if (this.readyState == 4 && this.status == 200) {
+ pre.innerHTML = this.responseText.replace(/[<>]/g, function (m) { return {'<':'&lt;','>':'&gt;'}[m]});
+ prettyPrint();
+ }
+ };
+
+ document.body.appendChild(pre);
+ // really need to be sync? - I like to think so
+ xhr.open("GET", window.location, true);
+ xhr.send();
+ }
+ document.body.className = 'view-source';
+
+ var sourceTimer = setInterval(function () {
+ if (window.location.hash != '#view-source') {
+ clearInterval(sourceTimer);
+ document.body.className = '';
+ }
+ }, 200);
+ }
+});
+
+})();
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html lang="en" manifest="cache.manifest">
+<head>
+<meta charset=utf-8 />
+<meta name="viewport" content="width=620" />
+<title>Mashups: An Offline HTML5 Webapp by Marinos Bernitsas</title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script src="html5utils.js"></script>
+<script src="ajax1.js"></script>
+</head>
+<body>
+ <h1>Mashups - <a style="color:blue;" href="http://bit.ly/html5mashups">bit.ly/html5mashups</a></h1>
+ <h2>An Offline HTML5 Webapp by Marinos Bernitsas</h2>
+
+
+<div id="drop">
+</div>
+
+<div id="buttons">
+ <div id="refresh" onclick="javascript:updateCache()">
+ Get New Articles
+ </div>
+
+ <div id="prefs" onclick="javascript:dropTables();">
+ Clear DBs
+ </div>
+</div>
+
+<div id="mainbox">
+ <div id="loading" style="display:none;">
+ <img src="loading.gif" />
+ Loading..
+ </div>
+
+ <div id="offline" style="display:none;">
+ Offline Mode..Using cached copy
+ </div>
+
+ <div id="contents">
+ <a onclick="javascript:addSampleFeeds()">add sample feeds</a>
+ </div>
+</div>
+
+
+<script src="mashups.js"></script>
+
+<div id="footer">
+ 2011 Marinos Bernitsas (<a href="http://bernitsas.com/dev/mashups.zip">Download Mashups for HTML5</a> - version 25)
+</div>
+
+
+</body>
+</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 837d083

Please sign in to comment.