Giter Club home page Giter Club logo

knockout-view's Introduction

#knockout-view version 2.0.0

Use this bookmarklet to view your Knockout View Models with a toggle-able, minimally-intrusive display.

KO View

##Installation

Copy the code from build/ko-view.min.js into a new Bookmark in the browser of your choice.

##Usage

Click the bookmarklet on any page with a Knockout model.

Need a page to test it on? Try this Knockout Example page.

You can toggle the visibility of the view model display panel with the main button. The x will remove the debugger from the DOM.

The display panel can be resized by dragging the lower right corner. It can also be moved about with the burger menu.

##Building

Want to make some changes? It's easy to do with grunt.

  1. Clone this repository
  2. Run npm install in the directory of installation
  3. Install Ruby and SASS, if you don't already have them
  4. Make your changes to the files in the source directory
  5. Run grunt from the command line to build the bookmarklet

##Licensing

Don't fret about legal stuff. Do whatever you want with it.

knockout-view's People

Contributors

jamesplease avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

knockout-view's Issues

Drag and drop over iFrame in Chrome

Note: Applies to version 2.0.0 of this bookmarklet

Chrome doesn't handle drag and drop over iFrames. Consequently, dragging and dropping over iFrames won't work as intended. This might be a bug in Chrome, or a security feature related to cross-domain scripting. Further research is needed!

Bookmarklet display expands on VM update

When your view model is updated, the bookmarklet will expand everything.

This is because the bookmarklet is completely re-rendered, and the default state is expanded.

My solution is to implement a map that links together three pieces of information for each collapsable object: the DOM element associated with it, a unique hash for it (to uniquely locate it in the VM independent from any element), and whether it is collapsed or expanded.

Updates

A new solution I've thought of is to map objects to DOM elements, then utilize a Json diff library and an injection method to dynamically update the DOM as the object changes.

Bug in the bookmarklet document.createTextNode in Firefox

Hi there,

wanted to use this very useful code, and was getting an error when I created a bookmarklet in FF using the supplied js, on line 18, complaining that there were too few arguments to document.createTextNode.

I modified line 18 from
closeText = document.createTextNode(),
to
closeText = document.createTextNode(""),

and this fixed the issue for me. Just wanted to let you know, I am not really sure how to do this whole git thing so I'm writing it up here so you can fix if it turns out to be an issue for others. Thanks for a very useful tool!

2.0.0 does not work in Firefox

Version 2.0.0 isn't working in the latest release of Firefox โ€“ it forces the bookmarklet into a new tab. This needs to be researched and figured out!

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.