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(){
@ -30,7 +38,7 @@ function( $, _, Backbone, ClientModel ) {
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"]
@ -63,7 +67,9 @@ require(
, "jquery" , "jquery"
] ]
, function ( App ) { , function ( App, $ ) {
"use strict";
$("body").ready(function(){ $("body").ready(function(){
App.init(); App.init();
}); });

@ -1,15 +1,24 @@
/*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";
@ -23,6 +32,10 @@ define([
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)) {
@ -34,8 +47,8 @@ define([
//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);
@ -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 () {
@ -118,7 +131,7 @@ define([
fetchServerInfo(function () { fetchServerInfo(function () {
that.trigger("inited", that.collections); that.trigger("inited", that.collections);
}); });
}) });
return this; return this;
} }

@ -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