Skip to content

Commit

Permalink
Update readme and blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbell committed Aug 17, 2012
1 parent 8ed6031 commit a299de4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

A place for Sir Trevor Blocks that don't come packaged as the default set.

# Documentation

Each BlockType should be documented with a header
# Block Types

1. Gist - written by (Chris Bell)[http://github.com/cjbell88]
2. Markdown - written by (Chris Bell)[http://github.com/cjbell88]
3. Ordered List - written by (Chris Bell)[http://github.com/cjbell88]
4. Tweet - written by (Chris Bell)[http://github.com/cjbell88]
2 changes: 0 additions & 2 deletions src/gist.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ var Gist = SirTrevor.BlockType.extend({

dropzoneHTML: template,

validate: function() {},

loadData: function(data){
this.loading();
this._super("loadGist", data.id);
Expand Down
8 changes: 2 additions & 6 deletions src/tweet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

var t_template = '<p>Drop tweet link here</p><div class="input text"><label>or paste URL:</label><input type="text" class="paste-block"></div>';
var tweet_template = '<div class="tweet media"><div class="img"><img src="<%= user.profile_image_url %>" class="tweet-avatar"></div><div class="bd tweet-body"><p><a href="http://twitter.com/#!/<%= user.screen_name %>">@<%= user.screen_name %></a>: <%= text %></p><time><%= created_at %></time></div></div>';

Expand All @@ -8,14 +7,12 @@ var Tweet = SirTrevor.BlockType.extend({
className: "tweet",
dropEnabled: true,

dropzoneHTML: template,

validate: function() {},
dropzoneHTML: t_template,

loadData: function(data){
this.$block.find(".dropzone").hide();
this.$el.show();
this.$el.html(_.template(t_template, data));
this.$el.html(_.template(tweet_template, data));
},

onContentPasted: function(event){
Expand Down Expand Up @@ -57,7 +54,6 @@ var Tweet = SirTrevor.BlockType.extend({
// Save this data on the block
var dataStruct = this.$el.data('block');
dataStruct.data = obj;

this.$el.html(_.template(tweet_template, obj)); // Render
this.$dropzone.hide();
this.$el.show();
Expand Down

0 comments on commit a299de4

Please sign in to comment.