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.89 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.88 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.87 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.86 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.85 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.84 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.83 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.82 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.81 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.80 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.79 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.78 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.77 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.76 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.75 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.74 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.73 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.72 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.71 lib/onebox/engine/google_calendar_onebox.rb
onebox-1.8.70 lib/onebox/engine/google_calendar_onebox.rb