1
0
Fork 0

MODIF - JSLint rules

master
Matthieu Lalonde 12 years ago committed by xSmurf
parent dcfb1307cc
commit 8d97105ed5

@ -0,0 +1,98 @@
# Classes
* DAAPr
* Router
* Modules
* DAAPClient
* AudioPlayer
* PlaylistManager
* Client
* Models
* Client
* DMAP
* Playlist
* Collections
* Client
* DMAP
* Playlist
* Views
* App
* Player
* SideBar
* Footer
* ListView
* ClientView
* BrowserView
* ^ListView
# Instances
* App (DAPPr)
* Router
* Views
* ClientViews
* ClientView
* Client
* Clients.Collections_Client
* Client.Model_Client
* Sysinfo.Collections_DMAP
* Sysinfo.Model_DMAP
* ContentCodes.Collections_DMAP
* ContentCode.Model_DMAP
* Genres.Collections_DMAP
* Genre.Model_DMAP
* Artists.Collections_DMAP
* Artist.Model_DMAP
* Albums.Collections_DMAP
* Album.Model_DMAP
* Items.Collections_DMAP
* Item.Model_DMAP
* Playlists.Collections_DMAP
* Playlist.Collections_DMAP
* Playlists.Collections_Playlist
* LocalStorage.Model_Playlist
* Remote.Modal_Playlist
* Client
* Properties
* database
* databases
* playlist
* playlists
* serverInfo
* contentCodes
* sessionId
* credentials
* login
* password
* Methods
* init
* getContentCodes
* getServerInfo
* doLogin
* getSessionId
* getDatabaseInfo
* getPlaylistInfo
* getDatabase(id)
* search
* getPlaylist(id)
* search
* getGenres
* getArtists
* search(genre)
* getAlbums
* search(genre, artist)
* doLogout
* Events
* inited
* loaded

File diff suppressed because it is too large Load Diff

@ -0,0 +1,27 @@
{
name: "daapr"
, verson: 0.3.2
, author: "https://matth.lalonde.me"
, description: "DAAPr is a client-side, multi-server, DAAP protocol client."
, contributors: [
{
name: "Mattieu Lalonde"
, email: "matth_code@lalonde.me"
}
]
,
}
/*
# Non-AMD Deps
* jquery
* jquery-ui
* jquery-event-drag
* jquery-datatable
* jquery-datatable-scroller
* jquery-datatable-tabletools
* jquery-datatable-colreorder
* jquery-layout
*
*/

@ -1,3 +1,10 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
// Filename: app.js // Filename: app.js
define([ define([
"jquery" "jquery"
@ -6,6 +13,7 @@ define([
, "models/client" , "models/client"
], ],
function( $, _, Backbone, ClientModel ) { function( $, _, Backbone, ClientModel ) {
"use strict";
var init = function(){ var init = function(){
@ -18,7 +26,7 @@ function( $, _, Backbone, ClientModel ) {
, password: "lawl" , password: "lawl"
}); });
console.log(client.attributes); console.log(client.attributes);
client.on("unauthorized", function __client_unauthorized() { client.on("unauthorized", function __client_unauthorized() {
console.log(arguments); console.log(arguments);
}); });
@ -26,11 +34,11 @@ function( $, _, Backbone, ClientModel ) {
client.on("inited", function () { client.on("inited", function () {
console.log(client.url(), arguments); console.log(client.url(), arguments);
}); });
console.log(client); console.log(client);
client.init(); client.init();
} };
return { init: init }; return { init: init };
}); });

@ -1,3 +1,7 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
require.config({ require.config({
shim: { shim: {
"jquery-ui": ["jquery"] "jquery-ui": ["jquery"]
@ -7,7 +11,7 @@ require.config({
, "bootstrap-contextmenu": ["bootstrap"] , "bootstrap-contextmenu": ["bootstrap"]
, "jquery": { , "jquery": {
exports: "jQuery.fn" exports: "jQuery.fn"
} }
@ -30,15 +34,15 @@ require.config({
exports: "Toolbox" exports: "Toolbox"
, deps: ["underscore"] , deps: ["underscore"]
} }
, "toolbox-extras": { , "toolbox-extras": {
deps: ["toolbox"] deps: ["toolbox"]
} }
} }
, paths: { , paths: {
"jquery": "../vendors/jquery/1.8.2/jquery.min" "jquery": "../vendors/jquery/1.8.2/jquery.min"
, "jquery-ui": "../vendors/jquery/ui/1.9.0/jquery-ui-all" , "jquery-ui": "../vendors/jquery/ui/1.9.0/jquery-ui-all"
, "jquery-event-drag": "../vendors/jquery/event-drag/2.2/jquery.event.drag" , "jquery-event-drag": "../vendors/jquery/event-drag/2.2/jquery.event.drag"
, "jquery-layout": "../vendors/jquery/layout/1.2.0/jquery.layout.min" , "jquery-layout": "../vendors/jquery/layout/1.2.0/jquery.layout.min"
, "datatables": "../vendors/jquery/datatables/1.9.4/media/js/jquery.dataTables.min" , "datatables": "../vendors/jquery/datatables/1.9.4/media/js/jquery.dataTables.min"
@ -63,7 +67,9 @@ require(
, "jquery" , "jquery"
] ]
, function ( App ) { , function ( App, $ ) {
"use strict";
$("body").ready(function(){ $("body").ready(function(){
App.init(); App.init();
}); });

@ -1,19 +1,28 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
/** /**
* TODO: If the user agrees, set the username/passs in a cookie * TODO: If the user agrees, set the username/passs in a cookie
**/ **/
define([ define([
"toolbox" "underscore"
, "backbone"
, "toolbox"
, "models/dmap-type" , "models/dmap-type"
, "models/dmap" , "models/dmap"
] ], function (_, Backbone, Toolbox, DMAPType, DMAPModel) {
, function (Toolbox, DMAPType, DMAPModel) { "use strict";
var that var that
// TODO Could be interesting to set a userage, could possibly affect transcoding on the server side // TODO: Could be interesting to set a userage, could possibly affect transcoding on the server side
, xhr = function (url, responseType, callback) { , xhr = function (url, responseType, callback) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var contentType = "text/plain; charset=utf-8"; var contentType = "text/plain; charset=utf-8";
if (typeof responseType === "function") { if (typeof responseType === "function") {
callback = responseType; callback = responseType;
responseType = "arraybuffer"; responseType = "arraybuffer";
@ -22,7 +31,11 @@ define([
xhr.open("GET", url, true); xhr.open("GET", url, true);
xhr.responseType = responseType; xhr.responseType = responseType;
xhr.setRequestHeader("Content-type", contentType); xhr.setRequestHeader("Content-type", contentType);
// TODO: Add this:
// xhr.timeout = 4000;
// xhr.ontimeout = function () { alert("Timed out!!!"); }
console.log(that.attributes.password, that.attributes.username, window.btoa((that.attributes.username || "") + ":" + (that.attributes.password || ""))); console.log(that.attributes.password, that.attributes.username, window.btoa((that.attributes.username || "") + ":" + (that.attributes.password || "")));
if (!_.isEmpty(that.attributes.password) || !_.isEmpty(that.attributes.username)) { if (!_.isEmpty(that.attributes.password) || !_.isEmpty(that.attributes.username)) {
@ -31,11 +44,11 @@ define([
xhr.withCredentials = true; xhr.withCredentials = true;
xhr.setRequestHeader("Authorization", "Basic " + basicAuth); xhr.setRequestHeader("Authorization", "Basic " + basicAuth);
} }
//xhr.overrideMimeType('text/plain; charset=x-user-defined'); //xhr.overrideMimeType('text/plain; charset=x-user-defined');
try { try {
xhr.onerror = function() {"error", console.log(arguments, this)}; xhr.onerror = function() {console.log(arguments, this);};
xhr.onabort = function() {"abort", console.log(arguments, this)}; xhr.onabort = function() {console.log(arguments, this);};
xhr.onload = function(e) { xhr.onload = function(e) {
if (this.status === 200) { if (this.status === 200) {
callback(null, this.response); callback(null, this.response);
@ -45,7 +58,7 @@ define([
callback(e.status); callback(e.status);
} }
}; };
xhr.send(); xhr.send();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
@ -56,7 +69,7 @@ define([
, fetchContentTypes = function (success, error) { , fetchContentTypes = function (success, error) {
xhr(that.url("/content-codes?"), function (err, content) { xhr(that.url("/content-codes?"), function (err, content) {
if (err) { if (err) {
error || error = function (err) {/*throw [err, content]*/}(); error || (error = function (err) {throw [err, content]}());
error(err, content); error(err, content);
@ -69,7 +82,7 @@ define([
}); });
} }
, fetchServerInfo = function (success, error) {/* , fetchServerInfo = function (success, error) {
xhr(that.url("/server-info?"), function (err, content) { xhr(that.url("/server-info?"), function (err, content) {
if (err) { if (err) {
error || error = function (err) {throw [err, content]}(); error || error = function (err) {throw [err, content]}();
@ -83,7 +96,7 @@ define([
}); });
success && success(content); success && success(content);
} }
});*/ });
} }
, fetchLogin = function () { , fetchLogin = function () {
@ -91,11 +104,11 @@ define([
} }
, fetchDatabases = function () { , fetchDatabases = function () {
} }
, fetchDatabase = function () { , fetchDatabase = function () {
} }
, fetchPlaylists = function () { , fetchPlaylists = function () {
@ -103,7 +116,7 @@ define([
} }
, Client = Toolbox.Base.extend({ , Client = Toolbox.Base.extend({
constructor: function(attributes, options) { constructor: function(attributes, options) {
that = this; that = this;
@ -118,7 +131,7 @@ define([
fetchServerInfo(function () { fetchServerInfo(function () {
that.trigger("inited", that.collections); that.trigger("inited", that.collections);
}); });
}) });
return this; return this;
} }
@ -150,9 +163,9 @@ define([
, collections: { , collections: {
contentCodes: null contentCodes: null
, serverInfo: null , serverInfo: null
, session: { , session: {
id: null id: null
} }

@ -2,6 +2,8 @@
/*jslint laxcomma:true */ /*jslint laxcomma:true */
/*jslint loopfunc:true */ /*jslint loopfunc:true */
/*jslint strict:true */ /*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
define([ define([
"underscore" "underscore"
, "toolbox" , "toolbox"

@ -1,9 +1,18 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
define([ define([
"backbone" "underscore"
, "backbone"
, "models/dmap-type" , "models/dmap-type"
, "collections/dmap" , "collections/dmap"
] ]
, function (Backbone, DMAPType, DMAPCollection) { , function (_, Backbone, DMAPType, DMAPCollection) {
"use strict";
var that var that
, Model = Backbone.Model.extend({ , Model = Backbone.Model.extend({
@ -156,7 +165,6 @@ define([
} }
, parseWrapper = function(binaryData) { , parseWrapper = function(binaryData) {
console.log(DMAPType);
var containerType = DMAPType.getType(binaryData); var containerType = DMAPType.getType(binaryData);
//var binaryLength = DMAPType.getUint32(binaryData.slice(4,8)); //var binaryLength = DMAPType.getUint32(binaryData.slice(4,8));
var contentData = binaryData.slice(8); var contentData = binaryData.slice(8);

@ -0,0 +1,4 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */

@ -0,0 +1,4 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
Loading…
Cancel
Save