"use strict"; var Component = React.createClass({ getInitialState: function getInitialState() { return {}; }, render: function render() { var _this = this; return React.createElement( "form", null, React.createElement( "div", { className: "form-group" }, React.createElement( "label", null, "Your Name (required)" ), React.createElement("input", { type: "text", className: "form-control", value: this.state.name, onChange: function onChange(e) { return _this.setState({ name: e.target.value }); }, onFocus: function onFocus() { return nf_track.upload_action("contact_focus_name"); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement( "label", null, "Your Email (required)" ), React.createElement("input", { type: "text", className: "form-control", value: this.state.email, onChange: function onChange(e) { return _this.setState({ email: e.target.value }); }, onBlur: function onBlur() { return nf_track.upload_action("contact_blur_email", "Email: " + _this.state.email); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement( "label", null, "Subject" ), React.createElement("input", { type: "text", className: "form-control", value: this.state.subject, onChange: function onChange(e) { return _this.setState({ subject: e.target.value }); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement( "label", null, "Your Message" ), React.createElement("textarea", { className: "form-control", value: this.state.message, onChange: function onChange(e) { return _this.setState({ message: e.target.value }); } }) ), React.createElement( "button", { className: "btn btn-primary btn-lg", disabled: this.state.sending, onClick: this.send }, React.createElement("i", { className: "fa fa-envelope-o", style: { marginRight: 5 } }), " Send" ), function () { if (_this.state.sending) return React.createElement( "p", null, "Sending..." ); }() ); }, send: function send(e) { var _this2 = this; e.preventDefault(); goog_report_conversion_contact(); ga('send', 'event', 'Contact', 'contact_submit_form'); if (this.state.sending) return; var name = this.state.name; var email = this.state.email; var subject = this.state.subject; var message = this.state.message; this.setState({ sending: true }); rpc.execute("email.message", "submit_contact_form", [name, email, subject, message], {}, function (err, res) { _this2.setState({ sending: false }); if (err) { alert("Error: " + err); return; } _this2.setState({ name: "", email: "", subject: "", message: "" }); alert("Your message was sent successfully."); }); } }); var Contact = Component;"use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Login = function (_React$Component) { _inherits(Login, _React$Component); function Login() { _classCallCheck(this, Login); var _this = _possibleConstructorReturn(this, (Login.__proto__ || Object.getPrototypeOf(Login)).call(this)); _this.state = {}; return _this; } _createClass(Login, [{ key: "render", value: function render() { var _this2 = this; return React.createElement( "form", { onSubmit: this.login.bind(this) }, React.createElement( "div", { className: "form-group" }, React.createElement( "div", { className: "input-group" }, React.createElement("input", { type: "text", className: "form-control text-right", placeholder: "company-short-name", value: this.state.domain, onChange: function onChange(e) { return _this2.setState({ domain: e.target.value }); }, ref: "domain" }), React.createElement( "span", { className: "input-group-addon" }, ".netforce.com" ) ) ), React.createElement( "button", { type: "submit", className: classNames("btn btn-lg btn-primary", { disabled: this.state.loading }) }, this.state.loading ? React.createElement("img", { src: require("../img/spinner.gif"), style: { marginRight: 10 } }) : null, React.createElement("span", { className: "glyphicon glyphicon-arrow-right", style: { marginRight: 5 } }), "Continue" ) ); } }, { key: "login", value: function login(e) { e.preventDefault(); try { var domain = this.state.domain; if (!domain) throw "Missing domain"; } catch (err) { alert("Error: " + err); return; } window.location.href = "https://" + domain + ".netforce.com/login"; } }]); return Login; }(React.Component);"use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _ReactBootstrap = ReactBootstrap, OverlayTrigger = _ReactBootstrap.OverlayTrigger, Popover = _ReactBootstrap.Popover; var SignUp = function (_React$Component) { _inherits(SignUp, _React$Component); function SignUp() { _classCallCheck(this, SignUp); var _this = _possibleConstructorReturn(this, (SignUp.__proto__ || Object.getPrototypeOf(SignUp)).call(this)); _this.state = {}; return _this; } _createClass(SignUp, [{ key: "render", value: function render() { var _this2 = this; return React.createElement( "div", null, React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "First name", value: this.state.first_name, onChange: function onChange(e) { return _this2.setState({ first_name: e.target.value }); }, ref: "first_name", onFocus: function onFocus() { return nf_track.upload_action("trial_focus_first_name"); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "Last name", value: this.state.last_name, onChange: function onChange(e) { return _this2.setState({ last_name: e.target.value }); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "Email address", value: this.state.email, onChange: function onChange(e) { return _this2.setState({ email: e.target.value }); }, onBlur: function onBlur() { return nf_track.upload_action("trial_blur_email", "Email: " + _this2.state.email); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "Phone number", value: this.state.phone, onChange: function onChange(e) { return _this2.setState({ phone: e.target.value }); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "password", className: "form-control", placeholder: "Select a password", value: this.state.password, onChange: function onChange(e) { return _this2.setState({ password: e.target.value }); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "Your company name", value: this.state.company, onChange: function onChange(e) { return _this2.setState({ company: e.target.value }); } }) ), React.createElement( "div", { className: "form-group" }, React.createElement( "div", { className: "input-group" }, React.createElement("input", { type: "text", className: "form-control text-right", placeholder: "company-short-name", value: this.state.domain, onChange: function onChange(e) { return _this2.setState({ domain: e.target.value }); } }), React.createElement( "span", { className: "input-group-addon" }, ".netforce.com" ) ), React.createElement( "div", { style: { position: "relative" } }, function () { var popover = React.createElement( Popover, null, "Select a URL to access your database. For example, if your company short name is \"acme\", your database will be accessible at http://acme.netforce.com." ); return React.createElement( OverlayTrigger, { trigger: "hover", overlay: popover, placement: "bottom" }, React.createElement( "a", { href: "#", style: { position: "absolute", right: -120, top: -25 }, onClick: function onClick(e) { return e.preventDefault(); } }, React.createElement("span", { className: "glyphicon glyphicon-arrow-left" }), " What is this?" ) ); }() ) ), function () { if (window.location.href.indexOf("template=1") == -1) return; return React.createElement( "div", { className: "form-group" }, React.createElement("input", { type: "text", className: "form-control", placeholder: "Database Template", value: _this2.state.template, onChange: function onChange(e) { return _this2.setState({ template: e.target.value }); } }) ); }(), React.createElement( "button", { className: classNames("btn btn-lg btn-success", { disabled: this.state.loading }), onClick: this.sign_up.bind(this) }, this.state.loading_msg ? React.createElement("img", { src: "/static/theme/img/spinner.gif", style: { marginRight: 10 } }) : null, React.createElement("span", { className: "glyphicon glyphicon-arrow-right" }), " Get Started" ), this.state.loading_msg ? React.createElement( "p", { style: { marginTop: 10 } }, this.state.loading_msg ) : null ); } }, { key: "sign_up", value: function sign_up(e) { var _this3 = this; e.preventDefault(); nf_track.upload_action("trial_click_get_started", "Email: " + this.state.email); goog_report_conversion_trial(); ga('send', 'event', 'Trial', 'submit_form'); try { var first_name = this.state.first_name; if (!first_name) throw "Missing first name"; var last_name = this.state.last_name; if (!last_name) throw "Missing last name"; var email = this.state.email; if (!email) throw "Missing email"; var password = this.state.password; if (!password) throw "Missing password"; var company = this.state.company; if (!company) throw "Missing company"; var domain = this.state.domain; if (!domain) throw "Missing domain"; var phone = this.state.phone; var template = this.state.template; } catch (err) { nf_track.upload_action("trial_signup_error", "Client error: " + err); alert("Error: " + err); return; } this.setState({ loading_msg: "Creating your account, please wait a few seconds..." }); rpc.execute("trial", "sign_up", [first_name, last_name, email, password, company, domain], { phone: phone, template: template }, function (err, data) { _this3.setState({ loading_msg: null }); if (err) { nf_track.upload_action("trial_signup_error", "Server error: " + err); alert("Error: " + err); return; } var url = "https://" + domain + ".netforce.com/auth_login?user_id=" + data.user_id + "&token=" + data.token + "&company_id=" + data.company_id + "&action=" + data.action; window.location = url; }); } }]); return SignUp; }(React.Component);