Permalink
Browse files

latest/merge

  • Loading branch information...
2 parents b822afd + 7f2aa64 commit f70fd9fd9d21e13e2a803ab7b4b98bf39d806a29 @adamsilver committed Apr 17, 2012
View
@@ -16,7 +16,7 @@
<link rel="stylesheet" type="text/css" href="css/print.css" media="print">
<!--[if IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" /><![endif]-->
</head>
- <body>
+ <body id="pageCatalogue">
<div id="container">
<div id="header">
<div id="headerInner">
View
@@ -301,5 +301,75 @@ h1 {
}
#primary .inner {
+
+}
+
+#placeHolder {
+ border: 1px solid #d0d0d0;
+ background: #f5f5f5;
+ margin-bottom: 20px;
+ padding: 20px;
+}
+
+#placeHolder p {
+ text-align: center;
+ font-size: 17px;
+}
+
+#streamNavigation {
+ border: 1px solid #D0D0D0;
+ border-right: none;
+}
+
+#streamNavigation ul {
+ padding: 0;
+ margin: 0;
+}
+
+#streamNavigation .stream {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ border-bottom: 1px solid #D0D0D0
+}
+
+#streamNavigation .stream:last-child {
+ border-bottom: none;
+}
+
+#streamNavigation .stream a {
+ padding: 6px;
+ display: block;
+ color: #444;
+ text-decoration: none;
+ position: relative;
+}
+
+#streamNavigation .stream a.selected {
+ background-color: #eee;
+}
+
+#streamNavigation .stream p.header {
+ font-size: 15px;
+ margin: 0;
+ padding: 0;
+}
+
+#streamNavigation .stream p.name {
+ font-size: 11px;
+}
+
+#streamNavigation .stream p.updateTime {
+ position: absolute;
+ bottom: 7px;
+ right: 7px;
+}
+
+#streamDisplay {
+ height: 500px;
+ border: 1px solid #d0d0d0;
+}
+
+#pageCatalogue #primary .inner {
padding-left: 20px;
}
View
@@ -102,4 +102,16 @@ body {
#primary .inner {
padding-left: 0px;
+}
+
+#streamNavigation {
+
+}
+
+#placeHolder {
+ display: none;
+}
+
+#main {
+ padding: 3px;
}
View
@@ -21,7 +21,7 @@
<div id="header">
<div id="headerInner">
<div id="logo">
- <a href="index.html"><img src="img/logo.png" alt="T-Mobile" ></a>
+ <a href="stream.html"><img src="img/logo.png" alt="T-Mobile" ></a>
</div>
</div>
</div>
View
@@ -29,7 +29,13 @@
throw new Error('Use attachListener with an element.');
}
- global.addEventListener(eventType, fn, false);
+ var listener = function(e) {
+ fn.call(e, e);
+ };
+
+ global.addEventListener(eventType, listener, false);
+
+ return listener;
};
};
@@ -213,6 +219,81 @@
}
};
};
+
+ var attachBoundWindowListener;
+
+ if(attachWindowListener && bind) {
+ attachBoundWindowListener = function(eventType, fn, thisObject) {
+ var listener = bind(fn, thisObject);
+ return attachWindowListener(eventType, listener);
+ };
+ };
+
+ var attachListener;
+
+ if(html && isHostMethod(html, 'addEventListener')) {
+ attachListener = function(el, eventType, fn) {
+
+ var listener = function(e) {
+ fn.call(e, e);
+ };
+
+ el.addEventListener(eventType, listener, false);
+
+ return listener;
+ };
+ };
+
+ var getEventTarget;
+
+ if(html && isHostMethod(html, 'addEventListener')) {
+ getEventTarget = function(e) {
+ var target = e.target;
+ // Check if not an element (e.g. a text node)
+ if (1 != target.nodeType) {
+ // Set reference to parent node (which must be an element)
+ target = target.parentNode;
+ }
+ return target;
+ };
+ }
+
+ var delegateListener;
+
+ if(attachListener && getEventTarget) {
+ delegateListener = function(el, eventType, fn, fnDelegate) {
+
+ var listener = function(e) {
+ if(fnDelegate(getEventTarget(e))) {
+ fn.call(e, e);
+ }
+ };
+
+ return attachListener(el, eventType, listener);
+
+ };
+ };
+
+ var delegateBoundListener;
+
+ if(delegateListener && bind) {
+ delegateBoundListener = function(el, eventType, fn, fnDelegate, thisObject) {
+ var listener = bind(function(e) {
+ if(fnDelegate(getEventTarget(e))) {
+ fn.call(thisObject, e);
+ }
+ }, thisObject);
+
+ attachListener(el, eventType, listener);
+ return listener;
+ };
+ };
+
+ if(html && isHostMethod(html, 'addEventListener')) {
+ var cancelDefault = function(e) {
+ e.preventDefault();
+ };
+ }
var getViewportSize;
@@ -234,5 +315,10 @@
global.jessie.addClass = addClass;
global.jessie.removeClass = removeClass;
global.jessie.getViewportSize = getViewportSize;
-
+ global.jessie.attachBoundWindowListener = attachBoundWindowListener;
+ global.jessie.attachListener = attachListener;
+ global.jessie.delegateListener = delegateListener;
+ global.jessie.delegateBoundListener = delegateBoundListener;
+ global.jessie.getEventTarget = getEventTarget;
+ global.jessie.cancelDefault = cancelDefault;
})(this);
@@ -0,0 +1,22 @@
+mould.ModeChanger;
+
+if(jessie.attachBoundWindowListener) {
+ mould.ModeChanger = function() {
+ jessie.attachBoundWindowListener("resize", this.window_onResize, this);
+ this.checkMode();
+ };
+
+ mould.ModeChanger.prototype.window_onResize = function(e){
+ this.checkMode();
+ };
+
+ mould.ModeChanger.prototype.checkMode = function() {
+ var width = document.documentElement.clientWidth;
+ if(width <= 320) {
+ this.enableCompactMode();
+ }
+ else {
+ this.disableCompactMode();
+ }
+ };
+};
@@ -0,0 +1,105 @@
+mould.StreamEnhancer;
+
+if( mould.ModeChanger &&
+ jessie.delegateBoundListener &&
+ jessie.attachBoundListener &&
+ jessie.cancelDefault) {
+
+ mould.StreamEnhancer = function(navigation, display) {
+ this.navigation = navigation;
+ this.display = display;
+ mould.ModeChanger.apply(this, arguments);
+ jessie.delegateBoundListener(navigation, "click", this.handleNavigation_onClick, function(target) {
+ if(target.tagName.toLowerCase() == "a") {
+ return true;
+ }
+ if(target.parentNode.tagName.toLowerCase() == "a") {
+ return true;
+ }
+ if(target.parentNode.parentNode.tagName.toLowerCase() == "a") {
+ return true;
+ }
+ }, this);
+
+ this.createBackButton();
+ };
+
+ mould.StreamEnhancer.prototype = mould.ModeChanger.prototype;
+
+ mould.StreamEnhancer.prototype.handleNavigation_onClick = function(e) {
+ jessie.cancelDefault(e);
+ this.display.innerHTML = "";
+ if(this.compactMode) {
+ this.showDisplay();
+ this.hideNavigation();
+ this.showBackButton();
+ }
+ this.requestStream();
+ };
+
+ mould.StreamEnhancer.prototype.createBackButton = function() {
+ this.backButton = document.createElement("a");
+ this.backButton.innerHTML = "Back to streams";
+ this.backButton.href = "#";
+ jessie.attachBoundListener(this.backButton, "click", this.handleBackButton_onClick, this);
+ };
+
+ mould.StreamEnhancer.prototype.handleBackButton_onClick = function(e) {
+ jessie.cancelDefault(e);
+ this.hideDisplay();
+ this.showNavigation();
+ };
+
+ mould.StreamEnhancer.prototype.showBackButton = function() {
+ this.display.appendChild(this.backButton);
+ };
+
+ mould.StreamEnhancer.prototype.hideBackButton = function() {
+ if(this.backButton && this.backButton.parentNode) {
+ this.display.removeChild(this.backButton);
+ }
+ };
+
+ mould.StreamEnhancer.prototype.hideNavigation = function() {
+ this.navigation.style.display = "none";
+ };
+
+ mould.StreamEnhancer.prototype.showNavigation = function() {
+ this.navigation.style.display = "block";
+ };
+
+ mould.StreamEnhancer.prototype.requestStream = function() {
+ //alert("request stream");
+ this.requestStream_onSuccess();
+ };
+
+ mould.StreamEnhancer.prototype.requestStream_onSuccess = function(response) {
+ //alert("show stream in display area");
+ var p = document.createElement("p");
+ p.innerHTML = "i have been updated";
+ this.display.appendChild(p);
+ };
+
+ mould.StreamEnhancer.prototype.enableCompactMode = function() {
+ if(this.compactMode) {
+ return;
+ }
+ this.hideDisplay();
+ this.compactMode = true;
+ };
+
+ mould.StreamEnhancer.prototype.hideDisplay = function() {
+ this.display.style.display = "none";
+ };
+
+ mould.StreamEnhancer.prototype.showDisplay = function() {
+ this.display.style.display = "block";
+ };
+
+ mould.StreamEnhancer.prototype.disableCompactMode = function() {
+ this.showDisplay();
+ this.hideBackButton();
+ this.showNavigation();
+ this.compactMode = false;
+ };
+}
@@ -0,0 +1,11 @@
+mould.pages.streams = (function() {
+
+ if(mould.Ribbon) {
+ this.ribbon = new mould.Ribbon(document.getElementById("ribbon"), document.getElementById("headerInner"));
+ }
+
+ //if(mould.StreamEnhancer) {
+ // this.streamEnhancer = new mould.StreamEnhancer(document.getElementById("streamNavigation"), document.getElementById("streamDisplay"));
+ //}
+
+})();
@@ -0,0 +1,11 @@
+mould.pages.streams = (function() {
+
+ if(mould.Ribbon) {
+ this.ribbon = new mould.Ribbon(document.getElementById("ribbon"), document.getElementById("headerInner"));
+ }
+
+ if(mould.StreamEnhancer) {
+ this.streamEnhancer = new mould.StreamEnhancer(document.getElementById("streamNavigation"), document.getElementById("streamDisplay"));
+ }
+
+})();
Oops, something went wrong.

0 comments on commit f70fd9f

Please sign in to comment.