All Projects → hsynlms → theroomjs

hsynlms / theroomjs

Licence: MIT License
A vanilla javascript plugin that allows you to outline dom elements like web inspectors

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to theroomjs

Ply
CSS inspection aided by visual regression pruning
Stars: ✭ 370 (+598.11%)
Mutual labels:  dom, inspector
Object Visualizer
Vue JSON inspector with Chrome-like theme.
Stars: ✭ 159 (+200%)
Mutual labels:  dom, inspector
dom-inspector
Dom inspect like chrome dev tools.
Stars: ✭ 124 (+133.96%)
Mutual labels:  dom, inspector
JsObjExporter
A little JavaScript plugin to generate PDF, XLS, CSV and DOC from JavaScript Object or DOM element only from the frontend!
Stars: ✭ 58 (+9.43%)
Mutual labels:  dom
IdeaSingletonInspection
Inspection for detecting of inappropriate use of Singleton pattern in Java
Stars: ✭ 14 (-73.58%)
Mutual labels:  inspection
XrayDOM
🔥 X-ray your DOM using just the cursor and never open the console again!
Stars: ✭ 13 (-75.47%)
Mutual labels:  dom
vanillajs-hello
Start a VanillaJS website using WebPack in just 30 seconds: HTML,CSS,Babel,SASS,Bootstrap,Prettier,Gitpod
Stars: ✭ 24 (-54.72%)
Mutual labels:  vanillajs
capsid
💊 Declarative DOM programming library. Lightweight (1.79 kb).
Stars: ✭ 76 (+43.4%)
Mutual labels:  dom
fox
A Fortran XML library
Stars: ✭ 51 (-3.77%)
Mutual labels:  dom
InAppDevTools
Android library with a collection of tools for debugging, inspecting and reporting from within your own app
Stars: ✭ 26 (-50.94%)
Mutual labels:  inspector
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-64.15%)
Mutual labels:  dom
BabyBrowser
A Small Web Browser Built in Python
Stars: ✭ 21 (-60.38%)
Mutual labels:  dom
hotshot
Takes screenshots of DOM elements
Stars: ✭ 19 (-64.15%)
Mutual labels:  dom
vue-identify-network
⚡ Identify what kinda internet your users are using!
Stars: ✭ 60 (+13.21%)
Mutual labels:  dom
decoy
jQuery plugin to make decoys for your elements.
Stars: ✭ 53 (+0%)
Mutual labels:  dom
JavaScript-Bootcamp
Complete Documentation For JavaScript Bootcamp Course By Osama Elzero.
Stars: ✭ 27 (-49.06%)
Mutual labels:  dom
shaven
DOM building utility & Template engine based on JsonML + syntax sugar
Stars: ✭ 66 (+24.53%)
Mutual labels:  dom
UndoRedo.js
A powerful and simple JavaScript library provides a history for undo/redo functionality. Just like a time machine! 🕐
Stars: ✭ 19 (-64.15%)
Mutual labels:  dom
wutpl
高性能模板引擎 (js template)
Stars: ✭ 85 (+60.38%)
Mutual labels:  dom
texthighlighter
a no dependency typescript npm package for highlighting user selected text
Stars: ✭ 17 (-67.92%)
Mutual labels:  dom

theroomjs

A vanilla javascript plugin that allows you to outline DOM elements like web inspectors.

Downloads install size

theroomjs can be accessable globally as theRoom. It's compatible with modern browsers such as Google Chrome, Mozilla Firefox, Safari, Edge and Internet Explorer.

Install

$ npm install theroomjs --save

Usage

  // setup/configure theRoom before inspection
  // this configurations can be passed in 'start' event as well
  window.theRoom.configure({
    inspector: '.inspector-element',
    blockRedirection: true,
    excludes: ['footer'],
    click: function (element) {
      console.log('element is clicked:', element)
    }
  })

  // start inspection
  window.theRoom.start()

  // dynamically bind event
  window.theRoom.on('mouseover', function (element) {
    console.log('the element is hovered', element)
  })

  // stop inspection
  // and reset inspector styles
  window.theRoom.stop(true)

  // dont emit mouseover and click events
  // if the target element id is 'yusufHayaloglu'
  window.theRoom.on('hook', function (event) {
    if (event.target.id === 'yusufHayaloglu') {
      return false
    }
  })

  console.log(
    window.theRoom.status() // will print out -> stopped
  )

Options

Name Type Default Description
inspector string or DOM node - Placeholder element for inspection. It will not be inspected
createInspector boolean false If true and inspector option is not provided, theRoom will try to create an inspector element whose class is inspector-element for you and will be appended to <body/>
htmlClass boolean true If true theRoom's namespace will be automatically added to <html/> element class list
blockRedirection boolean false If true the page will not be redirected elsewhere. theRoom will override onbeforeunload to do that
excludes array (string) - Elements that excluded for inspection. Basic CSS selectors are allowed. For more information please see document.querySelector

Events

Name Description
starting Fired when inspection is being started
started Fired when inspection is started
stopping Fired when inspection is being stopped
stopped Fired when inspection is stopped
click Fired when the inspected element is clicked. The element is passed as the first argument, Event passed as the second argument
mouseover Fired when the inspected element mouseovered. The element is passed as the first argument, Event passed as the second argument
hook Fired before click and mouseover events. Event passed as the only argument. mouseover and click events wont be emitted if the hook event returns false

Events can also be defined in options.

theRoom object

theRoom global object exposes those:

Option Type Parameters Description
on function event name and handler function To dynamically event binding
start function options (optional) To start inspection
stop function resetInspector (optional) To stop inspection
configure function options To override theRoom option(s) anytime
status function - Gets inspection engine status. Can be idle, running and stopped

Related

  • path-finder - A Chrome extension to inspect and find out an HTML element unique CSS selector
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].