mirror of
https://github.com/openvk/openvk
synced 2025-04-23 08:33:02 +03:00
М
- Долокализована админка (точно помню, что уже делал это, но ладно)
- Удалён лишний пункт "audios" в getLeftMenuItemStatus (реально)
- Если. У плеера есть параметр "hideButtons", то при наведении на него не пропадает время.
- На странице редактирования/создания плейлиста если у песни длинное название, то оно да похуй короче. Ну в общем лучше стало
- Там где нужно, добавлена строка в конце файла
- Возвращена строка "photo" в английской локали (я её случайно удалил 👍 )
This commit is contained in:
parent
11c563a7cd
commit
323154ea8a
21 changed files with 67 additions and 119 deletions
|
@ -464,7 +464,6 @@ class User extends RowModel
|
||||||
"links",
|
"links",
|
||||||
"poster",
|
"poster",
|
||||||
"apps",
|
"apps",
|
||||||
"audios",
|
|
||||||
],
|
],
|
||||||
])->get($id);
|
])->get($id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<a href="/admin/bannedLinks">{_admin_banned_links}</a>
|
<a href="/admin/bannedLinks">{_admin_banned_links}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/admin/music">Музыка</a>
|
<a href="/admin/music">{_admin_music}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="aui-nav-heading">
|
<div class="aui-nav-heading">
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
<input class="text medium-field" type="number" id="id" disabled value="{$playlist->getId()}" />
|
<input class="text medium-field" type="number" id="id" disabled value="{$playlist->getId()}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="name">Название</label>
|
<label for="name">{_name}</label>
|
||||||
<input class="text medium-field" type="text" id="name" name="name" value="{$playlist->getName()}" />
|
<input class="text medium-field" type="text" id="name" name="name" value="{$playlist->getName()}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="ext">Описание</label>
|
<label for="ext">{_description}</label>
|
||||||
<textarea class="text medium-field" type="text" id="description" name="description" style="resize: vertical;">{$playlist->getDescription()}</textarea>
|
<textarea class="text medium-field" type="text" id="description" name="description" style="resize: vertical;">{$playlist->getDescription()}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="ext">Обложка (ID фото)</label>
|
<label for="ext">{_admin_cover_id}</label>
|
||||||
<span id="avatar" class="aui-avatar aui-avatar-project aui-avatar-xlarge">
|
<span id="avatar" class="aui-avatar aui-avatar-project aui-avatar-xlarge">
|
||||||
<span class="aui-avatar-inner">
|
<span class="aui-avatar-inner">
|
||||||
<img src="{$playlist->getCoverUrl()}" style="object-fit: cover;"></img>
|
<img src="{$playlist->getCoverUrl()}" style="object-fit: cover;"></img>
|
||||||
|
@ -35,11 +35,11 @@
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="owner">Владелец</label>
|
<label for="owner">{_owner}</label>
|
||||||
<input class="text medium-field" type="number" id="owner_id" name="owner" value="{$playlist->getOwner()->getId()}" />
|
<input class="text medium-field" type="number" id="owner_id" name="owner" value="{$playlist->getOwner()->getId()}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label for="deleted">Удален</label>
|
<label for="deleted">{_deleted}</label>
|
||||||
<input class="toggle-large" type="checkbox" id="deleted" name="deleted" value="1" {if $playlist->isDeleted()} checked {/if} />
|
<input class="toggle-large" type="checkbox" id="deleted" name="deleted" value="1" {if $playlist->isDeleted()} checked {/if} />
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>{_admin_author}</th>
|
<th>{_admin_author}</th>
|
||||||
<th>Исполнитель</th>
|
<th>{_peformer}</th>
|
||||||
<th>{_admin_title}</th>
|
<th>{_admin_title}</th>
|
||||||
<th>{_genre}</th>
|
<th>{_genre}</th>
|
||||||
<th>Explicit</th>
|
<th>Explicit</th>
|
||||||
|
@ -88,8 +88,8 @@
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>{_admin_author}</th>
|
<th>{_admin_author}</th>
|
||||||
<th>{_name}</th>
|
<th>{_name}</th>
|
||||||
<th>Создан</th>
|
<th>{_created_playlist}</th>
|
||||||
<th>Действия</th>
|
<th>{_actions}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -113,12 +113,12 @@
|
||||||
<img src="{$playlist->getCoverURL()}" alt="{$owner->getCanonicalName()}" style="object-fit: cover;" role="presentation" />
|
<img src="{$playlist->getCoverURL()}" alt="{$owner->getCanonicalName()}" style="object-fit: cover;" role="presentation" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{$playlist->getName()}
|
{ovk_proc_strtr($playlist->getName(), 30)}
|
||||||
</td>
|
</td>
|
||||||
<td>{$playlist->getCreationTime()}</td>
|
<td>{$playlist->getCreationTime()}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="aui-button aui-button-primary" href="/admin/playlist/{$playlist->getId()}/edit">
|
<a class="aui-button aui-button-primary" href="/admin/playlist/{$playlist->getId()}/edit">
|
||||||
<span class="aui-icon aui-icon-small aui-iconfont-new-edit">Редактировать</span>
|
<span class="aui-icon aui-icon-small aui-iconfont-new-edit">{_edit}</span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -37,12 +37,12 @@
|
||||||
|
|
||||||
<div style="margin-top: 19px;">
|
<div style="margin-top: 19px;">
|
||||||
<input id="playlist_query" type="text" style="height: 26px;" placeholder="{_header_search}">
|
<input id="playlist_query" type="text" style="height: 26px;" placeholder="{_header_search}">
|
||||||
<div class="playlistAudiosContainer" style="display:table;clear:both;width:100%;margin-top: 10px;">
|
<div class="playlistAudiosContainer editContainer">
|
||||||
<div id="newPlaylistAudios" n:foreach="$audios as $audio">
|
<div id="newPlaylistAudios" n:foreach="$audios as $audio">
|
||||||
<div style="width: 78%;float: left;">
|
<div class="playerContainer">
|
||||||
{include "player.xml", audio => $audio, hideButtons => true}
|
{include "player.xml", audio => $audio, hideButtons => true}
|
||||||
</div>
|
</div>
|
||||||
<div class="attachAudio addToPlaylist" data-id="{$audio->getId()}" style="width: 22%;">
|
<div class="attachAudio addToPlaylist" data-id="{$audio->getId()}">
|
||||||
<span>{_remove_from_playlist}</span>
|
<span>{_remove_from_playlist}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,92 +3,18 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
||||||
|
<link rel="icon">
|
||||||
<title>{$audio->getName()}</title>
|
<title>{$audio->getName()}</title>
|
||||||
|
|
||||||
{css "css/style.css"}
|
{css "css/main.css"}
|
||||||
|
{css "css/audios.css"}
|
||||||
|
{script "js/node_modules/dashjs/dist/dash.all.min.js"}
|
||||||
|
{script "js/node_modules/jquery/dist/jquery.min.js"}
|
||||||
|
{script "js/node_modules/umbrellajs/umbrella.min.js"}
|
||||||
</head>
|
</head>
|
||||||
<body id="audioEmbed">
|
<body id="audioEmbed">
|
||||||
<audio id="audio" />
|
{include "player.xml", audio => $audio}
|
||||||
|
|
||||||
<div id="miniplayer" class="audioEntry">
|
{script "js/al_music.js"}
|
||||||
<div class="playerButton">
|
|
||||||
<img src="/assets/packages/static/openvk/img/play.jpg" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="status">
|
|
||||||
<div class="mediaInfo">
|
|
||||||
<strong>
|
|
||||||
{$audio->getPerformer()}
|
|
||||||
</strong>
|
|
||||||
-
|
|
||||||
<span class="nobold">
|
|
||||||
{$audio->getTitle()}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="track">
|
|
||||||
<div class="selectableTrack">
|
|
||||||
<div> <!-- actual track --></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="volume">
|
|
||||||
<span class="nobold">
|
|
||||||
{$audio->getFormattedLength()}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{script "js/node_modules/umbrellajs/umbrella.min.js"}
|
|
||||||
{script "js/node_modules/dashjs/dist/dash.all.min.js"}
|
|
||||||
<script>
|
|
||||||
function fmtTime(time) {
|
|
||||||
mins = Math.floor(time / 60).toString().padStart(2, 0);
|
|
||||||
secs = (time - (Math.floor(time / 60) * 60)).toString().padStart(2, 0);
|
|
||||||
|
|
||||||
return mins + ":" + secs;
|
|
||||||
}
|
|
||||||
|
|
||||||
const protData = {
|
|
||||||
"org.w3.clearkey": {
|
|
||||||
"clearkeys": {$audio->getKeys()}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const play = u(".playerButton > img");
|
|
||||||
const audio = document.querySelector("#audio");
|
|
||||||
const player = dashjs.MediaPlayer().create();
|
|
||||||
player.initialize(audio, {$audio->getURL()}, true);
|
|
||||||
player.setProtectionData(protData);
|
|
||||||
|
|
||||||
play.on("click", function() {
|
|
||||||
audio.paused ? audio.play() : audio.pause();
|
|
||||||
});
|
|
||||||
|
|
||||||
u(audio).on("timeupdate", function() {
|
|
||||||
let time = audio.currentTime;
|
|
||||||
let ps = Math.ceil((time * 100) / {$audio->getLength()});
|
|
||||||
|
|
||||||
u(".volume span").html(fmtTime(Math.floor(time)));
|
|
||||||
u(".track > div > div").nodes[0].style.width = ps + "%";
|
|
||||||
});
|
|
||||||
|
|
||||||
u(audio).on("play", function() {
|
|
||||||
play.attr("src", "/assets/packages/static/openvk/img/pause.jpg");
|
|
||||||
});
|
|
||||||
|
|
||||||
u(audio).on(["pause", "ended", "suspended"], function() {
|
|
||||||
play.attr("src", "/assets/packages/static/openvk/img/play.jpg");
|
|
||||||
});
|
|
||||||
|
|
||||||
u(".track > div").on("click", function(e) {
|
|
||||||
let rect = document.querySelector(".selectableTrack").getBoundingClientRect();
|
|
||||||
let width = e.clientX - rect.left;
|
|
||||||
let time = Math.ceil((width * {$audio->getLength()}) / (rect.right - rect.left));
|
|
||||||
|
|
||||||
audio.currentTime = time;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -49,12 +49,12 @@
|
||||||
|
|
||||||
<div style="margin-top: 19px;">
|
<div style="margin-top: 19px;">
|
||||||
<input id="playlist_query" type="text" style="height: 26px;" placeholder="{_header_search}">
|
<input id="playlist_query" type="text" style="height: 26px;" placeholder="{_header_search}">
|
||||||
<div class="playlistAudiosContainer" style="display:table;clear:both;width:100%;margin-top: 10px;">
|
<div class="playlistAudiosContainer editContainer">
|
||||||
<div id="newPlaylistAudios" n:foreach="$audios as $audio">
|
<div id="newPlaylistAudios" n:foreach="$audios as $audio">
|
||||||
<div style="width: 78%;float: left;">
|
<div style="width: 78%;float: left;">
|
||||||
{include "player.xml", audio => $audio, hideButtons => true}
|
{include "player.xml", audio => $audio, hideButtons => true}
|
||||||
</div>
|
</div>
|
||||||
<div class="attachAudio addToPlaylist" data-id="{$audio->getId()}" style="width: 22%;">
|
<div class="attachAudio addToPlaylist" data-id="{$audio->getId()}">
|
||||||
<span>{_add_to_playlist}</span>
|
<span>{_add_to_playlist}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,9 +66,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" id="newPlaylistForm" enctype="multipart/form-data">
|
<form method="post" id="newPlaylistForm" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="title" maxlength="128" />
|
<input type="hidden" name="title" maxlength="125" />
|
||||||
<input type="hidden" name="hash" value="{$csrfToken}" />
|
<input type="hidden" name="hash" value="{$csrfToken}" />
|
||||||
<textarea style="display:none;" name="description" maxlength="2048" />
|
<textarea style="display:none;" name="description" maxlength="2045" />
|
||||||
<input type="hidden" name="audios">
|
<input type="hidden" name="audios">
|
||||||
<input type="file" style="display:none;" name="cover" accept=".jpg,.png">
|
<input type="file" style="display:none;" name="cover" accept=".jpg,.png">
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
<div class="mediaInfo" style="margin-bottom: -8px; cursor: pointer;display:flex;width: 85%;">
|
<div class="mediaInfo" style="margin-bottom: -8px; cursor: pointer;display:flex;width: 85%;">
|
||||||
<div class="info noOverflow">
|
<div class="info noOverflow">
|
||||||
<strong class="performer">
|
<strong class="performer">
|
||||||
<a href="/search?query=&type=audios&sort=id&only_performers=on&query={$audio->getPerformer()}">{$audio->getPerformer()}</a>
|
<a href="/search?query=&type=audios&sort=id&only_performers=on&query={$audio->getPerformer()}">{ovk_proc_strtr($audio->getPerformer(), 30)}</a>
|
||||||
</strong>
|
</strong>
|
||||||
—
|
—
|
||||||
<span class="title {if !empty($audio->getLyrics())}withLyrics{/if}">{$audio->getTitle()}</span>
|
<span class="title {if !empty($audio->getLyrics())}withLyrics{/if}">{ovk_proc_strtr($audio->getTitle(), 30)}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="explicitMark" n:if="$audio->isExplicit()"></div>
|
<div class="explicitMark" n:if="$audio->isExplicit()"></div>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="volume" style="display: flex; flex-direction: column;width:14%;">
|
<div class="volume" style="display: flex; flex-direction: column;width:14%;">
|
||||||
<span class="nobold" data-unformatted="{$audio->getLength()}" style="text-align: center;margin-top: 12px;">{$audio->getFormattedLength()}</span>
|
<span class="nobold {if !$hideButtons}hideOnHover{/if}" data-unformatted="{$audio->getLength()}" style="text-align: center;margin-top: 12px;">{$audio->getFormattedLength()}</span>
|
||||||
<div class="buttons" style="margin-top: 8px;">
|
<div class="buttons" style="margin-top: 8px;">
|
||||||
{php $hasAudio = isset($thisUser) && $audio->isInLibraryOf($thisUser)}
|
{php $hasAudio = isset($thisUser) && $audio->isInLibraryOf($thisUser)}
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audioEntry:hover .volume span {
|
.audioEntry:hover .volume .hideOnHover {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,3 +641,21 @@
|
||||||
background: #787878;
|
background: #787878;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editContainer {
|
||||||
|
display:table;
|
||||||
|
clear:both;
|
||||||
|
width:100%;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editContainer .playerContainer {
|
||||||
|
width: 78%;
|
||||||
|
float: left;
|
||||||
|
max-width: 78%;
|
||||||
|
min-width: 68%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addToPlaylist {
|
||||||
|
width: 22%;
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
|
@ -25,10 +25,10 @@ searcher.successCallback = (response, thisc) => {
|
||||||
|
|
||||||
document.querySelector(".playlistAudiosContainer").insertAdjacentHTML("beforeend", `
|
document.querySelector(".playlistAudiosContainer").insertAdjacentHTML("beforeend", `
|
||||||
<div id="newPlaylistAudios">
|
<div id="newPlaylistAudios">
|
||||||
<div style="width: 78%;float: left;">
|
<div class="playerContainer">
|
||||||
${el.outerHTML}
|
${el.outerHTML}
|
||||||
</div>
|
</div>
|
||||||
<div class="attachAudio addToPlaylist" data-id="${id}" style="width: 22%;">
|
<div class="attachAudio addToPlaylist" data-id="${id}">
|
||||||
<span>${isAttached ? tr("remove_from_playlist") : tr("add_to_playlist")}</span>
|
<span>${isAttached ? tr("remove_from_playlist") : tr("add_to_playlist")}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -347,6 +347,7 @@
|
||||||
"albums" = "Albums";
|
"albums" = "Albums";
|
||||||
"album" = "Album";
|
"album" = "Album";
|
||||||
"photos" = "photos";
|
"photos" = "photos";
|
||||||
|
"photo" = "Photo";
|
||||||
"create_album" = "Create album";
|
"create_album" = "Create album";
|
||||||
"edit_album" = "Edit album";
|
"edit_album" = "Edit album";
|
||||||
"edit_photo" = "Edit photo";
|
"edit_photo" = "Edit photo";
|
||||||
|
@ -1530,6 +1531,8 @@
|
||||||
"admin_gift_moved_to_recycle" = "This gift will now be in <b>Recycle Bin</b>.";
|
"admin_gift_moved_to_recycle" = "This gift will now be in <b>Recycle Bin</b>.";
|
||||||
"admin_original_file" = "Original file";
|
"admin_original_file" = "Original file";
|
||||||
"admin_audio_length" = "Length";
|
"admin_audio_length" = "Length";
|
||||||
|
"admin_cover_id" = "Cover (photo ID)";
|
||||||
|
"admin_music" = "Music";
|
||||||
|
|
||||||
"logs" = "Logs";
|
"logs" = "Logs";
|
||||||
"logs_anything" = "Anything";
|
"logs_anything" = "Anything";
|
||||||
|
|
|
@ -1415,6 +1415,8 @@
|
||||||
"admin_gift_moved_to_recycle" = "Теперь подарок находится в <b>корзине</b>.";
|
"admin_gift_moved_to_recycle" = "Теперь подарок находится в <b>корзине</b>.";
|
||||||
"admin_original_file" = "Оригинальный файл";
|
"admin_original_file" = "Оригинальный файл";
|
||||||
"admin_audio_length" = "Длина";
|
"admin_audio_length" = "Длина";
|
||||||
|
"admin_cover_id" = "Обложка (ID фото)";
|
||||||
|
"admin_music" = "Музыка";
|
||||||
|
|
||||||
"logs" = "Логи";
|
"logs" = "Логи";
|
||||||
"logs_anything" = "Любое";
|
"logs_anything" = "Любое";
|
||||||
|
|
Loading…
Reference in a new issue