CC-1799 Put Airtime Storage into a Human Readable File Naming Convention
making separate js file for music dirs page.
This commit is contained in:
parent
253eb811c7
commit
f1893cebe6
|
@ -130,7 +130,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/serverbrowse/serverbrowser.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/musicdirs.js','text/javascript');
|
||||
|
||||
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
|
||||
$watched_dirs_pref->setWatchedDirs();
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
function setWatchedDirEvents() {
|
||||
$('#watchedFolder-selection').serverBrowser({
|
||||
onSelect: function(path) {
|
||||
$('#watchedFolder').val(path);
|
||||
},
|
||||
onLoad: function() {
|
||||
return $('#watchedFolder').val();
|
||||
},
|
||||
width: 500,
|
||||
height: 250,
|
||||
position: ['center', 'center'],
|
||||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: 'img/browser/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
title: 'Choose Folder to Watch',
|
||||
basePath: '/home',
|
||||
requestMethod: 'POST',
|
||||
});
|
||||
|
||||
$('#watchedFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
url = "/Preference/reload-watch-directory";
|
||||
chosen = $('#watchedFolder').val();
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: chosen},
|
||||
|
||||
function(json) {
|
||||
$("#watched-folder-section").empty();
|
||||
$("#watched-folder-section").append(json.subform);
|
||||
setWatchedDirEvents();
|
||||
});
|
||||
});
|
||||
|
||||
$('#watchedFolder-table').find('.ui-icon-close').click(function(){
|
||||
var row = $(this).parent();
|
||||
var folder = $(this).prev().text();
|
||||
|
||||
url = "/Preference/remove-watch-directory";
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: folder},
|
||||
|
||||
function(json) {
|
||||
row.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
setWatchedDirEvents();
|
||||
|
||||
});
|
|
@ -1,79 +1,3 @@
|
|||
function setWatchedDirEvents() {
|
||||
$('#watchedFolder-selection').serverBrowser({
|
||||
onSelect: function(path) {
|
||||
$('#watchedFolder').val(path);
|
||||
},
|
||||
onLoad: function() {
|
||||
return $('#watchedFolder').val();
|
||||
},
|
||||
width: 500,
|
||||
height: 250,
|
||||
position: ['center', 'center'],
|
||||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: 'img/browser/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
title: 'Choose Folder to Watch',
|
||||
basePath: '/home',
|
||||
requestMethod: 'POST',
|
||||
});
|
||||
|
||||
$('#watchedFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
url = "/Preference/reload-watch-directory";
|
||||
chosen = $('#watchedFolder').val();
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: chosen},
|
||||
|
||||
function(json) {
|
||||
$("#watched-folder-section").empty();
|
||||
$("#watched-folder-section").append(json.subform);
|
||||
setWatchedDirEvents();
|
||||
});
|
||||
});
|
||||
|
||||
$('#watchedFolder-table').find('.ui-icon-close').click(function(){
|
||||
var row = $(this).parent();
|
||||
var folder = $(this).prev().text();
|
||||
|
||||
url = "/Preference/remove-watch-directory";
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: folder},
|
||||
|
||||
function(json) {
|
||||
row.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var form = $("form");
|
||||
|
||||
$('.collapsible-header').live('click',function() {
|
||||
$(this).next().toggle('fast');
|
||||
$(this).toggleClass("close");
|
||||
return false;
|
||||
}).next().hide();
|
||||
|
||||
$("#SupportFeedback").click( function(){
|
||||
var pub = $("#Publicise");
|
||||
if( !$(this).is(':checked') ){
|
||||
pub.removeAttr("checked");
|
||||
pub.attr("disabled", true);
|
||||
}else{
|
||||
pub.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
showErrorSections();
|
||||
setWatchedDirEvents();
|
||||
|
||||
});
|
||||
|
||||
function showErrorSections() {
|
||||
|
||||
if($("soundcloud-settings .errors").length > 0) {
|
||||
|
@ -111,7 +35,24 @@ function resizeImg(ele){
|
|||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var form = $("form");
|
||||
|
||||
$('.collapsible-header').live('click',function() {
|
||||
$(this).next().toggle('fast');
|
||||
$(this).toggleClass("close");
|
||||
return false;
|
||||
}).next().hide();
|
||||
|
||||
$("#SupportFeedback").click( function(){
|
||||
var pub = $("#Publicise");
|
||||
if( !$(this).is(':checked') ){
|
||||
pub.removeAttr("checked");
|
||||
pub.attr("disabled", true);
|
||||
}else{
|
||||
pub.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
showErrorSections();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue