deleted unnecessary handlebars js and partials

This commit is contained in:
bill bittner 2018-02-01 10:46:41 -08:00
parent 97a6254370
commit 69ed241d1c
9 changed files with 0 additions and 351 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9 KiB

View file

@ -1,56 +0,0 @@
// Create new error objects, that prototypically inherit from the Error constructor
function FileError(message) {
this.name = 'FileError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
FileError.prototype = Object.create(Error.prototype);
FileError.prototype.constructor = FileError;
function NameError(message) {
this.name = 'NameError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
NameError.prototype = Object.create(Error.prototype);
NameError.prototype.constructor = NameError;
function ChannelNameError(message) {
this.name = 'ChannelNameError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
ChannelNameError.prototype = Object.create(Error.prototype);
ChannelNameError.prototype.constructor = ChannelNameError;
function ChannelPasswordError(message) {
this.name = 'ChannelPasswordError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
ChannelPasswordError.prototype = Object.create(Error.prototype);
ChannelPasswordError.prototype.constructor = ChannelPasswordError;
function AuthenticationError(message) {
this.name = 'AuthenticationError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
AuthenticationError.prototype = Object.create(Error.prototype);
AuthenticationError.prototype.constructor = AuthenticationError;
function showAssetDetails(event) {
var thisAssetHolder = document.getElementById(event.target.id);
var thisAssetImage = thisAssetHolder.firstElementChild;
var thisAssetDetails = thisAssetHolder.lastElementChild;
thisAssetImage.style.opacity = 0.2;
thisAssetDetails.setAttribute('class', 'grid-item-details flex-container--column flex-container--center-center');
}
function hideAssetDetails(event) {
var thisAssetHolder = document.getElementById(event.target.id);
var thisAssetImage = thisAssetHolder.firstElementChild;
var thisAssetDetails = thisAssetHolder.lastElementChild;
thisAssetImage.style.opacity = 1;
thisAssetDetails.setAttribute('class', 'hidden');
}

View file

@ -1,134 +0,0 @@
{{#if claimInfo.channelName}}
<div class="row row--padded row--wide row--no-top">
<div class="column column--2 column--med-10">
<span class="text">Channel:</span>
</div><div class="column column--8 column--med-10">
<span class="text"><a href="/{{claimInfo.channelName}}:{{claimInfo.certificateId}}">{{claimInfo.channelName}}</a></span>
</div>
</div>
{{/if}}
{{#if claimInfo.description}}
<div class="row row--padded row--wide row--no-top">
<span class="text">{{claimInfo.description}}</span>
</div>
{{/if}}
<div class="row row--padded row--wide row--no-top">
<div id="show-short-link">
<div class="column column--2 column--med-10">
<a class="link--primary" href="/{{shortId}}/{{claimInfo.name}}.{{claimInfo.fileExt}}"><span class="text">Link:</span></a>
</div><div class="column column--8 column--med-10">
<div class="row row--short row--wide">
<div class="column column--7">
<div class="input-error" id="input-error-copy-short-link" hidden="true"></div>
<input type="text" id="short-link" class="input-disabled input-text--full-width" readonly spellcheck="false" value="{{claimInfo.host}}/{{shortId}}/{{claimInfo.name}}.{{claimInfo.fileExt}}" onclick="select()"/>
</div><div class="column column--1"></div><div class="column column--2">
<button class="button--primary" data-elementtocopy="short-link" onclick="copyToClipboard(event)">copy</button>
</div>
</div>
</div>
</div>
<div id="show-embed-code">
<div class="column column--2 column--med-10">
<span class="text">Embed:</span>
</div><div class="column column--8 column--med-10">
<div class="row row--short row--wide">
<div class="column column--7">
<div class="input-error" id="input-error-copy-embed-text" hidden="true"></div>
{{#ifConditional claimInfo.contentType '===' 'video/mp4'}}
<input type="text" id="embed-text" class="input-disabled input-text--full-width" readonly onclick="select()" spellcheck="false" value='&lt;video width="100%" controls poster="{{claimInfo.thumbnail}}" src="{{claimInfo.host}}/{{claimInfo.claimId}}/{{claimInfo.name}}.{{claimInfo.fileExt}}"/>&lt;/video>'/>
{{else}}
<input type="text" id="embed-text" class="input-disabled input-text--full-width" readonly onclick="select()" spellcheck="false" value='&lt;img src="{{claimInfo.host}}/{{claimInfo.claimId}}/{{claimInfo.name}}.{{claimInfo.fileExt}}"/>'/>
{{/ifConditional}}
</div><div class="column column--1"></div><div class="column column--2">
<button class="button--primary" data-elementtocopy="embed-text" onclick="copyToClipboard(event)">copy</button>
</div>
</div>
</div>
</div>
</div>
<div id="show-share-buttons">
<div class="row row--padded row--wide row--no-top">
<div class="column column--2 column--med-10">
<span class="text">Share:</span>
</div><div class="column column--7 column--med-10">
<div class="row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap">
<a class="link--primary" target="_blank" href="https://twitter.com/intent/tweet?text={{claimInfo.host}}/{{shortId}}/{{claimInfo.name}}">twitter</a>
<a class="link--primary" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u={{claimInfo.host}}/{{shortId}}/{{claimInfo.name}}">facebook</a>
<a class="link--primary" target="_blank" href="http://tumblr.com/widgets/share/tool?canonicalUrl={{claimInfo.host}}/{{shortId}}/{{claimInfo.name}}">tumblr</a>
<a class="link--primary" target="_blank" href="https://www.reddit.com/submit?url={{claimInfo.host}}/{{shortId}}/{{claimInfo.name}}&title={{claimInfo.name}}">reddit</a>
</div>
</div>
</div>
</div>
<div id="show-details" class="row--padded row--wide row--no-top" hidden="true">
<div id="show-claim-name">
<div class="column column--2 column--med-10">
<span class="text">Claim Name:</span>
</div><div class="column column--8 column--med-10">
{{claimInfo.name}}
</div>
</div>
<div id="show-claim-id">
<div class="column column--2 column--med-10">
<span class="text">Claim Id:</span>
</div><div class="column column--8 column--med-10">
{{claimInfo.claimId}}
</div>
</div>
<div id="show-claim-id">
<div class="column column--2 column--med-10">
<span class="text">File Type:</span>
</div><div class="column column--8 column--med-10">
{{#if claimInfo.contentType}}
{{claimInfo.contentType}}
{{else}}
unknown
{{/if}}
</div>
</div>
<div id="show-claim-id">
<div class="column column--10">
<a target="_blank" href="https://lbry.io/dmca">Report</a>
</div>
</div>
</div>
<div class="row row--wide">
<a class="text link--primary" id="show-details-toggle" href="#" onclick="toggleSection(event)" data-status="closed">[more]</a>
</div>
<script>
function toggleSection(event){
event.preventDefault();
var dataSet = event.target.dataset;
var status = dataSet.status;
var toggle = document.getElementById("show-details-toggle");
var details = document.getElementById("show-details");
if (status === "closed") {
details.hidden = false;
toggle.innerText = "[less]";
toggle.dataset.status = "open";
} else {
details.hidden = true;
toggle.innerText = "[more]";
toggle.dataset.status = "closed";
}
}
function copyToClipboard(event){
var elementToCopy = event.target.dataset.elementtocopy;
var element = document.getElementById(elementToCopy);
var errorElement = 'input-error-copy-text' + elementToCopy;
element.select();
try {
document.execCommand('copy');
} catch (err) {
validationFunctions.showError(errorElement, 'Oops, unable to copy');
}
}
</script>

View file

@ -1,39 +0,0 @@
<form id="publish-channel-form">
<p id="input-error-channel-name" class="info-message-placeholder info-message--failure"></p>
<div class="row row--wide row--short">
<div class="column column--3 column--sml-10">
<label class="label" for="new-channel-name">Name:</label>
</div><div class="column column--6 column--sml-10">
<div class="input-text--primary flex-container--row flex-container--left-bottom">
<span>@</span>
<input type="text" name="new-channel-name" id="new-channel-name" class="input-text" placeholder="exampleChannelName" value="" oninput="validationFunctions.checkChannelName(event.target.value)">
<span id="input-success-channel-name" class="info-message--success"></span>
</div>
</div>
</div>
<div class="row row--wide row--short">
<div class="column column--3 column--sml-10">
<label class="label" for="new-channel-password">Password:</label>
</div><div class="column column--6 column--sml-10">
<div class="input-text--primary">
<input type="password" name="new-channel-password" id="new-channel-password" class="input-text" placeholder="" value="" >
</div>
</div>
</div>
<div class="row row--wide">
<button class="button--primary" onclick="publishNewChannel(event)">Create Channel</button>
</div>
</form>
<div id="channel-publish-in-progress" hidden="true">
<p>Creating your new channel. This may take a few seconds...</p>
{{> progressBar}}
</div>
<div id="channel-publish-done" hidden="true">
<p>Your channel has been successfully created!</p>
</div>
<script src="/assets/js/createChannelFunctions.js"></script>

View file

@ -1,28 +0,0 @@
<form id="channel-login-form">
<p id="login-error-display-element" class="info-message-placeholder info-message--failure"></p>
<div class="row row--wide row--short">
<div class="column column--3 column--sml-10">
<label class="label" for="channel-login-name-input">Name:</label>
</div><div class="column column--6 column--sml-10">
<div class="input-text--primary flex-container--row flex-container--left-bottom">
<span>@</span>
<input type="text" id="channel-login-name-input" class="input-text" placeholder="" value="">
</div>
</div>
</div>
<div class="row row--wide row--short">
<div class="column column--3 column--sml-10">
<label class="label" for="channel-login-password-input" >Password:</label>
</div><div class="column column--6 column--sml-10">
<div class="input-text--primary">
<input type="password" id="channel-login-password-input" class="input-text" placeholder="" value="">
</div>
</div>
</div>
<div class="row row--wide">
<button class="button--primary" onclick="loginToChannel(event)">Authenticate</button>
</div>
</form>
<script src="/assets/js/loginFunctions.js"></script>

View file

@ -1,15 +0,0 @@
<div class='row row--wide'>
<div class="column column--3 align-content-top">
<a href="{{this.showUrlLong}}">
{{#ifConditional this.contentType '===' 'video/mp4'}}
<img class="content-list-item-asset" src="{{this.thumbnail}}"/>
{{else}}
<img class="content-list-item-asset" src="{{this.directUrlLong}}" />
{{/ifConditional}}
</a>
</div><div class="column column--7 align-content-top">
<p>{{this.title}}</p>
<a class="link--primary" href="{{this.showUrlShort}}">spee.ch{{this.showUrlShort}}</a>
</div>
</div>

View file

@ -1,11 +0,0 @@
<div class="grid-item" id="grid-item-{{this.name}}-{{this.claimId}}" onmouseenter="showAssetDetails(event)" onmouseleave="hideAssetDetails(event)">
{{#ifConditional this.contentType '===' 'video/mp4'}}
<img class="grid-item-image" src="{{this.thumbnail}}"/>
{{else}}
<img class="grid-item-image" src="{{this.claimId}}/{{this.name}}.{{this.fileExt}}" />
{{/ifConditional}}
<div class="hidden" onclick="window.location='{{this.claimId}}/{{this.name}}'">
<p class="grid-item-details-text">{{this.name}}</p>
</div>
</div>

View file

@ -1,68 +0,0 @@
<div class="row row--wide nav-bar">
<div class="row row--padded row--short flex-container--row flex-container--space-between-center">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" height="24px" viewBox="0 0 80 31" enable-background="new 0 0 80 31" xml:space="preserve" class="nav-bar-logo">
<a href="/">
<title>Logo</title>
<desc>Spee.ch logo</desc>
<g id="About">
<g id="Publish-Form-V2-_x28_filled_x29_" transform="translate(-42.000000, -23.000000)">
<g id="Group-17" transform="translate(42.000000, 22.000000)">
<text transform="matrix(1 0 0 1 0 20)" font-size="25" font-family="Roboto">Spee&lt;h</text>
<g id="Group-16" transform="translate(0.000000, 30.000000)">
<path id="Line-8" fill="none" stroke="#09F911" stroke-width="1" stroke-linecap="square" d="M0.5,1.5h15"/>
<path id="Line-8-Copy" fill="none" stroke="#029D74" stroke-width="1" stroke-linecap="square" d="M16.5,1.5h15"/>
<path id="Line-8-Copy-2" fill="none" stroke="#E35BD8" stroke-width="1" stroke-linecap="square" d="M32.5,1.5h15"/>
<path id="Line-8-Copy-3" fill="none" stroke="#4156C5" stroke-width="1" stroke-linecap="square" d="M48.5,1.5h15"/>
<path id="Line-8-Copy-4" fill="none" stroke="#635688" stroke-width="1" stroke-linecap="square" d="M64.5,1.5h15"/>
</g>
</g>
</g>
</g>
</a>
</svg>
<div class="nav-bar--center">
<span class="nav-bar-tagline">Open-source, decentralized image and video sharing.</span>
</div>
<div class="nav-bar--right">
<a class="nav-bar-link link--nav" href="/">Publish</a>
<!--<a class="nav-bar-link link--nav" href="/popular">Popular</a>-->
<a class="nav-bar-link link--nav" href="/about">About</a>
{{#if user }}
<select type="text" id="nav-bar-channel-select" class="select select--arrow link--nav" onchange="toggleNavBarSelection(event)">
<option id="nav-bar-channel-select-channel-option" >{{user.channelName}}</option>
<option value="VIEW" data-channelUrl="/{{user.channelName}}:{{user.channelClaimId}}">View</option>
<option value="LOGOUT">Logout</option>
</select>
{{else}}
<a id="nav-bar-login-link" class="nav-bar-link link--nav" href="/login">Channel</a>
{{/if}}
</div>
</div>
</div>
<script type="text/javascript">
// highlight the link for the current page
const navBarLinks = document.getElementsByClassName('link--nav');
for (let i = 0; i < navBarLinks.length; i++){
const link = navBarLinks[i];
if (link.href == window.location.href) {
link.setAttribute('class', 'nav-bar-link link--nav-active');
} else if (`/${link.value}` === window.location.pathname) {
link.setAttribute('class', 'select select--arrow link--nav-active');
}
}
// function to send user to their channel if selected
function toggleNavBarSelection (event) {
console.log('toggleNavBarSelection event', event);
const selectedOption = event.target.selectedOptions[0].value;
if (selectedOption === 'LOGOUT') {
// send logout request to server
window.location.href = '/logout';
} else if (selectedOption === 'VIEW') {
// redirect to channel page
const channelUrl = event.target.selectedOptions[0].dataset.channelurl;
console.log('url:', channelUrl);
window.location.href = channelUrl;
}
}
</script>