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