Permalink
Browse files

working on a fullscreen view #23

  • Loading branch information...
1 parent a7179e5 commit 9515e2434dfc9a24932f937adaa525538865fb5d @rauhryan rauhryan committed Feb 23, 2013
View
@@ -49,6 +49,27 @@ def fetch(key)
end
end
+ class Mimetype < Faraday::Middleware
+ begin
+
+ rescue LoadError, NameError => e
+ self.load_error = e
+ end
+
+ def initialize(app, *args)
+ @app = app
+ end
+
+
+
+ def call(env)
+
+ env[:request_headers].merge!('Accept' => "application/vnd.github.beta.full+json" )
+
+ @app.call env
+ end
+ end
+
module Helpers
def encrypted_token
encrypted = Encryptor.encrypt user_token, :key => settings.secret_key
@@ -73,8 +94,8 @@ def logged_in?
end
def cache
- @cache ||= SimpleCache.new
- #@cache ||= ActiveSupport::Cache::FileStore.new "tmp", :namespace => 'huboard', :expires_in => 3600
+ @cache ||= SimpleCache.new
+ #@cache ||= ActiveSupport::Cache::FileStore.new "tmp", :namespace => 'huboard', :expires_in => 3600
end
def github
@@ -92,6 +113,7 @@ def h(input = "")
def gh(token = nil)
@gh ||= Ghee.new(:access_token => token || user_token) do |conn|
conn.use FaradayMiddleware::Caching, cache
+ conn.use Mimetype
end
end
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,93 @@
+.fullscreen-overlay {
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ // just above drawer
+ z-index: 10;
+
+
+ height: 100%;
+ width: 100%;
+
+ overflow-x: hidden;
+ overflow-y: auto;
+
+ background-color: rgba(243,243,243, 0.8);
+
+ display:none;
+
+}
+
+.fullscreen-open {
+
+ overflow: hidden;
+
+ .fullscreen-overlay {
+ display: block;
+ }
+
+}
+
+.fullscreen-wrapper {
+ margin: 0px 60px;
+
+}
+
+.fullscreen-card {
+ position: relative;
+
+ background-color: #fff;
+
+ margin: 50px auto;
+
+ border-radius: 2px;
+ border: 1px solid rgba(0,0,0, 0.3);
+
+ padding: 20px 0px;
+
+ overflow:hidden;
+
+}
+
+.fullscreen-card-header {
+ h2{
+ margin-top: 0;
+ font-size: 20px;
+ line-height: 28px;
+ }
+
+}
+.fullscreen-card-description {
+ p {
+ -ms-word-break: break-all;
+ word-break: break-all;
+
+ // Non standard for webkit
+ word-break: break-word;
+
+-webkit-hyphens: auto;
+ -moz-hyphens: auto;
+ hyphens: auto;
+ }
+}
+.fullscreen-card-right{
+ position: absolute;
+ right: 0;
+ top: 20px;
+
+ margin-right: 20px;
+ width: 160px;
+
+ height: 100px;
+
+}
+.fullscreen-card-left {
+ margin-left: 20px;
+ margin-right: 200px;
+ border-right: 1px solid #ccc;
+ padding-right: 10px;
+ @include prefixer(box-sizing, border-box);
+ overflow: hidden;
+}
+
+
@@ -6,6 +6,7 @@
@import "board";
@import "header";
@import "footer";
+@import "overlay";
.navbar {
&.navbar-fixed-top, &.navbar-static-top {
@@ -1,4 +1,7 @@
-define(["../events/postal"],function(postal){
+define(["../../common/events/postal"],function(postal){
+
+
+
var card = function(params) {
this.attributes = params.model;
@@ -4,7 +4,7 @@ define(["../collections/issues",
"./sidebarView",
"./headerView",
"./assigneeView",
- "../events/postal",
+ "../../common/events/postal",
"./cssView"],
function (issues,
template,
@@ -1,4 +1,4 @@
-define(["text!../templates/card.html","../models/card", "../events/postal"],function(template,card, postal){
+define(["text!../templates/card.html","../models/card", "../../common/events/postal"],function(template,card, postal){
return Backbone.View.extend({
initialize: function ( params ) {
@@ -1,4 +1,4 @@
-define(["text!../templates/column.html","./cardView","../events/postal","../models/milestone"],function(template, CardView, postal, milestone){
+define(["text!../templates/column.html","./cardView","../../common/events/postal","../models/milestone"],function(template, CardView, postal, milestone){
var Column = Backbone.View.extend({
initialize : function(params) {
@@ -1,4 +1,4 @@
-define(["../events/postal"], function(postal) {
+define(["../../common/events/postal"], function(postal) {
jQuery.Color.fn.contrastColor = function() {
var r = this._rgba[0], g = this._rgba[1], b = this._rgba[2];
return (((r*299)+(g*587)+(b*144))/1000) >= 131.5 ? "#333" : "white";
@@ -1,4 +1,4 @@
-define(["../events/postal"], function(postal){
+define(["../../common/events/postal"], function(postal){
return Backbone.View.extend({
el: $(".page-header-wrapper"),
@@ -1,4 +1,4 @@
-define(["../events/postal","./filterView"], function (postal, filterView) {
+define(["../../common/events/postal","./filterView"], function (postal, filterView) {
return Backbone.View.extend( {
tagName: "ul",
@@ -1,44 +0,0 @@
-define(["socket"],function(socket){
- function S4() {
- return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
- }
- function guid() {
- return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
- }
-
- var sockets = {},
- correlationId = guid();
-
-
- return {
- correlationId: correlationId,
- subscribe: function(channel, callback) {
- postal.channel(channel).subscribe(callback);
- },
- channel : function (channel) {
- return postal.channel(channel);
- },
- publish: function (channel, payload) {
- postal.channel(channel).publish(payload);
- },
- socket: function (channel, event, callback) {
- if(!socket) {
- return;
- }
- var theChannel = postal.channel(channel);
-
- postal.channel(event).subscribe(callback);
-
- if(sockets[channel]) {
- return;
- } else {
- sockets[channel] = channel;
- socket.on(channel, function (message) {
- message.correlationId !== correlationId && postal.channel(message.event).publish(message.payload);
- });
- }
- }
- }
-
-
-});
@@ -1,4 +1,4 @@
-define(["../events/postal"],function(postal){
+define(["../../common/events/postal"],function(postal){
var card = function(params) {
this.attributes = params.model;
@@ -14,7 +14,9 @@
Milestone: <%= milestone.title %>
</div>
<% } %>
-<% if (pull_request.html_url) { %><span class="label label-info">Pull request</span> <%}%>
+<% if(pull_request.html_url) { %>
+ <span class="label label-info">Pull request</span>
+<% } %>
<div class="card-labels">
<% _(other_labels).each(function(l) { %>
<div class="card-label-wrapper">
@@ -4,7 +4,7 @@ define(["../collections/issues",
"./sidebarView",
"./headerView",
"./assigneeView",
- "../events/postal",
+ "../../common/events/postal",
"./cssView"],
function (issues,
template,
@@ -1,4 +1,4 @@
-define(["text!../templates/card.html","../models/card", "../events/postal"],function(template,card, postal){
+define(["text!../templates/card.html","../models/card", "../../common/events/postal"],function(template,card, postal){
return Backbone.View.extend({
initialize: function ( params ) {
@@ -19,7 +19,9 @@ define(["text!../templates/card.html","../models/card", "../events/postal"],func
"moved" : "moved",
"click .close": "closed",
"drop": "dropped",
- "reorder" : "drop"
+ "reorder" : "drop",
+ "click" : "fullscreen"
+
},
tagName:"li",
onMoved: function(data){
@@ -29,6 +31,9 @@ define(["text!../templates/card.html","../models/card", "../events/postal"],func
this.remove();
postal.publish("Closed.Issue",{card: this});
},
+ fullscreen: function (ev) {
+ postal.publish("Card.Fullscreen",this.issue);
+ },
render: function(){
$(this.el).html( _.template(template, this.issue.attributes))
.droppable({scope:"assignee",hoverClass:"assignee-accept"})
@@ -1,4 +1,4 @@
-define(["../collections/issues","text!../templates/column.html","./cardView","../events/postal"],function(issues,template, CardView, postal){
+define(["../collections/issues","text!../templates/column.html","./cardView","../../common/events/postal"],function(issues,template, CardView, postal){
var Column = Backbone.View.extend({
initialize : function(params) {
@@ -1,4 +1,4 @@
-define(["../events/postal"], function(postal) {
+define(["../../common/events/postal"], function(postal) {
jQuery.Color.fn.contrastColor = function() {
var r = this._rgba[0], g = this._rgba[1], b = this._rgba[2];
return (((r*299)+(g*587)+(b*144))/1000) >= 131.5 ? "#333" : "white";
@@ -1,4 +1,4 @@
-define(["../events/postal"], function(postal){
+define(["../../common/events/postal"], function(postal){
return Backbone.View.extend({
el: $(".page-header-wrapper"),
@@ -1,4 +1,4 @@
-define(["../events/postal","./filterView"], function (postal, filterView) {
+define(["../../common/events/postal","./filterView"], function (postal, filterView) {
return Backbone.View.extend( {
tagName: "ul",
@@ -0,0 +1,32 @@
+define(['../common/events/postal',"./views/card"], function (postal, card) {
+
+ var app = {
+ open: function () {
+ $("body").addClass("fullscreen-open");
+ },
+ close: function () {
+ $("body").removeClass("fullscreen-open");
+ },
+ init: function () {
+ $(".fullscreen-card").click(function (ev) {
+ ev.stopPropagation();
+ })
+
+ $(".fullscreen-overlay").click(app.close);
+
+ postal.subscribe("Card.Fullscreen",$.proxy(this.open, this));
+ }
+ };
+
+
+ return {
+ init: function (params) {
+ app.card = new card(params);
+
+ $(this).append(app.card.el);
+
+ app.init();
+ }
+ }
+
+});
@@ -0,0 +1,11 @@
+<div class="fullscreen-card-left">
+ <div class="fullscreen-card-header">
+ <h2> <%= title %> </h2>
+ </div>
+
+ <div class="fullscreen-card-description">
+ <%= body_html %>
+ </div>
+</div>
+<div class="fullscreen-card-right">
+</div>
@@ -0,0 +1,17 @@
+define(["../../common/events/postal","text!../templates/card.html"],function (postal, template) {
+ return Backbone.View.extend({
+ tagName: "div",
+ className : "fullscreen-card",
+ initialize: function (params) {
+ postal.subscribe("Card.Fullscreen",$.proxy(this.open, this));
+ },
+ render: function (attributes) {
+ $(this.el).html( _.template(template, attributes))
+ return this;
+ },
+ open: function (issue) {
+ this.issue = issue;
+ this.render(issue.attributes);
+ }
+ });
+});
View
@@ -14,6 +14,16 @@
<% end %>
+<% content_for :overlay do %>
+ <div class="fullscreen-overlay" >
+
+ <div class="fullscreen-wrapper" data-module="card/main" data-parameters='<%= @parameters.to_json %>'>
+
+ </div>
+
+ </div>
+
+<% end %>
<% content_for :header do %>
<ol class="assignees">
Oops, something went wrong.

0 comments on commit 9515e24

Please sign in to comment.