Sha256: a877ee185734c516e85f164dbaf2b29b62cb0acb5a57091de8ba465e494a2a83

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

module Scrivito

  module EditingHelper

    def generator_meta_tag
      content = 'Scrivito by Infopark AG (scrivito.com)'
      content << "; Version #{GemInfo.version}" if inplace_editing_allowed?
      tag :meta, name: 'generator', content: content
    end

    def include_editing_stylesheet
      (inplace_editing_allowed? ? stylesheet_link_tag(:scrivito_editing) : '').html_safe
    end

    def widget_reset_stylesheet
      stylesheet = '*[data-scrivito-field-type="widget"],' \
          ' *[data-scrivito-private-widget-id] { position: relative; }'
      content_tag(:style, stylesheet, {type: 'text/css'}, false)
    end

    def include_editing_javascript
      (inplace_editing_allowed? ? render('scrivito/editing_javascript') : '').html_safe
    end

    def scrivito_client_config
      client_config = ClientConfig.new(@obj, cms_editing_context, lookup_context,
          resource: @scrivito_resource, return_to: params[:return_to])
      client_config.to_json.html_safe
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scrivito_sdk-0.18.1 app/helpers/scrivito/editing_helper.rb
scrivito_sdk-0.18.0 app/helpers/scrivito/editing_helper.rb
scrivito_sdk-0.17.0 app/helpers/scrivito/editing_helper.rb