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.48 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.47 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.46 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.45 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.44 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.43 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.42 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.41 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.40 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.39 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.38 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.36 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.35 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.34 lib/onebox/engine/google_calendar_onebox.rb