Permalink
Browse files

seeding userscript sub-portion

  • Loading branch information...
etivite committed Jan 13, 2012
0 parents commit 9f77c6a4adacc3b173766872bb9e05c919b58090
Showing with 4,232 additions and 0 deletions.
  1. BIN src/chrome/crx/icon128.png
  2. BIN src/chrome/crx/icon16.png
  3. BIN src/chrome/crx/icon48.png
  4. +16 −0 src/chrome/crx/manifest.json
  5. +3 −0 src/firefox/chrome.manifest
  6. BIN src/firefox/chrome/icons/default/firevortexvmgabout.ico
  7. BIN src/firefox/chrome/icons/default/firevortexvmgprefs.ico
  8. BIN src/firefox/chrome/skin/classic/Thumbs.db
  9. BIN src/firefox/chrome/skin/classic/bug.png
  10. BIN src/firefox/chrome/skin/classic/cancel.png
  11. BIN src/firefox/chrome/skin/classic/close.png
  12. BIN src/firefox/chrome/skin/classic/cog.png
  13. BIN src/firefox/chrome/skin/classic/error.png
  14. BIN src/firefox/chrome/skin/classic/exclamation.png
  15. BIN src/firefox/chrome/skin/classic/favicon.png
  16. +9 −0 src/firefox/chrome/skin/classic/firevortexmenubarstyle.css
  17. +33 −0 src/firefox/chrome/skin/classic/firevortexshoutbox.css
  18. +2 −0 src/firefox/chrome/skin/classic/firevortexvmgforumscriptoverlay.css
  19. BIN src/firefox/chrome/skin/classic/fvlogo.png
  20. BIN src/firefox/chrome/skin/classic/fvlogo_disabled.png
  21. BIN src/firefox/chrome/skin/classic/link_go.png
  22. BIN src/firefox/chrome/skin/classic/money_dollar.png
  23. BIN src/firefox/chrome/skin/classic/money_euro.png
  24. +4 −0 src/firefox/content/common/functions.js
  25. +39 −0 src/firefox/content/common/preferences.js
  26. +83 −0 src/firefox/content/firevortexfirstrun.js
  27. +7 −0 src/firefox/content/firevortexoverlay.xul
  28. +92 −0 src/firefox/content/prefman.js
  29. +273 −0 src/firefox/content/script-compiler.js
  30. +89 −0 src/firefox/content/xmlhttprequester.js
  31. +43 −0 src/firefox/defaults/preferences/fvprefs.js
  32. +1 −0 src/firefox/install.rdf
  33. +3,198 −0 src/userscript/firevortex.user.js
  34. +340 −0 src/userscript/fv_options.html
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
{
"content_scripts": [ {
"exclude_globs": [ "http://ads2.vortexmediagroup.com/*", "http://www.google-analytics.com/*", "http://prstats.postrelease.com/*", "http://*.gmodules.com/*", "http://*.googlesyndication.com/*", "http://pagead2.googlesyndication.com/*", "http://*.vortexmediagroup.com/*", "http://googleads.g.doubleclick.net/*", "http://*.doubleclick.net/*", "http://ad.linksynergy.com/*", "http://click.linksynergy.com/*", "http://stats.big-boards.com/*", "http://*.youtube.com/*", "http://youtube.com/*", "http://*.archive.org/*", "http://vwvortex.jbrlsr.com/*", "http://la.jbrlsr.com/*", "http://www.stumbleupon.com/*", "http://http.cdnlayer.com/*", "http://ads.adbrite.com/*", "http://*.adbrite.com/*", "http://ad.technoratimedia.com/*", "http://ad-cdn.technoratimedia.com/*", "http://*.technoratimedia.com/*", "http://*.turn.com/*", "http://*.yieldmanager.com/*", "http://*.scorecardresearch.com/*", "http://*.quantserve.com/*", "http://*.viglink.com/*", "http://*.realmedia.com/*", "http://m.audizine.com/*" ],
"include_globs": [ "http://forums.vwvortex.com/*", "http://forums.fourtitude.com/*", "http://forums.thecarlounge.net/*", "http://forums.thecarlounge.com/*", "http://forums.subdriven.com/*", "http://forums.swedespeed.com/*", "http://forums.mwerks.com/*", "http://forums.triplezoom.com/*", "http://forums.speedarena.com/*", "http://forums.motivemag.com/*", "http://forums.turbonines.com/*", "http://forums.kilometermagazine.com/*", "http://www.audizine.com/forum/*", "http://audizine.com/forum/*" ],
"js": [ "firevortex.js" ],
"matches": [ "http://*/*", "https://*/*" ]
} ],
"converted_from_user_script": true,
"description": "An enhancement for the VWVortex, The Car Lounge, Fourtitude, and AudiZine community forums - http://firevortex.net",
"name": "FireVortex",
"version": "2.0.1016",
"icons": { "16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png" },
"homepage_url": "http://firevortex.net"
}
@@ -0,0 +1,3 @@
content firevortex content/
skin firevortex classic/1.0 chrome/skin/classic/
overlay chrome://browser/content/browser.xul chrome://firevortex/content/firevortexoverlay.xul
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#fvListButton {
list-style-image: url("chrome://firevortexvmgforumscript/skin/fvlogo.png");
-moz-box-orient: horizontal;
}
toolbar[iconsize="small"] #fvListButton {
list-style-image: url("chrome://firevortexvmgforumscript/skin/favicon.png");
}
@@ -0,0 +1,33 @@
.splitpannel {
margin: 0px !important;
padding: 0px !important;
border: 0px !important;
}
.splitpannel-bar {
border-top: 1px solid ThreeDHighlight;
border-bottom: 1px solid ThreeDShadow;
}
#splitpannel-box {
min-height: 20px;
min-width: 20px;
height: 200px;
width: 200px;
}
#splitpannel-close-button {
list-style-image: url("chrome://firevortexvmgforumscript/skin/close.png");
-moz-appearance: none;
-moz-image-region: rect(0px, 16px, 16px, 0px);
padding: 4px 2px;
border: none !important;
}
#splitpannel-close-button {
-moz-image-region: rect(0px, 32px, 16px, 16px);
}
#splitpannel-close-button:hover:active {
-moz-image-region: rect(0px, 48px, 16px, 32px);
}
@@ -0,0 +1,2 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
var firevortex_FireVortexFunctions = {
};
@@ -0,0 +1,39 @@
var firevortex_preferencesService = null;
// Gets a boolean preference, returning false if the preference is not set
function firevortex_getBooleanPreference(preference, userPreference) {
// If the preference is set
if(preference) {
// If not a user preference or a user preference is set
if(!userPreference || firevortex_isPreferenceSet(preference)) {
try {
return firevortex_getPreferencesService().getBoolPref(preference);
} catch(exception) {
// Do nothing
}
}
}
return false;
}
// Gets the preferences service
function firevortex_getPreferencesService() {
// If the preferences service is not set
if(!firevortex_preferencesService) {
firevortex_preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
}
return firevortex_preferencesService;
}
// Is a preference set
function firevortex_isPreferenceSet(preference) {
// If the preference is set
if(preference) {
return firevortex_getPreferencesService().prefHasUserValue(preference);
}
return false;
}
@@ -0,0 +1,83 @@
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var obsSvc = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
var FireVortexWelcomeOverlay = {
init: function() {
try {
// Firefox 4 and later; Mozilla 2 and later
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID("{50ba92ba-8f28-11dc-8314-0800200c9a66}", function(addon) {
FireVortexWelcomeOverlay.checkFirstRun( addon.version );
});
} catch (ex) {
// Firefox 3.6 and before; Mozilla 1.9.2 and before
var em = Components.classes["@mozilla.org/extensions/manager;1"].getService(Components.interfaces.nsIExtensionManager);
var addon = em.getItemForID("{50ba92ba-8f28-11dc-8314-0800200c9a66}");
FireVortexWelcomeOverlay.checkFirstRun( addon.version );
}
},
checkFirstRun: function(currentVer) {
var ver = "-1", firstrun = true;
try {
//get our pref
firstrun = pref.getBoolPref("firevortex.app.firstrun");
ver = pref.getCharPref("firevortex.app.version");
} catch(e) {
//nothing
} finally {
if (firstrun) {
pref.setBoolPref("firevortex.app.firstrun",false);
pref.setCharPref("firevortex.app.version",currentVer);
//FireVortexWelcomeOverlay.PrepareToLaunchWelcome(true,currentVer);
FireVortexWelcomeOverlay.tryLaunchWelcome(true,currentVer);
}
if (ver!=currentVer && !firstrun){ // !firstrun ensures that this section does not get loaded if its a first run.
pref.setCharPref("firevortex.app.version",currentVer);
//FireVortexWelcomeOverlay.PrepareToLaunchWelcome(false,currentVer);
FireVortexWelcomeOverlay.tryLaunchWelcome(false,currentVer);
}
}
window.removeEventListener("load",function(){ FireVortexWelcomeOverlay.init(); },true);
},
PrepareToLaunchWelcome: function (first,currentVer) {
sessionRestoreObserve = {
observe: function(subject, topic, data) {
FireVortexWelcomeOverlay.tryLaunchWelcome(first,currentVer);
}
};
obsSvc.addObserver( sessionRestoreObserve, "sessionstore-windows-restored" , false);
},
tryLaunchWelcome: function (first,currentVer) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var mainWindow = wm.getMostRecentWindow("navigator:browser");
var content = mainWindow.getBrowser();
if (first) {
window.setTimeout(function() { content.selectedTab = content.addTab("http://firevortex.net/welcome/"+currentVer+"/"); }, 1500); //Firefox 2 fix - or else tab will get closed
} else {
window.setTimeout(function() { content.selectedTab = content.addTab("http://firevortex.net/welcome/upgrade/"+currentVer+"/"); }, 1500); //Firefox 2 fix - or else tab will get closed
}
},
};
window.addEventListener("load",function(){ FireVortexWelcomeOverlay.init(); },true);
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<overlay id="firevortexoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type='application/x-javascript' src='chrome://firevortex/content/xmlhttprequester.js'></script>
<script type='application/x-javascript' src='chrome://firevortex/content/prefman.js'></script>
<script type='application/x-javascript' src='chrome://firevortex/content/script-compiler.js'></script>
<script type='application/x-javascript' src='chrome://firevortex/content/firevortexfirstrun.js'></script>
</overlay>
@@ -0,0 +1,92 @@
function firevortex_PrefManager() {
var startPoint="firevortex.";
var pref=Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefService).
getBranch(startPoint);
var observers={};
// whether a preference exists
this.exists=function(prefName) {
return pref.getPrefType(prefName) != 0;
}
// returns the named preference, or defaultValue if it does not exist
this.getValue=function(prefName, defaultValue) {
var prefType=pref.getPrefType(prefName);
// underlying preferences object throws an exception if pref doesn't exist
if (prefType==pref.PREF_INVALID) {
return defaultValue;
}
switch (prefType) {
case pref.PREF_STRING: return pref.getCharPref(prefName);
case pref.PREF_BOOL: return pref.getBoolPref(prefName);
case pref.PREF_INT: return pref.getIntPref(prefName);
}
}
// sets the named preference to the specified value. values must be strings,
// booleans, or integers.
this.setValue=function(prefName, value) {
var prefType=typeof(value);
switch (prefType) {
case "string":
case "boolean":
break;
case "number":
if (value % 1 != 0) {
throw new Error("Cannot set preference to non integral number");
}
break;
default:
throw new Error("Cannot set preference with datatype: " + prefType);
}
// underlying preferences object throws an exception if new pref has a
// different type than old one. i think we should not do this, so delete
// old pref first if this is the case.
if (this.exists(prefName) && prefType != typeof(this.getValue(prefName))) {
this.remove(prefName);
}
// set new value using correct method
switch (prefType) {
case "string": pref.setCharPref(prefName, value); break;
case "boolean": pref.setBoolPref(prefName, value); break;
case "number": pref.setIntPref(prefName, Math.floor(value)); break;
}
}
// deletes the named preference or subtree
this.remove=function(prefName) {
pref.deleteBranch(prefName);
}
// call a function whenever the named preference subtree changes
this.watch=function(prefName, watcher) {
// construct an observer
var observer={
observe:function(subject, topic, prefName) {
watcher(prefName);
}
};
// store the observer in case we need to remove it later
observers[watcher]=observer;
pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal).
addObserver(prefName, observer, false);
}
// stop watching
this.unwatch=function(prefName, watcher) {
if (observers[watcher]) {
pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal)
.removeObserver(prefName, observers[watcher]);
}
}
}
Oops, something went wrong.

0 comments on commit 9f77c6a

Please sign in to comment.