diff options
| author | anekos | 2008-12-14 11:15:20 +0000 | 
|---|---|---|
| committer | anekos | 2008-12-14 11:15:20 +0000 | 
| commit | e2ee47432d7f9430b9fd74d33350cd531defc14f (patch) | |
| tree | b4a9b3705897c3695a2aeae2350c3a616ed46411 | |
| parent | 3b47a8922d33f2081489e03e3ada67e6be144449 (diff) | |
| download | vimperator-plugins-e2ee47432d7f9430b9fd74d33350cd531defc14f.tar.bz2 | |
とりあえずちょっと書いてみた release
FoxyTunes 用
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26672 d0d07461-0603-4401-acd4-de1884942a52
| -rw-r--r-- | foxytunes.js | 388 | 
1 files changed, 388 insertions, 0 deletions
diff --git a/foxytunes.js b/foxytunes.js new file mode 100644 index 0000000..2492729 --- /dev/null +++ b/foxytunes.js @@ -0,0 +1,388 @@ +var PLUGIN_INFO = +<VimperatorPlugin> +  <name>Foxy Tunes</name> +  <description>for Foxy Tunes</description> +  <description lang="ja">for Foxy Tunes</description> +  <version>1.2</version> +  <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> +  <minVersion>2.0pre</minVersion> +  <maxVersion>2.0pre</maxVersion> +  <license document="http://creativecommons.org/licenses/by-sa/3.0/"> +    Creative Commons Attribution-Share Alike 3.0 Unported +  </license> +  <detail><![CDATA[ +    == Commands == +    +:ftplay +    +:ftpause +    +:ftvolume <VOLUME> +  ]]></detail> +  <detail lang="ja"><![CDATA[ +    == Commands == +    +:ftplay +    +:ftpause +    +:ftvolume <VOLUME> +  ]]></detail> +</VimperatorPlugin>; + +(function () { + +  // $B>e<j$$6q9g$KIB?t$KD>$9$h(B +  function fromTimeCode (code) { +    let m; +    function sign (s, v) +      (s == '-' ? -v : v); +    if (m = code.match(/^([-+])?(\d+):(\d+)$/)) +      return sign(m[1], parseInt(m[2]) * 60 + parseInt(m[3])); +    if (m = code.match(/^([-+])?(\d+.\d+)$/)) +      return sign(m[1], parseFloat(m[2]) * 60); +    return parseInt(code); +  } + +  let player = Components.classes['@foxytunes.org/FoxyTunesEngine/FoxyTunesService;1'].getService(); + +  // foxytunesDispatchPlayerCommand +  ['Pause', 'Play'].forEach(function (name) { +    commands.addUserCommand( +      ['ft' + name.toLowerCase()], +      name + ' - FoxyTunes', +      function () foxytunesDispatchPlayerCommand(name, true), +      true +    ); +  }); + +  // volume +  commands.addUserCommand( +    ['ftvo[lume]'], +    'Set Volume - FoxyTunes', +    function (args) { +      let v = parseInt(args.string || '0', 10); +      let volume = args.bang ? Math.min(Math.max(foxytunesGetVolume() + v, 0), 100) +                             : Math.min(Math.max(v, 0), 100); +      foxytunesSetVolume(v); +    }, +    { +      argCount: '*' +    }, +    true +  ); + + +})(); + +/* +  foxytunes $B$,(B window $B$K@_CV$9$k4X?t$N?t!9!D(B +  gFoxytunesYMPPageAnalyzer +  FoxyTunesHTMLTooltip +  FoxyTunesTooltipInfo +  FoxytunesYMPPageAnalyzer +  FoxytunesThunderbirdSignatures +  FoxytunesSignatures +  FoxytunesSignaturesSiteHandler +  FoxyTunesFeedMenuPopupUI +  FoxyTunesSearchEngine +  FoxyTunesSearchTermsBuilder +  FoxyTunesSearchExecuter +  foxytunescontextMenuExecuteSearch +  foxytunesExecuteSearch +  foxytunesInitMusicSearchMenuPopup +  gFoxytunesSignatures +  gFoxyTunesUninstallObserver +  gbFoxyTunesIgnorePrefChange +  gFoxyTunesRecentPlayers +  gFoxyTunesInfoBoxShowTimerId +  gFoxyTunesInfoBoxHideTimerId +  gFoxyTunesInfoBoxWindow +  gbFoxyTunesInfoBoxWindowOpened +  gbFoxyTunesInfoPopupVisible +  gFoxyTunesDOMParser +  gbFoxyTunesShiftDown +  gbFoxyTunesNoTitlePopup +  gFoxyTunesUpdateTitleOnCommandTimerID +  gbFoxyTunesDontUpdateTitleOnCommand +  gFoxyTunesMaxLinksForWebMedia +  gFoxyTunesAutoHideTimeout +  gFoxyTunesAllButtonsAutohideTimerID +  gFoxyTunesCurrentTrackTitle +  gFoxyTunesTrackInfoTooltipHeight +  gFoxyTunesPlayerObj +  gFoxyTunesCurrentPlayerClass +  gFoxyTunesInsertAfterElementId +  gFoxyTunesInsertBeforeElementId +  gFoxyTunesParentElementID +  gbFoxyTunesOpenWindowInTab +  gFoxyTunesCurrentPlayerOptions +  gFoxyTunesCustomPlayerOptions +  gFoxyTunesMaxRecentCharsets +  gFoxyTunesRecentCharsets +  gFoxyTunesAllCharSets +  gbFoxyTunesChangingSliderPos +  gbFoxyTunesPlaying +  gFoxyTunesTrackInfoTimerID +  gFoxyTunesCharacterEncoding +  gFoxytunesUtils +  gFoxyTunesUnicodeConverter +  foxytunesScriptableUnicodeConverter +  gFoxyTunesPref +  gFoxyTunesPrefService +  foxytunesDragAndDropObserver +  foxytunesGenarateUrlsFromUrl +  foxytunesGenarateUrlsFromFileOrDirectory +  foxytunesSetAmazonStoreOption +  foxytunesSetAmazonStore +  foxytunesInstallTwittyTunes +  foxytunesOpenTwittyTunesDialog +  foxytunesUninitOverlay +  foxytunesInitOverlay +  foxytunesShowStatusBarUponFreshInstall +  foxytunesUninstallObserver +  foxytunesUpdateFoxytunesVersionAndShowWelcomeScreenIfNeeded +  foxytunesClearQuickSwitch +  foxytunesCustomizeWebSearchEngine +  foxytunesInitMinibrowserOverlay +  foxytunesObserveContextMenu +  foxytunesObserveSwitchPlayer +  gFoxyTunesSwitchPlayerObserver +  foxytunesObserveTrackData +  foxytunesObservePrefs +  gFoxyTunesPreferencesObserver +  gFoxyTunesTrackDataObserver +  foxytunesDoPlatformSpecificUIChanges +  foxytunesDisableFoxyTunesMini +  foxytunesShowPleaseWait +  foxytunesModuleInstallationFailed +  foxytunesSeaMonkeyInstallFixer +  foxytunesOnQuickPlayerSwitch +  foxytunesPopulateRecentPlayers +  foxytunesOnMainMenuShowing +  foxytunesAlertStreamNotSupported +  foxytunesStreamIsSupportedInCurrentPlayer +  foxytunesGetSupportedRegExp +  foxytunesURLIsMedia +  foxytunesOnContextPopupShowing +  foxytunesShowOrHideContextMenuItems +  foxytunesSetElementHiddenAttrByFtpref +  foxytunesPopulateFeedMenu +  foxytunesPopulatePageMediaMenu +  foxytunesGetLinkDescription +  foxytunesPlayMedia +  foxytunesOpenMinimode +  foxytunesOnMouseMove +  foxytunesOnBrowserStatusChanged +  foxytunesVerifyWidth +  foxytunesRestoreIfHidden +  foxytunesShowRestartBrowserAlert +  foxytunesEmusicSpecificInit +  foxytunesSeaMonkeySpecificInit +  foxytunesThunderbirdSpecificInit +  foxytunesRenameMainDll +  foxytunesShowUpdateAvailableButtonIfNeeded +  foxytunesUpdateAvailableButtonIsDisabled +  foxytunesDisableUpdateAvailableButton +  foxytunesGotoUpdateURL +  foxytunesFoxyTunesHasUpdates +  foxytunesGetFoxyTunesAvailableUpdateVersion +  foxytunesGetFoxyTunesVersion +  foxytunesGetFoxyTunesEMItem +  foxytunesInstallPlatformSpecificLibraryIfNeeded +  foxytunesRemoveRegistryFiles +  foxytunesGetComponentFile +  foxytunesGetHome +  foxytunesGetProfileDir +  foxytunesInsertPlayersMenuItem +  foxytunesInitVolumeSlider +  foxytunesRegisterVolumeSliderEvents +  foxytunesRegisterGlobalScrollEvent +  foxytunesSetPlayerOptionsCustom +  foxytunesSetPlayerOptionsPreset +  foxytunesSetPlayerOptions +  foxytunesDoPlayerSpecificUIChanges +  foxytunesSubscribeToNewsletter +  foxytunesOpenConfigureShortcutsDialog +  foxytunesInitKeyboardShortcuts +  foxytunesOverrideKeyIfNeeded +  foxytunesGetAllKeys +  foxytunesOpenFoxyTunesAboutDialog +  foxytunesToggleAllButtonsVisibility +  foxytunesAllButtonsMouseOut +  foxytunesAllButtonsMouseOver +  foxytunesAllButtonsAutoHideIsOn +  foxytunesToggleVolumeSliderVisibility +  foxytunesToggleButtonVisibility +  foxytunesToggleSeparatorsVisibility +  foxytunesToggleOpenWindowInTab +  foxytunesToggleURLUnescapeTitle +  foxytunesToggleObjectVisibilityWithArrow +  foxytunesScrollOnVolumeControls +  foxytunesDecreaseVolume +  foxytunesIncreaseVolume +  foxytunesRefreshVolumeSliderIfDirty +  foxytunesRefreshVolumeSliderPosition +  foxytunesVolumeSliderPositionDirty +  foxytunesSetVolumeSliderPosition +  foxytunesVolumeSliderChanged +  foxytunesEndTrackInfoTooltip +  foxytunesStartTrackInfoTooltip +  foxytunesHideTrackInfoPopup +  foxytunesShowTrackInfoPopup +  foxytunesTriggerShowTrackInfoPopup +  foxytunesCancelShowTrackInfoPopup +  foxytunesHideTrackInfoBox +  foxytunesTriggerHideTrackInfoBox +  foxytunesCancelHideTrackInfoBox +  foxytunesShowTrackInfoBox +  foxytunesHideAllPopups +  foxytunesHideAllPopupsByType +  foxytunesSetTrackInfoTooltip +  foxytunesGetTrackInfoTooltipText +  foxytunesSetCurrentTrackPosition +  foxytunesUpdatePlanetTooltip +  foxytunesGetCurrentTrackItem +  foxytunesGetCurrentTrackTitle +  foxytunesGetCurrentTrackData +  foxytunesGetVolume +  foxytunesSetVolume +  foxytunesVerifyWMPStartPlaying +  foxytunesDispatchPlayerCommand +  foxytunesUpdateTrackTitleAfterCommand +  foxytunesInitPlayerObjectIfNeeded +  foxytunesSelectPlayer +  foxytunesUpdateRecentPlayer +  foxytunesOnSelectPlayer +  foxytunesReadPreferences +  foxytunesWritePreferences +  foxytunesUpdateRecentCharsetsList +  foxytunesSelectCharset +  foxytunesPopulateRecentCharsets +  foxytunesAddRecentCharSet +  foxytunesTrimRecentCharSets +  foxytunesGetCharSetMenuItem +  foxytunesPopulatePlayers +  foxytunesConfigureCurrentPlayer +  foxytunesOnPlayerListShowing +  foxytunesPopulateCharacterEncodings +  foxytunesCompareCharSets +  gFoxyTunesTimeTools +  FoxyTunesTimeTools +  gFoxyTunesTrackInfoDisplayAutohideTimerID +  gFoxyTunesResizeInitialWidth +  gFoxyTunesResizeStartX +  gbFoxyTunesTrackPressing +  gFoxyTunesTrackTitleQueryInterval +  gFoxyTunesTrackTitleDisplayTimerID +  foxytunesTrackTitleDragStartObserver +  foxytunesTrackTitleDisplayResizeMove +  foxytunesTrackTitleDisplayResizeUp +  foxytunesTrackTitleDisplayResizeDown +  foxytunesTrackTitleToggleAlignment +  foxytunesTrackTitleHideGotoPlanetButton +  foxytunesTrackToggleSeekSlider +  foxytunesTrackTitleToggleScrolling +  foxytunesTrackTitleCopyToClipBoard +  foxytunesToggleTrackTitleDisplayVisibility +  foxytunesTrackTitleAutoHideIsOn +  foxytunesTrackInfoDisplayMouseOut +  foxytunesTrackInfoDisplayMouseOver +  foxytunesTrackTitleDisplayVisibile +  foxytunesSetCurrentTrackTitleLabel +  foxytunesTrackTitleLabelUpdater +  foxytunesUpdateTrackPositionMarker +  foxytunesUpdateTrackTitleLabel +  foxytunesInitTrackTitleLabel +  foxytunesGetTrackInfoLabelElement +  gFoxyTunesCurrentDropTarget +  foxytunesSetFoxyTunesPosition +  foxytunesRenameTagName +  foxyTargetObserver +  foxyDragStartObserver +  foxytunesOnTargetDragDrop +  foxytunesOnTargetDragExit +  foxytunesOnTargetDragOver +  foxytunesSetDropTargetMarker +  foxytunesElementIsToolbarOrStatusbar +  foxytunesRemoveDropClass +  foxytunesHasDropClass +  foxytunesUnInstallDragDropObservers +  foxytunesInstallDragDropObservers +  foxytunesInstallUninstallDragDropObservers +  foxytunesInstallDragDropObserversForElementById +  foxytunesInclude +  gFoxyTunesIncludeRegistry +  foxytunesGetExtensionVersion +  foxytunesOpenSignatuensConfigurationWindow +  foxytunesGetLocaleStringExternalfunction +  foxytunesGetDefaultPlayerForOs +  foxytunesMd5 +  foxytunesGetIconPath +  foxytunesGetExtensionPath +  foxytunesEscapeNonAsciiText +  foxytunesPrefToUIElements +  foxytunesUIElementToPref +  gFoxytunesPreferenceManager +  foxytunesPreferenceManager +  foxytunesShowBalloonHelpWithTip +  foxytunesShowBalloonHelp +  foxytunesGetMostRecentWindow +  foxytunesGetBaseWindow +  foxytunesFixLocalStore +  foxytunesDoAndHidePleaseWait +  foxytunesGetAppName +  foxytunesGetAppVersion +  foxytunesGetPlatform +  foxytunesGetPlatformFull +  foxytunesGetDefaultBrowserIcon +  foxytunesGetDefaultBrowserLocation +  foxytunesReadRegistryValue +  foxytunesInitMenupopups +  foxytunesCloseLastContextMenu +  gFoxyTunesLastMenu +  foxytunesSeconds2TimeStr +  foxytunesIsNumber +  foxytunesTryGetFoxyTunesPlayerFromContractID +  foxytunesGetPlayerShortNameFromContractID +  foxytunesIsInMinimode +  foxytunesWindowIsMinimode +  foxytunesWindowIsMinibrowser +  foxytunesClearMenupopup +  foxytunesSanitizeURL +  foxytunesGetClippedText +  foxytunesGetSelection +  foxytunesGetTextFromClipboard +  foxytinesTrimString +  foxytunesShortcutsEnabledByDefault +  foxytunesReadSinglePreference +  foxytunesReadSingleUnicharPreference +  foxytunesWriteSingleUnicharPreference +  foxytunesWriteSinglePreference +  foxytunesGetLocaleString +  foxytunesStringPadRight +  foxytunesShowPrompt +  foxytunesShowAlert +  foxytunesShowAlertWithDelay +  foxytunesOpenInTabs +  foxytunesGoToURL +  foxytunesEmusicGoToUrl +  foxytunesShouldOpenWindowsInTabs +  foxytunesGetEmusicWindow +  foxytunesGetBrowserWindow +  foxytunesRaiseBrowserWindow +  foxytunesGotoPlanet +  foxytunesGetPlanetUrl +  foxytunesOpenBrowserWindow +  gFoxyTunesSanitizer +  foxytunesSanitizer +  foxytunesGetMinibrowserURL +  foxytunesCalculateMinibrowserPosition +  foxytunesShouldUseMinibrowser +  foxytunesLaunchExternalURL +  foxytunesLaunchExternalURLFromThunderbird +  foxytunesAdjustStringForCorrectHost +  getFoxyTunesPlanetBaseURL +  foxytunesIsInEmusic +  foxytunesIsInMozilla +  foxytunesIsInThunderbird +  foxytunesIsInFirefox +  foxytunesIsInIceweasel +  foxytunesIsInMineField +*/ + +// vim:sw=2 ts=2 et si fdm=marker:  | 
