Commit f4b86584 authored by Xiaowu Zhang's avatar Xiaowu Zhang

remove addMusic for localhost&online

parent 5ba0532c
......@@ -174,10 +174,16 @@
if (options.page === "playlist") {
if (options.id === "offline") {
gadget.storageType = 0;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "";
} else if (options.id === "localhost") {
gadget.storageType = 1;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "none";
} else if (options.id === "online") {
gadget.storageType = 2;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "none";
}
}
return gadget.declareGadget(
......
......@@ -17,7 +17,7 @@
<div data-role="page" class="ui-page" >
<div class="nav" data-role="header" data-theme="b">
<h1>music player</h1>
<a data-icon="plus" href="#page=upload" >add</a>
<a class="addMusic" data-icon="plus" href="#page=upload">add</a>
<a data-icon="grid" href="#page=playlist" >playlist</a>
</div>
......
......@@ -189,7 +189,8 @@
share_context.href =
"https://twitter.com/intent/tweet?hashtags=MusicPlayer&text="
+ result.data.title;
return g.displayThisTitle(result.data.title);
return g.displayThisTitle(options.action + " : "
+ result.data.title);
})
.push(function () {
return g.allDocs({"include_docs": true});
......@@ -205,7 +206,8 @@
} while (g.currentId === id);
}
return g.displayThisPage({page: "control",
id : id});
id : id,
action : options.action});
})
.push(function (url) {
g.__element.getElementsByClassName("next")[0].href = url;
......
......@@ -13,7 +13,7 @@
<script id="network" type="text/x-handlebars-template">
{{#each rows}}
<li>
<a href=#page=control&id={{this.id}}>
<a href=#page=control&id={{this.id}}&action=localhost>
{{this.doc.title}}
</a>
</li>
......
......@@ -13,7 +13,7 @@
<script id="rows-template" type="text/x-handlebars-template">
{{#each rows}}
<li>
<a href=#page=control&id={{this.id}}>
<a href=#page=control&id={{this.id}}&action=offline>
{{this.doc.title}}
</a>
<a href=#page=playlist&id={{this.id}}&action=delete>
......
......@@ -12,7 +12,7 @@
<script id="network" type="text/x-handlebars-template">
{{#each rows}}
<li>
<a href=#page=control&id={{this.id}}>
<a href=#page=control&id={{this.id}}&action=online>
{{this.doc.title}}
</a>
</li>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment