Sorry! The URL you have requested does not exist (404).
18 |├── data └── .gitignore ├── public ├── css │ ├── admin.css │ ├── styles.css │ └── base.css ├── img │ └── nytlabs.png ├── js │ ├── buttons.jsx │ ├── login.jsx │ ├── initialresponse.jsx │ ├── author.jsx │ ├── response.jsx │ ├── main.jsx │ ├── responseAdmin.jsx │ ├── findAndReplaceDOMText.js │ └── admin.jsx ├── login.html ├── 404.html ├── author.html ├── 403.html ├── loggedout.html ├── initial.html ├── admin.html ├── index.html ├── home.html └── styleguide.html ├── .gitignore ├── requirements.txt ├── qanda.gif ├── Dockerfile ├── push.sh ├── main.go ├── app.json ├── LICENSE ├── DEPLOY.md ├── middle.go ├── types.go ├── README.md ├── server.go └── handlers.go /data/.gitignore: -------------------------------------------------------------------------------- 1 | [^.]* -------------------------------------------------------------------------------- /public/css/admin.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | membrane 2 | *.un~ 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.10.1 2 | -------------------------------------------------------------------------------- /qanda.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nytlabs/membrane/HEAD/qanda.gif -------------------------------------------------------------------------------- /public/img/nytlabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nytlabs/membrane/HEAD/public/img/nytlabs.png -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM google/golang 2 | 3 | ADD ./membrane . 4 | 5 | COPY public /public 6 | 7 | EXPOSE 8080 8 | 9 | CMD ["./membrane"] 10 | -------------------------------------------------------------------------------- /push.sh: -------------------------------------------------------------------------------- 1 | go get . 2 | go build 3 | docker build -t membrane . 4 | docker tag -f membrane mikedewar/membrane 5 | docker push mikedewar/membrane 6 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func main() { 9 | log.Println("~~~ WELCOME TO MEMBRANE ~~~~") 10 | 11 | router := NewRouter() 12 | controller.session = getSession() 13 | 14 | defer controller.session.Close() 15 | 16 | log.Fatal(http.ListenAndServe(":8080", router)) 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "React Tutorial Server", 3 | "description": "Code from the React tutorial", 4 | "keywords": [ "react", "reactjs", "tutorial" ], 5 | "repository": "https://github.com/reactjs/react-tutorial", 6 | "logo": "https://facebook.github.io/react/img/logo.svg", 7 | "website": "http://facebook.github.io/react/docs/tutorial.html", 8 | "success_url": "/", 9 | "env" : { 10 | "BUILDPACK_URL": "https://github.com/heroku/heroku-buildpack-nodejs.git" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 The New York Times Company 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this library except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /DEPLOY.md: -------------------------------------------------------------------------------- 1 | # MEMBRANE DEPLOYMENT 2 | 3 | ## PREREQ 4 | On a blank ubuntu machine, install docker, then run `docker run --name local-mongo -p 27017:27017 -d mongo`. 5 | 6 | ## DEPLOY ON TEST SERVER 7 | * On your linux dev box, in the root of the membrane repository, run `./push.sh`. 8 | * login to the test server via ssh 9 | * run: 10 | ``` 11 | docker rm -f membrane 12 | docker pull mikedewar/membrane 13 | docker run -d -e MONGOIP=10.0.0.91 -e MONGOPORT=27017 -p 8888:8080 --name membrane mikedewar/membrane 14 | ``` 15 | ***YOU MUST CHANGE MONGOIP TO YOUR LOCAL IP!!*** it should be in your prompt. It will look like 10.0.0.## except the pound signs will be numbers like regular integer numbers. 16 | 17 | Now membrane is running. Confirm by waiting 10s then running `docker ps` - you should see two containers running. Visit membrane by visiting the public IP of your machine on port 8888. 18 | 19 | ## WIPING MONGO 20 | From the server, run `mongo --port 27017` to attach to the mongo database. Then: 21 | ``` 22 | db.users.drop() 23 | db.authors.drop() 24 | db.responses.drop() 25 | db.prompts.drop() 26 | ``` 27 | -------------------------------------------------------------------------------- /public/js/buttons.jsx: -------------------------------------------------------------------------------- 1 | var LogOutButton = React.createClass({ 2 | 3 | logout: function() { 4 | $.ajax({ 5 | url: "/logout", 6 | type: "POST", 7 | statusCode: { 8 | 200: function() { 9 | window.location.replace("/loggedOut") 10 | } 11 | } 12 | }) 13 | }, 14 | 15 | render: function() { 16 | return ( 17 |
18 | ) 19 | } 20 | 21 | }) 22 | 23 | var DeleteButton = React.createClass({ 24 | 25 | propTypes: { 26 | slug: React.PropTypes.string.isRequired 27 | }, 28 | 29 | 30 | deletePost: function(){ 31 | $.ajax({ 32 | url: "/responses/"+this.props.slug, 33 | type: "DELETE", 34 | statusCode : { 35 | 200: function(){ 36 | window.location.reload() 37 | }, 38 | } 39 | }) 40 | }, 41 | 42 | render: function() { 43 | return ( 44 | 45 | ) 46 | } 47 | }) 48 | -------------------------------------------------------------------------------- /public/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Sorry! The URL you have requested does not exist (404).
18 |Hi this page is Forbidden to you! (403). If you are a membrane author, please login
18 |You are logged out! We've removed the cookie from your browser, so now you look just like any old person to us now. If you want to, please log back in.
18 |129 | Over the last few months, we at The New York Times's R&D Lab have been developing Membrane, which is an experiment in permeable publishing.
130 | 131 | 132 |A team that looks beyond the next product cycle, identifying trends and technologies that will emerge in the next three to five years.
136 |The R&D Lab is: Matt Boggie, Alexis Lloyd, Jane Friedhoff, Noah Feehan, Nik Hanselmann, and Mike Dewar.
143 |Membrane empowers readers with two abilities. The first is that they can highlight any piece of text within the article, select a question they want to ask, and submit that question to the writer. The second is that they can browse, inline, other user questions that have been answered by the writer. In this way, the article becomes a channel through which questions can be asked, responses can be given, and relationships can be developed.
147 | 148 |152 | Donec id elit non mi porta gravida at eget metus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec id elit non mi porta gravida at eget metus. Cras mattis consectetur purus sit amet fermentum. Nulla vitae elit libero, a pharetra augue. 153 |
154 | 155 | 156 | 170 | 171 | 176 | 177 | 178 | 179 |49 | {responses} 50 |
51 | 52 |{filtered}
359 |Membrane is an experiment in permeable publishing. It is a new form of reading experience, in which readers may “push back” through the medium to ask questions of the author.
429 | 430 |432 | As you read an essay, highlight any parts that you want to know more about, or express agreement with, or dispute. Once you have highlighted some text, a menu will appear asking you to select which question (or reaction) you’d like to submit. This list of “prompts” is provided by the author, and is specific to each essay. 433 |
434 | 435 |437 | When an author replies to your question, you will see an alert on your Membrane screen with details and a link to the author’s response. 438 |
439 | 440 | 441 | 442 |46 | {responses} 47 |
48 | 49 |{filtered}
365 |Reply to {this.props.prompt.kind} about {this.props.prompt.text}
447 | } 448 | 449 | return ( 450 |If your response answers any other unanswered questions, select them here. The users who asked these questions will be notified that their question has been answered.
458 |