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
define([
"jquery"
@ -6,6 +13,7 @@ define([
, "models/client"
],
function( $, _, Backbone, ClientModel ) {
"use strict";
var init = function(){
@ -18,7 +26,7 @@ function( $, _, Backbone, ClientModel ) {
, password: "lawl"
});
console.log(client.attributes);
client.on("unauthorized", function __client_unauthorized() {
console.log(arguments);
});
@ -26,11 +34,11 @@ function( $, _, Backbone, ClientModel ) {
client.on("inited", function () {
console.log(client.url(), arguments);
});
console.log(client);
client.init();
}
};
return { init: init };
});

@ -1,3 +1,7 @@
/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
require.config({
shim: {
"jquery-ui": ["jquery"]
@ -7,7 +11,7 @@ require.config({
, "bootstrap-contextmenu": ["bootstrap"]
, "jquery": {
, "jquery": {
exports: "jQuery.fn"
}
@ -30,15 +34,15 @@ require.config({
exports: "Toolbox"
, deps: ["underscore"]
}
, "toolbox-extras": {
deps: ["toolbox"]
}
}
, paths: {
"jquery": "../vendors/jquery/1.8.2/jquery.min"
, "jquery-ui": "../vendors/jquery/ui/1.9.0/jquery-ui-all"
, paths: {
"jquery": "../vendors/jquery/1.8.2/jquery.min"
, "jquery-ui": "../vendors/jquery/ui/1.9.0/jquery-ui-all"
, "jquery-event-drag": "../vendors/jquery/event-drag/2.2/jquery.event.drag"
, "jquery-layout": "../vendors/jquery/layout/1.2.0/jquery.layout.min"
, "datatables": "../vendors/jquery/datatables/1.9.4/media/js/jquery.dataTables.min"
@ -63,7 +67,9 @@ require(
, "jquery"
]
, function ( App ) {
, function ( App, $ ) {
"use strict";
$("body").ready(function(){
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
**/
define([
"toolbox"
"underscore"
, "backbone"
, "toolbox"
, "models/dmap-type"
, "models/dmap"
]
, function (Toolbox, DMAPType, DMAPModel) {
], function (_, Backbone, Toolbox, DMAPType, DMAPModel) {
"use strict";
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) {
var xhr = new XMLHttpRequest();
var contentType = "text/plain; charset=utf-8";
if (typeof responseType === "function") {
callback = responseType;
responseType = "arraybuffer";
@ -22,7 +31,11 @@ define([
xhr.open("GET", url, true);
xhr.responseType = responseType;
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 || "")));
if (!_.isEmpty(that.attributes.password) || !_.isEmpty(that.attributes.username)) {
@ -31,11 +44,11 @@ define([
xhr.withCredentials = true;
xhr.setRequestHeader("Authorization", "Basic " + basicAuth);
}
//xhr.overrideMimeType('text/plain; charset=x-user-defined');
try {
xhr.onerror = function() {"error", console.log(arguments, this)};
xhr.onabort = function() {"abort", console.log(arguments, this)};
xhr.onerror = function() {console.log(arguments, this);};
xhr.onabort = function() {console.log(arguments, this);};
xhr.onload = function(e) {
if (this.status === 200) {
callback(null, this.response);
@ -45,7 +58,7 @@ define([
callback(e.status);
}
};
xhr.send();
} catch (e) {
console.error(e);
@ -56,7 +69,7 @@ define([
, fetchContentTypes = function (success, error) {
xhr(that.url("/content-codes?"), function (err, content) {
if (err) {
error || error = function (err) {/*throw [err, content]*/}();
error || (error = function (err) {throw [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) {
if (err) {
error || error = function (err) {throw [err, content]}();
@ -83,7 +96,7 @@ define([
});
success && success(content);
}
});*/
});
}
, fetchLogin = function () {
@ -91,11 +104,11 @@ define([
}
, fetchDatabases = function () {
}
, fetchDatabase = function () {
}
, fetchPlaylists = function () {
@ -103,7 +116,7 @@ define([
}
, Client = Toolbox.Base.extend({
constructor: function(attributes, options) {
that = this;
@ -118,7 +131,7 @@ define([
fetchServerInfo(function () {
that.trigger("inited", that.collections);
});
})
});
return this;
}
@ -150,9 +163,9 @@ define([
, collections: {
contentCodes: null
, serverInfo: null
, session: {
id: null
}

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

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