是否可以向标准化“列表”中的条目添加更多元素(或以其他方式改变)?在 Spotify 应用程序中查看?
所以我在这个 stackoverflow 中使用“标准化曲目列表”问题,以及指南指导开发人员使用的问题。
我可以使用 css(仅显示:无等)轻松地删除曲目列表中每个条目的字段,并同样更改总体外观。但是,我想为每个条目添加另一个字段。
例如,请参阅 Spotify 客户端中的“热门列表”功能(对我来说,这是应用程序下的第二项)。这些列表看起来大多像普通的播放列表(当然,也按这样的方式操作),但每个元素旁边都有一个数字,并且格式有点不同。
是否可以在我自己的应用程序中执行此操作,而无需完全重新发明轮子?
我可以这样做: $(".sp-list a").each(function(){$(this).append("foo")})
但这只会影响当前可见轨道(ish)。如果播放列表的一部分滚动到视图之外,这些曲目不会受到影响。此外,如果 Spotify 决定重新绘制列表的任何部分(确实发生了这种情况)(例如,如果我将受影响的项目滚动到视图之外并播放曲目),我就会丢失更改。所以这不是特别可行/干净。
想法?
So I'm using the "standardized track listing" in this stackoverflow question, and which the guidelines instruct developers to use.
I can easily remove fields from each entry in the track listing with css (just display:none, etc), and likewise alter the general appearance. However, I would like to add another field to each entry.
As an example, see the "Top Lists" feature in your spotify client (for me this is the second item under APPS). These lists look mostly like normal playlists (and of course, operate as such too), but each element has a number next to it, and the format is a little bit different.
Would it be possible to do this in my own application, without totally reinventing the wheel?
I can do something like: $(".sp-list a").each(function(){$(this).append("foo")})
but that will only affect the currently visible tracks(ish). If part of the playlist scrolls out of view, those tracks are not affected. Also, if Spotify decides to redraw any part of the list, which does happen (for example if I scroll the affected items out of view and play a track), I lose the change. So this is not especially viable/clean.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
今天早些时候,当我与 Spotify 开会时,我向他们询问了这个问题。
目前无法向 list.node 添加元素,但他们表示将调查“问题”。
在那之前,您必须将元素添加到 list.node 之外,您可以将其放在顶部(与position:absolute;一起),或者如果您的元素应该是第一个或则可以将其放在之前或之后(使用浮动)最后一栏。
As I were on a meeting with Spotify earlier today I asked them about this question.
There is no option to add elements to the list.node at this moment but they said they will look into the "problem".
Until then you will have to add your elements outside the list.node, either you could put it on top (together with position: absolute;) or you could put it before or after (with float) if your element should be the first or last column.
到目前为止,这是(某种程度上)可能的;不太好但仍然。因此仅供参考:
删除字段: 编辑 Spotify 应用程序播放列表中的时间字段
添加 HTML:
您会看到 hi 现在出现在每一行上,并且其行为与播放列表的任何其他部分一样。
现在,为了保存我想要显示的额外信息,我只需将其添加到 track.data 对象中,以便我可以从 myTrackView 访问它。
By now, it is (kind of) possible; not very nicely but still. So just for reference:
Deleting fields: Editing Time Field in a Spotify App Playlist
Adding HTML:
You see the hi now appear on each row, and behave like any other part of the playlist.
Now, to save the extra information I want to show, I just add it to the track.data object, so that I can get to it from myTrackView.