bcms_tools 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 0.2.1
1
+ 0.2.2
2
2
 
data/bcms_tools.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bcms_tools}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["buzzware"]
12
- s.date = %q{2010-06-26}
12
+ s.date = %q{2010-07-21}
13
13
  s.description = %q{Tools for BrowserCms.}
14
14
  s.email = %q{contact@buzzware.com.au}
15
15
  s.extra_rdoc_files = [
@@ -126,6 +126,23 @@ Cms::FormBuilder.class_eval do
126
126
  template.concat("<br clear=\"all\" />") # Fixes issue with bad line wrapping
127
127
  template.concat("</div>")
128
128
  end
129
+
130
+ def bcmstools_check_box(aField,aOptions={})
131
+ result = "<br clear=\"all\" />" # Fixes issue with bad line wrapping
132
+ result += '<div class="fields text_fields">'
133
+ result += if aOptions[:label]
134
+ label aField, aOptions[:label]
135
+ else
136
+ label aField
137
+ end
138
+ ins = aOptions.delete(:instructions)
139
+ result += check_box(aField, aOptions)
140
+
141
+ result += "<div class=\"instructions\">#{ins}</div>" if aOptions[:instructions]
142
+ result += "<br clear=\"all\" />" # Fixes issue with bad line wrapping
143
+ result += "</div>"
144
+ result
145
+ end
129
146
 
130
147
  end
131
148
 
@@ -23,6 +23,53 @@ module ActionView
23
23
  EOS
24
24
  end
25
25
 
26
+ def mailto_a_friend(aSubject,aOptions={})
27
+ <<-EOS
28
+ <SCRIPT LANGUAGE="JavaScript">
29
+ <!-- Begin
30
+
31
+ //Script by Tronn: http://come.to/tronds
32
+ //Submitted to JavaScript Kit (http://javascriptkit.com)
33
+ //Visit http://javascriptkit.com for this script
34
+
35
+ var initialsubj="#{aSubject}"
36
+ var initialmsg="Hello! You may be interested in this : "+window.location+" \n \n \n"
37
+ var good;
38
+ function checkEmailAddress(field) {
39
+
40
+ var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
41
+ if (goodEmail) {
42
+ good = true;
43
+ }
44
+ else {
45
+ alert('Please enter a valid address.');
46
+ field.focus();
47
+ field.select();
48
+ good = false;
49
+ }
50
+ }
51
+ u = window.location;
52
+ function mailThisUrl() {
53
+ good = false
54
+ checkEmailAddress(document.mailto_a_friend.email);
55
+ if (good) {
56
+
57
+ //window.location = "mailto:"+document.mailto_a_friend.email.value+"?subject="+initialsubj+"&body="+document.title+" "+u;
58
+ window.location = "mailto:"+document.mailto_a_friend.email.value+"?subject="+initialsubj+"&body="+initialmsg
59
+ }
60
+ }
61
+ // End -->
62
+ </script>
63
+
64
+
65
+ <form class="mailto_a_friend" name="mailto_a_friend">
66
+ <input class="mailto_a_friend" type="text" name="email" size="26" value="Email Address Here" onFocus="this.value=''" onMouseOver="window.status='Enter email address here and tell a friend about this...'; return true" onMouseOut="window.status='';return true">
67
+ <input class="mailto_a_friend" type="button" value="Email to a friend" onMouseOver="window.status='Enter email address above and click this to send an email to a friend!'; return true" onMouseOut="window.status='';return true" onClick="mailThisUrl();">
68
+ </form>
69
+
70
+ EOS
71
+ end
72
+
26
73
  def default_content_for(name, &block)
27
74
  name = name.kind_of?(Symbol) ? ":#{name}" : name
28
75
  out = eval("yield #{name}", block.binding)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcms_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzzware
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-06-26 00:00:00 +08:00
12
+ date: 2010-07-21 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency