Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit b49b0ee

Browse files
committed
Added Copy Replay URL to clipboard button in replay listings
1 parent b6c6f4e commit b49b0ee

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/electron/app/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h4></h4>
149149
</main>
150150
<script id="replays-list-row" type="text/x-handlebars-template">
151151
<tr data-id="{{vid}}" class="link {{searched}} {{seen}} user-{{userid}}">
152-
<td width="400" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}">{{{watched}}}&nbsp;&nbsp;&nbsp;{{unlisted}}{{{isLive}}}{{title}}</td>
152+
<td width="350" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer; overflow: hidden;" onClick="playVideo('{{vid}}')" class="{{highlight}}">{{{watched}}}&nbsp;&nbsp;&nbsp;{{unlisted}}{{{isLive}}}{{title}}</td>
153153
<td width="130" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" align="center" data-name="date">{{ds}}</td>
154154
<td width="55" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" align="right">{{length}}</td>
155155
<td width="75" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" align="right" data-name="views">{{playnumber}}</td>
@@ -158,8 +158,9 @@ <h4></h4>
158158
<td width="33" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" style="color:gray" align="right" data-name="lpm">{{lpm}}</td>
159159
<td width="75" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" align="right" data-name="shares">{{sharenum}}</td>
160160
<td width="33" oncontextmenu="openReplayContextMenu('{{vid}}')" style="cursor: pointer;" onClick="playVideo('{{vid}}')" class="{{highlight}}" style="color:gray" align="right" data-name="spm">{{spm}}</td>
161-
<td width="35" class="{{highlight}}" style="padding: 0 0.5em; text-align: right;">
162-
{{{inQueue}}}
161+
<td width="85" class="{{highlight}}" style="padding: 0 0.5em; text-align: right;">
162+
{{{inQueue}}}&nbsp;&nbsp;
163+
{{{getURL}}}
163164
</td>
164165
<td width="40" class="{{highlight}}" style="padding: 0 0.5em; text-align: right;">
165166
<a class="button " onClick="openReplayContextMenu('{{vid}}')" title="menu">...</a>

src/electron/app/js/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ function _addReplayEntry(replay, wasSearched) {
11521152

11531153
let isLive = replay.hlsvideosource.endsWith('flv') || replay.hlsvideosource.indexOf('liveplay') > 0 ? '<b style="color:limegreen;">[LIVE]</b>' : ''
11541154
let inQueue = $('#download-' + replay.vid).length > 0 ? '<a id="download-replay-' + replay.vid + '" class="button icon-only"><i class="icon icon-download dim"></i></a>' : '<a id="download-replay-' + replay.vid + '" class="button icon-only" onClick="downloadVideo(\'' + replay.vid + '\')"">' + downloaded + '</a>'
1155+
let getURL = '<a title="Copy Replay URL to clipboard." class="button icon-only" onClick="copyToClipboard(\'https://www.liveme.com/us/v/'+replay.vid+'/index.html\')"><i class="icon icon-copy bright"></i></a>'
11551156

11561157
const template = Handlebars.compile($('#replays-list-row').html())
11571158

@@ -1169,6 +1170,7 @@ function _addReplayEntry(replay, wasSearched) {
11691170
vpm: vpm.toFixed(1),
11701171
spm: spm.toFixed(1),
11711172
inQueue,
1173+
getURL,
11721174
source: replay.videosource || replay.hlsvideosource
11731175
})
11741176

0 commit comments

Comments
 (0)