Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Still has a bunch of problems (Hash, stack traces, File.open)
- Loading branch information
1 parent
f51abc5
commit 4eaa9b0
Showing
107 changed files
with
386 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,10 @@ | ||
require 'silverlight' | ||
|
||
class Posts < SilverlightApplication | ||
def initialize | ||
super | ||
result = download "/posts.json" | ||
@posts = result.empty? ? [] : JSON.new.parse(result) | ||
render_posts :id => "posts" | ||
end | ||
|
||
def render_posts(options = {}) | ||
id, posts = options[:id], @posts | ||
if @posts.empty? | ||
output = "No posts! Add one below!" | ||
else | ||
output = "<table>" | ||
output += " <tr>" | ||
posts.first.keys.each do |key| | ||
output += " <th>#{key}</th>" | ||
end | ||
output += " </tr>" | ||
posts.each do |post| | ||
output += " <tr>" | ||
post.keys.each do |key| | ||
output += " <td>#{post[key]}</td>" | ||
end | ||
output += " </tr>" | ||
end | ||
output += "</table>" | ||
end | ||
document.send(id)[:innerHTML] = output | ||
def start | ||
@posts = get "posts", :format => 'ruby' | ||
render :partial => "posts/posts", :update => "posts" | ||
end | ||
end | ||
|
||
Posts.new | ||
Posts.new.start |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-9.01 KB
(80%)
public/ironruby/Microsoft.Scripting.Silverlight.dll
100644 → 100755
Binary file not shown.
Binary file not shown.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 26 additions & 15 deletions
41
vendor/plugins/silverline/client/lib/helpers/debug.rb
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
module Debug | ||
def self.puts(msg) | ||
if document.debug_print.nil? | ||
div = document.create_element('div') | ||
div[:id] = "debug_print" | ||
document.get_elements_by_tag_name("body").get_Item(0).append_child(div) | ||
end | ||
document.debug_print[:innerHTML] = "#{document.debug_print.innerHTML}<hr />#{msg}" | ||
def self.included(base) | ||
base.extend(ClassMethods) | ||
base.include(InstanceMethods) | ||
end | ||
def puts(msg) | ||
self.class.puts(msg) | ||
|
||
module ClassMethods | ||
def puts(msg) | ||
if document.debug_print.nil? | ||
div = document.create_element('div') | ||
div[:id] = "debug_print" | ||
document.get_elements_by_tag_name("body").get_Item(0).append_child(div) | ||
end | ||
document.debug_print[:innerHTML] = "#{document.debug_print.innerHTML}<hr />#{msg}" | ||
end | ||
|
||
def debug_puts(msg) | ||
self.puts(msg) if $DEBUG | ||
end | ||
end | ||
|
||
def self.debug_puts(msg) | ||
puts(msg) if $DEBUG | ||
end | ||
def debug_puts(msg) | ||
self.class.debug_puts(msg) | ||
|
||
module InstanceMethods | ||
def puts(msg) | ||
self.class.puts(msg) | ||
end | ||
|
||
def debug_puts(msg) | ||
self.class.debug_puts(msg) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.