Permalink
Browse files

Self doc for postMessage

  • Loading branch information...
1 parent 27d631a commit 9c3d03b46a96458cd88310ef48ecbf1ad74b839f Andy Zhang committed Mar 25, 2013
View
@@ -26,6 +26,7 @@ end
gem 'jquery-rails'
gem 'haml-rails'
+gem 'redcarpet'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
View
@@ -83,6 +83,7 @@ GEM
rake (10.0.3)
rdoc (3.12.2)
json (~> 1.4)
+ redcarpet (2.2.2)
ref (1.0.4)
sass (3.2.7)
sass-rails (4.0.0.beta1)
@@ -127,6 +128,7 @@ DEPENDENCIES
jquery-rails
pg
rails (= 4.0.0.beta1)
+ redcarpet
sass-rails (~> 4.0.0.beta1)
sqlite3
therubyracer
@@ -15,3 +15,7 @@ $ ->
commentAuthor: $(e.currentTarget).find('.fyre-comment-username')[0].text
commentHTML: $(e.currentTarget).find('.fyre-comment')[0].innerHTML
window.opener.postMessage commentJSON, cmsLocation
+
+ $('.code a').click (event) ->
+ event.preventDefault()
+ $(@).next('codeblock').slideToggle()
@@ -1,2 +1,5 @@
.fyre-editor, .fyre-auth, .fyre-help
display: none
+
+.codeblock
+ display: none
@@ -0,0 +1,28 @@
+markdown:
+ javascript:
+
+ var cmsLocation;
+
+ cmsLocation = 'https://young-savannah-2721.herokuapp.com';
+ return fyre.conv.load({
+ network: 'thedailybeast.fyre.co'
+ }, [
+ {
+ siteId: '308094',
+ articleId: '/content/dailybeast/cheats/2013/03/20/weed-found-on-rihanna-s-tour-bus',
+ el: 'livefyre-app'
+ }
+ ], function(widget) {
+ return widget.on("initialRenderComplete", function(widget) {
+ return $('.fyre-comment-article').click(function(e) {
+ var commentJSON;
+
+ commentJSON = {
+ commentId: e.currentTarget.id.split('fyre-message-')[1],
+ commentAuthor: $(e.currentTarget).find('.fyre-comment-username')[0].text,
+ commentHTML: $(e.currentTarget).find('.fyre-comment')[0].innerHTML
+ };
+ return window.opener.postMessage(commentJSON, cmsLocation);
+ });
+ });
+ });
@@ -1 +1,5 @@
+%h1 Comment Stream
+.code
+ = link_to 'Example Code'
+ .codeblock= render 'send_comment'
#livefyre-app

0 comments on commit 9c3d03b

Please sign in to comment.