bmf 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.asc +11 -0
  3. data.tar.gz.asc +11 -0
  4. data/bin/bmf +8 -0
  5. data/lib/bmf.rb +70 -0
  6. data/lib/bmf/lib/address_store.rb +45 -0
  7. data/lib/bmf/lib/alert.rb +53 -0
  8. data/lib/bmf/lib/bmf.rb +364 -0
  9. data/lib/bmf/lib/folder.rb +76 -0
  10. data/lib/bmf/lib/message.rb +27 -0
  11. data/lib/bmf/lib/message_store.rb +250 -0
  12. data/lib/bmf/lib/settings.rb +74 -0
  13. data/lib/bmf/lib/thread_status.rb +98 -0
  14. data/lib/bmf/lib/xmlrpc_client.rb +27 -0
  15. data/lib/bmf/public/bitbrowser.css~ +15 -0
  16. data/lib/bmf/public/bitmessageforum.css +50 -0
  17. data/lib/bmf/public/css/bootstrap.min.css +9 -0
  18. data/lib/bmf/public/images/apple-touch-icon-114x114.png +0 -0
  19. data/lib/bmf/public/images/apple-touch-icon-144x144.png +0 -0
  20. data/lib/bmf/public/images/apple-touch-icon-57x57.png +0 -0
  21. data/lib/bmf/public/images/apple-touch-icon-72x72.png +0 -0
  22. data/lib/bmf/public/images/apple-touch-icon.png +0 -0
  23. data/lib/bmf/public/images/favicon.ico +0 -0
  24. data/lib/bmf/public/js/bootstrap.min.js +6 -0
  25. data/lib/bmf/public/js/html5.js +9 -0
  26. data/lib/bmf/public/js/jquery-1.10.1.min.js +6 -0
  27. data/lib/bmf/public/js/messagePoll.js +24 -0
  28. data/lib/bmf/views/addresses.haml +23 -0
  29. data/lib/bmf/views/compose.haml +38 -0
  30. data/lib/bmf/views/couldnt_reach_pybitmessage.haml +24 -0
  31. data/lib/bmf/views/home.haml +12 -0
  32. data/lib/bmf/views/https_quick_start.haml +71 -0
  33. data/lib/bmf/views/identities.haml +32 -0
  34. data/lib/bmf/views/layout.haml +128 -0
  35. data/lib/bmf/views/messages.haml +55 -0
  36. data/lib/bmf/views/settings.haml +18 -0
  37. data/lib/bmf/views/subscriptions.haml +40 -0
  38. data/lib/bmf/views/threads.haml +46 -0
  39. metadata +163 -0
  40. metadata.gz.asc +11 -0
@@ -0,0 +1,55 @@
1
+ .breadcrumb
2
+ %a{:href => "/#{params[:folder]}/"}
3
+ = params[:folder]
4
+ >
5
+ %a{:href => "./" }
6
+ - if @addresses.has_key? @address
7
+ = @addresses[@address]['label']
8
+ - else
9
+ = @address
10
+ \-
11
+ &= @thread
12
+ - @messages.each do |message|
13
+ %div{:class => (message['_source'] == 'sent' ? "alert alert-success" : "alert")}
14
+
15
+ - message_time = BMF::Message.time(message)
16
+ - new = message_time > @thread_last_visited
17
+ %div
18
+ %b From:
19
+ - if @addresses.has_key? message['fromAddress']
20
+ = @addresses[message['fromAddress']]['label']
21
+ - else
22
+ = message['fromAddress']
23
+
24
+ %small
25
+ (#{BMF::Message.sent_or_received(message)}
26
+ = Time.at(message_time).to_datetime
27
+ )
28
+
29
+ - if new
30
+ %span{:class => "label label-success"}New!
31
+ - body = message['message']
32
+ - body = body.split("------------------------------------------------------").map { |line| line.strip}.select{|line| line != ""}
33
+ = safe_text body.first
34
+ - if body[1..-1] != []
35
+ %small
36
+ %i
37
+ [Hiding Quoted Text]
38
+
39
+ - if @folder.name == "chans"
40
+ %form.button.btn{:method => :get, :action => "/messages/compose/"}
41
+ %input{:type => :hidden, :name => :to, :value => @address}
42
+ %input{:type => :hidden, :name => :subject, :value => "Re: " + @thread}
43
+ %input{:type => :hidden, :name => :reply_to, :value => message['msgid']}
44
+ %input.small_button{:type => :submit, :value => "Reply Chan"}
45
+  
46
+ - if @folder.name != "chans" || (@address != message['fromAddress'])
47
+ %form.button{:method => :get, :action => "/messages/compose/" }
48
+ %input{:type => :hidden, :name => :to, :value => message['fromAddress']}
49
+ %input{:type => :hidden, :name => :subject, :value => "Re: " + @thread}
50
+ %input{:type => :hidden, :name => :reply_to, :value => message['msgid']}
51
+ %input.small_button{:type => :submit, :value => "Reply"}
52
+ %form.button{:method => :post, :action => "/messages/delete/", :onsubmit => "return confirm('Really delete?')"}
53
+ %input{:type => :hidden, :name => :msgid, :value => message['msgid']}
54
+ %input.small_button{:type => :submit, :value => "Delete"}
55
+ .clear
@@ -0,0 +1,18 @@
1
+ %h1 Edit Settings
2
+
3
+ - if @flash
4
+ .new_messages
5
+ = @flash
6
+
7
+ %form{:method => :post, :action => "/settings/update"}
8
+ %table
9
+ - @settings.each_pair do |key, value|
10
+ %tr
11
+ %th= key
12
+ %td= BMF::Settings::SETTINGS_AND_DESCRIPTIONS[key]
13
+ %td
14
+ %input{:type => :text, :name => key, :value => value, :size => 50}
15
+
16
+ %tr
17
+ %th{:colspan => 3}
18
+ %input{:type => :submit}
@@ -0,0 +1,40 @@
1
+ %h1 Subscriptions
2
+
3
+ %h2 Add New Subscription
4
+
5
+ %form{:method => :post, :action => "/subscriptions/create/"}
6
+ %label Label
7
+ %input.form-control{:type => :text, :name => :label, :value => params[:label], :size => 50}
8
+ %label Address
9
+ %input.form-control{:type => :text, :name => :address, :value => params[:address], :size => 50}
10
+
11
+ %input.btn{:type => :submit, :value => "Add New Subscription"}
12
+
13
+ %h2 Delete Subscription
14
+ %form{:method => :post, :action => "/subscriptions/delete/", :onsubmit => "return confirm('Are you sure');"}
15
+ %table
16
+ %tr
17
+ %th Address
18
+ %td
19
+ %input.form-control{:type => :text, :name => :address, :size => 50}
20
+ %tr
21
+ %th{:colspan => 2}
22
+ %input.btn{:type => :submit, :value => "Delete Subscription"}
23
+
24
+
25
+ %h2 Current Subscriptions
26
+
27
+ - if @subscriptions.empty?
28
+ %p
29
+ %i
30
+ You either don't have any subscriptions, or your version of PyBitmessage doesn't support the listSubscriptions API call.
31
+ - else
32
+ %table.table.table-striped
33
+ %tr
34
+ %th Label
35
+ %th Address
36
+ - @subscriptions.each do |subscription|
37
+ - next if !subscription['enabled']
38
+ %tr
39
+ %th= Base64.decode64(subscription['label']).force_encoding('utf-8')
40
+ %td= subscription['address']
@@ -0,0 +1,46 @@
1
+ .breadcrumb
2
+ %a{:href => "/#{params[:folder]}/"}
3
+ = params[:folder]
4
+ >
5
+ - if @addresses.has_key? @address
6
+ = @addresses[@address]['label']
7
+ - else
8
+ = @address
9
+
10
+ %form{:method => :get, :action => "/messages/compose/"}
11
+ %input{:type => :hidden, :name => :to, :value => params[:folder] == 'lists' ? @threads.first[1].first['fromAddress'] : @address}
12
+ %input.btn.btn{:type => :submit, :value => (params[:folder] == "chans" ? "Start New Thread" : "Send Message") }
13
+
14
+ %form.form-inline{:method => :post, :name => :bulk_update , :action => "/#{params[:folder]}/thread/bulk_modify", :onsubmit => "if (document.forms['bulk_update']['update_action'].value == 'delete'){return confirm('Really delete selected threads?')}else{return true;};" }
15
+
16
+ %br
17
+ %input{:type => :hidden, :name => :address, :value => @address}
18
+ .alert
19
+ - thread_no = 0
20
+ - @threads.each do |thread, messages|
21
+ - thread_no += 1
22
+ - new = BMF::ThreadStatus.instance.new_messages?(@address, thread)
23
+ %div
24
+ %input{:type => :checkbox, :name => "thread__#{thread_no}", :value=> thread}
25
+ %a{:href => "./#{CGI.escape(thread)}"}
26
+ - if thread == " "
27
+  
28
+ - else
29
+ &= thread
30
+
31
+ %small
32
+ Updated:
33
+ = Time.at(BMF::MessageStore.instance.thread_last_updates[@address][thread]).to_datetime
34
+
35
+ - if new
36
+ %span{:class => "label label-success"}New!
37
+
38
+ %input.btn.btn{:type => :submit, :value => "Go!"}
39
+ %select.form-control{:name => :update_action, :style => "width: 200px" }
40
+ %option{:value => :noop}
41
+ %option{:value => :delete}
42
+ Delete Selected
43
+ %option{:value => :mark_read}
44
+ Mark Selected Read
45
+ %option{:value => :mark_all_read}
46
+ Mark All Read
metadata ADDED
@@ -0,0 +1,163 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bmf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Grant T. Olson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.5.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.5.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 1.4.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: sinatra-contrib
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 1.4.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: haml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 4.0.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: sanitize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rdiscount
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Browse bitmessages in a forum-like environment.
98
+ email: kgo@grant-olson.net
99
+ executables:
100
+ - bmf
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/bmf.rb
105
+ - lib/bmf/lib/message_store.rb
106
+ - lib/bmf/lib/message.rb
107
+ - lib/bmf/lib/address_store.rb
108
+ - lib/bmf/lib/thread_status.rb
109
+ - lib/bmf/lib/bmf.rb
110
+ - lib/bmf/lib/alert.rb
111
+ - lib/bmf/lib/settings.rb
112
+ - lib/bmf/lib/xmlrpc_client.rb
113
+ - lib/bmf/lib/folder.rb
114
+ - lib/bmf/views/messages.haml
115
+ - lib/bmf/views/compose.haml
116
+ - lib/bmf/views/layout.haml
117
+ - lib/bmf/views/threads.haml
118
+ - lib/bmf/views/couldnt_reach_pybitmessage.haml
119
+ - lib/bmf/views/settings.haml
120
+ - lib/bmf/views/home.haml
121
+ - lib/bmf/views/identities.haml
122
+ - lib/bmf/views/https_quick_start.haml
123
+ - lib/bmf/views/subscriptions.haml
124
+ - lib/bmf/views/addresses.haml
125
+ - lib/bmf/public/js/bootstrap.min.js
126
+ - lib/bmf/public/js/messagePoll.js
127
+ - lib/bmf/public/js/jquery-1.10.1.min.js
128
+ - lib/bmf/public/js/html5.js
129
+ - lib/bmf/public/css/bootstrap.min.css
130
+ - lib/bmf/public/bitbrowser.css~
131
+ - lib/bmf/public/images/apple-touch-icon-72x72.png
132
+ - lib/bmf/public/images/apple-touch-icon-114x114.png
133
+ - lib/bmf/public/images/apple-touch-icon-57x57.png
134
+ - lib/bmf/public/images/favicon.ico
135
+ - lib/bmf/public/images/apple-touch-icon-144x144.png
136
+ - lib/bmf/public/images/apple-touch-icon.png
137
+ - lib/bmf/public/bitmessageforum.css
138
+ - bin/bmf
139
+ homepage: https://github.com/grant-olson/BitMessageForum
140
+ licenses:
141
+ - BSD
142
+ metadata: {}
143
+ post_install_message:
144
+ rdoc_options: []
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - '>='
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - '>='
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubyforge_project:
159
+ rubygems_version: 2.0.6
160
+ signing_key:
161
+ specification_version: 4
162
+ summary: BitMessageForum!
163
+ test_files: []
metadata.gz.asc ADDED
@@ -0,0 +1,11 @@
1
+ -----BEGIN PGP SIGNATURE-----
2
+ Version: GnuPG v1.4.12 (GNU/Linux)
3
+
4
+ iQEcBAABAgAGBQJR/lRGAAoJEP5F5V2hilTWpVsH/RBMpNChxco1M756zoPEJ+uT
5
+ iptDu3PjAaV1d1gtrGDuoKn9PIOH9ppwWPo1xE/3aKTT+6HzELG2HuIm2Rh32XyP
6
+ FqFy1tDBFaxwUsAD2aBMtbW5CuGC8B0cj9nPvET+m+kt8yszFp137m1MgfNpPND/
7
+ 8okAcuHu+tWVwwvbnyxk0YBsaVmNosLCRHPLibl5gYNL7CUKFv/0GV6B/bFPkt1N
8
+ OF4okf6lyu0sLVshJJjuA+CkAAxnsIAH4xmBxLDhlC8ZZQJUTheN1VfbQdV4S83f
9
+ 0EX3RSCNtDDxOYjLiulxFXPdPlcY0BY4hwQSrnI1w4vtItF4Lg3z2HchcvBjLwg=
10
+ =8hse
11
+ -----END PGP SIGNATURE-----