• R/O
  • SSH
  • HTTPS

slashdotext: Commit


Commit MetaInfo

Revision43 (tree)
Time2009-01-20 21:52:43
Authorhylom

Log Message

Add Journal Dlg.

Change Summary

Incremental Difference

--- trunk/slashext/chrome/content/slashext/seJournalDlg.js (nonexistent)
+++ trunk/slashext/chrome/content/slashext/seJournalDlg.js (revision 43)
@@ -0,0 +1,783 @@
1+/*
2+Copyright (c) 2008, hylom.
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6+
7+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+ * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+*/
13+
14+var seSubmitDlg = {
15+
16+ reskey: "",
17+ workFile: null,
18+ prefBranch: null,
19+ lastUpdate: 0,
20+ lastSize: 0,
21+ intervalId: null,
22+ createTempFile: function() {
23+
24+ /*
25+ // create work dir if not exists.
26+ var file = Components.classes["@mozilla.org/file/directory_service;1"]
27+ .getService(Components.interfaces.nsIProperties)
28+ .get("ProfD", Components.interfaces.nsILocalFile);
29+ file.append("slashext");
30+ if( !file.exists() || !file.isDirectory() ) { // if it doesn't exist, create
31+ file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777);
32+ }
33+ */
34+ var strTempDirPath = this.prefBranch.getCharPref("temporary_directory");
35+ var file = Components.classes["@mozilla.org/file/local;1"]
36+ .createInstance(Components.interfaces.nsILocalFile);
37+ file.initWithPath(strTempDirPath);
38+
39+ file.append("slashext_tmp.txt");
40+ file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0666);
41+ // do whatever you need to the created file
42+
43+ this.workFile = file;
44+ },
45+ openFileWithExternalEditor: function() {
46+
47+ this.createTempFile();
48+ if( ! this.workFile ) {
49+ alert("cannot open temporary file!" );
50+ return;
51+ }
52+
53+ var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports
54+
55+ var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
56+ .createInstance(Components.interfaces.nsIFileOutputStream);
57+ foStream.init( this.workFile, 0x02 | 0x08 | 0x20, 0666, 0);
58+
59+
60+ // See https://developer.mozilla.org/en/Writing_textual_data
61+ var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
62+ .createInstance(Components.interfaces.nsIConverterOutputStream);
63+
64+ // This assumes that fos is the nsIOutputStream you want to write to
65+ os.init(foStream, charset, 0, 0x0000);
66+
67+ var body = document.getElementById('tb_body').value;
68+ os.writeString( body );
69+ os.close();
70+ foStream.close();
71+
72+ this.lastUpdate = this.workFile.lastModifiedTime;
73+ this.lastSize = this.workFile.fileSize;
74+
75+ var useSysDefaultEditor = this.prefBranch.getBoolPref("use_system_default_editor");
76+
77+ if( useSysDefaultEditor ) {
78+ // launch text file with system default text editor.
79+ this.workFile.launch();
80+ } else {
81+ }
82+
83+
84+ this.startUpdateText();
85+ document.getElementById('lb_status').value =
86+ "editing file: " + this.workFile.path;
87+
88+ /*
89+ var strEditor = this.prefBranch.getCharPref("external_editor");
90+ var strOptions = this.prefBranch.getCharPref("external_editor_option");
91+
92+ var regex = new RegExp( '%s', "g" );
93+ if( regex.exec( strOptions ) ) {
94+ strOptions.replace( regex, strWorkFile );
95+ } else {
96+ strOptions = strOptions + " " + strWorkFile;
97+ }
98+
99+ // see nsILocalFile
100+ var efEditor = Components.classes["@mozilla.org/file/directory_service;1"]
101+ .createInstance(Components.interfaces.nsILocalFile);
102+ efEditor.initWithPath( strEditor );
103+
104+ // TODO:err check!
105+ if (efEditor === null) {
106+ return;
107+ }
108+ if (!efEditor.exists()) {
109+ return;
110+ }
111+
112+ // オプションをパースして配列にする
113+
114+ // see nsIProcess
115+ var proc = Components.classes["@mozilla.org/process/util;1"]
116+ .createInstance(Components.interfaces.nsIProcess);
117+ proc.init(efEditor);
118+ var pid = process.run(false, strOptions, args.length);
119+
120+ */
121+ },
122+ startUpdateText: function() {
123+ if( this.intervalId =! 0 ) {
124+ this.stopUpdateText();
125+ }
126+ this.intervalId = window.setInterval( this.pollingTempFile, 3000, this );
127+ },
128+ stopUpdateText: function() {
129+ window.clearInterval( this.intervalId );
130+ },
131+ pollingTempFile: function( dlgObj ) {
132+
133+ if( !(dlgObj.workFile) ||
134+ !(dlgObj.workFile.exists()) ||
135+ !(dlgObj.workFile.isReadable() ) ) {
136+ return;
137+ }
138+
139+ var modTime = dlgObj.workFile.lastModifiedTime;
140+ var size = dlgObj.workFile.fileSize;
141+
142+ if( (modTime != dlgObj.lastUpdate) || (size != dlgObj.lastSize ) ) {
143+
144+ dlgObj.lastUpdate = modTime;
145+ dlgObj.lastSize = size;
146+ // See https://developer.mozilla.org/en/Reading_textual_data
147+ var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"]
148+ .createInstance(Components.interfaces.nsIFileInputStream);
149+
150+ fstream.init(dlgObj.workFile, -1, 0, 0);
151+
152+ var charset = "UTF-8";
153+ const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
154+ var is = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
155+ .createInstance(Components.interfaces.nsIConverterInputStream);
156+ is.init(fstream, charset, 1024, replacementChar);
157+
158+ var str = {};
159+ var readString = "";
160+ var numChars = is.readString(4096, str);
161+ while (numChars != 0 /* EOF */) {
162+ readString += str.value;
163+ numChars = is.readString(4096, str);
164+ }
165+ is.close();
166+ fstream.close();
167+
168+ document.getElementById('tb_body').value = readString;
169+
170+ var lastmod = new Date( modTime );
171+
172+ var hour = (lastmod.getHours() < 10 ) ? "0" + lastmod.getHours() : lastmod.getHours();
173+ var min = (lastmod.getMinutes() < 10 ) ? "0" + lastmod.getMinutes() : lastmod.getMinutes();
174+ var sec = (lastmod.getSeconds() < 10 ) ? "0" + lastmod.getSeconds() : lastmod.getSeconds();
175+ var strLastMod = "(last update: " + hour + ":" + min + ":" + sec + " )";
176+
177+ document.getElementById('lb_status').value =
178+ "editing file: " + dlgObj.workFile.path
179+ + strLastMod;
180+ }
181+ },
182+ open: function( url, title, selection ) {
183+ window.openDialog( "chrome://slashext/content/slashext/seSubmitDlg.xul",
184+ "Submit to Slashdot Japan",
185+ "chrome,dialog,centerscreen,resizable=yes",
186+ url, title, selection
187+ );
188+ },
189+
190+ submit: function() {
191+ // Submit to /.'s submit page.
192+
193+ var url = document.getElementById('tb_url').value;
194+ var title = document.getElementById('tb_title').value;
195+ var body = document.getElementById('tb_body').value;
196+ var mediiatype = document.getElementById('ml_mediiatype').value;
197+ var primaryskid = document.getElementById('ml_primaryskid').value;
198+ var tid = document.getElementById('ml_tid').value;
199+ var sub_type = document.getElementById('ml_sub_type').value;
200+ var name = document.getElementById('tb_name').value;
201+ var email = document.getElementById('tb_email').value;
202+
203+ document.getElementById("reskey").value = this.reskey;
204+ document.getElementById("name").value = name;
205+ document.getElementById("email").value = email;
206+ document.getElementById("url").value = url;
207+ document.getElementById("mediiatype").value = mediiatype;
208+ document.getElementById("subj").value = title;
209+ document.getElementById("primaryskid").value = primaryskid;
210+ document.getElementById("tid").value = tid;
211+ document.getElementById("story").value = body;
212+ document.getElementById("sub_type").value = sub_type;
213+
214+ var targetSite = document.getElementById('ml_target').value;
215+
216+ var parentWnd = window.opener;
217+ if( ! parentWnd ) {
218+ parentWnd = window;
219+ }
220+
221+ // open new window
222+ //parentWnd.open("", "submition_window");
223+
224+ var form = document.getElementById("submit_form");
225+ var orgTarget = form.target;
226+
227+ if( targetSite == "jp" ) {
228+ form.action = "http://slashdot.jp/submit.pl";
229+ } else if ( targetSite == "org" ) {
230+ form.action = "http://slashdot.org/submit.pl";
231+ }
232+
233+ //form.target = "submition_window";
234+ form.target = "_blank";
235+ form.submit();
236+
237+ form.target = orgTarget;
238+ },
239+
240+ cancel: function() {
241+ // TODO: 閉じるか確認する
242+ // alert("cancel!");
243+ this.stopUpdateText();
244+ window.close();
245+ },
246+
247+ bodyText: function(strText, strUrl, strTitle) {
248+
249+ return strText;
250+ /*
251+ return "<blockquote>\n" + strText + "</blockquote>\n" +
252+ '(<a href="' + strUrl + '">' + strTitle + "</a>)\n";
253+ */
254+ },
255+
256+ setSectionAndTopic: function() {
257+ var target = document.getElementById('ml_target').value;
258+
259+ var ml_section = document.getElementById('ml_primaryskid');
260+ var ml_topic = document.getElementById('ml_tid');
261+ var index = 0;
262+
263+ if( target == "jp" ) {
264+ ml_section.removeAllItems();
265+ for (var i in this.sectionIdJp) {
266+ ml_section.insertItemAt( index, i, this.sectionIdJp[i]);
267+ index++;
268+ }
269+ index = 0;
270+
271+ ml_topic.removeAllItems();
272+ for (var i in this.topicIdJp) {
273+ ml_topic.insertItemAt( index, i, this.topicIdJp[i]);
274+ index++;
275+ }
276+ ml_section.value = "1";
277+ ml_topic.value = "0";
278+
279+ } else { // target == org
280+ ml_section.removeAllItems();
281+ for (var i in this.sectionIdOrg) {
282+ ml_section.insertItemAt( index, i, this.sectionIdOrg[i]);
283+ index++;
284+ }
285+
286+ index = 0;
287+ ml_topic.removeAllItems();
288+ for (var i in this.topicIdOrg) {
289+ ml_topic.insertItemAt( index, i, this.topicIdOrg[i]);
290+ index++;
291+ }
292+ ml_section.value = "0";
293+ ml_topic.value = "0";
294+ }
295+ },
296+
297+ onLoad: function() {
298+
299+ var url = window.arguments[0];
300+ var title = window.arguments[1];
301+ var selection = window.arguments[2];
302+ //alert( url + " : " + title + " : " + selection );
303+
304+ document.getElementById("btn_Submit").disabled = true;
305+
306+ document.getElementById('tb_url').value = url;
307+ document.getElementById('tb_title').value = title;
308+ document.getElementById('tb_body').value =
309+ this.bodyText(selection, url, title);
310+
311+ var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
312+ .getService(Components.interfaces.nsIPrefService);
313+
314+ this.prefBranch = prefSvc.getBranch("extensions.slashext.");
315+ var strTarget = this.prefBranch.getCharPref("target");
316+
317+ if( (strTarget == null) || (strTarget == "" ) ) {
318+ var genPref = prefSvc.getBranch("general.useragent.");
319+ var curLocale = genPref.getCharPref("locale");
320+
321+ var re = /^ja/;
322+ if( re.exec(curLocale) ) {
323+ strTarget = "jp"
324+ } else {
325+ strTarget = "org"
326+ }
327+ }
328+ document.getElementById('ml_target').value = strTarget;
329+
330+ document.getElementById('lb_status').value = "retriving reskey...";
331+ this.setSectionAndTopic();
332+ this.requestSubmitId();
333+
334+ if( this.prefBranch.getBoolPref("edit_with_external") ) {
335+ this.openFileWithExternalEditor();
336+ }
337+ },
338+
339+ selectTarget: function() {
340+ document.getElementById("btn_Submit").disabled = true;
341+ document.getElementById('lb_status').value = "retriving reskey...";
342+ this.setSectionAndTopic();
343+ this.requestSubmitId();
344+ },
345+
346+ parseHtml: function(htmlDoc) {
347+
348+ /*
349+ parse target:
350+ <input type="hidden" id="reskey" name="reskey" value="QpsOCAOWSisLwpQgqoQI">
351+ <input type="text" name="name" value="hylom" size="50" maxlength="50">
352+ <input type="text" name="email" value="http://slashdot.jp/~hylom/" size="50" maxlength="50">
353+ */
354+
355+ // extract /.'s submittion resource ID.
356+ var regex = new RegExp( 'id="reskey".*value="(.*?)"', "m" );
357+ var match = regex.exec( htmlDoc );
358+ var resId = match[1];
359+
360+ // extract handle name.
361+ regex = new RegExp( 'name="name".*value="(.*?)"', "m" );
362+ match = regex.exec( htmlDoc );
363+ var yourName = match[1];
364+
365+ // extract homepage url
366+ regex = new RegExp( 'name="email".*value="(.*?)"', "m" );
367+ match = regex.exec( htmlDoc );
368+ var yourUrl = match[1];
369+
370+ //document.getElementById('tb_resID').value = resId;
371+ document.getElementById('tb_name').value = yourName;
372+ document.getElementById('tb_email').value = yourUrl;
373+
374+ this.reskey = resId;
375+ //document.getElementById('lb_status').value = "resID:" + resId;
376+ document.getElementById('lb_status').value = "done.";
377+ document.getElementById("btn_Submit").disabled = false;
378+ },
379+
380+ retriveCookie: function( targetSite ) {
381+
382+ // Read Cookies
383+ // Firefox 3.0 or later, can't use below method.
384+ /*
385+ var ios = Components.classes["@mozilla.org/network/io-service;1"]
386+ .getService(Components.interfaces.nsIIOService);
387+ var uri = ios.newURI( targetSite, null, null);
388+
389+ var cookieSvc =
390+ Components.classes["@mozilla.org/cookieService;1"]
391+ .getService(Components.interfaces.nsICookieService);
392+
393+ var cookie = cookieSvc.getCookieString(uri, null);
394+ */
395+
396+ var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"]
397+ .getService(Components.interfaces.nsICookieManager);
398+
399+ var targetCookie;
400+ var strTargetSite = "slashdot.org";
401+ if( targetSite == "jp" ) {
402+ strTargetSite = "slashdot.jp";
403+ } else if( targetSite = "org" ) {
404+ strTargetSite = "slashdot.org";
405+ }
406+
407+ for (var e = cookieMgr.enumerator; e.hasMoreElements();) {
408+ var cookie = e.getNext().QueryInterface(Components.interfaces.nsICookie);
409+ if( (cookie.name == "user") && (cookie.host == strTargetSite) ) {
410+ var strVal = cookie.value;
411+ return "user=" + encodeURI(strVal);
412+ }
413+ }
414+
415+ return;
416+ },
417+
418+ requestSubmitId: function() {
419+ // get ResourceID for submittion.
420+ // TODO: need timeout proc.
421+ var targetSite = document.getElementById('ml_target').value;
422+
423+ var url;
424+ if( targetSite == "jp" ) {
425+ url = "http://slashdot.jp/submit.pl";
426+ } else if( targetSite == "org" ) {
427+ url = "http://slashdot.org/submit.pl";
428+ }
429+
430+ // Submittion URL
431+ var self = this;
432+
433+ var cookie = this.retriveCookie( targetSite );
434+
435+ var req = new XMLHttpRequest();
436+ req.open("GET",url);
437+ req.onreadystatechange=function() {
438+ if( req.readyState == 4 ) {
439+ self.parseHtml(req.responseText);
440+ }
441+ }
442+
443+ if( cookie ) {
444+ req.setRequestHeader( "Cookie", cookie );
445+ }
446+
447+ req.send(null);
448+ },
449+ sectionIdJp: {
450+ "/.":12,
451+ "IT": 13,
452+ "Linux": 7,
453+ "Slashdotに聞け": 2,
454+ "YRO": 15,
455+ "アップル": 8,
456+ "インタビュー": 6,
457+ "オープンソース": 16,
458+ "サイエンス": 10,
459+ "セキュリティ": 11,
460+ "デベロッパー": 5,
461+ "トップページ": 1,
462+ "ハードウェア": 14,
463+ "モバイル": 9,
464+ "レビュー": 3
465+ },
466+ topicIdJp: {
467+ "AMD": 18,
468+ "Amiga": 60,
469+ "apache": 10,
470+ "Be": 13,
471+ "BSD": 15,
472+ "Caldera": 17,
473+ "Comdex": 21,
474+ "Compaq": 22,
475+ "Debian": 24,
476+ "Digital": 25,
477+ "enlightenment": 88,
478+ "GNOME": 32,
479+ "GNU is Not Unix": 34,
480+ "Google": 112,
481+ "GUI": 100,
482+ "HP": 94,
483+ "IBM": 39,
484+ "Intel": 40,
485+ "IT": 138,
486+ "Java": 43,
487+ "JAXA": 143,
488+ "KDE": 44,
489+ "Linux": 2,
490+ "Linux Mandrake": 47,
491+ "Linux ビジネス": 46,
492+ "Linuxcare": 48,
493+ "MacOS Classic": 155,
494+ "MacOSX": 154,
495+ "Mozilla": 51,
496+ "Namazu": 87,
497+ "NASA": 136,
498+ "Novell": 115,
499+ "NTT": 29,
500+ "Oracle": 150,
501+ "OS": 106,
502+ "Perl": 55,
503+ "PHP": 56,
504+ "Python": 93,
505+ "Quake": 59,
506+ "Ruby": 86,
507+ "Select Topic": 0,
508+ "SGI": 63,
509+ "SNS": 151,
510+ "Sony": 134,
511+ "spam": 66,
512+ "SuSE": 69,
513+ "The Gimp": 33,
514+ "Transmeta": 77,
515+ "TRON": 98,
516+ "UNIX": 80,
517+ "VA Linux Systems": 82,
518+ "Windows": 110,
519+ "Wine": 83,
520+ "X": 84,
521+ "Ximian": 85,
522+ "Yahoo!": 133,
523+ "おもちゃ": 76,
524+ "お金": 72,
525+ "アップグレード": 81,
526+ "アップル": 11,
527+ "アナウンス": 12,
528+ "アニメ・マンガ": 9,
529+ "アメリカオンライン": 7,
530+ "アメリカ合衆国": 79,
531+ "インタビュー": 26,
532+ "インターネット": 74,
533+ "インターネットエクスプローラ": 41,
534+ "オープンソース": 142,
535+ "ガンダム": 96,
536+ "クリスマス": 20,
537+ "グラフィック": 36,
538+ "ゲーム": 31,
539+ "コーレル": 23,
540+ "サイエンス": 62,
541+ "サン・マイクロシステムズ": 68,
542+ "スターウオーズ": 67,
543+ "スタートレック": 111,
544+ "ストレージ": 107,
545+ "スパコン": 131,
546+ "スポーツ": 95,
547+ "スラッシュコード": 4,
548+ "スラッシュドット": 3,
549+ "スラッシュバック": 64,
550+ "セキュリティ": 92,
551+ "ソフトウェア": 104,
552+ "ターボリナックス": 78,
553+ "テクノロジー": 70,
554+ "テレビ": 71,
555+ "データベース": 113,
556+ "ニュース": 145,
557+ "ネットスケープ": 53,
558+ "ネットワーク": 129,
559+ "ノートPC": 109,
560+ "ハンドヘルド": 37,
561+ "ハードウェア": 38,
562+ "ハードウェアハック": 114,
563+ "バイオテック": 99,
564+ "バグ": 16,
565+ "パテント": 54,
566+ "ビジネス": 105,
567+ "プライバシ": 57,
568+ "プリンター": 101,
569+ "プログラミング": 58,
570+ "マイクロソフト": 49,
571+ "メディア": 75,
572+ "モニター": 103,
573+ "モバイル": 125,
574+ "リンク": 45,
575+ "レッドハット": 61,
576+ "ロボット": 90,
577+ "ワーム": 117,
578+ "交通": 141,
579+ "任天堂": 135,
580+ "入力デバイス": 127,
581+ "医療": 149,
582+ "地球": 147,
583+ "変なモノ": 42,
584+ "娯楽": 108,
585+ "宇宙": 65,
586+ "情報漏洩": 132,
587+ "携帯通信": 97,
588+ "携帯電話": 146,
589+ "政府": 148,
590+ "政治": 116,
591+ "教育": 27,
592+ "数学": 128,
593+ "日本": 89,
594+ "日記": 91,
595+ "映画": 50,
596+ "暗号": 28,
597+ "書籍": 102,
598+ "月": 140,
599+ "検閲": 19,
600+ "法廷": 73,
601+ "火星": 139,
602+ "著作権": 144,
603+ "軍事": 152,
604+ "通信": 137,
605+ "電力": 130,
606+ "音楽": 52
607+ },
608+ sectionIdOrg: {
609+ "Apache":2,
610+ "Apple":3,
611+ "Ask Slashdot":4,
612+ "Backslash":24,
613+ "Book Reviews":6,
614+ "BSD":7,
615+ "Developers":8,
616+ "Entertainment":32,
617+ "Features":9,
618+ "Games":10,
619+ "Hardware":21,
620+ "Idle":28,
621+ "Index":1,
622+ "Interviews":11,
623+ "IT":18,
624+ "Linux":19,
625+ "Meta":27,
626+ "Mobile":29,
627+ "News":31,
628+ "Politics":20,
629+ "Polls":12,
630+ "Science":14,
631+ "Select Section":0,
632+ "Technology":30,
633+ "Your Rights Online":17
634+ },
635+ topicIdOrg: {
636+ "AMD":142,
637+ "America Online":120,
638+ "Amiga":138,
639+ "Anime":168,
640+ "Announcements":162,
641+ "Be":87,
642+ "Biotech":191,
643+ "Books":192,
644+ "Bug":128,
645+ "Businesses":187,
646+ "Caldera":88,
647+ "CDA":116,
648+ "Cellphones":269,
649+ "Censorship":153,
650+ "Christmas Cheer":105,
651+ "Classic Games (Games)":202,
652+ "Comdex":89,
653+ "Communications":215,
654+ "Compaq":140,
655+ "Corel":132,
656+ "Data Storage":198,
657+ "Databases":221,
658+ "Debian":90,
659+ "Democrats":225,
660+ "Desktops (Apple)":174,
661+ "Digital":91,
662+ "Displays":196,
663+ "E3":235,
664+ "Earth":271,
665+ "Editorial":166,
666+ "Education":146,
667+ "Emulation (Games)":203,
668+ "Encryption":93,
669+ "Enlightenment":115,
670+ "ePlus":119,
671+ "First Person Shooters (Games)":204,
672+ "GameCube (Games)":213,
673+ "GNOME":131,
674+ "GNU is Not Unix":117,
675+ "GNUStep":94,
676+ "Google":217,
677+ "Government":266,
678+ "Graphics":152,
679+ "GUI":189,
680+ "Handhelds":100,
681+ "Hardware Hacking":222,
682+ "HP":173,
683+ "IBM":136,
684+ "Idle email":273,
685+ "iMac":175,
686+ "Input Devices":227,
687+ "Intel":118,
688+ "Internet Explorer":113,
689+ "It's funny. Laugh.":133,
690+ "Java":108,
691+ "KDE":121,
692+ "Links":96,
693+ "Linux Business":163,
694+ "Linuxcare":151,
695+ "Lord of the Rings":199,
696+ "Mandriva":147,
697+ "Mars":226,
698+ "Math":228,
699+ "Media":188,
700+ "Media (Apple)":176,
701+ "Medicine":272,
702+ "Microsoft":109,
703+ "Moon":229,
704+ "Movies":97,
705+ "Mozilla":154,
706+ "Music":141,
707+ "NASA":236,
708+ "NES (Games)":205,
709+ "Netscape":114,
710+ "Networking":230,
711+ "Networking (Apple)":177,
712+ "Nintendo":234,
713+ "Novell":223,
714+ "Operating Systems":190,
715+ "Oracle":249,
716+ "OS 9":178,
717+ "OS X":179,
718+ "Patents":155,
719+ "PC Games (Games)":206,
720+ "Perl":145,
721+ "PHP":169,
722+ "PlayStation (Games)":212,
723+ "Portables":184,
724+ "Portables (Apple)":180,
725+ "Portables (Games)":207,
726+ "Power":232,
727+ "Printers":194,
728+ "Privacy":158,
729+ "Programming":156,
730+ "Puzzle Games (Games)":208,
731+ "Quake":112,
732+ "Quickies":144,
733+ "Real Time Strategy (Games)":210,
734+ "Red Hat Software":110,
735+ "Republicans":224,
736+ "Robotics":216,
737+ "Role Playing (Games)":209,
738+ "Sci-Fi":214,
739+ "Security":172,
740+ "Select Topic":0,
741+ "Silicon Graphics":139,
742+ "Slashback":167,
743+ "Social Networks":267,
744+ "Software":185,
745+ "Sony":233,
746+ "Space":160,
747+ "Spam":111,
748+ "Star Wars Prequels":101,
749+ "Sun Microsystems":102,
750+ "Supercomputing":231,
751+ "SuSE":143,
752+ "Technology (Apple)":181,
753+ "Television":129,
754+ "The Almighty Buck":98,
755+ "The Courts":123,
756+ "The Gimp":92,
757+ "The Internet":95,
758+ "The Matrix":200,
759+ "The Media":149,
760+ "The Military":265,
761+ "Toys":159,
762+ "Transmeta":161,
763+ "Transportation":270,
764+ "TurboLinux":165,
765+ "United States":103,
766+ "Unix":130,
767+ "Upgrades":164,
768+ "User Journal":171,
769+ "Utilities (Apple)":182,
770+ "VA":150,
771+ "Wii (Games)":250,
772+ "Windows":201,
773+ "Wine":125,
774+ "Wireless (Apple)":183,
775+ "Wireless Networking":193,
776+ "Worms":220,
777+ "X":104,
778+ "XBox (Games)":211,
779+ "Ximian":170,
780+ "Yahoo!":237
781+ }
782+}
783+
--- trunk/slashext/chrome/content/slashext/slashextOverlay.js (revision 42)
+++ trunk/slashext/chrome/content/slashext/slashextOverlay.js (revision 43)
@@ -94,7 +94,21 @@
9494 event.stopPropagation();
9595 }
9696 },
97+ showJournalDialog : function(event){
98+ var string;
99+ var webNav = window.getBrowser().webNavigation;
97100
101+ var url = webNav.currentURI.spec;
102+ var title = webNav.document.title;
103+ var selectedText = this.getSelectedText();
104+
105+ seJournalDlg.open( url, title, selectedText );
106+
107+ if( event ) {
108+ event.stopPropagation();
109+ }
110+ },
111+
98112 searchKeyPress : function(event) {
99113 if( (event.keyCode == 13) || // DOM_VK_RETURN
100114 (event.keyCode == 14 ) ) { //DOM_VK_ENTER
Show on old repository browser