diff options
42 files changed, 617 insertions, 116 deletions
diff --git a/NOTICE.txt b/NOTICE.txt index af77fe8ec..f31472477 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -74,6 +74,465 @@ DEALINGS IN THE SOFTWARE. --- +This product contains a modified portion of 'jquery-dragster', a drag and drop listener +by Jan Martin. + +* HOMEPAGE: + * https://github.com/catmanjan/jquery-dragster + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Jan Martin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This product contains a modified portion of 'twemoji', a set of emoticons by Twitter, Inc. + +* HOMEPAGE: + * https://github.com/twitter/twemoji + +* LICENSE: + +# Code licensed under the MIT License: + +Copyright (c) 2014 Twitter, Inc and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +# Graphics licensed under CC-BY 4.0: + +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public licenses. +Notwithstanding, Creative Commons may elect to apply one of its public +licenses to material it publishes and in those instances will be +considered the "Licensor." Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the public +licenses. + +Creative Commons may be contacted at creativecommons.org. + +--- + This product contains a modified portion of 'golang-lru', a golang LRU cache by hashicorp, based on Groupcache by Google Inc. diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index 9c8e7c6c3..a080150dd 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -89,7 +89,10 @@ export default class AccessHistoryModal extends React.Component { } accessList[i] = ( - <div className='access-history__table'> + <div + key={'accessHistoryEntryKey' + i} + className='access-history__table' + > <div className='access__date'>{newDate}</div> <div className='access__report'> <div className='report__time'>{newHistoryDate.toLocaleTimeString(navigator.language, {hour: '2-digit', minute: '2-digit'})}</div> diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx index 2a83b3c40..7cbd4021e 100644 --- a/web/react/components/activity_log_modal.jsx +++ b/web/react/components/activity_log_modal.jsx @@ -102,7 +102,10 @@ export default class ActivityLogModal extends React.Component { } activityList[i] = ( - <div className='activity-log__table'> + <div + key={'activityLogEntryKey' + i} + className='activity-log__table' + > <div className='activity-log__report'> <div className='report__platform'><i className={devicePicture} />{currentSession.props.platform}</div> <div className='report__info'> diff --git a/web/react/components/email_verify.jsx b/web/react/components/email_verify.jsx index f2e91dd98..396e201f8 100644 --- a/web/react/components/email_verify.jsx +++ b/web/react/components/email_verify.jsx @@ -1,6 +1,8 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. +import {config} from '../utils/config.js'; + export default class EmailVerify extends React.Component { constructor(props) { super(props); diff --git a/web/react/components/file_attachment_list.jsx b/web/react/components/file_attachment_list.jsx index 33643de73..d93f461e8 100644 --- a/web/react/components/file_attachment_list.jsx +++ b/web/react/components/file_attachment_list.jsx @@ -8,8 +8,14 @@ var Constants = require('../utils/constants.jsx'); export default class FileAttachmentList extends React.Component { constructor(props) { super(props); + + this.handleImageClick = this.handleImageClick.bind(this); + this.state = {startImgId: 0}; } + handleImageClick(e) { + this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)}); + } render() { var filenames = this.props.filenames; var modalId = this.props.modalId; @@ -40,9 +46,6 @@ export default class FileAttachmentList extends React.Component { </div> ); } - handleImageClick(e) { - this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)}); - } } FileAttachmentList.propTypes = { diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx index c91d03599..dcb938cbf 100644 --- a/web/react/components/file_upload.jsx +++ b/web/react/components/file_upload.jsx @@ -18,6 +18,21 @@ export default class FileUpload extends React.Component { }; } + fileUploadSuccess(channelId, data) { + var parsedData = $.parseJSON(data); + this.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); + + var requests = this.state.requests; + for (var j = 0; j < parsedData.client_ids.length; j++) { + delete requests[parsedData.client_ids[j]]; + } + this.setState({requests: requests}); + } + + fileUploadFail(clientId, err) { + this.props.onUploadError(err, clientId); + } + handleChange() { var element = $(React.findDOMNode(this.refs.fileInput)); var files = element.prop('files'); @@ -57,19 +72,8 @@ export default class FileUpload extends React.Component { formData.append('client_ids', clientId); var request = client.uploadFile(formData, - function success(data) { - var parsedData = $.parseJSON(data); - this.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); - - var requests = this.state.requests; - for (var j = 0; j < parsedData.client_ids.length; j++) { - delete requests[parsedData.client_ids[j]]; - } - this.setState({requests: requests}); - }.bind(this), - function fail(err) { - this.props.onUploadError(err, clientId); - }.bind(this) + this.fileUploadSuccess.bind(this, channelId), + this.fileUploadFail.bind(this, clientId) ); var requests = this.state.requests; @@ -122,19 +126,8 @@ export default class FileUpload extends React.Component { formData.append('client_ids', clientId); var request = client.uploadFile(formData, - function success(data) { - var parsedData = $.parseJSON(data); - this.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); - - var requests = this.state.requests; - for (var j = 0; j < parsedData.client_ids.length; j++) { - delete requests[parsedData.client_ids[j]]; - } - this.setState({requests: requests}); - }.bind(this), - function fail(err) { - this.props.onUploadError(err, clientId); - }.bind(this) + this.fileUploadSuccess.bind(this, channelId), + this.fileUploadFail.bind(this, clientId) ); var requests = this.state.requests; @@ -248,19 +241,8 @@ export default class FileUpload extends React.Component { formData.append('client_ids', clientId); var request = client.uploadFile(formData, - function(data) { - var parsedData = $.parseJSON(data); - self.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); - - var requests = self.state.requests; - for (var j = 0; j < parsedData.client_ids.length; j++) { - delete requests[parsedData.client_ids[j]]; - } - self.setState({requests: requests}); - }, - function(err) { - self.props.onUploadError(err, clientId); - } + self.fileUploadSuccess.bind(self, channelId), + self.fileUploadFail.bind(self, clientId) ); var requests = self.state.requests; diff --git a/web/react/components/find_team.jsx b/web/react/components/find_team.jsx index bb1c6c7ea..4040a771d 100644 --- a/web/react/components/find_team.jsx +++ b/web/react/components/find_team.jsx @@ -3,6 +3,7 @@ var utils = require('../utils/utils.jsx'); var client = require('../utils/client.jsx'); +import {strings} from '../utils/config.js'; export default class FindTeam extends React.Component { constructor(props) { diff --git a/web/react/components/get_link_modal.jsx b/web/react/components/get_link_modal.jsx index fc32d946b..1f25ea0b7 100644 --- a/web/react/components/get_link_modal.jsx +++ b/web/react/components/get_link_modal.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var UserStore = require('../stores/user_store.jsx'); +import {strings} from '../utils/config.js'; export default class GetLinkModal extends React.Component { constructor(props) { diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 2ef42a993..c1cfa7800 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -6,6 +6,7 @@ var ConfigStore = require('../stores/config_store.jsx'); var Client = require('../utils/client.jsx'); var UserStore = require('../stores/user_store.jsx'); var ConfirmModal = require('./confirm_modal.jsx'); +import {config} from '../utils/config.js'; export default class InviteMemberModal extends React.Component { constructor(props) { diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index f87e77ff7..b20c62833 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -6,6 +6,7 @@ const Client = require('../utils/client.jsx'); const UserStore = require('../stores/user_store.jsx'); const BrowserStore = require('../stores/browser_store.jsx'); const Constants = require('../utils/constants.jsx'); +import {config, strings} from '../utils/config.js'; export default class Login extends React.Component { constructor(props) { diff --git a/web/react/components/member_list_item.jsx b/web/react/components/member_list_item.jsx index d244939f5..bfce0f49f 100644 --- a/web/react/components/member_list_item.jsx +++ b/web/react/components/member_list_item.jsx @@ -44,7 +44,7 @@ export default class MemberListItem extends React.Component { var self = this; let makeAdminOption = null; - if (makeAdminOption) { + if (this.props.handleMakeAdmin) { makeAdminOption = ( <li role='presentation'> <a @@ -56,7 +56,7 @@ export default class MemberListItem extends React.Component { } let handleRemoveOption = null; - if (handleRemoveOption) { + if (this.props.handleRemove) { handleRemoveOption = ( <li role='presentation'> <a diff --git a/web/react/components/navbar.jsx b/web/react/components/navbar.jsx index d6cf4f9d6..2258bf2b3 100644 --- a/web/react/components/navbar.jsx +++ b/web/react/components/navbar.jsx @@ -274,6 +274,7 @@ export default class Navbar extends React.Component { if (currentId == null) { buttons.push( <button + key='navbar-toggle-collapse' type='button' className='navbar-toggle' data-toggle='collapse' @@ -288,6 +289,7 @@ export default class Navbar extends React.Component { } else { buttons.push( <button + key='navbar-toggle-sidebar' type='button' className='navbar-toggle' data-toggle='collapse' @@ -304,6 +306,7 @@ export default class Navbar extends React.Component { buttons.push( <button + key='navbar-toggle-menu' type='button' className='navbar-toggle menu-toggle pull-right' data-toggle='collapse' diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index e818a5c92..a949205da 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -7,6 +7,7 @@ var UserStore = require('../stores/user_store.jsx'); var TeamStore = require('../stores/team_store.jsx'); var Constants = require('../utils/constants.jsx'); +import {config} from '../utils/config.js'; function getStateFromStores() { return {teams: UserStore.getTeams(), currentTeam: TeamStore.getCurrent()}; diff --git a/web/react/components/password_reset_form.jsx b/web/react/components/password_reset_form.jsx index 7acd2d1f7..1b579efbc 100644 --- a/web/react/components/password_reset_form.jsx +++ b/web/react/components/password_reset_form.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var client = require('../utils/client.jsx'); +import {config} from '../utils/config.js'; export default class PasswordResetForm extends React.Component { constructor(props) { diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx index e284f4b6a..5f4aeb961 100644 --- a/web/react/components/post.jsx +++ b/web/react/components/post.jsx @@ -136,7 +136,7 @@ export default class Post extends React.Component { } var profilePic = null; - if (this.props.hideProfilePic) { + if (!this.props.hideProfilePic) { profilePic = ( <div className='post-profile-img__container'> <img diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 62925b9c5..c5db3956d 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -15,6 +15,8 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; +import {strings} from '../utils/config.js'; + export default class PostList extends React.Component { constructor() { super(); @@ -516,7 +518,7 @@ export default class PostList extends React.Component { var postCtl = ( <Post - key={post.id} + key={post.id + 'postKey'} ref={post.id} sameUser={sameUser} sameRoot={sameRoot} diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx index dbb16872e..d99177bda 100644 --- a/web/react/components/rhs_thread.jsx +++ b/web/react/components/rhs_thread.jsx @@ -191,7 +191,7 @@ export default class RhsThread extends React.Component { return ( <Comment ref={comPost.id} - key={comPost.id} + key={comPost.id + 'commentKey'} post={comPost} selected={(comPost.id === selectedPost.id)} /> diff --git a/web/react/components/setting_picture.jsx b/web/react/components/setting_picture.jsx index 33c3b650a..6eaa4a96e 100644 --- a/web/react/components/setting_picture.jsx +++ b/web/react/components/setting_picture.jsx @@ -1,6 +1,8 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. +import {config} from '../utils/config.js'; + export default class SettingPicture extends React.Component { constructor(props) { super(props); diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index ef23f5bc2..983260187 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -387,13 +387,13 @@ export default class Sidebar extends React.Component { this.setState({loadingDMChannel: -1}); AsyncClient.getChannel(data.id); Utils.switchChannel(data); - }, + }.bind(this), function error() { this.setState({loadingDMChannel: -1}); window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name; - } + }.bind(this) ); - }; + }.bind(this); } } diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx index 6e219cc6c..fb79f8b1e 100644 --- a/web/react/components/sidebar_header.jsx +++ b/web/react/components/sidebar_header.jsx @@ -3,6 +3,7 @@ var NavbarDropdown = require('./navbar_dropdown.jsx'); var UserStore = require('../stores/user_store.jsx'); +import {config} from '../utils/config.js'; export default class SidebarHeader extends React.Component { constructor(props) { diff --git a/web/react/components/sidebar_right_menu.jsx b/web/react/components/sidebar_right_menu.jsx index fea889b33..9c5733799 100644 --- a/web/react/components/sidebar_right_menu.jsx +++ b/web/react/components/sidebar_right_menu.jsx @@ -4,6 +4,7 @@ var UserStore = require('../stores/user_store.jsx'); var client = require('../utils/client.jsx'); var utils = require('../utils/utils.jsx'); +import {config} from '../utils/config.js'; export default class SidebarRightMenu extends React.Component { constructor(props) { @@ -128,4 +129,4 @@ export default class SidebarRightMenu extends React.Component { SidebarRightMenu.propTypes = { teamType: React.PropTypes.string, teamDisplayName: React.PropTypes.string -};
\ No newline at end of file +}; diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index 67e85d4de..f078f6169 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -6,6 +6,7 @@ var client = require('../utils/client.jsx'); var UserStore = require('../stores/user_store.jsx'); var BrowserStore = require('../stores/browser_store.jsx'); var Constants = require('../utils/constants.jsx'); +import {config} from '../utils/config.js'; export default class SignupUserComplete extends React.Component { constructor(props) { diff --git a/web/react/components/team_general_tab.jsx b/web/react/components/team_general_tab.jsx index 2966a8a9a..25139bb95 100644 --- a/web/react/components/team_general_tab.jsx +++ b/web/react/components/team_general_tab.jsx @@ -6,6 +6,7 @@ const SettingItemMax = require('./setting_item_max.jsx'); const Client = require('../utils/client.jsx'); const Utils = require('../utils/utils.jsx'); +import {strings} from '../utils/config.js'; export default class GeneralTab extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_allowed_domains_page.jsx b/web/react/components/team_signup_allowed_domains_page.jsx index aee5afd23..721fa142a 100644 --- a/web/react/components/team_signup_allowed_domains_page.jsx +++ b/web/react/components/team_signup_allowed_domains_page.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var Client = require('../utils/client.jsx'); +import {strings} from '../utils/config.js'; export default class TeamSignupAllowedDomainsPage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_choose_auth.jsx b/web/react/components/team_signup_choose_auth.jsx index 92ade5d24..71780c677 100644 --- a/web/react/components/team_signup_choose_auth.jsx +++ b/web/react/components/team_signup_choose_auth.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var Constants = require('../utils/constants.jsx'); +import {strings} from '../utils/config.js'; export default class ChooseAuthPage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_display_name_page.jsx b/web/react/components/team_signup_display_name_page.jsx index de756f4d5..5d0e4c7b3 100644 --- a/web/react/components/team_signup_display_name_page.jsx +++ b/web/react/components/team_signup_display_name_page.jsx @@ -3,6 +3,7 @@ var utils = require('../utils/utils.jsx'); var client = require('../utils/client.jsx'); +import {strings} from '../utils/config.js'; export default class TeamSignupDisplayNamePage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_password_page.jsx b/web/react/components/team_signup_password_page.jsx index 4088c7cef..aa402846b 100644 --- a/web/react/components/team_signup_password_page.jsx +++ b/web/react/components/team_signup_password_page.jsx @@ -4,6 +4,7 @@ var Client = require('../utils/client.jsx'); var BrowserStore = require('../stores/browser_store.jsx'); var UserStore = require('../stores/user_store.jsx'); +import {strings, config} from '../utils/config.js'; export default class TeamSignupPasswordPage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_send_invites_page.jsx b/web/react/components/team_signup_send_invites_page.jsx index 6d9b0ec03..35d2441c5 100644 --- a/web/react/components/team_signup_send_invites_page.jsx +++ b/web/react/components/team_signup_send_invites_page.jsx @@ -5,6 +5,7 @@ var EmailItem = require('./team_signup_email_item.jsx'); var Utils = require('../utils/utils.jsx'); var ConfigStore = require('../stores/config_store.jsx'); var Client = require('../utils/client.jsx'); +import {strings, config} from '../utils/config.js'; export default class TeamSignupSendInvitesPage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_url_page.jsx b/web/react/components/team_signup_url_page.jsx index 6911ba871..ffe9d9fe8 100644 --- a/web/react/components/team_signup_url_page.jsx +++ b/web/react/components/team_signup_url_page.jsx @@ -4,6 +4,7 @@ const Utils = require('../utils/utils.jsx'); const Client = require('../utils/client.jsx'); const Constants = require('../utils/constants.jsx'); +import {strings, config} from '../utils/config.js'; export default class TeamSignupUrlPage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_username_page.jsx b/web/react/components/team_signup_username_page.jsx index 8efcd87e1..b5c8b14df 100644 --- a/web/react/components/team_signup_username_page.jsx +++ b/web/react/components/team_signup_username_page.jsx @@ -3,6 +3,7 @@ var Utils = require('../utils/utils.jsx'); var Client = require('../utils/client.jsx'); +import {strings} from '../utils/config.js'; export default class TeamSignupUsernamePage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_welcome_page.jsx b/web/react/components/team_signup_welcome_page.jsx index e742cba2f..e4374fa28 100644 --- a/web/react/components/team_signup_welcome_page.jsx +++ b/web/react/components/team_signup_welcome_page.jsx @@ -4,6 +4,7 @@ var Utils = require('../utils/utils.jsx'); var Client = require('../utils/client.jsx'); var BrowserStore = require('../stores/browser_store.jsx'); +import {config} from '../utils/config.js'; export default class TeamSignupWelcomePage extends React.Component { constructor(props) { diff --git a/web/react/components/team_signup_with_email.jsx b/web/react/components/team_signup_with_email.jsx index c0bbb7da9..d75736bd3 100644 --- a/web/react/components/team_signup_with_email.jsx +++ b/web/react/components/team_signup_with_email.jsx @@ -3,6 +3,7 @@ const Utils = require('../utils/utils.jsx'); const Client = require('../utils/client.jsx'); +import {strings} from '../utils/config.js'; export default class EmailSignUpPage extends React.Component { constructor() { diff --git a/web/react/components/team_signup_with_sso.jsx b/web/react/components/team_signup_with_sso.jsx index 96a216005..521c21733 100644 --- a/web/react/components/team_signup_with_sso.jsx +++ b/web/react/components/team_signup_with_sso.jsx @@ -4,6 +4,7 @@ var utils = require('../utils/utils.jsx'); var client = require('../utils/client.jsx'); var Constants = require('../utils/constants.jsx'); +import {strings} from '../utils/config.js'; export default class SSOSignUpPage extends React.Component { constructor(props) { diff --git a/web/react/components/user_profile.jsx b/web/react/components/user_profile.jsx index fbdcdca59..739084053 100644 --- a/web/react/components/user_profile.jsx +++ b/web/react/components/user_profile.jsx @@ -3,6 +3,7 @@ var Utils = require('../utils/utils.jsx'); var UserStore = require('../stores/user_store.jsx'); +import {config} from '../utils/config.js'; var id = 0; diff --git a/web/react/components/user_settings_appearance.jsx b/web/react/components/user_settings_appearance.jsx index 878ec42fc..3afdd7349 100644 --- a/web/react/components/user_settings_appearance.jsx +++ b/web/react/components/user_settings_appearance.jsx @@ -6,6 +6,7 @@ var SettingItemMin = require('./setting_item_min.jsx'); var SettingItemMax = require('./setting_item_max.jsx'); var Client = require('../utils/client.jsx'); var Utils = require('../utils/utils.jsx'); +import {config} from '../utils/config.js'; export default class UserSettingsAppearance extends React.Component { constructor(props) { @@ -89,6 +90,7 @@ export default class UserSettingsAppearance extends React.Component { for (var i = 0; i < config.ThemeColors.length; i++) { themeButtons.push( <button + key={config.ThemeColors[i] + 'key' + i} ref={config.ThemeColors[i]} type='button' className='btn btn-lg color-btn' @@ -101,7 +103,10 @@ export default class UserSettingsAppearance extends React.Component { var inputs = []; inputs.push( - <li className='setting-list-item'> + <li + key='themeColorSetting' + className='setting-list-item' + > <div className='btn-group' data-toggle='buttons-radio' diff --git a/web/react/components/user_settings_notifications.jsx b/web/react/components/user_settings_notifications.jsx index b97f29e29..84a7b62c7 100644 --- a/web/react/components/user_settings_notifications.jsx +++ b/web/react/components/user_settings_notifications.jsx @@ -9,6 +9,7 @@ var client = require('../utils/client.jsx'); var AsyncClient = require('../utils/async_client.jsx'); var utils = require('../utils/utils.jsx'); var assign = require('object-assign'); +import {config} from '../utils/config.js'; function getNotificationsStateFromStores() { var user = UserStore.getCurrentUser(); diff --git a/web/react/components/user_settings_security.jsx b/web/react/components/user_settings_security.jsx index a9f62097a..d83151cd8 100644 --- a/web/react/components/user_settings_security.jsx +++ b/web/react/components/user_settings_security.jsx @@ -113,7 +113,10 @@ export default class SecurityTab extends React.Component { if (this.props.user.auth_service === '') { inputs.push( - <div className='form-group'> + <div + key='currentPasswordUpdateForm' + className='form-group' + > <label className='col-sm-5 control-label'>Current Password</label> <div className='col-sm-7'> <input @@ -126,7 +129,10 @@ export default class SecurityTab extends React.Component { </div> ); inputs.push( - <div className='form-group'> + <div + key='newPasswordUpdateForm' + className='form-group' + > <label className='col-sm-5 control-label'>New Password</label> <div className='col-sm-7'> <input @@ -139,7 +145,10 @@ export default class SecurityTab extends React.Component { </div> ); inputs.push( - <div className='form-group'> + <div + key='retypeNewPasswordUpdateForm' + className='form-group' + > <label className='col-sm-5 control-label'>Retype New Password</label> <div className='col-sm-7'> <input @@ -155,7 +164,10 @@ export default class SecurityTab extends React.Component { submit = this.submitPassword; } else { inputs.push( - <div className='form-group'> + <div + key='oauthPasswordInfo' + className='form-group' + > <label className='col-sm-12'>Log in occurs through GitLab. Please see your GitLab account settings page to update your password.</label> </div> ); diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 6e61ab156..ed88c3df4 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -3,6 +3,7 @@ var Client = require('../utils/client.jsx'); var Utils = require('../utils/utils.jsx'); +import {config} from '../utils/config.js'; export default class ViewImageModal extends React.Component { constructor(props) { diff --git a/web/react/utils/config.js b/web/react/utils/config.js new file mode 100644 index 000000000..c7d1aa2bc --- /dev/null +++ b/web/react/utils/config.js @@ -0,0 +1,48 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +export var config = { + + // Loggly configs + LogglyWriteKey: '', + LogglyConsoleErrors: true, + + // Segment configs + SegmentWriteKey: '', + + // Feature switches + AllowPublicLink: true, + AllowInviteNames: true, + RequireInviteNames: false, + AllowSignupDomainsWizard: false, + + // Google Developer Key (for Youtube API links) + // Leave blank to disable + GoogleDeveloperKey: '', + + // Privacy switches + ShowEmail: true, + + // Links + TermsLink: '/static/help/configure_links.html', + PrivacyLink: '/static/help/configure_links.html', + AboutLink: '/static/help/configure_links.html', + HelpLink: '/static/help/configure_links.html', + ReportProblemLink: '/static/help/configure_links.html', + HomeLink: '', + + // Toggle whether or not users are shown a message about agreeing to the Terms of Service during the signup process + ShowTermsDuringSignup: false, + + ThemeColors: ['#2389d7', '#008a17', '#dc4fad', '#ac193d', '#0072c6', '#d24726', '#ff8f32', '#82ba00', '#03b3b2', '#008299', '#4617b4', '#8c0095', '#004b8b', '#004b8b', '#570000', '#380000', '#585858', '#000000'] +}; + +// Flavor strings +export var strings = { + Team: 'team', + TeamPlural: 'teams', + Company: 'company', + CompanyPlural: 'companies' +}; + +global.window.config = config; diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 6267ebd8f..dc229bd36 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -9,6 +9,7 @@ var ActionTypes = Constants.ActionTypes; var AsyncClient = require('./async_client.jsx'); var client = require('./client.jsx'); var Autolinker = require('autolinker'); +import {config} from '../utils/config.js'; export function isEmail(email) { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; @@ -564,7 +565,7 @@ export function textToJsx(textin, options) { key={word + i + z + '_hash'} className={'theme ' + mClass + highlightSearchClass} href='#' - onClick={() => searchForTerm(trimWord)} //eslint-disable-line no-loop-func + onClick={searchForTerm.bind(this, trimWord)} //eslint-disable-line no-loop-func > {trimWord} </a> diff --git a/web/static/config/config.js b/web/static/config/config.js deleted file mode 100644 index 00cae7ab2..000000000 --- a/web/static/config/config.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -// See License.txt for license information. - -var config = { - - // Loggly configs - LogglyWriteKey: "", - LogglyConsoleErrors: true, - - // Segment configs - SegmentWriteKey: "", - - // Feature switches - AllowPublicLink: true, - AllowInviteNames: true, - RequireInviteNames: false, - AllowSignupDomainsWizard: false, - - // Google Developer Key (for Youtube API links) - // Leave blank to disable - GoogleDeveloperKey: "", - - // Privacy switches - ShowEmail: true, - - // Links - TermsLink: "/static/help/configure_links.html", - PrivacyLink: "/static/help/configure_links.html", - AboutLink: "/static/help/configure_links.html", - HelpLink: "/static/help/configure_links.html", - ReportProblemLink: "/static/help/configure_links.html", - HomeLink: "", - - // Toggle whether or not users are shown a message about agreeing to the Terms of Service during the signup process - ShowTermsDuringSignup: false, - - ThemeColors: ["#2389d7", "#008a17", "#dc4fad", "#ac193d", "#0072c6", "#d24726", "#ff8f32", "#82ba00", "#03b3b2", "#008299", "#4617b4", "#8c0095", "#004b8b", "#004b8b", "#570000", "#380000", "#585858", "#000000"] -}; - -// Flavor strings -var strings = { - Team: "team", - TeamPlural: "teams", - Company: "company", - CompanyPlural: "companies" -}; diff --git a/web/templates/head.html b/web/templates/head.html index 6b6b7f09d..76ee70ced 100644 --- a/web/templates/head.html +++ b/web/templates/head.html @@ -37,8 +37,8 @@ <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['annotationchart']}]}"></script> <script type="text/javascript" src="https://cloudfront.loggly.com/js/loggly.tracker.js" async></script> - <script id="config" type="text/javascript" src="/static/config/config.js"></script> <style id="antiClickjack">body{display:none !important;}</style> + <script src="/static/js/bundle.js"></script> <script type="text/javascript"> if (self === top) { var blocker = document.getElementById("antiClickjack"); @@ -46,30 +46,29 @@ } </script> <script> - if (config == null) { - config = {}; + if (window.config == null) { + window.config = {}; } - config.SiteName = '{{ .SiteName }}'; - config.ProfileWidth = '{{ .Props.ProfileWidth }}' - config.ProfileHeight = '{{ .Props.ProfileHeight }}' + window.config.SiteName = '{{ .SiteName }}'; + window.config.ProfileWidth = '{{ .Props.ProfileWidth }}' + window.config.ProfileHeight = '{{ .Props.ProfileHeight }}' </script> - <script src="/static/js/bundle.js"></script> <script> - if (config.LogglyWriteKey != null && config.LogglyWriteKey !== "") { + if (window.config.LogglyWriteKey != null && window.config.LogglyWriteKey !== "") { var LTracker = LTracker || []; window.LTracker = LTracker; - LTracker.push({'logglyKey': config.LogglyWriteKey, 'sendConsoleErrors' : config.LogglyConsoleErrors }); + LTracker.push({'logglyKey': window.config.LogglyWriteKey, 'sendConsoleErrors' : window.config.LogglyConsoleErrors }); } else { window.LTracker = []; console.warn("config.js missing LogglyWriteKey, Loggly analytics is not reporting"); } </script> <script type="text/javascript"> - if (config.SegmentWriteKey != null && config.SegmentWriteKey !== "") { + if (window.config.SegmentWriteKey != null && window.config.SegmentWriteKey !== "") { !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1"; - analytics.load(config.SegmentWriteKey); + analytics.load(window.config.SegmentWriteKey); var user = window.UserStore.getCurrentUser(true); if (user) { analytics.identify(user.id, { |