root/lang/javascript/vimperator-plugins/branches/2.1/foxytunes.js

Revision 29538, 13.5 kB (checked in by anekos, 19 months ago)

PLUGIN_INFO 修正(Wiki記法)

Line 
1/* NEW BSD LICENSE {{{
2Copyright (c) 2008, anekos.
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification,
6are permitted provided that the following conditions are met:
7
8    1. Redistributions of source code must retain the above copyright notice,
9       this list of conditions and the following disclaimer.
10    2. Redistributions in binary form must reproduce the above copyright notice,
11       this list of conditions and the following disclaimer in the documentation
12       and/or other materials provided with the distribution.
13    3. The names of the authors may not be used to endorse or promote products
14       derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25THE POSSIBILITY OF SUCH DAMAGE.
26
27
28###################################################################################
29# http://sourceforge.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license       #
30# に参考になる日本語訳がありますが、有効なのは上記英文となります。                #
31###################################################################################
32
33}}} */
34
35var PLUGIN_INFO =
36<VimperatorPlugin>
37  <name>Foxy Tunes</name>
38  <description>for FoxyTunes</description>
39  <description lang="ja">for FoxyTunes</description>
40  <version>0.3.1</version>
41  <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
42  <minVersion>2.0pre</minVersion>
43  <maxVersion>2.0pre</maxVersion>
44  <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/foxytunes.js</updateURL>
45  <license>new BSD License (Please read the source code comments of this plugin)</license>
46  <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license>
47  <detail><![CDATA[
48    == Commands ==
49      + :ftplay
50      + :ftpause
51      + :ftnext
52      + :ftprevious
53      + :ftvolume <VOLUME>
54  ]]></detail>
55  <detail lang="ja"><![CDATA[
56    == Commands ==
57      + :ftplay
58      + :ftpause
59      + :ftnext
60      + :ftprevious
61      + :ftvolume <VOLUME>
62  ]]></detail>
63</VimperatorPlugin>;
64
65(function () {
66
67  // 上手い具合に病数に直すよ
68  function fromTimeCode (code) {
69    let m;
70    function sign (s, v)
71      (s == '-' ? -v : v);
72    if (m = code.match(/^([-+])?(\d+):(\d+)$/))
73      return sign(m[1], parseInt(m[2]) * 60 + parseInt(m[3]));
74    if (m = code.match(/^([-+])?(\d+\.\d+)$/))
75      return sign(m[1], parseFloat(m[2]) * 60);
76    return parseInt(code);
77  }
78
79  let player = Components.classes['@foxytunes.org/FoxyTunesEngine/FoxyTunesService;1'].getService();
80
81  // foxytunesDispatchPlayerCommand
82  ['Pause', 'Play', 'Next', 'Previous'].forEach(function (name) {
83    let ln = name.toLowerCase();
84    let lnm = ln.match(/(..)(.*)/);
85    commands.addUserCommand(
86      ['ft' + lnm[1] + '[' + lnm[2] + ']'],
87      name + ' - FoxyTunes',
88      function () foxytunesDispatchPlayerCommand(name, true),
89      true
90    );
91  });
92
93  // volume
94  commands.addUserCommand(
95    ['ftvo[lume]'],
96    'Set Volume - FoxyTunes',
97    function (args) {
98      let v = parseInt(args.string || '0', 10);
99      let volume = args.bang ? Math.min(Math.max(foxytunesGetVolume() + v, 0), 100)
100                             : Math.min(Math.max(v, 0), 100);
101      foxytunesSetVolume(v);
102    },
103    {
104      argCount: '*'
105    },
106    true
107  );
108
109})();
110
111/*
112  FoxyTunes が window に設置する関数の数々…
113  gFoxytunesYMPPageAnalyzer
114  FoxyTunesHTMLTooltip
115  FoxyTunesTooltipInfo
116  FoxytunesYMPPageAnalyzer
117  FoxytunesThunderbirdSignatures
118  FoxytunesSignatures
119  FoxytunesSignaturesSiteHandler
120  FoxyTunesFeedMenuPopupUI
121  FoxyTunesSearchEngine
122  FoxyTunesSearchTermsBuilder
123  FoxyTunesSearchExecuter
124  foxytunescontextMenuExecuteSearch
125  foxytunesExecuteSearch
126  foxytunesInitMusicSearchMenuPopup
127  gFoxytunesSignatures
128  gFoxyTunesUninstallObserver
129  gbFoxyTunesIgnorePrefChange
130  gFoxyTunesRecentPlayers
131  gFoxyTunesInfoBoxShowTimerId
132  gFoxyTunesInfoBoxHideTimerId
133  gFoxyTunesInfoBoxWindow
134  gbFoxyTunesInfoBoxWindowOpened
135  gbFoxyTunesInfoPopupVisible
136  gFoxyTunesDOMParser
137  gbFoxyTunesShiftDown
138  gbFoxyTunesNoTitlePopup
139  gFoxyTunesUpdateTitleOnCommandTimerID
140  gbFoxyTunesDontUpdateTitleOnCommand
141  gFoxyTunesMaxLinksForWebMedia
142  gFoxyTunesAutoHideTimeout
143  gFoxyTunesAllButtonsAutohideTimerID
144  gFoxyTunesCurrentTrackTitle
145  gFoxyTunesTrackInfoTooltipHeight
146  gFoxyTunesPlayerObj
147  gFoxyTunesCurrentPlayerClass
148  gFoxyTunesInsertAfterElementId
149  gFoxyTunesInsertBeforeElementId
150  gFoxyTunesParentElementID
151  gbFoxyTunesOpenWindowInTab
152  gFoxyTunesCurrentPlayerOptions
153  gFoxyTunesCustomPlayerOptions
154  gFoxyTunesMaxRecentCharsets
155  gFoxyTunesRecentCharsets
156  gFoxyTunesAllCharSets
157  gbFoxyTunesChangingSliderPos
158  gbFoxyTunesPlaying
159  gFoxyTunesTrackInfoTimerID
160  gFoxyTunesCharacterEncoding
161  gFoxytunesUtils
162  gFoxyTunesUnicodeConverter
163  foxytunesScriptableUnicodeConverter
164  gFoxyTunesPref
165  gFoxyTunesPrefService
166  foxytunesDragAndDropObserver
167  foxytunesGenarateUrlsFromUrl
168  foxytunesGenarateUrlsFromFileOrDirectory
169  foxytunesSetAmazonStoreOption
170  foxytunesSetAmazonStore
171  foxytunesInstallTwittyTunes
172  foxytunesOpenTwittyTunesDialog
173  foxytunesUninitOverlay
174  foxytunesInitOverlay
175  foxytunesShowStatusBarUponFreshInstall
176  foxytunesUninstallObserver
177  foxytunesUpdateFoxytunesVersionAndShowWelcomeScreenIfNeeded
178  foxytunesClearQuickSwitch
179  foxytunesCustomizeWebSearchEngine
180  foxytunesInitMinibrowserOverlay
181  foxytunesObserveContextMenu
182  foxytunesObserveSwitchPlayer
183  gFoxyTunesSwitchPlayerObserver
184  foxytunesObserveTrackData
185  foxytunesObservePrefs
186  gFoxyTunesPreferencesObserver
187  gFoxyTunesTrackDataObserver
188  foxytunesDoPlatformSpecificUIChanges
189  foxytunesDisableFoxyTunesMini
190  foxytunesShowPleaseWait
191  foxytunesModuleInstallationFailed
192  foxytunesSeaMonkeyInstallFixer
193  foxytunesOnQuickPlayerSwitch
194  foxytunesPopulateRecentPlayers
195  foxytunesOnMainMenuShowing
196  foxytunesAlertStreamNotSupported
197  foxytunesStreamIsSupportedInCurrentPlayer
198  foxytunesGetSupportedRegExp
199  foxytunesURLIsMedia
200  foxytunesOnContextPopupShowing
201  foxytunesShowOrHideContextMenuItems
202  foxytunesSetElementHiddenAttrByFtpref
203  foxytunesPopulateFeedMenu
204  foxytunesPopulatePageMediaMenu
205  foxytunesGetLinkDescription
206  foxytunesPlayMedia
207  foxytunesOpenMinimode
208  foxytunesOnMouseMove
209  foxytunesOnBrowserStatusChanged
210  foxytunesVerifyWidth
211  foxytunesRestoreIfHidden
212  foxytunesShowRestartBrowserAlert
213  foxytunesEmusicSpecificInit
214  foxytunesSeaMonkeySpecificInit
215  foxytunesThunderbirdSpecificInit
216  foxytunesRenameMainDll
217  foxytunesShowUpdateAvailableButtonIfNeeded
218  foxytunesUpdateAvailableButtonIsDisabled
219  foxytunesDisableUpdateAvailableButton
220  foxytunesGotoUpdateURL
221  foxytunesFoxyTunesHasUpdates
222  foxytunesGetFoxyTunesAvailableUpdateVersion
223  foxytunesGetFoxyTunesVersion
224  foxytunesGetFoxyTunesEMItem
225  foxytunesInstallPlatformSpecificLibraryIfNeeded
226  foxytunesRemoveRegistryFiles
227  foxytunesGetComponentFile
228  foxytunesGetHome
229  foxytunesGetProfileDir
230  foxytunesInsertPlayersMenuItem
231  foxytunesInitVolumeSlider
232  foxytunesRegisterVolumeSliderEvents
233  foxytunesRegisterGlobalScrollEvent
234  foxytunesSetPlayerOptionsCustom
235  foxytunesSetPlayerOptionsPreset
236  foxytunesSetPlayerOptions
237  foxytunesDoPlayerSpecificUIChanges
238  foxytunesSubscribeToNewsletter
239  foxytunesOpenConfigureShortcutsDialog
240  foxytunesInitKeyboardShortcuts
241  foxytunesOverrideKeyIfNeeded
242  foxytunesGetAllKeys
243  foxytunesOpenFoxyTunesAboutDialog
244  foxytunesToggleAllButtonsVisibility
245  foxytunesAllButtonsMouseOut
246  foxytunesAllButtonsMouseOver
247  foxytunesAllButtonsAutoHideIsOn
248  foxytunesToggleVolumeSliderVisibility
249  foxytunesToggleButtonVisibility
250  foxytunesToggleSeparatorsVisibility
251  foxytunesToggleOpenWindowInTab
252  foxytunesToggleURLUnescapeTitle
253  foxytunesToggleObjectVisibilityWithArrow
254  foxytunesScrollOnVolumeControls
255  foxytunesDecreaseVolume
256  foxytunesIncreaseVolume
257  foxytunesRefreshVolumeSliderIfDirty
258  foxytunesRefreshVolumeSliderPosition
259  foxytunesVolumeSliderPositionDirty
260  foxytunesSetVolumeSliderPosition
261  foxytunesVolumeSliderChanged
262  foxytunesEndTrackInfoTooltip
263  foxytunesStartTrackInfoTooltip
264  foxytunesHideTrackInfoPopup
265  foxytunesShowTrackInfoPopup
266  foxytunesTriggerShowTrackInfoPopup
267  foxytunesCancelShowTrackInfoPopup
268  foxytunesHideTrackInfoBox
269  foxytunesTriggerHideTrackInfoBox
270  foxytunesCancelHideTrackInfoBox
271  foxytunesShowTrackInfoBox
272  foxytunesHideAllPopups
273  foxytunesHideAllPopupsByType
274  foxytunesSetTrackInfoTooltip
275  foxytunesGetTrackInfoTooltipText
276  foxytunesSetCurrentTrackPosition
277  foxytunesUpdatePlanetTooltip
278  foxytunesGetCurrentTrackItem
279  foxytunesGetCurrentTrackTitle
280  foxytunesGetCurrentTrackData
281  foxytunesGetVolume
282  foxytunesSetVolume
283  foxytunesVerifyWMPStartPlaying
284  foxytunesDispatchPlayerCommand
285  foxytunesUpdateTrackTitleAfterCommand
286  foxytunesInitPlayerObjectIfNeeded
287  foxytunesSelectPlayer
288  foxytunesUpdateRecentPlayer
289  foxytunesOnSelectPlayer
290  foxytunesReadPreferences
291  foxytunesWritePreferences
292  foxytunesUpdateRecentCharsetsList
293  foxytunesSelectCharset
294  foxytunesPopulateRecentCharsets
295  foxytunesAddRecentCharSet
296  foxytunesTrimRecentCharSets
297  foxytunesGetCharSetMenuItem
298  foxytunesPopulatePlayers
299  foxytunesConfigureCurrentPlayer
300  foxytunesOnPlayerListShowing
301  foxytunesPopulateCharacterEncodings
302  foxytunesCompareCharSets
303  gFoxyTunesTimeTools
304  FoxyTunesTimeTools
305  gFoxyTunesTrackInfoDisplayAutohideTimerID
306  gFoxyTunesResizeInitialWidth
307  gFoxyTunesResizeStartX
308  gbFoxyTunesTrackPressing
309  gFoxyTunesTrackTitleQueryInterval
310  gFoxyTunesTrackTitleDisplayTimerID
311  foxytunesTrackTitleDragStartObserver
312  foxytunesTrackTitleDisplayResizeMove
313  foxytunesTrackTitleDisplayResizeUp
314  foxytunesTrackTitleDisplayResizeDown
315  foxytunesTrackTitleToggleAlignment
316  foxytunesTrackTitleHideGotoPlanetButton
317  foxytunesTrackToggleSeekSlider
318  foxytunesTrackTitleToggleScrolling
319  foxytunesTrackTitleCopyToClipBoard
320  foxytunesToggleTrackTitleDisplayVisibility
321  foxytunesTrackTitleAutoHideIsOn
322  foxytunesTrackInfoDisplayMouseOut
323  foxytunesTrackInfoDisplayMouseOver
324  foxytunesTrackTitleDisplayVisibile
325  foxytunesSetCurrentTrackTitleLabel
326  foxytunesTrackTitleLabelUpdater
327  foxytunesUpdateTrackPositionMarker
328  foxytunesUpdateTrackTitleLabel
329  foxytunesInitTrackTitleLabel
330  foxytunesGetTrackInfoLabelElement
331  gFoxyTunesCurrentDropTarget
332  foxytunesSetFoxyTunesPosition
333  foxytunesRenameTagName
334  foxyTargetObserver
335  foxyDragStartObserver
336  foxytunesOnTargetDragDrop
337  foxytunesOnTargetDragExit
338  foxytunesOnTargetDragOver
339  foxytunesSetDropTargetMarker
340  foxytunesElementIsToolbarOrStatusbar
341  foxytunesRemoveDropClass
342  foxytunesHasDropClass
343  foxytunesUnInstallDragDropObservers
344  foxytunesInstallDragDropObservers
345  foxytunesInstallUninstallDragDropObservers
346  foxytunesInstallDragDropObserversForElementById
347  foxytunesInclude
348  gFoxyTunesIncludeRegistry
349  foxytunesGetExtensionVersion
350  foxytunesOpenSignatuensConfigurationWindow
351  foxytunesGetLocaleStringExternalfunction
352  foxytunesGetDefaultPlayerForOs
353  foxytunesMd5
354  foxytunesGetIconPath
355  foxytunesGetExtensionPath
356  foxytunesEscapeNonAsciiText
357  foxytunesPrefToUIElements
358  foxytunesUIElementToPref
359  gFoxytunesPreferenceManager
360  foxytunesPreferenceManager
361  foxytunesShowBalloonHelpWithTip
362  foxytunesShowBalloonHelp
363  foxytunesGetMostRecentWindow
364  foxytunesGetBaseWindow
365  foxytunesFixLocalStore
366  foxytunesDoAndHidePleaseWait
367  foxytunesGetAppName
368  foxytunesGetAppVersion
369  foxytunesGetPlatform
370  foxytunesGetPlatformFull
371  foxytunesGetDefaultBrowserIcon
372  foxytunesGetDefaultBrowserLocation
373  foxytunesReadRegistryValue
374  foxytunesInitMenupopups
375  foxytunesCloseLastContextMenu
376  gFoxyTunesLastMenu
377  foxytunesSeconds2TimeStr
378  foxytunesIsNumber
379  foxytunesTryGetFoxyTunesPlayerFromContractID
380  foxytunesGetPlayerShortNameFromContractID
381  foxytunesIsInMinimode
382  foxytunesWindowIsMinimode
383  foxytunesWindowIsMinibrowser
384  foxytunesClearMenupopup
385  foxytunesSanitizeURL
386  foxytunesGetClippedText
387  foxytunesGetSelection
388  foxytunesGetTextFromClipboard
389  foxytinesTrimString
390  foxytunesShortcutsEnabledByDefault
391  foxytunesReadSinglePreference
392  foxytunesReadSingleUnicharPreference
393  foxytunesWriteSingleUnicharPreference
394  foxytunesWriteSinglePreference
395  foxytunesGetLocaleString
396  foxytunesStringPadRight
397  foxytunesShowPrompt
398  foxytunesShowAlert
399  foxytunesShowAlertWithDelay
400  foxytunesOpenInTabs
401  foxytunesGoToURL
402  foxytunesEmusicGoToUrl
403  foxytunesShouldOpenWindowsInTabs
404  foxytunesGetEmusicWindow
405  foxytunesGetBrowserWindow
406  foxytunesRaiseBrowserWindow
407  foxytunesGotoPlanet
408  foxytunesGetPlanetUrl
409  foxytunesOpenBrowserWindow
410  gFoxyTunesSanitizer
411  foxytunesSanitizer
412  foxytunesGetMinibrowserURL
413  foxytunesCalculateMinibrowserPosition
414  foxytunesShouldUseMinibrowser
415  foxytunesLaunchExternalURL
416  foxytunesLaunchExternalURLFromThunderbird
417  foxytunesAdjustStringForCorrectHost
418  getFoxyTunesPlanetBaseURL
419  foxytunesIsInEmusic
420  foxytunesIsInMozilla
421  foxytunesIsInThunderbird
422  foxytunesIsInFirefox
423  foxytunesIsInIceweasel
424  foxytunesIsInMineField
425*/
426
427// vim:sw=2 ts=2 et si fdm=marker:
Note: See TracBrowser for help on using the browser.