All Projects → sul-dlss → sul-embed

sul-dlss / sul-embed

Licence: other
An oEmbed Service for Stanford University Libraries

Programming Languages

ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
SCSS
7915 projects
Handlebars
879 projects

Projects that are alternatives of or similar to sul-embed

SearchWorks
SearchWorks (Stanford University Libraries)
Stars: ✭ 42 (+180%)
Mutual labels:  application, access
app-application-logger
A small standalone Windows application to log the applications one is using
Stars: ✭ 13 (-13.33%)
Mutual labels:  application
view-admin-as
View the WordPress admin as a different role, switch between users, temporarily change your capabilities, set default screen settings for roles, manage your roles and capabilities.
Stars: ✭ 44 (+193.33%)
Mutual labels:  access
intuiter
Global productivity app for anyone who use Windows
Stars: ✭ 24 (+60%)
Mutual labels:  application
ANODA-Turn-Timer
ANODA Open Source iOS Swift example app
Stars: ✭ 19 (+26.67%)
Mutual labels:  application
ICNS2ICO
ICNS2ICO lets you easily convert icons from the Apple's ICNS format to the Windows ICO format.
Stars: ✭ 17 (+13.33%)
Mutual labels:  application
Time-and-Attendance-Management-System
TMS is a full-stack website that maintains records of all employees with their personal information. It keeps track of hours worked by an employee on a particular project assigned to him. It maintains time sheets and generates detailed and summary reports of the employee time sheets. TMS also has an admin page, which can manage all the employees…
Stars: ✭ 46 (+206.67%)
Mutual labels:  application
vue-js-3-firebase-firestore
Vue 3 Firebase Tutorial: Build Firestore CRUD Web Application
Stars: ✭ 34 (+126.67%)
Mutual labels:  application
gogen
Command-line tool to generate GO applications and libraries
Stars: ✭ 17 (+13.33%)
Mutual labels:  application
react-native-curated
💁‍♂️ Hand picked collection of packages, tutorials and more for React Native.
Stars: ✭ 43 (+186.67%)
Mutual labels:  application
English-Persian-Word-Database
English Persian Word Database - Popular database extensions
Stars: ✭ 19 (+26.67%)
Mutual labels:  access
tic-tac-toe
🕹 iOS game - classic Tic Tac Toe with AI and state machines [Swift + SpriteKit + GameplayKit].
Stars: ✭ 60 (+300%)
Mutual labels:  application
glassmorphism
Glassmorphic UI Package For Flutter || UI ||
Stars: ✭ 45 (+200%)
Mutual labels:  application
kinta
🛠️ Automate your mobile workflows in Kotlin 🛠️
Stars: ✭ 40 (+166.67%)
Mutual labels:  application
DroNet
DroNet: Efficient convolutional neural network detector for Real-Time UAV applications
Stars: ✭ 54 (+260%)
Mutual labels:  application
argo
The administrative discovery interface for Stanford's Digital Object Registry
Stars: ✭ 19 (+26.67%)
Mutual labels:  application
ecs-demo
Minimal demo App for the Fireblade Entity-Component System (ECS)
Stars: ✭ 20 (+33.33%)
Mutual labels:  application
guardian
Guardian is a tool for extensible and universal data access with automated access workflows and security controls across data stores, analytical systems, and cloud products.
Stars: ✭ 127 (+746.67%)
Mutual labels:  access
vaahcms
VaahCMS is a laravel based open-source web application development platform shipped with a headless content management system (CMS).
Stars: ✭ 56 (+273.33%)
Mutual labels:  application
Meteor-Files-Demo
Demo application for ostrio:files package
Stars: ✭ 16 (+6.67%)
Mutual labels:  application

CI | Code Climate

SUL-Embed

An oEmbed provider for embedding resources from the Stanford University Library.

Development/Test Sandbox

There is an embedded static page available at /pages/sandbox in your development and test environments. Make sure that you use the same host on the service input (first text field) as you are accessing the site from (e.g. localhost or 127.0.0.1).

oEmbed specification details

URL scheme: http://purl.stanford.edu/*

API endpoint: TBD

Example: TBD?url=http://purl.stanford.edu/zw200wd8767&format=json

Installing JavaScript dependencies using Yarn

Sul-Embed is starting to manage its JavaScript dependencies using Yarn.

To install needed JavaScript dependencies make sure to install them using:

$ yarn install

Creating Viewers

You can create a viewer by implementing a class with a pretty simple API.

The viewer class will be instantiated with an Embed::Request object. The initialize method is included in the CommonViewer parent class but can be overridden.

module Embed
  class Viewer
    class DemoViewer < CommonViewer
    end
  end
end

The class must define a class method returning an array of which types it will support. These types are derived from the type attribute from the contentMetadata.

module Embed
  class Viewer
    class DemoViewer < CommonViewer

      def self.supported_types
        [:demo_type]
      end
    end
  end
end

The file that the class is defined in (or your preferred method) should register itself as a view with the Embed module.

module Embed
  class Viewer
    class DemoViewer < CommonViewer
      def self.supported_types
        [:demo_type]
      end
    end
  end
end

Embed.register_viewer(Embed::Viewer::DemoViewer) if Embed.respond_to?(:register_viewer)

Linking in viewers

The rich HTML payload that is supplied via the oEmbed API is an iframe. This means that all consumers will be embedding an iframe into their page. Given this fact, generating links will require explicit targets if they are not intended to internally replace embed content. Given this, there are two patterns that can be used. For links intended to download files, a target="_blank" can be used (effectively opening a new tab for the download which is immediately closed). When using target="_blank" add rel="noopener noreferrer" particularly when linking externally (although this should be reserved for linking to internal resources when possible). See this blog post for an explanation. Note: This does not apply to WebAuth links.

For links that are intended to navigate the users browser away from the current page (e.g. the links to Memento/GeoBlacklight/etc.) then target="_parent" should be used to give the link the default browser behavior. More about link targets.

Console Example

$ viewer = Embed.registered_viewers.first
=> Embed::DemoViewer
$ request = Embed::Request.new({url: 'http://purl.stanford.edu/bb112fp0199'})
=> #<Embed::Request>
$ viewer.new(request)
=> # your viewer instance

Customizing the Embed Panel

Viewers can customize the embed panel. To do this, create a template in app/views/embed/embed-this, to provide the HTML for the embed panel.

See File viewers for an example.

Adding a Download Panel

Viewers can add their own download panel. To do this, create a template in app/views/embed/download, to provide the HTML for the download panel.

In order to enable the download panel you need to provide a method in your viewer class. This method lets the footer logic know that the viewer will provide a download panel and it should render the Download button.

def show_download?
  true
end
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].