Example #1
0
var refreshTimer;
var activeOverlay = new Value();
activeOverlay.link(null, function(newOverlay, oldOverlay){
  if (oldOverlay)
  {
    domUtils.remove(oldOverlay.element);
    oldOverlay.deactivate();
  }
  else
  {
    startWatch();
    refreshTimer = setInterval(update, REFRESH_TIMER);
  }

  if (newOverlay)
  {
    muteEvents(newOverlay.muteEvents || {});
    newOverlay.activate();
    updateOnScroll();
    domUtils.insert(document.body, newOverlay.element);
  }
  else
  {
    clearInterval(refreshTimer);
    muteEvents({}); // unmute all
    stopWatch();
  }
});

var checkTimer;
Example #2
0
var popup = new Popup({
  loc: sourceLoc,

  dir: 'top left bottom left',
  autorotate: [
    'bottom left top left'
  ],
  template: resource('./template/popup.tmpl'),
  binding: {
    isOpenFileSupported: basis.fn.$const(true), // FIXME: use real value
    loc: sourceLoc.as(function(loc) {
      return (loc || '').replace(/(:\d+){1,4}$/, '');
    }),
    source: source
  },

  setZIndex: function() {
    this.element.style.zIndex = 65000;
  }
});

source.link(popup, function(source) {
  if (source) {
    this.show();
  } else {
    this.hide();
  }
});

module.exports = popup;
Example #3
0
var inspectBasis = require('devpanel').inspectBasis;
var Value = require('basis.data').Value;
var createTreeBuilder = require('./build-tree.js');

var input = new Value();
var selectedObject = new basis.Token();

var tree = selectedObject
  .as(createTreeBuilder({
    sandbox: inspectBasis
  }))
  // pass through stringify/parse to avoid notification about the same structure
  .as(JSON.stringify)
  .as(JSON.parse);

// rebuild graph by timer
input.link(selectedObject, selectedObject.set);
setInterval(function(){
  if (selectedObject.value)
    selectedObject.apply();
}, 100);

module.exports = {
  input: input,
  output: Value.from(tree)
};
Example #4
0
var api = require('../api.js');
var selectedNode = require('../data/dom-watcher.js');

Value.from(selectedNode).link(rempl.getHost(), function(node) {
  if (node) {
    if (inpageEnabled.value) {
      this.activate(remote.id);
    }
  } else {
    this.deactivate(remote.id);
  }
});
inpageEnabled.link(rempl.getHost(), function(value) {
  if (!value) {
    this.deactivate(remote.id);
  }
});

var document = global.document;

var inspectDepth = 0;
var inspectMode = new Value({ value: false });

var overlay = domUtils.createElement({
  css: {
    pointerEvents: 'none',
    transition: 'all .05s',
    position: 'absolute',
    top: 0,
    bottom: 0,