-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Contributors and Private Photos #71 from develop
[Release] Contributors and Private Photos #71
- Loading branch information
Showing
89 changed files
with
1,517 additions
and
211 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
"use strict"; | ||
|
||
(function() { | ||
var PolyfillEvent = eventConstructor(); | ||
|
||
function eventConstructor() { | ||
if (typeof window.CustomEvent === "function") return window.CustomEvent; | ||
// IE<=9 Support | ||
function CustomEvent(event, params) { | ||
params = params || {bubbles: false, cancelable: false, detail: undefined}; | ||
var evt = document.createEvent('CustomEvent'); | ||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
return evt; | ||
} | ||
CustomEvent.prototype = window.Event.prototype; | ||
return CustomEvent; | ||
} | ||
|
||
function buildHiddenInput(name, value) { | ||
var input = document.createElement("input"); | ||
input.type = "hidden"; | ||
input.name = name; | ||
input.value = value; | ||
return input; | ||
} | ||
|
||
function handleClick(element) { | ||
var to = element.getAttribute("data-to"), | ||
method = buildHiddenInput("_method", element.getAttribute("data-method")), | ||
csrf = buildHiddenInput("_csrf_token", element.getAttribute("data-csrf")), | ||
form = document.createElement("form"), | ||
target = element.getAttribute("target"); | ||
|
||
form.method = (element.getAttribute("data-method") === "get") ? "get" : "post"; | ||
form.action = to; | ||
form.style.display = "hidden"; | ||
|
||
if (target) form.target = target; | ||
|
||
form.appendChild(csrf); | ||
form.appendChild(method); | ||
document.body.appendChild(form); | ||
form.submit(); | ||
} | ||
|
||
window.addEventListener("click", function(e) { | ||
var element = e.target; | ||
|
||
while (element && element.getAttribute) { | ||
var phoenixLinkEvent = new PolyfillEvent('phoenix.link.click', { | ||
"bubbles": true, "cancelable": true | ||
}); | ||
|
||
if (!element.dispatchEvent(phoenixLinkEvent)) { | ||
e.preventDefault(); | ||
return false; | ||
} | ||
|
||
if (element.getAttribute("data-method")) { | ||
handleClick(element); | ||
e.preventDefault(); | ||
return false; | ||
} else { | ||
element = element.parentNode; | ||
} | ||
} | ||
}, false); | ||
|
||
window.addEventListener('phoenix.link.click', function (e) { | ||
var message = e.target.getAttribute("data-confirm"); | ||
if(message && !window.confirm(message)) { | ||
e.preventDefault(); | ||
} | ||
}, false); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react' | ||
|
||
class Contributors extends React.Component { | ||
contributionsList(contributors){ | ||
var names = []; | ||
for (var i = 0; i < contributors.length; i++) { | ||
var name = contributors[i].first_name + " " + contributors[i].last_name; | ||
names.push(<a key={"cont-" + contributors[i].id} href={"/contributors#cont-" + contributors[i].id}>{name}</a>); | ||
|
||
if(contributors.length > 1) { | ||
if (i == (contributors.length - 1)) { | ||
names.splice(-1, 0, " and "); | ||
} else { | ||
names.push(", "); | ||
} | ||
} | ||
} | ||
return names; | ||
} | ||
render() { | ||
var contributors = this.props.contributors; | ||
if (contributors === undefined || contributors.length === 0 ) { | ||
return ""; | ||
} | ||
return ( | ||
<div className="contributors"> | ||
<h2>Contributors</h2> | ||
<p>Additional contributions from {this.contributionsList(contributors)}.</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Contributors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.