Permalink
Browse files

generate example markup

  • Loading branch information...
1 parent c37bc63 commit d3cde3feb88f1e726544d6e053501125b76770e1 @rcsteins rcsteins committed Jun 22, 2012
Showing with 48 additions and 25 deletions.
  1. +1 −1 Gemfile
  2. +6 −7 Gemfile.lock
  3. +8 −6 lib/deploy.rb
  4. +5 −3 public/AccountEventsWidget/example.html
  5. +21 −7 public/CalendarEventsWidget/example.html
  6. +7 −1 public/index.html
View
@@ -5,7 +5,7 @@ gem 'json', '1.6.5'
gem 'rack', '1.3.6'
gem 'haml', '3.1.4'
gem 'unicorn', '4.2.0'
-gem "nokogiri", "~> 1.5.0"
+gem "nokogiri", " 1.5.0"
gem "fog", "~> 1.0.0"
gem "ruby-debug", '0.10.4'
gem "htmlentities", "~> 4.1.0"
View
@@ -54,19 +54,19 @@ GEM
addressable
linecache (0.46)
rbx-require-relative (> 0.0.4)
- mime-types (1.18)
+ mime-types (1.19)
multi_json (1.0.4)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.1.4)
- nokogiri (1.5.2)
+ nokogiri (1.5.0)
rack (1.3.6)
rack-protection (1.2.0)
rack
rack-test (0.6.1)
rack (>= 1.0)
rainbow (1.1.4)
- raindrops (0.9.0)
+ raindrops (0.10.0)
rake (0.9.2.2)
rbx-require-relative (0.0.9)
rspec (2.8.0)
@@ -83,10 +83,9 @@ GEM
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-hmac (0.4.0)
- rubyzip (0.9.8)
- selenium-webdriver (2.22.0)
+ rubyzip (0.9.9)
+ selenium-webdriver (2.24.0)
childprocess (>= 0.2.5)
- ffi (~> 1.0)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
@@ -120,7 +119,7 @@ DEPENDENCIES
jasmine (= 1.1.2)
jasmine-headless-webkit (~> 0.8.4)
json (= 1.6.5)
- nokogiri (~> 1.5.0)
+ nokogiri (= 1.5.0)
rack (= 1.3.6)
rake
rspec (= 2.8.0)
View
@@ -31,13 +31,15 @@ def deploy
# Copy the /demo.html file to an example.html file that shows the JavaScript code.
def generate_example
- demo_file = ''; File.open('public/AccountEventsWidget/demo.html').lines.each do |line|
- demo_file << line.gsub(/^(.*\').*(\'\;\s*\/\/example.*)$/) { "#{$1}#{$2}" }
- end
+ ['AccountEventsWidget','CalendarEventsWidget'].each do |folder_name|
+ demo_file = ''; File.open("public/#{folder_name}/demo.html").lines.each do |line|
+ demo_file << line.gsub(/^(.*\').*(\'\;\s*\/\/example.*)$/) { "#{$1}#{$2}" }
+ end
- example_template = File.open('public/example_template.html').read
- File.open('public/AccountEventsWidget/example.html', 'w') do |example|
- example.puts example_template.gsub(/\<\%\s*YIELD\s*\%\>/m, HTMLEntities.new.encode(demo_file))
+ example_template = File.open('public/example_template.html').read
+ File.open("public/#{folder_name}/example.html", 'w') do |example|
+ example.puts example_template.gsub(/\<\%\s*YIELD\s*\%\>/m, HTMLEntities.new.encode(demo_file))
+ end
end
end
@@ -1,9 +1,9 @@
<html>
<head>
-<title>AccountEventsWidget: example</title>
+<title>widgets.venuedriver.com -- example</title>
</head>
<body>
-<h1>AccountEventsWidget: example</h1>
+<h1>widgets.venuedriver.com -- example</h1>
<h3>Code To Embed</h3>
<p>Copy this example code, then set the API access token, then embed the widget in your HTML page.</p>
@@ -12,6 +12,7 @@
<blockquote>
<pre><code>&lt;html&gt;
&lt;head&gt;
+ &lt;title&gt;AccountEventsWidget: demo&lt;/title&gt;
&lt;link href=&quot;http://widgets.venuedriver.com/css/styles.css&quot; rel=&apos;stylesheet&apos; type=&apos;text/css&apos;/&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script&gt;
@@ -23,6 +24,7 @@
&lt;script src=&quot;http://widgets.venuedriver.com/js/AccountEventsWidget.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
+ &lt;h1&gt;AccountEventsWidget: demo&lt;/h1&gt;
&lt;div id=&quot;wrapper&quot;&gt;
&lt;div id=&quot;center_table&quot;&gt;
&lt;div id=&quot;selectevent_columnlabelbar&quot;&gt;
@@ -36,4 +38,4 @@
</p>
</body>
-</html>
+</html>
@@ -1,20 +1,34 @@
<html>
<head>
-<title>CalendarEventsWidget: example</title>
+<title>widgets.venuedriver.com -- example</title>
</head>
<body>
-<h1>CalendarEventsWidget: example</h1>
+<h1>widgets.venuedriver.com -- example</h1>
<h3>Code To Embed</h3>
-<p>Copy this example code, then set the options, then embed the widget in your HTML page.</p>
+<p>Copy this example code, then set the API access token, then embed the widget in your HTML page.</p>
<p>
<blockquote>
-<pre><code>
-
-</code></pre>
+<pre><code>&lt;html&gt;
+ &lt;head&gt;
+ &lt;title&gt;Calendar demo&lt;/title&gt;
+ &lt;link href=&quot;http://widgets.venuedriver.com/css/calendar.css&quot; rel=&apos;stylesheet&apos; type=&apos;text/css&apos;/&gt;
+ &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+ &lt;script src=&quot;http://widgets.venuedriver.com/js/lib/date.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+ &lt;script src=&quot;http://widgets.venuedriver.com/js/CalendarEventsWidget.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+ &lt;div id=&apos;cal-test&apos;&gt;
+ &lt;/div&gt;
+ &lt;script&gt;
+ $(&apos;#cal-test&apos;).AccountCalendar({account_id:1})
+ &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
+ </code></pre>
</blockquote>
</p>
</body>
-</html>
+</html>
View
@@ -26,6 +26,12 @@
<p>To display the widget on your web page, copy <a href="ReservationFormWidget/example.html">our example JavaScript code</a>, then set the API access token, then embed the widget in your HTML page. Here is a <a href="ReservationFormWidget/demo.html">live demo of the widget</a>.</p>
-<a href="cal">cal</a>
+<h3>CalendarEventsWidget Prototype</h3>
+
+<p>this is the prototype for the new calendar widget</p>
+
+<p>To display the widget on your web page, copy <a href="CalendarEventsWidget/example.html">our example JavaScript code</a>, then set the API access token, then embed the widget in your HTML page. Here is a <a href="CalendarEventsWidget/demo.html">live demo of the widget</a>.</p>
+
+
</body>
</html>

0 comments on commit d3cde3f

Please sign in to comment.