mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 12:47:58 +01:00
Formatting fixes.
This commit is contained in:
@@ -605,7 +605,7 @@ function Buffer() //{{{
|
|||||||
"Stop loading",
|
"Stop loading",
|
||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
if(config.name == "Xulmus")
|
if (config.name == "Xulmus")
|
||||||
getBrowser().mCurrentBrowser.stop();
|
getBrowser().mCurrentBrowser.stop();
|
||||||
else
|
else
|
||||||
window.BrowserStop();
|
window.BrowserStop();
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ function Events() //{{{
|
|||||||
// return true when load successful, or false otherwise
|
// return true when load successful, or false otherwise
|
||||||
function waitForPageLoaded() events.waitForPageLoad();
|
function waitForPageLoaded() events.waitForPageLoad();
|
||||||
|
|
||||||
// load all macros inside ~/.xulmus/macros/
|
// load all macros
|
||||||
// setTimeout needed since io. is loaded after events.
|
// setTimeout needed since io. is loaded after events.
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
try
|
try
|
||||||
@@ -1037,8 +1037,8 @@ function Events() //{{{
|
|||||||
// (i.e., cntrl codes 27--31)
|
// (i.e., cntrl codes 27--31)
|
||||||
// ---
|
// ---
|
||||||
// For more information, see:
|
// For more information, see:
|
||||||
// [*] Vimp FAQ: http://xulmus.org/trac/wiki/Xulmus/FAQ#WhydoesntC-workforEscMacOSX
|
// [*] Vimp FAQ: http://vimperator.org/trac/wiki/Vimperator/FAQ#WhydoesntC-workforEscMacOSX
|
||||||
// [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/xulmus/2008-May/001548.html
|
// [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/vimperator/2008-May/001548.html
|
||||||
// [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \"
|
// [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \"
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227
|
// https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227
|
||||||
// [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa
|
// [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa
|
||||||
@@ -1226,10 +1226,10 @@ function Events() //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.name == "Xulmus")
|
if (config.name == "Xulmus")
|
||||||
{
|
{
|
||||||
// Switch to -- PLAYER -- mode for Songbird Media Player.
|
// Switch to -- PLAYER -- mode for Songbird Media Player.
|
||||||
if(config.isPlayerWindow)
|
if (config.isPlayerWindow)
|
||||||
{
|
{
|
||||||
liberator.mode = modes.PLAYER;
|
liberator.mode = modes.PLAYER;
|
||||||
}
|
}
|
||||||
@@ -1437,7 +1437,6 @@ function Events() //{{{
|
|||||||
// also fixes key navigation in combo boxes, submitting forms, etc.
|
// also fixes key navigation in combo boxes, submitting forms, etc.
|
||||||
// FIXME: breaks iabbr for now --mst
|
// FIXME: breaks iabbr for now --mst
|
||||||
if (((config.name == "Xulmus" || config.name == "Vimperator") && liberator.mode == modes.NORMAL || liberator.mode == modes.INSERT))
|
if (((config.name == "Xulmus" || config.name == "Vimperator") && liberator.mode == modes.NORMAL || liberator.mode == modes.INSERT))
|
||||||
|
|
||||||
{
|
{
|
||||||
if (key == "<Return>")
|
if (key == "<Return>")
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ const liberator = (function () //{{{
|
|||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
if (nError++ == 0)
|
if (nError++ == 0)
|
||||||
|
window.toJavaScriptConsole();
|
||||||
liberator.dump("Error loading module - "+ name + "..");
|
liberator.dump("Error loading module - "+ name + "..");
|
||||||
liberator.dump(e);
|
liberator.dump(e);
|
||||||
liberator.dump(e.stack);
|
liberator.dump(e.stack);
|
||||||
window.toJavaScriptConsole();
|
|
||||||
liberator.reportError(e);
|
liberator.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1219,6 +1219,8 @@ const liberator = (function () //{{{
|
|||||||
startup: function ()
|
startup: function ()
|
||||||
{
|
{
|
||||||
let start = Date.now();
|
let start = Date.now();
|
||||||
|
liberator.log("Initializing liberator object...", 0);
|
||||||
|
|
||||||
config.features = config.features || [];
|
config.features = config.features || [];
|
||||||
config.features.push(getPlatformFeature());
|
config.features.push(getPlatformFeature());
|
||||||
config.defaults = config.defaults || {};
|
config.defaults = config.defaults || {};
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ function Tabs() //{{{
|
|||||||
/*
|
/*
|
||||||
if (config.name == "Xulmus")
|
if (config.name == "Xulmus")
|
||||||
getBrowser()._strip.getElementsByClassName(
|
getBrowser()._strip.getElementsByClassName(
|
||||||
*/
|
*/
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
////////////////////// OPTIONS /////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/dash
|
#!/bin/dash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
top=$(pwd)
|
top=$(pwd)
|
||||||
jar=$1
|
jar=$1
|
||||||
bases=$2
|
bases=$2
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
var artists = getArtistsArray();
|
var artists = getArtistsArray();
|
||||||
|
|
||||||
function Player()
|
function Player() // {{{
|
||||||
{
|
{
|
||||||
|
|
||||||
// Get the focus to the visible playlist first
|
// Get the focus to the visible playlist first
|
||||||
//window._SBShowMainLibrary();
|
//window._SBShowMainLibrary();
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@ function Player()
|
|||||||
gMM.sequencer.stop();
|
gMM.sequencer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["l"], "Play Media",
|
["l"], "Play Media",
|
||||||
function ()
|
function ()
|
||||||
@@ -65,7 +63,7 @@ function Player()
|
|||||||
["r"], "Toggle Repeat",
|
["r"], "Toggle Repeat",
|
||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
switch(gMM.sequencer.repeatMode)
|
switch (gMM.sequencer.repeatMode)
|
||||||
{
|
{
|
||||||
case gMM.sequencer.MODE_REPEAT_NONE:
|
case gMM.sequencer.MODE_REPEAT_NONE:
|
||||||
gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE;
|
gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE;
|
||||||
@@ -83,8 +81,8 @@ function Player()
|
|||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["playmedia"],
|
commands.add(["playmedia"],
|
||||||
"PLay Media",
|
"Play Media",
|
||||||
function(args)
|
function (args)
|
||||||
{
|
{
|
||||||
//Store the old view
|
//Store the old view
|
||||||
//var prev_view = gMM.status.view;
|
//var prev_view = gMM.status.view;
|
||||||
@@ -95,7 +93,6 @@ function Player()
|
|||||||
.createInstance(Ci.sbIMutablePropertyArray);
|
.createInstance(Ci.sbIMutablePropertyArray);
|
||||||
|
|
||||||
//args
|
//args
|
||||||
|
|
||||||
if (args.length == 1){
|
if (args.length == 1){
|
||||||
customProps.appendProperty(SBProperties.artistName,args[0].toString());
|
customProps.appendProperty(SBProperties.artistName,args[0].toString());
|
||||||
}
|
}
|
||||||
@@ -109,18 +106,12 @@ function Player()
|
|||||||
customProps.appendProperty(SBProperties.trackName,args[2].toString());
|
customProps.appendProperty(SBProperties.trackName,args[2].toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem)));
|
sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem)));
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
completer: function(context, args) completion.songCompletion(context, args)
|
completer: function (context, args) completion.songCompletion(context, args)
|
||||||
});
|
});
|
||||||
|
} // }}}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArtists()
|
function getArtists()
|
||||||
{
|
{
|
||||||
@@ -129,26 +120,25 @@ function getArtists()
|
|||||||
|
|
||||||
function getArtistsArray()
|
function getArtistsArray()
|
||||||
{
|
{
|
||||||
|
|
||||||
var list = LibraryUtils.mainLibrary;
|
var list = LibraryUtils.mainLibrary;
|
||||||
|
|
||||||
// Create an enumeration listener to count each item
|
// Create an enumeration listener to count each item
|
||||||
var listener = {
|
var listener = {
|
||||||
count: 0,
|
count: 0,
|
||||||
onEnumerationBegin: function(aMediaList) {
|
onEnumerationBegin: function (aMediaList) {
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
},
|
},
|
||||||
onEnumeratedItem: function(aMediaList, aMediaItem) {
|
onEnumeratedItem: function (aMediaList, aMediaItem) {
|
||||||
this.count++;
|
this.count++;
|
||||||
},
|
},
|
||||||
onEnumerationEnd: function(aMediaList, aStatusCode) {}
|
onEnumerationEnd: function (aMediaList, aStatusCode) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
var artistCounts = {};
|
var artistCounts = {};
|
||||||
var artists = list.getDistinctValuesForProperty(SBProperties.artistName);
|
var artists = list.getDistinctValuesForProperty(SBProperties.artistName);
|
||||||
var artist;
|
var artist;
|
||||||
var artistArray = [];
|
var artistArray = [];
|
||||||
var i=0;
|
var i = 0;
|
||||||
// Count the number of media items for each distinct artist
|
// Count the number of media items for each distinct artist
|
||||||
while (artists.hasMore()) {
|
while (artists.hasMore()) {
|
||||||
artist = artists.getNext();
|
artist = artists.getNext();
|
||||||
@@ -172,7 +162,7 @@ function getAlbums(artist)
|
|||||||
var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate();
|
var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate();
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
||||||
while(items.hasMoreElements()) {
|
while (items.hasMoreElements()) {
|
||||||
album = items.getNext().getProperty(SBProperties.albumName);
|
album = items.getNext().getProperty(SBProperties.albumName);
|
||||||
albumArray[i] = [album, album];
|
albumArray[i] = [album, album];
|
||||||
i++;
|
i++;
|
||||||
@@ -193,7 +183,7 @@ function getTracks(artist,album)
|
|||||||
pa.appendProperty(SBProperties.albumName,album.toString());
|
pa.appendProperty(SBProperties.albumName,album.toString());
|
||||||
var items = list.getItemsByProperties(pa).enumerate();
|
var items = list.getItemsByProperties(pa).enumerate();
|
||||||
|
|
||||||
while(items.hasMoreElements()) {
|
while (items.hasMoreElements()) {
|
||||||
track = items.getNext().getProperty(SBProperties.trackName);
|
track = items.getNext().getProperty(SBProperties.trackName);
|
||||||
tracksArray[i] = [track, track];
|
tracksArray[i] = [track, track];
|
||||||
i++;
|
i++;
|
||||||
@@ -205,15 +195,17 @@ function getTracks(artist,album)
|
|||||||
|
|
||||||
function removeDuplicateElement(arrayName)
|
function removeDuplicateElement(arrayName)
|
||||||
{
|
{
|
||||||
var newArray=new Array();
|
var newArray = new Array();
|
||||||
label:for(var i=0; i<arrayName.length;i++ )
|
label:for (var i = 0; i < arrayName.length; i++)
|
||||||
{
|
{
|
||||||
for(var j=0; j<newArray.length;j++ )
|
for (var j = 0; j < newArray.length; j++)
|
||||||
{
|
{
|
||||||
if(newArray[j].toString()==arrayName[i].toString())
|
if (newArray[j].toString() == arrayName[i].toString())
|
||||||
continue label;
|
continue label;
|
||||||
}
|
}
|
||||||
newArray[newArray.length] = arrayName[i];
|
newArray[newArray.length] = arrayName[i];
|
||||||
}
|
}
|
||||||
return newArray;
|
return newArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
Reference in New Issue
Block a user