Permalink
Browse files

initial refactoring

  • Loading branch information...
addyosmani committed Apr 25, 2011
1 parent 5de4a56 commit 1e96d110481a45d0608cfe1b97b48347fb29ffa5
View
@@ -0,0 +1,155 @@
+html, body {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ font-family: "Helvetica Neue", helvetica, arial, sans-serif;
+ font-size: 14px;
+ line-height: 1.4em;
+ background: #eeeeee;
+ color: #333333;
+}
+
+#views {
+ width: 520px;
+ margin: 0 auto 40px auto;
+ background: white;
+
+ -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
+ -o-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
+ box-shadow: rgba(0, 0, 0, 0.2) 0 2px 6px 0;
+
+ -moz-border-radius: 0 0 5px 5px;
+ -o-border-radius: 0 0 5px 5px;
+ -webkit-border-radius: 0 0 5px 5px;
+ border-radius: 0 0 5px 5px;
+}
+
+#tasks {
+ padding: 20px;
+}
+
+#tasks h1 {
+ font-size: 36px;
+ font-weight: bold;
+ text-align: center;
+ padding: 0 0 10px 0;
+}
+
+#tasks input[type="text"] {
+ width: 466px;
+ font-size: 24px;
+ font-family: inherit;
+ line-height: 1.4em;
+ border: 0;
+ outline: none;
+ padding: 6px;
+ border: 1px solid #999999;
+
+ -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
+ -o-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
+ box-shadow: rgba(0, 0, 0, 0.2) 0 1px 2px 0 inset;
+}
+
+#tasks input::-webkit-input-placeholder {
+ font-style: italic;
+}
+
+#tasks .items {
+ margin: 10px 0;
+ list-style: none;
+}
+
+#tasks .item {
+ padding: 15px 20px 15px 0;
+ position: relative;
+ font-size: 24px;
+ border-bottom: 1px solid #cccccc;
+}
+
+#tasks .item.done span {
+ color: #777777;
+ text-decoration: line-through;
+}
+
+#tasks .item .destroy {
+ position: absolute;
+ right: 10px;
+ top: 16px;
+ display: none;
+ cursor: pointer;
+ width: 20px;
+ height: 20px;
+ background: url(../img/destroy.png) no-repeat center center;
+}
+
+#tasks .item:hover .destroy {
+ display: block;
+}
+
+#tasks .item .edit { display: none; }
+#tasks .item.editing .edit { display: block; }
+#tasks .item.editing .view { display: none; }
+#tasks .item .original { clear:both; font-size:11px;}
+
+#tasks footer {
+ display: block;
+ margin: 20px -20px -20px -20px;
+ overflow: hidden;
+
+ color: #555555;
+ background: #f4fce8;
+ border-top: 1px solid #ededed;
+ padding: 0 20px;
+ line-height: 36px;
+
+ -moz-border-radius: 0 0 5px 5px;
+ -o-border-radius: 0 0 5px 5px;
+ -webkit-border-radius: 0 0 5px 5px;
+ border-radius: 0 0 5px 5px;
+}
+
+#tasks .clear {
+ display: block;
+ float: right;
+ line-height: 20px;
+ text-decoration: none;
+
+ background: rgba(0, 0, 0, 0.1);
+ color: #555555;
+ font-size: 11px;
+ margin-top: 8px;
+ padding: 0 10px 1px;
+
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ -o-border-radius: 12px;
+ border-radius: 12px;
+
+ -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
+ -o-box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
+ box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 0 0;
+
+ cursor: pointer;
+}
+
+#tasks .clear:hover {
+ background: rgba(0, 0, 0, 0.15);
+ -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
+ -o-box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
+ box-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0 0;
+}
+
+#tasks .clear:active {
+ position: relative;
+ top: 1px;
+}
+
+#tasks .count span {
+ font-weight: bold;
+}
View
Binary file not shown.
View
@@ -1,18 +1,16 @@
<!DOCTYPE html>
<html>
<head>
-
-
- <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
- <script src="spine.tmpl.js" type="text/javascript" charset="utf-8"></script>
- <script src="spine.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="spine.route.js" type="text/javascript" charset="utf-8"></script>
- <script src="jquery.bitlydfd.js" type="text/javascript"></script>
-<script src="spine.model.local.js" type="text/javascript" charset="utf-8"></script>
-
-
-<link rel="stylesheet" type="text/css" href="application.css"/>
+ <title>ShorterUrl</title>
+ <script src="js/jquery-1.5.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/spine.tmpl.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/spine.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/spine.route.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/jquery.bitlydfd.js" type="text/javascript"></script>
+ <script src="js/spine.model.local.js" type="text/javascript" charset="utf-8"></script>
+
+ <link rel="stylesheet" type="text/css" href="css/application.css"/>
<script type="text/javascript" charset="utf-8">
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,45 @@
+$.fn.bitlyShorten = function(options) {
+
+ var defaults = {
+ version: '2.0.1',
+ login: 'legacye',
+ apiKey: 'R_32f60d09cccde1f266bcba8c242bfb5a',
+ history: '0',
+ longUrl: '',
+ };
+
+ var args = arguments,
+ opts = $.extend(defaults,options),
+ collection = this,
+ result = "",
+ queryUrl = "http://api.bit.ly/shorten?"
+ +"version="+opts.version
+ +"&longUrl="+opts.longUrl
+ +"&login="+opts.login
+ +"&apiKey="+opts.apiKey
+ +"&history="+opts.history
+ +"&format=json&callback=?";
+
+ $.getJSON(queryUrl, function(data){
+ result = (data.results[defaults.longUrl].shortUrl);
+ })
+ .then(
+ function(){
+ if(result){
+ return collection.each(function() {
+ //$(this).val(result);
+ Task.create({name: result, original:opts.longUrl});
+ });
+ }
+ },
+ function(){
+ return collection.each(function() {
+ //$(this).val('Error: an issue was experienced when connecting to the bit.ly API');
+ alert('There was an error connecting to the Bit.ly API')
+ });
+ }
+);
+
+};
+
+
Oops, something went wrong.

0 comments on commit 1e96d11

Please sign in to comment.