Commit f4b86584 authored by Xiaowu Zhang's avatar Xiaowu Zhang

remove addMusic for localhost&online

parent 5ba0532c
...@@ -174,10 +174,16 @@ ...@@ -174,10 +174,16 @@
if (options.page === "playlist") { if (options.page === "playlist") {
if (options.id === "offline") { if (options.id === "offline") {
gadget.storageType = 0; gadget.storageType = 0;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "";
} else if (options.id === "localhost") { } else if (options.id === "localhost") {
gadget.storageType = 1; gadget.storageType = 1;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "none";
} else if (options.id === "online") { } else if (options.id === "online") {
gadget.storageType = 2; gadget.storageType = 2;
gadget.__element.getElementsByClassName('addMusic')[0].
style.display = "none";
} }
} }
return gadget.declareGadget( return gadget.declareGadget(
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div data-role="page" class="ui-page" > <div data-role="page" class="ui-page" >
<div class="nav" data-role="header" data-theme="b"> <div class="nav" data-role="header" data-theme="b">
<h1>music player</h1> <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> <a data-icon="grid" href="#page=playlist" >playlist</a>
</div> </div>
......
...@@ -189,7 +189,8 @@ ...@@ -189,7 +189,8 @@
share_context.href = share_context.href =
"https://twitter.com/intent/tweet?hashtags=MusicPlayer&text=" "https://twitter.com/intent/tweet?hashtags=MusicPlayer&text="
+ result.data.title; + result.data.title;
return g.displayThisTitle(result.data.title); return g.displayThisTitle(options.action + " : "
+ result.data.title);
}) })
.push(function () { .push(function () {
return g.allDocs({"include_docs": true}); return g.allDocs({"include_docs": true});
...@@ -205,7 +206,8 @@ ...@@ -205,7 +206,8 @@
} while (g.currentId === id); } while (g.currentId === id);
} }
return g.displayThisPage({page: "control", return g.displayThisPage({page: "control",
id : id}); id : id,
action : options.action});
}) })
.push(function (url) { .push(function (url) {
g.__element.getElementsByClassName("next")[0].href = url; g.__element.getElementsByClassName("next")[0].href = url;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script id="network" type="text/x-handlebars-template"> <script id="network" type="text/x-handlebars-template">
{{#each rows}} {{#each rows}}
<li> <li>
<a href=#page=control&id={{this.id}}> <a href=#page=control&id={{this.id}}&action=localhost>
{{this.doc.title}} {{this.doc.title}}
</a> </a>
</li> </li>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script id="rows-template" type="text/x-handlebars-template"> <script id="rows-template" type="text/x-handlebars-template">
{{#each rows}} {{#each rows}}
<li> <li>
<a href=#page=control&id={{this.id}}> <a href=#page=control&id={{this.id}}&action=offline>
{{this.doc.title}} {{this.doc.title}}
</a> </a>
<a href=#page=playlist&id={{this.id}}&action=delete> <a href=#page=playlist&id={{this.id}}&action=delete>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<script id="network" type="text/x-handlebars-template"> <script id="network" type="text/x-handlebars-template">
{{#each rows}} {{#each rows}}
<li> <li>
<a href=#page=control&id={{this.id}}> <a href=#page=control&id={{this.id}}&action=online>
{{this.doc.title}} {{this.doc.title}}
</a> </a>
</li> </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