Changeset 694
- Timestamp:
- 09/07/06 20:45:23 (2 years ago)
- Location:
- Trunk/association/browsertools/TiddlySnip/trunk/content
- Files:
-
- 4 added
- 7 modified
-
audio (added)
-
audio/error.wav (added)
-
audio/success.wav (added)
-
browserOverlay.js (modified) (2 diffs)
-
browserOverlay.xul (modified) (2 diffs)
-
categories.js (modified) (2 diffs)
-
notifier.js (added)
-
prefs.js (modified) (2 diffs)
-
prefs.xul (modified) (1 diff)
-
tiddlySnip.js (modified) (1 diff)
-
upload.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Trunk/association/browsertools/TiddlySnip/trunk/content/browserOverlay.js
r645 r694 2 2 var pref = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 3 3 4 var tiddlySnipUploading = false; 4 var tiddlySnipUploading = false; 5 5 6 6 // Open prefs window. … … 50 50 if(tiddlySnipUploading) 51 51 menus[i].setAttribute("disabled",true); 52 else 52 else 53 53 menus[i].setAttribute("disabled",false); 54 54 } -
Trunk/association/browsertools/TiddlySnip/trunk/content/browserOverlay.xul
r645 r694 11 11 <script type="application/x-javascript" src="tiddler.js"/> 12 12 <script type="application/x-javascript" src="upload.js"/> 13 <script type="application/x-javascript" src="notifier.js"/> 13 14 14 15 <popup id="contentAreaContextMenu"> … … 38 39 oncommand="tiddlySnipPrefs();" /> 39 40 </menupopup> 41 42 43 <statusbar id="status-bar"> 44 <hbox> 45 <popupset style="overflow: auto;"> 46 <tooltip id="tiddlysnip-popup" style="max-height: none; max-width: none;" onclick="this.hidePopup();"/> 47 </popupset> 48 </hbox> 49 </statusbar> 40 50 </overlay> -
Trunk/association/browsertools/TiddlySnip/trunk/content/categories.js
r645 r694 35 35 var selectedIndex = categoriesTree.currentIndex; 36 36 37 /* Ignore the button if no schedule selected */38 37 if(selectedIndex == -1) 39 38 return; … … 137 136 } 138 137 139 //add no categories message?140 138 //link to edit categories? 141 var categories = getCategories(); 142 for(var n in categories) 143 { 144 // Create a new menu item to be added 145 var tempItem = document.createElement("menuitem"); 139 if (noCategories()) 140 { 141 var item = document.createElement("menuitem"); 142 item.setAttribute("label","No categories defined"); 143 menu.appendChild(item); 144 } 145 else 146 { 147 var categories = getCategories(); 148 for(var n in categories) 149 { 150 // Create a new menu item to be added 151 var tempItem = document.createElement("menuitem"); 146 152 147 // Set the new menu item's label148 tempItem.setAttribute("label",n);153 // Set the new menu item's label 154 tempItem.setAttribute("label",n); 149 155 150 //Set the function to fire when clicked151 tempItem.setAttribute("oncommand", "tiddlySnip('"+mode+"','"+ categories[n]+"','"+n+"')");156 //Set the function to fire when clicked 157 tempItem.setAttribute("oncommand", "tiddlySnip('"+mode+"','"+ categories[n]+"','"+n+"')"); 152 158 153 // Add the item to our menu 154 menu.appendChild(tempItem); 155 } 159 // Add the item to our menu 160 menu.appendChild(tempItem); 161 } 162 } 163 } 164 165 function noCategories() 166 { 167 var prefString = pref.getCharPref("tiddlysnip.categories"); 168 return (prefString == ''); 156 169 } 157 170 -
Trunk/association/browsertools/TiddlySnip/trunk/content/prefs.js
r645 r694 30 30 prefMap['uploaddir'] = readCharPref("uploaddir"); 31 31 prefMap['uploadbackupdir'] = readCharPref("uploadbackupdir"); 32 prefMap['enablenotifications'] = readBoolPref("enablenotifications"); 33 prefMap['enablenotifsounds'] = readBoolPref("enablenotifsounds"); 32 34 33 35 document.getElementById("show_uploadpass").value = getUploadPassword(); … … 83 85 document.getElementById('show_backuppathbutton').setAttribute("disabled", !document.getElementById('show_togglebackuppath').checked || !document.getElementById('show_enablebackups').checked); 84 86 document.getElementById('show_togglebackuppath').setAttribute("disabled", !document.getElementById('show_enablebackups').checked); 87 document.getElementById('show_enablenotifsounds').setAttribute("disabled", !document.getElementById('show_enablenotifications').checked); 85 88 for (var t=0; t<4; t++) 86 89 { -
Trunk/association/browsertools/TiddlySnip/trunk/content/prefs.xul
r645 r694 67 67 type="checkbox" 68 68 oncommand="changePref('enableclipboard',this.checked);" 69 /> 70 <checkbox id="show_enablenotifications" 71 label="Enable notifications on snippet save" 72 type="checkbox" 73 oncommand="changePref('enablenotifications',this.checked);" 74 /> 75 <checkbox id="show_enablenotifsounds" 76 label="Enable notifications sounds" 77 type="checkbox" 78 class="indent" 79 oncommand="changePref('enablenotifsounds',this.checked);" 69 80 /> 70 81 </vbox> -
Trunk/association/browsertools/TiddlySnip/trunk/content/tiddlySnip.js
r647 r694 186 186 saveFile(fileLoc,newTW); 187 187 // call notifications here 188 notifier("TiddlySnip","Snippet saved: " + title,true); 188 189 showTW(title); 189 190 } -
Trunk/association/browsertools/TiddlySnip/trunk/content/upload.js
r645 r694 45 45 else status = false; 46 46 subject.data = status; 47 },47 }, 48 48 49 49 register: function() … … 54 54 }, 55 55 56 unregister: function()57 {58 var observerService = Components.classes["@mozilla.org/observer-service;1"]56 unregister: function() 57 { 58 var observerService = Components.classes["@mozilla.org/observer-service;1"] 59 59 .getService(Components.interfaces.nsIObserverService); 60 observerService.removeObserver(tiddlySnipUploadObserver, "quit-application-requested");61 }60 observerService.removeObserver(tiddlySnipUploadObserver, "quit-application-requested"); 61 } 62 62 }; 63 63 … … 97 97 if(request.responseText.substr(0,1)==0) 98 98 { 99 alert("Snippet saved!"); 100 //callbackFn(request.responseText); // call notifications function here? 99 notifier("TiddlySnip","Snippet saved: " + title,true); 101 100 showTW(title); 102 101 } 103 102 else 103 { 104 104 alert(request.responseText); 105 errorSound(); 106 } 105 107 } 106 else 107 alert("Upload failed"); 108 else 109 { 110 tiddlySnipUploadObserver.unregister(); 111 alert("Upload failed"); 112 errorSound(); 113 } 108 114 } 109 115 };
