Sha256: fa6fa4fd107ccd9de726d8f41b6a873a64198a13f308d4c0b10cbdb393db1eb7

Contents?: true

Size: 930 Bytes

Versions: 54

Compression:

Stored size: 930 Bytes

Contents

module Onebox
  module Engine
    class GoogleCalendarOnebox
      include Engine

      matches_regexp /^(https?:)?\/\/((www|calendar)\.google\.[\w.]{2,}|goo\.gl)\/calendar\/.+$/
      always_https

      def to_html
        url = @url.split('&').first
        src = ::Onebox::Helpers.normalize_url_for_output(url)
        "<iframe src='#{src}&rm=minimal' style='border: 0' width='800' height='600' frameborder='0' scrolling='no'>#{placeholder_html}</iframe>"
      end

      def placeholder_html
        <<-HTML
          <div placeholder>
            <div class='gdocs-onebox gdocs-onebox-splash' style='display:table-cell;vertical-align:middle;width:800px;height:600px'>
              <div style='text-align:center;'>
                <div class='gdocs-onebox-logo g-calendar-logo'></div>
                <p>Google Calendar</p>
              </div>
            </div>
          </div>
        HTML
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
onebox-1.8.69 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.68 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.67 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.66 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.65 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.64 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.63 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.62 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.61 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.60 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.59 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.58 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.57 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.55 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.54 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.53 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.52 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.51 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.50 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.49 lib/onebox/engine/google_calendar_onebox.rb