From 8d97105ed5c90dd2985aae0c2fc7a0aeed6dff42 Mon Sep 17 00:00:00 2001 From: Matthieu Lalonde Date: Sat, 27 Oct 2012 18:09:17 -0400 Subject: [PATCH] MODIF - JSLint rules --- docs/ARCHITECTURE.md | 98 ++ docs/DAAPr.graffle | 2369 ++++++++++++++++++++++++++++++ package.json | 27 + resources/js/app.js | 14 +- resources/js/config.js | 0 resources/js/main.js | 18 +- resources/js/models/client.js | 51 +- resources/js/models/dmap-type.js | 2 + resources/js/models/dmap.js | 14 +- resources/js/models/playlist.js | 4 + resources/js/router.js | 4 + 11 files changed, 2570 insertions(+), 31 deletions(-) create mode 100644 docs/ARCHITECTURE.md create mode 100644 docs/DAAPr.graffle create mode 100644 package.json create mode 100644 resources/js/config.js diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 0000000..505457a --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -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 \ No newline at end of file diff --git a/docs/DAAPr.graffle b/docs/DAAPr.graffle new file mode 100644 index 0000000..12b276c --- /dev/null +++ b/docs/DAAPr.graffle @@ -0,0 +1,2369 @@ + + + + + ApplicationVersion + + com.omnigroup.OmniGrafflePro + 138.12.0.121252 + + CreationDate + 2012-10-25 17:00:40 -0400 + Creator + Matthieu Lalonde + GraphDocumentVersion + 6 + GuidesLocked + NO + GuidesVisible + YES + ImageCounter + 1 + LinksVisible + NO + MagnetsVisible + NO + MasterSheets + + ModificationDate + 2012-10-25 20:03:15 -0400 + Modifier + Matthieu Lalonde + NotesVisible + NO + OriginVisible + NO + PageBreaks + YES + PrintInfo + + NSBottomMargin + + float + 41 + + NSLeftMargin + + float + 18 + + NSPaperSize + + size + {612, 792} + + NSRightMargin + + float + 18 + + NSTopMargin + + float + 18 + + + ReadOnly + NO + Sheets + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {576, 733}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 pt + GraphicsList + + + Class + TableGroup + Graphics + + + Bounds + {{297, 108}, {117, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 92 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 ClientModule} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{297, 122}, {117, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 93 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 92 + 93 + + + GroupConnect + YES + ID + 91 + + + Class + TableGroup + Graphics + + + Bounds + {{279, 63}, {117, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 87 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 ClientsCollection} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{279, 77}, {117, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 88 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 87 + 88 + + + GroupConnect + YES + ID + 86 + + + Class + TableGroup + Graphics + + + Bounds + {{216, 549}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 84 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 BrowserListView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{216, 563}, {108, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 85 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 84 + 85 + + + GroupConnect + YES + ID + 83 + + + Class + TableGroup + Graphics + + + Bounds + {{198, 593}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 78 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 ListView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{198, 607}, {108, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 79 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 78 + 79 + + + GroupConnect + YES + ID + 77 + + + Class + TableGroup + Graphics + + + Bounds + {{198, 475}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 75 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 BrowserView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{198, 489}, {108, 42}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 76 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 Genres\ +Artists\ +Albums} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 75 + 76 + + + GroupConnect + YES + ID + 74 + + + Class + TableGroup + Graphics + + + Bounds + {{180, 415}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 68 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 ClientView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{180, 429}, {108, 28}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 69 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 BrowserView\ +ListView} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 68 + 69 + + + GroupConnect + YES + ID + 67 + + + Class + TableGroup + Graphics + + + Bounds + {{180, 371}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 62 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 ListView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{180, 385}, {108, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 63 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 62 + 63 + + + GroupConnect + YES + ID + 61 + + + Class + TableGroup + Graphics + + + Bounds + {{162, 299}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 59 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 MainView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{162, 313}, {108, 42}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 60 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 ListView\ +ClientViews\ +CurrentView} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 59 + 60 + + + GroupConnect + YES + ID + 58 + + + Class + TableGroup + Graphics + + + Bounds + {{162, 255}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 56 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 FooterView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{162, 269}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 57 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 ItemsCount} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 56 + 57 + + + GroupConnect + YES + ID + 55 + + + Class + TableGroup + Graphics + + + Bounds + {{162, 195}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 53 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 SideBarView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{162, 209}, {108, 28}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 54 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 ClientsCollection\ +PlaylistsCollection} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 53 + 54 + + + GroupConnect + YES + ID + 52 + + + Class + TableGroup + Graphics + + + Bounds + {{162, 151}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 50 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 PlayerView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{162, 165}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 51 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 AudioModule} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 50 + 51 + + + GroupConnect + YES + ID + 49 + + + Class + TableGroup + Graphics + + + Bounds + {{144, 63}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 44 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 AppView} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{144, 77}, {108, 56}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 45 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural + +\f0\fs24 \cf0 PlayerView\ +SiderBarView\ +FooterView\ +MainView} + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 44 + 45 + + + GroupConnect + YES + ID + 43 + + + Class + TableGroup + Graphics + + + Bounds + {{9, 63}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 38 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 Router} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{9, 77}, {108, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 39 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 38 + 39 + + + GroupConnect + YES + ID + 37 + + + Class + TableGroup + Graphics + + + Bounds + {{9, 10}, {108, 14}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 34 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 App} + VerticalPad + 0 + + TextPlacement + 0 + + + Bounds + {{9, 24}, {108, 12}} + Class + ShapedGraphic + FitText + Vertical + Flow + Resize + ID + 36 + Shape + Rectangle + Style + + fill + + GradientCenter + {-0.294118, -0.264706} + + + Text + + Align + 0 + VerticalPad + 0 + + TextPlacement + 0 + + + GridH + + 34 + 36 + + + GroupConnect + YES + ID + 33 + + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 1 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 2 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + Relations + UniqueID + 8 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {1025, 600}} + Class + SolidGraphic + ID + 2 + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {1025, 600} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + + Bounds + {{163, 134}, {860, 415}} + Class + ShapedGraphic + ID + 6 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 ClientView\ +, ListView} + + + + Bounds + {{0, 558}, {1024, 40}} + Class + ShapedGraphic + ID + 5 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Footer View} + + VFlip + YES + + + Bounds + {{0, 135}, {145, 415}} + Class + ShapedGraphic + ID + 4 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 SideBar View} + + + + Bounds + {{0, 0}, {1024, 125}} + Class + ShapedGraphic + ID + 3 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Player View} + + + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + AppView + UniqueID + 1 + VPages + 2 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {1024, 125}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {1024, 125} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + PlayerView + UniqueID + 2 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {145, 415}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {145, 415} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 1 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + SideBarView + UniqueID + 3 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {1024, 40}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {1024, 40} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + FooterView + UniqueID + 4 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {861, 415}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {861, 415} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + ListView + UniqueID + 7 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {861, 210}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {861, 210} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + + Bounds + {{576, 0}, {285, 210}} + Class + ShapedGraphic + ID + 8 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 AlbumsView\cf0 inherits BrowserList} + + + + Bounds + {{288, 0}, {285, 210}} + Class + ShapedGraphic + ID + 7 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 ArtistsView\cf0 inherits BrowserList} + + + + Bounds + {{0, 0}, {285, 210}} + Class + ShapedGraphic + ID + 5 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 GenresView inherits BrowserList} + + + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + BrowserView + UniqueID + 6 + VPages + 1 + + + ActiveLayerIndex + 0 + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {861, 415}} + Class + SolidGraphic + ID + 2 + Style + + fill + + GradientColor + + w + 0.666667 + + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + CanvasOrigin + {0, 0} + CanvasSize + {861, 415} + ColumnAlign + 1 + ColumnSpacing + 36 + DisplayScale + 1 pt = 1 px + GraphicsList + + + Bounds + {{0, 215}, {860, 199}} + Class + ShapedGraphic + ID + 6 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 ListView} + + VFlip + YES + + + Bounds + {{0, 0}, {860, 210}} + Class + ShapedGraphic + ID + 14 + Shape + Rectangle + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 BrowserView} + + + + GridInfo + + ShowsGrid + YES + SnapsToGrid + YES + + HPages + 2 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + Orientation + 1 + PrintOnePage + + RowAlign + 1 + RowSpacing + 36 + SheetTitle + ClientView + UniqueID + 5 + VPages + 1 + + + SmartAlignmentGuidesActive + YES + SmartDistanceGuidesActive + YES + UseEntirePage + + WindowInfo + + CurrentSheet + 6 + ExpandedCanvases + + Frame + {{16, 208}, {1500, 922}} + ListView + + OutlineWidth + 142 + RightSidebar + + ShowRuler + + Sidebar + + SidebarWidth + 120 + VisibleRegion + {{-252, -279}, {1365, 768}} + Zoom + 1 + ZoomValues + + + AppView + 1 + 1 + + + PlayerView + 1 + 1 + + + SideBarView + 1 + 1 + + + FooterView + 1 + 1 + + + ClientView + 1 + 1 + + + BrowserView + 1 + 1 + + + ListView + 1 + 1 + + + Relations + 1 + 1 + + + + saveQuickLookFiles + NO + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..f1965fa --- /dev/null +++ b/package.json @@ -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 +* +*/ \ No newline at end of file diff --git a/resources/js/app.js b/resources/js/app.js index ce86d68..2a63ef8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -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 }; }); diff --git a/resources/js/config.js b/resources/js/config.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/main.js b/resources/js/main.js index ef5db88..2ed38db 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -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(); }); diff --git a/resources/js/models/client.js b/resources/js/models/client.js index b6f6dfd..6768a5f 100644 --- a/resources/js/models/client.js +++ b/resources/js/models/client.js @@ -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 } diff --git a/resources/js/models/dmap-type.js b/resources/js/models/dmap-type.js index d372dc3..407d33a 100644 --- a/resources/js/models/dmap-type.js +++ b/resources/js/models/dmap-type.js @@ -2,6 +2,8 @@ /*jslint laxcomma:true */ /*jslint loopfunc:true */ /*jslint strict:true */ +/*jslint browser:true */ +/*jslint devel:true */ define([ "underscore" , "toolbox" diff --git a/resources/js/models/dmap.js b/resources/js/models/dmap.js index 31afd09..6e47cbf 100644 --- a/resources/js/models/dmap.js +++ b/resources/js/models/dmap.js @@ -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); diff --git a/resources/js/models/playlist.js b/resources/js/models/playlist.js index e69de29..3c40aa2 100644 --- a/resources/js/models/playlist.js +++ b/resources/js/models/playlist.js @@ -0,0 +1,4 @@ +/*jslint laxbreak:true */ +/*jslint laxcomma:true */ +/*jslint loopfunc:true */ +/*jslint strict:true */ diff --git a/resources/js/router.js b/resources/js/router.js index e69de29..3c40aa2 100644 --- a/resources/js/router.js +++ b/resources/js/router.js @@ -0,0 +1,4 @@ +/*jslint laxbreak:true */ +/*jslint laxcomma:true */ +/*jslint loopfunc:true */ +/*jslint strict:true */