[Bbs2ch-cvs 195] [177]

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 7月 24日 (火) 22:00:46 JST


Revision: 177
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=177
Author:   flyson
Date:     2007-07-24 22:00:46 +0900 (Tue, 24 Jul 2007)

Log Message:
-----------


Added Paths:
-----------
    branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.js
    branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.xul

Added: branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.js
===================================================================
--- branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.js	2007-07-24 12:52:42 UTC (rev 176)
+++ branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.js	2007-07-24 13:00:46 UTC (rev 177)
@@ -0,0 +1,37 @@
+var gMaruPane = {
+
+	startup: function(){
+		setCcontainerDisabled("extensions.bbs2chreader.maru_enabled",
+				"boxMaru", true);
+
+		var os = Components.classes["@mozilla.org/observer-service;1"]
+					.getService(Components.interfaces.nsIObserverService);
+		os.addObserver(this, "b2r-2ch-viewer-auth", false);
+	},
+
+	shutdown: function(){
+		var os = Components.classes["@mozilla.org/observer-service;1"]
+				.getService(Components.interfaces.nsIObserverService);
+		os.removeObserver(this, "b2r-2ch-viewer-auth");
+	},
+
+	maruAuth: function(){
+		document.getElementById("btnAuth").disabled = true;
+
+		var bbs2chService = Components.classes["@mozilla.org/bbs2ch-service;1"]
+					.getService(Components.interfaces.nsIBbs2chService);
+		bbs2chService.maruAuth(true);
+	},
+
+
+  	// ********** ********* implements nsIObserver ********** **********
+
+	observe: function(aSubject, aTopic, aData){
+		if(aTopic == "b2r-2ch-viewer-auth"){
+			if(aData == "OK"){
+				alert("OK");
+			}
+			document.getElementById("btnAuth").disabled = false;
+		}
+	},
+}
\ No newline at end of file

Added: branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.xul
===================================================================
--- branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.xul	2007-07-24 12:52:42 UTC (rev 176)
+++ branches/GP_BRANCH/chrome/content/bbs2chreader/settings/maru.xul	2007-07-24 13:00:46 UTC (rev 177)
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://bbs2chreader/skin/settings.css" type="text/css"?>
+
+<prefwindow id="winMain" title="2ch ビューア [bbs2chreader]" type="child"
+	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+		onload="gMaruPane.startup()" onunload="gMaruPane.shutdown()">
+<prefpane id="paneMaru">
+	<preferences>
+		<preference id="extensions.bbs2chreader.maru_enabled"
+				name="extensions.bbs2chreader.maru_enabled" type="bool"
+				instantApply="true"
+				onchange="setCcontainerDisabled(this.name, 'boxMaru', true)"/>
+		<preference id="extensions.bbs2chreader.maru_auto_auth"
+				name="extensions.bbs2chreader.maru_auto_auth" type="bool"/>
+		<preference id="extensions.bbs2chreader.maru_id"
+				instantApply="true"
+				name="extensions.bbs2chreader.maru_id" type="string"/>
+		<preference id="extensions.bbs2chreader.maru_password"
+				instantApply="true"
+				name="extensions.bbs2chreader.maru_password" type="string"/>
+	</preferences>
+
+	<vbox flex="1">
+		<checkbox label="2ch ビューアを利用する"
+				preference="extensions.bbs2chreader.maru_enabled"/>
+		<vbox id="boxMaru" class="indent">
+			<checkbox label="起動時に自動的に認証を行う"
+				preference="extensions.bbs2chreader.maru_auto_auth"/>
+			<grid>
+				<columns>
+					<column flex="1"/>
+					<column width="200"/>
+				</columns>
+				<rows>
+					<row align="center">
+						<label value="ID :" style="text-align:right;"/>
+						<textbox id="txtMaruID"
+							preference="extensions.bbs2chreader.maru_id"/>
+					</row>
+					<row align="center">
+						<label value="Pass :" style="text-align:right;"/>
+						<textbox id="txtMaruPass" type="password"
+							preference="extensions.bbs2chreader.maru_password"/>
+					</row>
+				</rows>
+			</grid>
+
+			<hbox pack="end">
+				<button id="btnAuth" label="認証" oncommand="gMaruPane.maruAuth()"/>
+			</hbox>
+		</vbox>
+	</vbox>
+	<spacer flex="1"/>
+</prefpane>
+
+<script type="application/x-javascript; version=1.7"
+	src="chrome://bbs2chreader/content/settings/settings.js"/>
+<script type="application/x-javascript; version=1.7"
+	src="chrome://bbs2chreader/content/settings/maru.js"/>
+
+</prefwindow>
\ No newline at end of file




bbs2ch-cvs メーリングリストの案内
Back to archive index