Coder Social home page Coder Social logo

uclalibrary / mirador-disable-zoom Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 594 KB

A Mirador 2 plugin that allows users to disable (and re-enable) zoom controls per window.

Home Page: https://gist.github.com/markmatney/795a65e294a3ad1bcff3bd53eec4120b

CSS 7.60% JavaScript 92.40%
mirador-plugins mirador-2 mirador

mirador-disable-zoom's Introduction

mirador-disable-zoom

window zoom disable button

When interacting with Mirador on touch devices, users report that they sometimes unintentionally change the zoom level. This plugin adds a button to each window in Mirador that a user can click/touch to disable zooming on that window, until the user does one of the following:

  • replaces the current window object with a new object (via the list of loaded manifests)
  • moves to a different canvas in the same object
  • changes the view type (BookView -> ImageView, and vice versa)

Setup

You can find production-ready build artifacts inside the 'dist/' folder.

Alternatively, clone this repository and do:

npm install
gulp

Now look in the 'dist/' folder. Drop these files into your Mirador build output directory and point your webpage to them:

<!DOCTYPE html>
<html>
    <head>
        ...
        <link rel="stylesheet" type="text/css" href="mirador-combined.css">
        <link rel="stylesheet" type="text/css" href="MiradorDisableZoom.min.css">
        ...
    </head>
    <body>
        <div id="viewer"></div>

        <script src="mirador.js"></script>
        <script src="MiradorDisableZoom.min.js"></script>

        <script type="text/javascript">

        $(function() {
            Mirador({
                ...

mirador-disable-zoom's People

Contributors

markmatney avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

mirador-disable-zoom's Issues

home button behavior

When zooming is disabled, the home button is still enabled. This is because I've implemented the disable zoom button to set zoomPerClick/Scroll to 1, and the home button uses a method for zooming that doesn't use these values. I suppose it's arguable whether or not the home button should be disabled when zooming is disabled.

missing scripts?

Hi there,

The README file seems to indicate that there should be a mirador-combined.css stylesheet and a mirador.js script, but I don't see these in the dist folder.

Where'd they go? ๐Ÿคทโ€โ™€๏ธ

Thanks!

location of button

I was thinking it might be better suited for the HUD tray with the rest of the zoom and pan controls.

toggling between ImageView and BookView

When a user toggles between the two view types, zoom controls are no longer disabled, but the button is still selected as if they still are.

Should zoom controls be re-enabled when toggling between views? I am leaning towards yes, because by default the zoom level sometimes changes when doing so, and it seems likely that a user would want to adjust the zoom level after toggling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.