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(){
@ -30,7 +38,7 @@ function( $, _, Backbone, ClientModel ) {
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"
}
@ -36,9 +40,9 @@ require.config({
}
}
, 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,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
**/
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";
@ -23,6 +32,10 @@ define([
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)) {
@ -34,8 +47,8 @@ define([
//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);
@ -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 () {
@ -118,7 +131,7 @@ define([
fetchServerInfo(function () {
that.trigger("inited", that.collections);
});
})
});
return this;
}

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