Permalink
Browse files

Got graphics and firstrun page working.

  • Loading branch information...
1 parent 5c2b971 commit 03292dcc9c5917443bb886c38044d2d00e495307 @mikeal committed Feb 18, 2009
Binary file not shown.
@@ -5,6 +5,7 @@
<script type="text/javascript" src="jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.6rc6.min.js"></script>
<link type="text/css" href="theme/ui.all.css" rel="Stylesheet" />
+ <link rel="shortcut icon" href="chrome://pushmarks/content/favicon.ico" type="image/x-icon" />
<style type="text/css">
body{ font: 10px Verdana, sans-serif;}
/*demo page css*/
@@ -114,31 +115,13 @@
</table>
</div>
</div>
- <div>
- <h3><a href="#">Ma.gnolia</a></h3>
- <div>
- <span style="float:right;font-weight:bold;"><input type="checkbox" name="magnoliaEnabled" disabled="true"> enabled</span>
- <table>
- <tr><td>Username: </td><td><input type="text" name="magnoliaUsername" disabled="true"/></td></tr>
- <tr><td>Password: </td><td><input type="password" name="magnoliaPassword" disabled="true"/></td></tr>
- <tr><td>&nbsp;</td><tr>
- <tr>
- <td>&nbsp;</td>
- <td>
- <button onclick='javascript:return;' class="ui-state-default ui-corner-all">Save</button>
- <button onclick='javascript:return;' class="ui-state-default ui-corner-all">Sync</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
</div>
</div>
<div id="tabs-2">
- All kinds of cool information and help about pushmarks lives here.
- contact me: mikeal dot rogers at gmail dot com
+ <p>Written by <a href="mailto:mikeal.rogers@gmail.com">mikeal.rogers@gmail.com</a></p>
+ <p>Code can be viewed at <a href="http://github.com/mikeal/pushmarks/tree/master">http://github.com/mikeal/pushmarks/tree/master</a></p>
</div>
</div>
@@ -34,3 +34,51 @@
// the terms of any one of the MPL, the GPL or the LGPL.
var init = {}; Components.utils.import('resource://pushmarks/modules/init.js', init);
+
+
+var Prefs = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefService);
+Prefs = Prefs.getBranch("extensions.my_extension_name.");
+
+var Overlay = {
+ init: function(){
+ var ver = -1, firstrun = true;
+
+ var gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"]
+ .getService(Components.interfaces.nsIExtensionManager);
+ var current = gExtensionManager.getItemForID("pushmarks@mozilla.com").version;
+
+ try{
+ ver = Prefs.getCharPref("version");
+ firstrun = Prefs.getBoolPref("firstrun");
+ }catch(e){
+ //nothing
+ }finally{
+ if (firstrun){
+ Prefs.setBoolPref("firstrun",false);
+ Prefs.setCharPref("version",current);
+
+ // Insert code for first run here
+
+ // The example below loads a page by opening a new tab.
+ // Useful for loading a mini tutorial
+ window.setTimeout(function(){
+ gBrowser.selectedTab = gBrowser.addTab("about:pushmarks");
+ }, 1500); //Firefox 2 fix - or else tab will get closed
+
+ }
+
+ if (ver!=current && !firstrun){ // !firstrun ensures that this section does not get loaded if its a first run.
+ Prefs.setCharPref("version",current);
+
+ // Insert code if version is different here => upgrade
+ }
+ }
+ window.removeEventListener("load",function(){ Overlay.init(); },true);
+ }
+};
+
+
+window.addEventListener("load",function(){ Overlay.init(); },true);
+
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -4,17 +4,18 @@
<Description about="urn:mozilla:install-manifest">
<em:id>pushmarks@mozilla.com</em:id>
<em:name>PushMarks</em:name>
- <em:version>0.1</em:version>
+ <em:version>0.2</em:version>
<em:creator>Mikeal Rogers</em:creator>
<em:description>Firefox extension that pushes bookmarks to public bookmark sharing sites.</em:description>
<em:targetApplication>
<!-- Firefox -->
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>1.5</em:minVersion>
- <em:maxVersion>3.2a1pre</em:maxVersion>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>3.0.*</em:maxVersion>
</Description>
</em:targetApplication>
+ <em:iconURL>chrome://pushmarks/content/pushmarks.png</em:iconURL>
<em:optionsURL>chrome://pushmarks/content/preferences.xul</em:optionsURL>
</Description>
</RDF>
@@ -56,10 +56,8 @@ var historyService = Components.classes["@mozilla.org/browser/nav-history-servic
var uuidgen = Components.classes["@mozilla.org/uuid-generator;1"]
.getService(Components.interfaces.nsIUUIDGenerator);
-if (!JSON) {
- Components.utils.import("resource://gre/modules/JSON.jsm");
- Components.utils.import("resource://pushmarks/modules/service.js")
-}
+Components.utils.import("resource://gre/modules/JSON.jsm");
+Components.utils.import("resource://pushmarks/modules/service.js")
var withs = {}; Components.utils.import('resource://pushmarks/modules/withs.js', withs);
var arrays = {}; Components.utils.import('resource://pushmarks/modules/arrays.js', arrays);

0 comments on commit 03292dc

Please sign in to comment.