Merge branch 'cc-1799-put-airtime-storage-into-a-human-readable-file-naming-convention' into devel

Conflicts:
	airtime_mvc/application/controllers/PreferenceController.php
	airtime_mvc/application/models/Preference.php
	airtime_mvc/application/views/scripts/form/preferences.phtml
	airtime_mvc/public/js/airtime/preferences/preferences.js
This commit is contained in:
Naomi Aro 2011-06-21 11:20:35 +02:00
commit 253eb811c7
42 changed files with 3966 additions and 499 deletions

View file

@ -1,12 +1,64 @@
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') ){
@ -16,9 +68,10 @@ $(document).ready(function() {
pub.removeAttr("disabled");
}
});
showErrorSections();
setWatchedDirEvents();
});
function showErrorSections() {
@ -35,17 +88,17 @@ function showErrorSections() {
function resizeImg(ele){
var img = $(ele);
var width = ele.width;
var height = ele.height;
// resize img proportionaly
if( width > height && width > 450){
var ratio = 450/width;
img.css("width", "450px");
var newHeight = height * ratio;
img.css("height", newHeight );
}else if( width < height && height > 450){
var ratio = 450/height;
img.css("height", "450px");
@ -55,7 +108,10 @@ function resizeImg(ele){
img.css("height", "450px");
img.css("width", "450px" );
}
}
});