clipster 0.4.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/README.md +20 -4
  2. data/app/assets/flash/ZeroClipboard10.swf +0 -0
  3. data/app/assets/images/clipster/custom-clipboard.png +0 -0
  4. data/app/assets/images/clipster/git_hub.png +0 -0
  5. data/app/assets/javascripts/clipster/ZeroClipboard.min.js +3 -0
  6. data/app/assets/javascripts/clipster/{clip.js → about.js} +0 -0
  7. data/app/assets/javascripts/clipster/alertify.min.js +12 -0
  8. data/app/assets/javascripts/clipster/application.js +5 -0
  9. data/app/assets/javascripts/clipster/clips.js +2 -1
  10. data/app/assets/stylesheets/clipster/about.css +8 -0
  11. data/app/assets/stylesheets/clipster/alertify.css +155 -0
  12. data/app/assets/stylesheets/clipster/clips.css +81 -0
  13. data/app/controllers/clipster/about_controller.rb +8 -0
  14. data/app/controllers/clipster/clips_controller.rb +14 -31
  15. data/app/helpers/clipster/{clip_helper.rb → about_helper.rb} +1 -1
  16. data/app/helpers/clipster/application_helper.rb +4 -4
  17. data/app/models/clipster/clip.rb +5 -3
  18. data/app/views/clipster/about/index.html.erb +47 -0
  19. data/app/views/clipster/clips/{list.atom.builder → clips.atom.builder} +3 -5
  20. data/app/views/clipster/clips/{list.html.erb → clips.html.erb} +3 -9
  21. data/app/views/clipster/clips/{create.html.erb → new.html.erb} +37 -11
  22. data/app/views/clipster/clips/show.html.erb +24 -4
  23. data/app/views/clipster/clips/show.text.erb +1 -0
  24. data/app/views/clipster/common/_clip.html.erb +3 -0
  25. data/app/views/clipster/common/_includes.html.erb +1 -0
  26. data/app/views/clipster/common/_languages.html.erb +6 -0
  27. data/app/views/layouts/clipster/application.html.erb +10 -6
  28. data/config/routes.rb +6 -7
  29. data/config/schedule.rb +1 -1
  30. data/lib/clipster/engine.rb +2 -1
  31. data/lib/clipster/version.rb +1 -1
  32. data/lib/generators/clipster/install_generator.rb +3 -0
  33. data/lib/generators/templates/_includes.html.erb +1 -0
  34. metadata +23 -11
  35. data/app/assets/javascripts/clipster/bootstrap.js +0 -2027
  36. data/app/assets/stylesheets/clipster/clip.css +0 -32
  37. data/app/views/clipster/clips/about.html.erb +0 -15
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Clipster
2
2
 
3
3
  [<img src="https://secure.travis-ci.org/kwbock/clipster.png" alt="Build Status" />](http://travis-ci.org/kwbock/clipster)
4
+ [![Dependency Status](https://gemnasium.com/kwbock/clipster.png)](https://gemnasium.com/kwbock/clipster)
5
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/kwbock/clipster)
4
6
 
5
7
  Code snippets before they were cool.
6
8
 
@@ -66,11 +68,25 @@ Launch your server and navigate to https://localhost:3000/clipster to confirm th
66
68
 
67
69
  Restart your application and you should be able to access the engine at http://domain.tld/clipster
68
70
 
71
+ ### Contributing
72
+
73
+ Please see the [contribution guidelines](https://github.com/kwbock/clipster/blob/master/CONTRIBUTION_GUIDELINES.md).
74
+
69
75
  ### Upgrade Notes
70
76
 
71
77
  * v0.4.1 may break backwards compatibility due to some changes to the Clip model. It may be best to start with a fresh clips table with 0.4.1.
72
78
 
73
- ### Todos
74
-
75
- * Refactor Clips controller to be totally RESTful.
76
- * Get tests written for all features, preferably with mocks if thats possible.
79
+ ### Created Using
80
+ * [Alertify](https://github.com/fabien-d/alertify.js/)
81
+ * [Bootstrap](http://twitter.github.com/bootstrap/)
82
+ * [CodeRay](http://coderay.rubychan.de/)
83
+ * [Database Cleaner](https://github.com/bmabey/database_cleaner)
84
+ * [DynamicForm](https://github.com/joelmoss/dynamic_form)
85
+ * [Factory Girl](https://github.com/thoughtbot/factory_girl)
86
+ * [jQuery for Rails](https://github.com/indirect/jquery-rails)
87
+ * [Kaminari](https://github.com/amatsuda/kaminari)
88
+ * [RSpec for Rails](https://github.com/rspec/rspec-rails)
89
+ * [Ruby on Rails](http://rubyonrails.org/)
90
+ * [Sqlite](https://www.sqlite.org/)
91
+ * [Whenever](https://github.com/javan/whenever)
92
+ * [Zero Clipboard](https://github.com/jonrohan/ZeroClipboard)
@@ -0,0 +1,3 @@
1
+ // Simple Set Clipboard System
2
+ // Author: Joseph Huckaby
3
+ window.ZeroClipboard={version:"1.0.8",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return typeof a=="string"&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){var b=this.className.split(/\s+/),c=-1;for(var d=0;d<b.length;d++)b[d]==a&&(c=d,d=b.length);return c>-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},newClient:function(){return new ZeroClipboard.Client},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};while(a&&a!=b)c.left+=a.offsetLeft,c.left+=a.style.borderLeftWidth?parseInt(a.style.borderLeftWidth):0,c.top+=a.offsetTop,c.top+=a.style.borderTopWidth?parseInt(a.style.borderTopWidth):0,a=a.offsetParent;return c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}},ZeroClipboard.Client.prototype={id:0,title:"",ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,zIndex:99,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a),this.domElement.style.zIndex&&(this.zIndex=parseInt(this.domElement.style.zIndex,10)+1),this.domElement.getAttribute("title")!=null&&(this.title=this.domElement.getAttribute("title")),typeof b=="string"?b=ZeroClipboard.$(b):typeof b=="undefined"&&(b=document.getElementsByTagName("body")[0]);var d=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div");var e=this.div.style;e.position="absolute",e.left=""+d.left+"px",e.top=""+d.top+"px",e.width=""+d.width+"px",e.height=""+d.height+"px",e.zIndex=this.zIndex;if(typeof c=="object")for(var f in c)e[f]=c[f];b.appendChild(this.div),this.div.innerHTML=this.getHTML(d.width,d.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b,e=this.title?' title="'+this.title+'"':"";if(navigator.userAgent.match(/MSIE/)){var f=location.href.match(/^https/i)?"https://":"http://";c+="<object"+e+' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+f+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>'}else c+="<embed"+e+' id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+d+'" wmode="transparent" />';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide());if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},setTitle:function(a){this.title=a},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100),this.ready=!0;return}this.ready=!0,this.movie.setText(this.clipText),this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var d=0,e=this.handlers[a].length;d<e;d++){var f=this.handlers[a][d];typeof f=="function"?f(this,b):typeof f=="object"&&f.length==2?f[0][f[1]](this,b):typeof f=="string"&&window[f](this,b)}}},typeof module!="undefined"&&(module.exports=ZeroClipboard);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Alertify
3
+ * An unobtrusive customizable JavaScript notification system
4
+ *
5
+ * @author Fabien Doiron <fabien.doiron@gmail.com>
6
+ * @copyright Fabien Doiron 2012
7
+ * @license MIT <http://opensource.org/licenses/mit-license.php>
8
+ * @link http://www.github.com/fabien-d
9
+ * @module Alertify
10
+ * @version 0.1.3
11
+ */
12
+ (function(e,t){"use strict";var n=e.document,r;r=function(){var r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;return g={buttons:{holder:'<nav class="alertify-buttons">{{buttons}}</nav>',ok:'<a href="#" class="alertify-button alertify-button-ok" id="aOK">{{ok}}</a>',cancel:'<a href="#" class="alertify-button alertify-button-cancel" id="aCancel">{{cancel}}</a>'},input:'<input type="text" class="alertify-text" id="aText">',message:'<p class="alertify-message">{{message}}</p>',log:'<article class="alertify-log{{class}}">{{message}}</article>'},y=5e3,E={ENTER:13,ESC:27},S={ok:"OK",cancel:"Cancel"},T=[],w=!1,r=function(e){return n.getElementById(e)},i=function(e){var i=r("aOK")||t,o=r("aCancel")||t,u=r("aText")||t,f=typeof i!="undefined",l=typeof o!="undefined",c="",p,d,v,m;p=function(t){v(t),typeof u!="undefined"&&(c=u.value),typeof e=="function"&&e(!0,c),typeof t.preventDefault!="undefined"&&t.preventDefault()},d=function(t){v(t),typeof e=="function"&&e(!1),typeof t.preventDefault!="undefined"&&t.preventDefault()},v=function(e){a(),h(n.body,"keyup",m)},m=function(e){var t=e.keyCode;t===E.ENTER&&f?p(e):t===E.ESC&&l&&d(e)},f&&s(i,"click",p),l&&s(o,"click",d),n.activeElement.blur(),s(n.body,"keyup",m)},s=function(e,t,n){typeof e.addEventListener=="function"?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},o=function(e){var t="",n=e.type,r=e.message;t+='<div class="alertify-dialog">',t+='<article class="alertify-inner">',t+=g.message.replace("{{message}}",r),n==="prompt"&&(t+=g.input),t+=g.buttons.holder,t+="</article>",t+="</div>";switch(n){case"confirm":case"prompt":t=t.replace("{{buttons}}",g.buttons.cancel+g.buttons.ok),t=t.replace("{{ok}}",S.ok).replace("{{cancel}}",S.cancel);break;case"alert":t=t.replace("{{buttons}}",g.buttons.ok),t=t.replace("{{ok}}",S.ok);break;default:}return b.className="alertify alertify-show alertify-"+n,m.className="alertify-cover",t},u=function(){setTimeout(function(){var e=x.childNodes[x.childNodes.length-1];typeof e!="undefined"&&x.removeChild(e)},y)},a=function(){T.splice(0,1),T.length>0?c():(w=!1,b.className="alertify alertify-hide alertify-hidden",m.className="alertify-cover alertify-hidden")},f=function(){n.createElement("nav"),n.createElement("article"),n.createElement("section"),m=n.createElement("div"),m.setAttribute("id","alertifycover"),m.className="alertify-cover alertify-hidden",n.body.appendChild(m),b=n.createElement("section"),b.setAttribute("id","alertify"),b.className="alertify alertify-hidden",n.body.appendChild(b),x=n.createElement("section"),x.setAttribute("id","alertifylogs"),x.className="alertify-logs",n.body.appendChild(x),delete this.init},l=function(e,t){var r=n.createElement("article");r.className="alertify-log"+(typeof t=="string"&&t!==""?" alertify-log-"+t:""),r.innerHTML=e,x.insertBefore(r,x.firstChild),setTimeout(function(){r.className=r.className+" alertify-log-show"},50),u()},c=function(){var t=T[0];w=!0,b.innerHTML=o(t),i(t.callback),t.type==="prompt"&&e.setTimeout(function(){n.getElementById("aText").focus()},0)},h=function(e,t,n){typeof e.removeEventListener=="function"?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},p=function(e,t,n){var r=function(){if(b&&b.scrollTop!==null)return;r()};if(typeof e!="string")throw new Error("message must be a string");if(typeof t!="string")throw new Error("type must be a string");if(typeof n!="undefined"&&typeof n!="function")throw new Error("fn must be a function");return typeof this.init=="function"&&(this.init(),r()),T.push({type:t,message:e,callback:n}),w||c(),this},d=function(e){return function(t){v(t,e)}},v=function(e,t){var n=function(){if(x&&x.scrollTop!==null)return;n()};return typeof this.init=="function"&&(this.init(),n()),l(e,t),this},{alert:function(e,t){return p.call(this,e,"alert",t),this},confirm:function(e,t){return p.call(this,e,"confirm",t),this},extend:d,init:f,log:function(e,t){return v.call(this,e,t),this},prompt:function(e,t){return p.call(this,e,"prompt",t),this},success:function(e){return v.call(this,e,"success"),this},error:function(e){return v.call(this,e,"error"),this},delay:y,labels:S}},typeof define=="function"?define([],function(){return new r}):typeof e.alertify=="undefined"&&(e.alertify=new r)})(this);
@@ -13,3 +13,8 @@
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
15
  //= require_tree .
16
+ $(document).ready(function () {
17
+ $(".icon-search").click(function() {
18
+ document.search_form.submit();
19
+ });
20
+ });
@@ -4,4 +4,5 @@
4
4
  $(document).ready(function () {
5
5
  //enable all tool-tips
6
6
  $(".icon-question-sign").tooltip();
7
- });
7
+ });
8
+
@@ -0,0 +1,8 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
5
+ .developers {
6
+ border-left: solid 1px #E5E5E5;
7
+ text-align: center;
8
+ }
@@ -0,0 +1,155 @@
1
+ .alertify-show,
2
+ .alertify-log {
3
+ -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1); /* older webkit */
4
+ -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
5
+ -moz-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
6
+ -ms-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
7
+ -o-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
8
+ transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); /* easeOutBack */
9
+ }
10
+ .alertify-hide {
11
+ -webkit-transition: all 250ms cubic-bezier(0.600, 0, 0.735, 0.045); /* older webkit */
12
+ -webkit-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
13
+ -moz-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
14
+ -ms-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
15
+ -o-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
16
+ transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */
17
+ }
18
+ .alertify-cover {
19
+ position: fixed; z-index: 99999;
20
+ top: 0; right: 0; bottom: 0; left: 0;
21
+ }
22
+ .alertify {
23
+ position: fixed; z-index: 99999;
24
+ top: 50px; left: 50%;
25
+ width: 550px;
26
+ margin-left: -275px;
27
+ }
28
+ .alertify-hidden {
29
+ top: -50px;
30
+ visibility: hidden;
31
+ }
32
+ .alertify-logs {
33
+ position: fixed;
34
+ z-index: 5000;
35
+ bottom: 10px;
36
+ right: 10px;
37
+ width: 300px;
38
+ }
39
+ .alertify-log {
40
+ display: block;
41
+ margin-top: 10px;
42
+ position: relative;
43
+ right: -300px;
44
+ }
45
+ .alertify-log-show {
46
+ right: 0;
47
+ }
48
+ .alertify-dialog {
49
+ padding: 25px;
50
+ }
51
+ .alertify-inner {
52
+ text-align: center;
53
+ }
54
+ .alertify-text {
55
+ margin-bottom: 15px;
56
+ width: 100%;
57
+ -webkit-box-sizing: border-box;
58
+ -moz-box-sizing: border-box;
59
+ box-sizing: border-box;
60
+ font-size: 100%;
61
+ }
62
+ .alertify-buttons {
63
+ }
64
+ .alertify-button {
65
+ display: inline-block;
66
+ cursor: pointer;
67
+ margin-left: 5px;
68
+ }
69
+
70
+ @media only screen and (max-width: 680px) {
71
+ .alertify,
72
+ .alertify-logs {
73
+ width: 90%;
74
+ -webkit-box-sizing: border-box;
75
+ -moz-box-sizing: border-box;
76
+ box-sizing: border-box;
77
+ }
78
+ .alertify {
79
+ left: 5%;
80
+ margin: 0;
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Default Look and Feel
86
+ */
87
+ .alertify,
88
+ .alertify-log {
89
+ font-family: sans-serif;
90
+ }
91
+ .alertify {
92
+ background: #FFF;
93
+ border: 10px solid #333; /* browsers that don't support rgba */
94
+ border: 10px solid rgba(0,0,0,.7);
95
+ border-radius: 8px;
96
+ box-shadow: 0 3px 3px rgba(0,0,0,.3);
97
+ -webkit-background-clip: padding; /* Safari 4? Chrome 6? */
98
+ -moz-background-clip: padding; /* Firefox 3.6 */
99
+ background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */
100
+ }
101
+ .alertify-text {
102
+ border: 1px solid #CCC;
103
+ padding: 10px;
104
+ border-radius: 4px;
105
+ }
106
+ .alertify-button {
107
+ border-radius: 4px;
108
+ color: #FFF;
109
+ font-weight: bold;
110
+ padding: 6px 15px;
111
+ text-decoration: none;
112
+ text-shadow: 1px 1px 0 rgba(0,0,0,.5);
113
+ box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5);
114
+ background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
115
+ background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
116
+ background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
117
+ background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
118
+ background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
119
+ }
120
+ .alertify-button:hover,
121
+ .alertify-button:focus {
122
+ background-image: -webkit-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
123
+ background-image: -moz-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
124
+ background-image: -ms-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
125
+ background-image: -o-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
126
+ background-image: linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
127
+ }
128
+ .alertify-button:active {
129
+ position: relative;
130
+ top: 1px;
131
+ }
132
+ .alertify-button-cancel {
133
+ background-color: #FE1A00;
134
+ border: 1px solid #D83526;
135
+ }
136
+ .alertify-button-ok {
137
+ background-color: #5CB811;
138
+ border: 1px solid #3b7808;
139
+ }
140
+ .alertify-log {
141
+ background: #1F1F1F;
142
+ background: rgba(0,0,0,.9);
143
+ padding: 15px;
144
+ border-radius: 4px;
145
+ color: #FFF;
146
+ text-shadow: -1px -1px 0 rgba(0,0,0,.5);
147
+ }
148
+ .alertify-log-error {
149
+ background: #FE1A00;
150
+ background: rgba(254,26,0,.9);
151
+ }
152
+ .alertify-log-success {
153
+ background: #5CB811;
154
+ background: rgba(92,184,17,.9);
155
+ }
@@ -2,3 +2,84 @@
2
2
  Place all the styles related to the matching controller here.
3
3
  They will automatically be included in application.css.
4
4
  */
5
+
6
+ .bordered {
7
+ border: 1px solid #dddddd;
8
+ border-collapse: separate;
9
+ *border-collapse: collapse;
10
+ /*border-left: 0;*/
11
+ -webkit-border-radius: 4px;
12
+ -moz-border-radius: 4px;
13
+ border-radius: 4px;
14
+ }
15
+
16
+ .bordered div {
17
+ margin: 5px;
18
+ }
19
+
20
+ .title {
21
+ border-bottom: 1px solid #ddd;
22
+ }
23
+
24
+ .help-tip label{
25
+ display: inline;
26
+ }
27
+
28
+ .image-feed {
29
+ width: 14px;
30
+ height: 14px;
31
+ background:url("../clipster/rss_logo_small.png");
32
+ }
33
+
34
+ .icon-copy {
35
+ background-size:14px 14px;
36
+ background-repeat:no-repeat;
37
+ background:url("../clipster/custom-clipboard.png");
38
+ }
39
+
40
+ .hover {
41
+ color: #333333;
42
+ text-decoration: none;
43
+ background-color: #e6e6e6;
44
+ *background-color: #d9d9d9;
45
+ /* Buttons in IE7 don't get borders, so darken on hover */
46
+
47
+ background-position: 0 -15px;
48
+ -webkit-transition: background-position 0.1s linear;
49
+ -moz-transition: background-position 0.1s linear;
50
+ -o-transition: background-position 0.1s linear;
51
+ transition: background-position 0.1s linear;
52
+ }
53
+
54
+ .clip {
55
+ overflow: auto;
56
+ }
57
+
58
+ .clip pre{
59
+ white-space: pre;
60
+ word-wrap: normal;
61
+ word-break: normal;
62
+ }
63
+
64
+ .navbar-search .search-query {
65
+ border-radius: 15px 0 0 15px;
66
+ padding: 4px 14px;
67
+ border-right-style: none;
68
+ }
69
+
70
+ .input-append .add-on:last-child {
71
+ border-radius: 0 15px 15px 0;
72
+ -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
73
+ background-color: #FFFFFF;
74
+ border: 1px solid #CCCCCC;
75
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
76
+ border-left-style: none;
77
+ }
78
+
79
+ .navbar-inverse .input-append .add-on:last-child
80
+ {
81
+ -moz-transition: none 0s ease 0s;
82
+ background-color: #515151;
83
+ border-color: #111111;
84
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset, 0 1px 0 rgba(255, 255, 255, 0.15);
85
+ }
@@ -0,0 +1,8 @@
1
+ require_dependency "clipster/application_controller"
2
+
3
+ module Clipster
4
+ class AboutController < ApplicationController
5
+ def index
6
+ end
7
+ end
8
+ end
@@ -2,12 +2,8 @@ require_dependency "clipster/application_controller"
2
2
 
3
3
  module Clipster
4
4
  class ClipsController < ApplicationController
5
- def index
6
- create
7
- render 'create'
8
- end
9
5
 
10
- def list
6
+ def clips
11
7
  # get all clips, with the newest clip first
12
8
  if params[:lang].nil?
13
9
  @clips = Clip.public.order('created_at DESC').page(params[:page])
@@ -15,7 +11,6 @@ module Clipster
15
11
  @clips = Clip.language_for_public(params[:lang]).order('created_at DESC').page(params[:page])
16
12
  end
17
13
 
18
- @languages = Clip.public.select("language, count(*) as count").group(:language)
19
14
  @updated_at = @clips.first.updated_at unless @clips.empty?
20
15
 
21
16
  respond_to do |format|
@@ -24,24 +19,21 @@ module Clipster
24
19
  end
25
20
  end
26
21
 
27
- # TODO: refactor to do proper RESTful controller
28
22
  def new
29
- create
30
- render 'create'
23
+ @clip = Clip.new()
31
24
  end
32
25
 
33
26
  def create
34
27
  @clip = Clip.new(params[:clip])
35
28
 
36
29
  #only do validation if something was actually posted.
37
- if !params[:clip].nil? && @clip.valid?
30
+ if @clip.valid?
38
31
  @clip.save
39
32
  redirect_to @clip
40
33
  return #early return so we don't have else statement
41
34
  end
42
35
 
43
- # Get all languages we have syntax for and remove debugging languages.
44
- @languages = get_languages
36
+ render :new # didn't pass validation
45
37
  end
46
38
 
47
39
  def show
@@ -53,34 +45,25 @@ module Clipster
53
45
  if @clip.nil?
54
46
  # Most likely the clip is expired, take advantage of this time to
55
47
  # clean up all expired clips, then display error page
56
- Clip.delete_expired_clips
48
+ Clip.delete_expired
57
49
  render :expired
58
50
  return
59
51
  end
52
+
53
+ respond_to do |format|
54
+ format.html
55
+ format.text
56
+ end
60
57
  end
61
58
 
62
59
  def search
63
60
  @clips = Clip.search(params[:search_term]).page(params[:page])
64
-
65
- p '\n\n\n\n'
66
- p @clips
67
-
68
- @languages = Clip.select("language, count(*) as count").group(:language)
69
-
70
- render 'list' unless @clips.nil?
71
- end
72
-
73
- def about
61
+ render :clips
74
62
  end
75
63
 
76
- private
77
-
78
- def get_languages
79
- languages = CodeRay::Scanners.all_plugins
80
- languages.delete(CodeRay::Scanners::Raydebug)
81
- languages.delete(CodeRay::Scanners::Debug)
82
-
83
- languages
64
+ def preview
65
+ @clip = Clip.new(params[:clip])
66
+ render :partial => 'clipster/common/clip', :object => @clip
84
67
  end
85
68
  end
86
69
  end
@@ -1,4 +1,4 @@
1
1
  module Clipster
2
- module ClipHelper
2
+ module AboutHelper
3
3
  end
4
4
  end