How to use react-atom-fork - 10 common examples

To help you get started, we’ve selected a few react-atom-fork examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexcorre / git-blame / lib / controllers / blameViewController.js View on Github external
var editorView = atom.views.getView(editor);
  if (!editorView.blameView) {
    var remoteUrl = projectBlamer.repo.getOriginURL(filePath);
    var remoteRevision;
    try {
      remoteRevision = RemoteRevision.create(remoteUrl);
    } catch (e) {
      // the only exception possible occurs when the template string is invalid
      // TODO refactor this to not throw an exception
    }

    // insert the BlameListView after the gutter div
    var mountPoint = $('<div>', {'class': 'git-blame-mount'});
    $(editorView.rootElement).find('.gutter').after(mountPoint);

    editorView.blameView = React.renderComponent(new BlameListView({
      projectBlamer: projectBlamer,
      remoteRevision: remoteRevision,
      editorView: editorView
    }), mountPoint[0]);
  } else {
    editorView.blameView.toggle();
  }
}
</div>
github Floobits / floobits-atom / templates / conflicts.js View on Github external
/** @jsx React.DOM */
/*global fl */
"use strict";
const fs = require("fs");
const path = require("path");

const _ = require("lodash");
const $ = require('atom-space-pen-views').$;
const React = require('react-atom-fork');

const floop = require("../common/floop");
const utils = require("../common/utils");

module.exports = React.createClass({
  treeize_: function (obj) {
    let node = {};
    let tree = {};
    _.each(obj, function (p) {
      node = tree;
      p.split(path.sep).forEach(function (p) {
        if (p in node) {
          node = node[p];
          return;
        }
        node[p] = {};
        node = node[p];
      });
    });
    return tree;
  },
github Floobits / floobits-atom / templates / handle_request_perm.js View on Github external
/** @jsx React.DOM */

"use strict";

const React = require('react-atom-fork');
const floop = require("../common/floop");
const permsEvent = {};

const HandleRequestPermView = React.createClass({
  destroy: function () {
    this.getDOMNode().parentNode.destroy();
  },
  grant: function () {
    permsEvent.action = "add";
    this.send();
  },
  deny: function () {
    permsEvent.action = "reject";
    this.send();
  },
  send: function () {
    floop.send_perms(permsEvent);
    this.destroy();
  },
  render: function () {
github Floobits / floobits-atom / templates / code_review.js View on Github external
/** @jsx React.DOM */

"use strict";

const React = require('react-atom-fork');
const mixins = require("./mixins");
const atomUtils = require("../atom_utils");

const CodeReview = React.createClass({
  mixins: [mixins.ReactUnwrapper, mixins.FormMixin],
  onSubmit: function (state) {
    const cb = this.props.cb.bind({}, null, state, this.refs.description.getDOMNode().value);
    setTimeout(cb, 0);
    this.destroy();
  },
  componentDidMount: function () {
    this.refs.description.getDOMNode().focus();
  },
  render: function () {
    return (
      <form>
        <h2 style="{{textAlign:">Code Review</h2>
        <div>
          <div>
            <div></div></div></div></form>
github Floobits / floobits-atom / templates / user_list_pane.js View on Github external
/** @jsx React.DOM */
"use strict";
"use babel";

const React = require("react-atom-fork");
const mixins = require("./mixins");
const UserlistView = require("./user_view").UserlistView;

const UserlistPane = React.createClass({
  mixins: [mixins.ReactUnwrapper],
  render: function () {
    return (
      <div id="user-list-pane">
        <div id="user-list-pane-header">
          <img>Floobits
          <i></i>
        </div>
        
      </div>
    );
  }
});

module.exports = UserlistPane;
github Floobits / floobits-atom / templates / yes_no_cancel.js View on Github external
/** @jsx React.DOM */

"use strict";

const React = require('react-atom-fork');
const mixins = require("./mixins");
const atomUtils = require("../atom_utils");

const YesNoCancel = React.createClass({
  mixins: [mixins.ReactUnwrapper, mixins.FormMixin],
  onSubmit: function (type) {
    if (!type) {
      type = "yes";
    } else if (type.target) {
      type = type.target.name;
    }
    const cb = this.props.cb.bind({}, null, type);
    setTimeout(cb, 0);
    this.destroy();
  },
  componentDidMount: function () {
    this.refs.yes.getDOMNode().focus();
  },
  render: function () {
    const yes = this.props.yes || "Yes";
github Floobits / floobits-atom / templates / user_view.js View on Github external
}, this);
    return (
      <div>
        {thumbnailNodes}
      </div>
    );
  }
};

const ChatUserlistView = React.createClass({
  mixins: [ListViewMixin],
  componentName: "ChatUserlistView",
  isListView: true,
});

const UserlistView = React.createClass({
  componentName: "UserlistView",
  mixins: [ListViewMixin],
  isListView: false,
});

module.exports = {
  Connection,
  ChatUserlistView,
  NotMeUserView,
  UserlistView,
};
github Floobits / floobits-atom / lib / asdf-view.js View on Github external
var utils = require('./utils');
var React = require('react-atom-fork');
var div = require('reactionary-atom-fork').div;

Component = React.createClass({
  displayName: 'asdfasdfasdfasdf',
  render: function () {
    return div("asdf");
  }
});


function ASDF () {
  HTMLElement.call(this);
  this.shadow = null;
  this.styles = null;
}

utils.inherits(ASDF, HTMLElement);

ASDF.prototype.attach = function() {
github Floobits / floobits-atom / templates / user_view.js View on Github external
return (
      <div>
        <img src="{conn.image.data}" title="{canEdit" style="{{width:">
        {clickToVideo}
      </div>
    );
  }
});

const VideoThumbnailView = React.createClass({
  mixins: [UserView],
  componentDidMount: function () {
    const n = this.refs.volume.getDOMNode();
    this.id = this.props.connection.visualizer.onVISUALIZE(function (volume) {
      n.style.height = volume + "px";
      n.style.width = volume + "px";
      if (this.state.noMic &amp;&amp; volume) {
        this.setState({noMic: false});
      }
    }, this);
  },
  componentWillUnmount: function () {
    const elem = this.refs["user-thumb-" + this.props.connection.id].getDOMNode();

    this.props.connection.visualizer.off(this.id);
github Floobits / floobits-atom / templates / welcome.js View on Github external
<span>&nbsp;</span>
          <input tabindex="3" placeholder="Password" type="password">
        
      
      <div>
        <div>
          <span>&nbsp;</span>
          <input placeholder="Password confirmation" tabindex="4" type="password">
        </div>
      </div>
      <input value="Sign Up" tabindex="5" type="submit">
    
  }
});

const Welcome = React.createClass({
  getInitialState: function () {
    return {
      create: true,
    };
  },
  toggle_: function () {
    this.setState({create: !this.state.create});
  },
  render: function () {
    return (
      <div id="floo-welcome-wrapper">
        <div id="floo-main">
          <div style="{{}}">
            <div>
              <div>
                <div></div></div></div></div></div></div>

react-atom-fork

Minimal, Atom-specific fork of React. Allows us to opt out of selection restoration and event dispatch.

MIT
Latest version published 9 years ago

Package Health Score

73 / 100
Full package analysis