take-action-svn Mailing List for Take Action (Page 2)
Status: Pre-Alpha
Brought to you by:
jorgevillalobos
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
(14) |
Apr
(29) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|---|
|
From: <jor...@us...> - 2009-04-01 04:12:52
|
Revision: 23
http://take-action.svn.sourceforge.net/take-action/?rev=23&view=rev
Author: jorgevillalobos
Date: 2009-04-01 04:12:48 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Fixed a couple of licenses.
Modified Paths:
--------------
trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
trunk/implementation/src/chrome/locale/en-US/taSidebar.properties
Modified: trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-04-01 04:07:44 UTC (rev 22)
+++ trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-04-01 04:12:48 UTC (rev 23)
@@ -1,29 +1,17 @@
###
-# Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+# Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * 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.
-# * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names of
-# its contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# 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.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
###
takeaction.options.title = Take Action Options
Modified: trunk/implementation/src/chrome/locale/en-US/taSidebar.properties
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taSidebar.properties 2009-04-01 04:07:44 UTC (rev 22)
+++ trunk/implementation/src/chrome/locale/en-US/taSidebar.properties 2009-04-01 04:12:48 UTC (rev 23)
@@ -1,29 +1,17 @@
###
-# Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+# Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * 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.
-# * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names of
-# its contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# 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.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
###
takeaction.loading.label = Loading...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-04-01 04:07:48
|
Revision: 22
http://take-action.svn.sourceforge.net/take-action/?rev=22&view=rev
Author: jorgevillalobos
Date: 2009-04-01 04:07:44 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Added 'Loading' and 'No results' states to all result containers.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taSidebar.js
trunk/implementation/src/chrome/content/taSidebar.xul
trunk/implementation/src/chrome/skin/taSidebar.css
Added Paths:
-----------
trunk/implementation/src/chrome/locale/en-US/taSidebar.properties
Modified: trunk/implementation/src/chrome/content/taSidebar.js
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.js 2009-04-01 03:42:42 UTC (rev 21)
+++ trunk/implementation/src/chrome/content/taSidebar.js 2009-04-01 04:07:44 UTC (rev 22)
@@ -34,6 +34,8 @@
/* Logger for this object. */
_logger : null,
+ /* The string bundle for the sidebar. */
+ _bundle: null,
/**
* Initializes the object.
@@ -43,6 +45,8 @@
this._logger.level = Log4Moz.Level["All"];
this._logger.debug("init");
+ this._bundle = document.getElementById("takeaction-string-bundle");
+
this.loadRecentActions();
},
@@ -75,7 +79,11 @@
let that = this;
let searchQuery = new TakeAction.SearchQuery();
+ let container =
+ document.getElementById("takeaction-sidebar-recent-actions");
+ this._showMessage(container, true);
+
TakeAction.API.search(
searchQuery,
function(aSearchResults) {
@@ -106,6 +114,8 @@
let query = document.getElementById("takeaction-search-box").value;
let actionType = document.getElementById("takection-action-type").value;
let created = document.getElementById("takection-created").value;
+ let container =
+ document.getElementById("takeaction-sidebar-search-actions");
let searchQuery = new TakeAction.SearchQuery();
searchQuery.setQuery(query);
@@ -118,6 +128,8 @@
searchQuery.setCreatedDays(created);
}
+ this._showMessage(container, true);
+
TakeAction.API.search(
searchQuery,
function(aSearchResults) { that._searchCallback(aSearchResults); });
@@ -138,6 +150,30 @@
},
/**
+ * Shows a message in the results section
+ * @param aContainer The container element in which results will be loaded.
+ * @param aIsLoading true if the message to show is 'loading', false if the
+ * message to show is 'no results found'.
+ */
+ _showMessage : function(aContainer, aIsLoading) {
+ this._logger.trace("_showLoading");
+
+ let message =
+ this._bundle.getString(
+ (aIsLoading ? "takeaction.loading.label" :
+ "takeaction.noActions.label"));
+ let description = document.createElement("description");
+ let textNode = document.createTextNode(message);
+
+ while (aContainer.firstChild) {
+ aContainer.removeChild(aContainer.firstChild);
+ }
+
+ description.appendChild(textNode);
+ aContainer.appendChild(description);
+ },
+
+ /**
* Loads the given search results in the given container, creating a
* tasearchresultbox binding to display each one.
* @param aSearchResults The API search results to load.
@@ -146,16 +182,21 @@
_loadActions : function(aSearchResults, aContainer) {
this._logger.trace("_loadActions");
- while (aContainer.firstChild) {
- aContainer.removeChild(aContainer.firstChild);
- }
+ if (0 < aSearchResults.length) {
+ let searchResultBox = null;
- let searchResultBox = null;
- for (let i = 0; i < aSearchResults.length; i++) {
- searchResultBox = document.createElement("tasearchresultbox");
- aContainer.appendChild(searchResultBox);
+ while (aContainer.firstChild) {
+ aContainer.removeChild(aContainer.firstChild);
+ }
- searchResultBox.searchResult = aSearchResults[i];
+ for (let i = 0; i < aSearchResults.length; i++) {
+ searchResultBox = document.createElement("tasearchresultbox");
+ aContainer.appendChild(searchResultBox);
+
+ searchResultBox.searchResult = aSearchResults[i];
+ }
+ } else {
+ this._showMessage(aContainer, false);
}
}
};
Modified: trunk/implementation/src/chrome/content/taSidebar.xul
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.xul 2009-04-01 03:42:42 UTC (rev 21)
+++ trunk/implementation/src/chrome/content/taSidebar.xul 2009-04-01 04:07:44 UTC (rev 22)
@@ -30,6 +30,11 @@
<script type="application/x-javascript"
src="chrome://takeaction/content/taSidebar.js" />
+ <stringbundleset>
+ <stringbundle id="takeaction-string-bundle"
+ src="chrome://takeaction/locale/taSidebar.properties" />
+ </stringbundleset>
+
<tabbox id="takeaction-tabbox">
<tabs>
<tab label="&takeaction.onThisPage.label;"
@@ -42,11 +47,13 @@
<tabpanels>
<tabpanel>
<!-- On this page panel. -->
- <vbox id="takeaction-sidebar-thisPage-actions" flex="1" />
+ <vbox id="takeaction-sidebar-thisPage-actions"
+ class="takeaction-results" flex="1" />
</tabpanel>
<tabpanel>
<!-- Recent actions panel. -->
- <vbox id="takeaction-sidebar-recent-actions" flex="1" />
+ <vbox id="takeaction-sidebar-recent-actions"
+ class="takeaction-results" flex="1" />
</tabpanel>
<tabpanel>
<!-- Search panel. -->
@@ -86,7 +93,7 @@
control="takection-created" />
<menulist id="takection-created">
<menupopup>
- <menuitem label="&takeaction.actionType.all.label;" value="all"
+ <menuitem label="&takeaction.created.all.label;" value="all"
selected="true" />
<menuitem label="&takeaction.created.30.label;" value="30" />
<menuitem label="&takeaction.created.14.label;" value="14" />
@@ -96,7 +103,8 @@
</menupopup>
</menulist>
</hbox>
- <vbox id="takeaction-sidebar-search-actions" flex="1" />
+ <vbox id="takeaction-sidebar-search-actions" class="takeaction-results"
+ flex="1" />
</tabpanel>
</tabpanels>
</tabbox>
Added: trunk/implementation/src/chrome/locale/en-US/taSidebar.properties
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taSidebar.properties (rev 0)
+++ trunk/implementation/src/chrome/locale/en-US/taSidebar.properties 2009-04-01 04:07:44 UTC (rev 22)
@@ -0,0 +1,30 @@
+###
+# Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names of
+# its contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# 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.
+###
+
+takeaction.loading.label = Loading...
+takeaction.noActions.label = No actions were found
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 03:42:42 UTC (rev 21)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 04:07:44 UTC (rev 22)
@@ -60,3 +60,14 @@
.takeaction-form {
-moz-box-align: baseline;
}
+
+.takeaction-results {
+ -moz-box-align: center;
+}
+
+.takeaction-results > description {
+ -moz-box-flex: 1;
+ margin-top: 3em;
+ font-size: 1.3em;
+ font-weight: bold;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-04-01 03:42:51
|
Revision: 21
http://take-action.svn.sourceforge.net/take-action/?rev=21&view=rev
Author: jorgevillalobos
Date: 2009-04-01 03:42:42 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Hooked up the search form to the API. Everything seems to be working as expected.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taSidebar.js
Modified: trunk/implementation/src/chrome/content/taSidebar.js
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.js 2009-04-01 02:28:51 UTC (rev 20)
+++ trunk/implementation/src/chrome/content/taSidebar.js 2009-04-01 03:42:42 UTC (rev 21)
@@ -96,6 +96,48 @@
},
/**
+ * Performs an advanced search from the search tab.
+ * @param aEvent the event that triggered this action.
+ */
+ search : function(aEvent) {
+ this._logger.debug("search");
+
+ let that = this;
+ let query = document.getElementById("takeaction-search-box").value;
+ let actionType = document.getElementById("takection-action-type").value;
+ let created = document.getElementById("takection-created").value;
+ let searchQuery = new TakeAction.SearchQuery();
+
+ searchQuery.setQuery(query);
+
+ if ("all" != actionType) {
+ searchQuery.addActionType(actionType);
+ }
+
+ if ("all" != created) {
+ searchQuery.setCreatedDays(created);
+ }
+
+ TakeAction.API.search(
+ searchQuery,
+ function(aSearchResults) { that._searchCallback(aSearchResults); });
+ },
+
+ /**
+ * Handles the response from the API call made in the search method. Loads
+ * the search results in the "Search" tab.
+ * @param aSearchResults The search result array.
+ */
+ _searchCallback : function(aSearchResults) {
+ this._logger.trace("_loadRecentActionsCallback");
+
+ let container =
+ document.getElementById("takeaction-sidebar-search-actions");
+
+ this._loadActions(aSearchResults, container);
+ },
+
+ /**
* Loads the given search results in the given container, creating a
* tasearchresultbox binding to display each one.
* @param aSearchResults The API search results to load.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-04-01 02:29:23
|
Revision: 20
http://take-action.svn.sourceforge.net/take-action/?rev=20&view=rev
Author: jorgevillalobos
Date: 2009-04-01 02:28:51 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Added a search form that mimics the advanced search in the socialactions site. It's not hooked up to the code yet.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taSidebar.xul
trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd
trunk/implementation/src/chrome/skin/taSidebar.css
Modified: trunk/implementation/src/chrome/content/taSidebar.xul
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.xul 2009-04-01 01:56:07 UTC (rev 19)
+++ trunk/implementation/src/chrome/content/taSidebar.xul 2009-04-01 02:28:51 UTC (rev 20)
@@ -41,13 +41,62 @@
</tabs>
<tabpanels>
<tabpanel>
- <vbox id="takeaction-sidebar-thisPage-actions" flex="1"/>
+ <!-- On this page panel. -->
+ <vbox id="takeaction-sidebar-thisPage-actions" flex="1" />
</tabpanel>
<tabpanel>
- <vbox id="takeaction-sidebar-recent-actions" flex="1"/>
+ <!-- Recent actions panel. -->
+ <vbox id="takeaction-sidebar-recent-actions" flex="1" />
</tabpanel>
<tabpanel>
- <vbox id="takeaction-sidebar-search-actions" flex="1"/>
+ <!-- Search panel. -->
+ <hbox class="takeaction-form">
+ <label id="takeaction-search-label" value="&takeaction.search.label;"
+ accesskey="&takeaction.search.accesskey;"
+ control="takeaction-search-box" />
+ <textbox id="takeaction-search-box" type="search" cocoa-size="small"
+ flex="1" oncommand="TakeActionChrome.Sidebar.search(event);" />
+ </hbox>
+ <hbox class="takeaction-form">
+ <label value="&takeaction.actionType.label;"
+ accesskey="&takeaction.actionType.accesskey;"
+ control="takection-action-type" />
+ <menulist id="takection-action-type">
+ <menupopup>
+ <menuitem label="&takeaction.actionType.all.label;" value="all"
+ selected="true" />
+ <menuitem label="&takeaction.actionType.1.label;" value="1" />
+ <menuitem label="&takeaction.actionType.2.label;" value="2" />
+ <menuitem label="&takeaction.actionType.3.label;" value="3" />
+ <menuitem label="&takeaction.actionType.4.label;" value="4" />
+ <menuitem label="&takeaction.actionType.5.label;" value="5" />
+ <menuitem label="&takeaction.actionType.6.label;" value="6" />
+ <menuitem label="&takeaction.actionType.7.label;" value="7" />
+ <menuitem label="&takeaction.actionType.8.label;" value="8" />
+ <menuitem label="&takeaction.actionType.9.label;" value="9" />
+ <menuitem label="&takeaction.actionType.10.label;" value="10" />
+ <menuitem label="&takeaction.actionType.11.label;" value="11" />
+ <menuitem label="&takeaction.actionType.12.label;" value="12" />
+ </menupopup>
+ </menulist>
+ </hbox>
+ <hbox class="takeaction-form">
+ <label value="&takeaction.created.label;"
+ accesskey="&takeaction.created.accesskey;"
+ control="takection-created" />
+ <menulist id="takection-created">
+ <menupopup>
+ <menuitem label="&takeaction.actionType.all.label;" value="all"
+ selected="true" />
+ <menuitem label="&takeaction.created.30.label;" value="30" />
+ <menuitem label="&takeaction.created.14.label;" value="14" />
+ <menuitem label="&takeaction.created.7.label;" value="7" />
+ <menuitem label="&takeaction.created.1.label;" value="1" />
+ <menuitem label="&takeaction.created.0.label;" value="0" />
+ </menupopup>
+ </menulist>
+ </hbox>
+ <vbox id="takeaction-sidebar-search-actions" flex="1" />
</tabpanel>
</tabpanels>
</tabbox>
Modified: trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd 2009-04-01 01:56:07 UTC (rev 19)
+++ trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd 2009-04-01 02:28:51 UTC (rev 20)
@@ -22,3 +22,33 @@
<!ENTITY takeaction.recent.label "Recent">
<!ENTITY takeaction.recent.accesskey "R">
+
+<!ENTITY takeaction.search.label "Search:">
+<!ENTITY takeaction.search.accesskey "S">
+
+<!ENTITY takeaction.actionType.label "Type of action:">
+<!ENTITY takeaction.actionType.accesskey "T">
+
+<!ENTITY takeaction.actionType.all.label "All actions">
+<!ENTITY takeaction.actionType.1.label "Group Fundraiser">
+<!ENTITY takeaction.actionType.2.label "Campaign">
+<!ENTITY takeaction.actionType.3.label "Pledged Action">
+<!ENTITY takeaction.actionType.4.label "Event">
+<!ENTITY takeaction.actionType.5.label "Affinity Group">
+<!ENTITY takeaction.actionType.6.label "Volunteer">
+<!ENTITY takeaction.actionType.7.label "Micro-credit Loan">
+<!ENTITY takeaction.actionType.8.label "Petition">
+<!ENTITY takeaction.actionType.9.label "Individual Action">
+<!ENTITY takeaction.actionType.10.label "Unknown">
+<!ENTITY takeaction.actionType.11.label "Employment">
+<!ENTITY takeaction.actionType.12.label "Vote For An Idea">
+
+<!ENTITY takeaction.created.label "Created:">
+<!ENTITY takeaction.created.accesskey "C">
+
+<!ENTITY takeaction.created.all.label "Any Time">
+<!ENTITY takeaction.created.30.label "Last 30 days">
+<!ENTITY takeaction.created.14.label "Last 14 days">
+<!ENTITY takeaction.created.7.label "Last week">
+<!ENTITY takeaction.created.1.label "Yesterday">
+<!ENTITY takeaction.created.0.label "Today">
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 01:56:07 UTC (rev 19)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 02:28:51 UTC (rev 20)
@@ -48,6 +48,15 @@
}
tabpanel {
+ -moz-box-orient: vertical;
background: white;
overflow: auto;
}
+
+#takeaction-search-label {
+ display: none;
+}
+
+.takeaction-form {
+ -moz-box-align: baseline;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-04-01 02:22:41
|
Revision: 18
http://take-action.svn.sourceforge.net/take-action/?rev=18&view=rev
Author: jorgevillalobos
Date: 2009-04-01 01:37:24 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Modified toolbar graphics to make them clearer.
Modified Paths:
--------------
trunk/art/toolbar-mac.xcf
trunk/art/toolbar-unix.xcf
trunk/art/toolbar-win.xcf
trunk/implementation/src/chrome/skin/mac/toolbar.png
trunk/implementation/src/chrome/skin/unix/toolbar.png
trunk/implementation/src/chrome/skin/win/toolbar.png
Modified: trunk/art/toolbar-mac.xcf
===================================================================
(Binary files differ)
Modified: trunk/art/toolbar-unix.xcf
===================================================================
(Binary files differ)
Modified: trunk/art/toolbar-win.xcf
===================================================================
(Binary files differ)
Modified: trunk/implementation/src/chrome/skin/mac/toolbar.png
===================================================================
(Binary files differ)
Modified: trunk/implementation/src/chrome/skin/unix/toolbar.png
===================================================================
(Binary files differ)
Modified: trunk/implementation/src/chrome/skin/win/toolbar.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-04-01 02:22:31
|
Revision: 19
http://take-action.svn.sourceforge.net/take-action/?rev=19&view=rev
Author: jorgevillalobos
Date: 2009-04-01 01:56:07 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Style changes to the tabs in the sidebar.
Modified Paths:
--------------
trunk/implementation/src/chrome/skin/taSidebar.css
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 01:37:24 UTC (rev 18)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-04-01 01:56:07 UTC (rev 19)
@@ -14,13 +14,40 @@
* limitations under the License.
**/
-#takeaction-sidebar-thisPage-actions {
+#takeaction-tabbox,
+tabpanels,
+tabpanels > tabpanel {
+ -moz-box-flex: 1;
+ -moz-appearance: none;
+}
+
+tabs {
+ margin: 0em;
+}
+
+tab {
+ -moz-appearance: none;
+ -moz-border-radius: 0.6em 0.6em 0em 0em;
+ font-size: 0.9em;
+ font-weight: bold;
+ border: 2px solid #3b6604;
+ border-bottom: none;
+ background-color: #c8de92;
+ margin-right: 0.3em;
+ color: #3b6604;
+}
+
+tab[selected="true"] {
+ background-color: #3b6604;
+ color: white;
+}
+
+tabpanels {
+ border: 2px solid #3b6604;
+ padding: 0em;
+}
+
+tabpanel {
background: white;
overflow: auto;
}
-
-#takeaction-tabbox,
-#takeaction-tabbox > tabpanels,
-#takeaction-tabbox > tabpanels > tabpanel {
- -moz-box-flex: 1;
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-31 02:01:05
|
Revision: 17
http://take-action.svn.sourceforge.net/take-action/?rev=17&view=rev
Author: jorgevillalobos
Date: 2009-03-31 01:56:30 +0000 (Tue, 31 Mar 2009)
Log Message:
-----------
Fixed some CSS issues in the sidebar. I also took some liberties in formatting which we'll have to discuss later. I think it looks OK, although certainly needs improvement in styling.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taSearchResultBox.xml
trunk/implementation/src/chrome/skin/taSearchResultBox.css
trunk/implementation/src/chrome/skin/taSidebar.css
Modified: trunk/implementation/src/chrome/content/taSearchResultBox.xml
===================================================================
--- trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-29 18:18:05 UTC (rev 16)
+++ trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-31 01:56:30 UTC (rev 17)
@@ -34,17 +34,14 @@
</resources>
<content>
- <xul:vbox class="outerbox">
+ <xul:vbox class="outerbox" flex="1">
+ <xul:label class="title" crop="end"
+ xbl:inherits="value=title,tooltiptext" />
+ <xul:description anonid="ta-action-description" class="description" />
<xul:hbox>
- <xul:label class="title" xbl:inherits="value=title" crop="end"/>
- </xul:hbox>
- <xul:hbox>
- <xul:label class="description" xbl:inherits="value=description" crop="end"/>
- </xul:hbox>
- <xul:hbox class="info">
<xul:label class="site" xbl:inherits="value=site"/>
<xul:label value="-"/>
- <xul:label class="actionType" xbl:inherits="value=actionType"/>
+ <xul:label class="actionType" xbl:inherits="value=actionType" />
</xul:hbox>
</xul:vbox>
</content>
@@ -69,35 +66,53 @@
]]>
</getter>
<setter><![CDATA[
+ let description =
+ document.getAnonymousElementByAttribute(
+ this, "anonid", "ta-action-description");
+
this._searchResult = val;
- this.setAttribute("title",
- this._stripHtmlTags(this._searchResult.title));
- this.setAttribute("description",
- this._stripHtmlTags(this._searchResult.description));
+ this.setAttribute(
+ "title", this._stripHTMLTags(this._searchResult.title));
+ this.setAttribute(
+ "tooltiptext", this._stripHTMLTags(this._searchResult.title));
this.setAttribute("actionType", this._searchResult.actionTypeName);
this.setAttribute("site", this._searchResult.siteName);
+
+ if (null != description.firstChild) {
+ description.removeChild(description.firstChild);
+ }
+
+ description.appendChild(
+ document.createTextNode(
+ this._crop(this._searchResult.description, 150)));
]]>
</setter>
</property>
- <method name="_stripHtmlTags">
- <parameter name="aString"/>
+ <method name="_crop">
+ <parameter name="aString" />
+ <parameter name="aMaxLength" />
<body><![CDATA[
- // TODO: This is throwing a "mal-formed" error sometimes,
- // even with the try-catch block.
- return aString;
- try {
- let div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
- div.innerHTML = aString;
- return div.textContent;
- } catch (ex) {
- return aString;
+ let result = this._stripHTMLTags(aString);
+
+ if (aMaxLength < result.length) {
+ result = result.substring(0, (aMaxLength - 3)) + "...";
}
+
+ return result;
]]>
</body>
</method>
+ <method name="_stripHTMLTags">
+ <parameter name="aString"/>
+ <body><![CDATA[
+ return aString.replace(/<[^>]+>/g, "");
+ ]]>
+ </body>
+ </method>
+
</implementation>
</binding>
Modified: trunk/implementation/src/chrome/skin/taSearchResultBox.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSearchResultBox.css 2009-03-29 18:18:05 UTC (rev 16)
+++ trunk/implementation/src/chrome/skin/taSearchResultBox.css 2009-03-31 01:56:30 UTC (rev 17)
@@ -14,10 +14,15 @@
* limitations under the License.
**/
+.title,
+.site,
+.description {
+ margin-left: 0.7em !important;
+}
+
.outerbox {
border-bottom: thin dotted #ccc;
padding: 2px;
- background: #fff;
}
.outerbox:hover {
@@ -33,11 +38,6 @@
font-size: 0.9em;
}
-.info label {
- font-size: 0.9em;
- margin-right: 0px !important;
-}
-
.actionType {
color: #008000;
}
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-29 18:18:05 UTC (rev 16)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-31 01:56:30 UTC (rev 17)
@@ -15,7 +15,7 @@
**/
#takeaction-sidebar-thisPage-actions {
- background: #ccc;
+ background: white;
overflow: auto;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-29 18:18:14
|
Revision: 16
http://take-action.svn.sourceforge.net/take-action/?rev=16&view=rev
Author: jorgevillalobos
Date: 2009-03-29 18:18:05 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Fixed the pending issues with the result count.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
trunk/implementation/src/chrome/skin/unix/taToolbar.css
trunk/implementation/src/chrome/skin/win/taToolbar.css
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-29 17:53:44 UTC (rev 15)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-29 18:18:05 UTC (rev 16)
@@ -28,20 +28,32 @@
* Browser overlay controller.
*/
TakeActionChrome.BrowserOverlay = {
-
/* Logger for this object. */
_logger : null,
+ /* Overlay string bundle. */
+ _bundle : null,
/**
* Initializes the object.
*/
init : function() {
let that = this;
+ let toolbarButton;
this._logger = Log4Moz.repository.getLogger("TakeActionChrome.BrowserOverlay");
this._logger.level = Log4Moz.Level["All"];
this._logger.debug("init");
+ this._bundle = document.getElementById("takeaction-string-bundle");
+ // set the default tooltip text for the toolbar button.
+ toolbarButton = document.getElementById("takeaction-toolbarbutton");
+
+ if (null != toolbarButton) {
+ toolbarButton.setAttribute(
+ "tooltiptext",
+ this._bundle.getString("takeaction.resultsDefault.label"));
+ }
+
// Perform first run operations
let extension = Application.extensions.get(TakeAction.EXTENSION_UUID);
if (extension.firstRun) {
@@ -207,9 +219,16 @@
if ("object" == typeof(aSearchResults)) {
toolbarButton.setAttribute("takeactionresults", aSearchResults.length);
toolbarButton.setAttribute("takeactionresultshidden", false);
+ toolbarButton.setAttribute(
+ "tooltiptext",
+ this._bundle.getFormattedString(
+ "takeaction.results.label", [aSearchResults.length]));
} else {
toolbarButton.setAttribute("takeactionresultshidden", true);
toolbarButton.removeAttribute("takeactionresults");
+ toolbarButton.setAttribute(
+ "tooltiptext",
+ this._bundle.getString("takeaction.resultsDefault.label"));
}
}
}
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-29 17:53:44 UTC (rev 15)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-29 18:18:05 UTC (rev 16)
@@ -57,4 +57,10 @@
oncommand="toggleSidebar('takeaction-broadcaster-view-sidebar');" />
</toolbarpalette>
+ <window id="main-window">
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="takeaction-string-bundle"
+ src="chrome://takeaction/locale/taBrowserOverlay.properties" />
+ </stringbundleset>
+ </window>
</overlay>
Modified: trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-03-29 17:53:44 UTC (rev 15)
+++ trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-03-29 18:18:05 UTC (rev 16)
@@ -37,3 +37,6 @@
takeaction.actionType.6 = Volunteer
takeaction.actionType.7 = Micro-credit Loan
takeaction.actionType.8 = Petition
+
+takeaction.resultsDefault.label = Take Action sidebar
+takeaction.results.label = %S actions available
Modified: trunk/implementation/src/chrome/skin/unix/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/unix/taToolbar.css 2009-03-29 17:53:44 UTC (rev 15)
+++ trunk/implementation/src/chrome/skin/unix/taToolbar.css 2009-03-29 18:18:05 UTC (rev 16)
@@ -34,9 +34,8 @@
.takeaction-toolbarbutton-results {
-moz-border-radius: 0.6em;
- border: 1px solid #3b6604;
- background-color: #c8de92;
- color: #3b6604;
+ background-color: #D8190C;
+ color: white;
font-size: 0.6em;
font-weight: bold;
padding: 0.1em;
Modified: trunk/implementation/src/chrome/skin/win/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/win/taToolbar.css 2009-03-29 17:53:44 UTC (rev 15)
+++ trunk/implementation/src/chrome/skin/win/taToolbar.css 2009-03-29 18:18:05 UTC (rev 16)
@@ -39,9 +39,8 @@
.takeaction-toolbarbutton-results {
-moz-border-radius: 0.6em;
- border: 1px solid #3b6604;
- background-color: #c8de92;
- color: #3b6604;
+ background-color: #D8190C;
+ color: white;
font-size: 0.6em;
font-weight: bold;
padding: 0.1em;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-29 17:53:47
|
Revision: 15
http://take-action.svn.sourceforge.net/take-action/?rev=15&view=rev
Author: jorgevillalobos
Date: 2009-03-29 17:53:44 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Implemented the result count in the toolbar button. There are still some things pending to do:
1) the styles were copied to windows and linux, but haven't been tested. I think the colors will have to be different.
2) Dynamically setting the tooltip for the button depending on the result count.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/bindings.css
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/chrome/skin/mac/taToolbar.css
trunk/implementation/src/chrome/skin/unix/taToolbar.css
trunk/implementation/src/chrome/skin/win/taToolbar.css
trunk/implementation/src/chrome.manifest
Added Paths:
-----------
trunk/implementation/src/chrome/content/taToolbarButton.xml
Modified: trunk/implementation/src/chrome/content/bindings.css
===================================================================
--- trunk/implementation/src/chrome/content/bindings.css 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/content/bindings.css 2009-03-29 17:53:44 UTC (rev 15)
@@ -17,3 +17,7 @@
tasearchresultbox {
-moz-binding: url("chrome://takeaction/content/taSearchResultBox.xml#takeaction-search-result-box");
}
+
+#takeaction-toolbarbutton {
+ -moz-binding: url("chrome://takeaction/content/taToolbarButton.xml#takeaction-toolbarbutton");
+}
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-29 17:53:44 UTC (rev 15)
@@ -192,6 +192,7 @@
// Get sidebar and verify that it is opened at this moment
let sidebarWindow = document.getElementById("sidebar").contentWindow;
+
if (sidebarWindow.location.href ==
"chrome://takeaction/content/taSidebar.xul") {
// Pass the search results to the sidebar
@@ -201,10 +202,15 @@
// Set the search result count in the toolbar button
let toolbarButton = document.getElementById("takeaction-toolbarbutton");
- if (typeof(aSearchResults) == 'object') {
- toolbarButton.setAttribute("label", "Results: " + aSearchResults.length);
- } else {
- toolbarButton.setAttribute("label", "Loading...");
+
+ if (null != toolbarButton) {
+ if ("object" == typeof(aSearchResults)) {
+ toolbarButton.setAttribute("takeactionresults", aSearchResults.length);
+ toolbarButton.setAttribute("takeactionresultshidden", false);
+ } else {
+ toolbarButton.setAttribute("takeactionresultshidden", true);
+ toolbarButton.removeAttribute("takeactionresults");
+ }
}
}
};
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-29 17:53:44 UTC (rev 15)
@@ -17,6 +17,8 @@
-->
<?xml-stylesheet type="text/css"
+ href="chrome://takeaction/content/bindings.css" ?>
+<?xml-stylesheet type="text/css"
href="chrome://takeaction-os/skin/taToolbar.css" ?>
<!DOCTYPE overlay [
Added: trunk/implementation/src/chrome/content/taToolbarButton.xml
===================================================================
--- trunk/implementation/src/chrome/content/taToolbarButton.xml (rev 0)
+++ trunk/implementation/src/chrome/content/taToolbarButton.xml 2009-03-29 17:53:44 UTC (rev 15)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+
+<!--
+ - Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- Search result box -->
+ <binding id="takeaction-toolbarbutton" display="xul:button"
+ extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
+ <resources>
+ <stylesheet src="chrome://global/skin/toolbarbutton.css"/>
+ </resources>
+
+ <content>
+ <children includes="observes|template|menupopup|tooltip" />
+ <xul:stack>
+ <xul:image class="toolbarbutton-icon"
+ xbl:inherits="validate,src=image,toolbarmode,buttonstyle" />
+ <xul:hbox class="takeaction-toolbarbutton-container">
+ <xul:label class="takeaction-toolbarbutton-results" hidden="true"
+ xbl:inherits=
+ "value=takeactionresults,hidden=takeactionresultshidden" />
+ </xul:hbox>
+ </xul:stack>
+ <xul:label class="toolbarbutton-text" crop="right" flex="1"
+ xbl:inherits="value=label,accesskey,crop,toolbarmode,buttonstyle"/>
+ </content>
+ </binding>
+
+</bindings>
Modified: trunk/implementation/src/chrome/skin/mac/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/mac/taToolbar.css 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/skin/mac/taToolbar.css 2009-03-29 17:53:44 UTC (rev 15)
@@ -30,3 +30,19 @@
#takeaction-toolbarbutton:not([disabled="true"]):hover:active {
-moz-image-region: rect(46px, 36px, 69px, 0px);
}
+
+.takeaction-toolbarbutton-container {
+ -moz-box-align: end;
+ -moz-box-pack: end;
+}
+
+.takeaction-toolbarbutton-results {
+ -moz-border-radius: 0.6em;
+ border: 1px solid #3b6604;
+ background-color: #c8de92;
+ color: #3b6604;
+ font-size: 0.6em;
+ font-weight: bold;
+ padding: 0.1em;
+ margin: 0em;
+}
Modified: trunk/implementation/src/chrome/skin/unix/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/unix/taToolbar.css 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/skin/unix/taToolbar.css 2009-03-29 17:53:44 UTC (rev 15)
@@ -26,3 +26,19 @@
#takeaction-toolbarbutton[disabled="true"] {
-moz-image-region: rect(24px, 24px, 48px, 0px);
}
+
+.takeaction-toolbarbutton-container {
+ -moz-box-align: end;
+ -moz-box-pack: end;
+}
+
+.takeaction-toolbarbutton-results {
+ -moz-border-radius: 0.6em;
+ border: 1px solid #3b6604;
+ background-color: #c8de92;
+ color: #3b6604;
+ font-size: 0.6em;
+ font-weight: bold;
+ padding: 0.1em;
+ margin: 0em;
+}
Modified: trunk/implementation/src/chrome/skin/win/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/win/taToolbar.css 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome/skin/win/taToolbar.css 2009-03-29 17:53:44 UTC (rev 15)
@@ -27,6 +27,23 @@
#takeaction-toolbarbutton:not([disabled="true"]):hover:active {
-moz-image-region: rect(24px, 24px, 48px, 0px);
}
+
#takeaction-toolbarbutton[disabled="true"] {
-moz-image-region: rect(48px, 24px, 72px, 0px);
}
+
+.takeaction-toolbarbutton-container {
+ -moz-box-align: end;
+ -moz-box-pack: end;
+}
+
+.takeaction-toolbarbutton-results {
+ -moz-border-radius: 0.6em;
+ border: 1px solid #3b6604;
+ background-color: #c8de92;
+ color: #3b6604;
+ font-size: 0.6em;
+ font-weight: bold;
+ padding: 0.1em;
+ margin: 0em;
+}
Modified: trunk/implementation/src/chrome.manifest
===================================================================
--- trunk/implementation/src/chrome.manifest 2009-03-29 17:02:59 UTC (rev 14)
+++ trunk/implementation/src/chrome.manifest 2009-03-29 17:53:44 UTC (rev 15)
@@ -32,3 +32,4 @@
overlay chrome://browser/content/browser.xul chrome://takeaction/content/taBrowserOverlay.xul
style chrome://global/content/customizeToolbar.xul chrome://takeaction-os/skin/taToolbar.css
+style chrome://global/content/customizeToolbar.xul chrome://takeaction/content/bindings.css
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-29 17:03:02
|
Revision: 14
http://take-action.svn.sourceforge.net/take-action/?rev=14&view=rev
Author: jorgevillalobos
Date: 2009-03-29 17:02:59 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Made some changes to the toolbar button installation code.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-28 17:25:20 UTC (rev 13)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-29 17:02:59 UTC (rev 14)
@@ -55,24 +55,31 @@
_installToolbarButton : function() {
this._logger.trace("_installToolbarButton");
- let toolbar = document.getElementById("nav-bar");
- let buttons = toolbar.currentSet.split(",");
- let buttonAdded = false;
+ try {
+ let toolbar = document.getElementById("nav-bar");
+ let curSet = toolbar.currentSet;
- for (let i = 0; i < buttons.length; i++) {
- if (buttons[i] == "home-button") {
- buttons.splice(i+1, 0, "takeaction-toolbarbutton");
- buttonAdded = true;
- break;
+ if (-1 == curSet.indexOf("takeaction-toolbarbutton")) {
+ let set;
+
+ // Place the button before the urlbar
+ if (curSet.indexOf("urlbar-container") != -1) {
+ set =
+ curSet.replace(
+ /urlbar-container/, "takeaction-toolbarbutton,urlbar-container");
+ } else { // at the end
+ set = curSet + ",takeaction-toolbarbutton";
+ }
+
+ toolbar.setAttribute("currentset", set);
+ toolbar.currentSet = set;
+ document.persist("nav-bar", "currentset");
+
+ try {
+ BrowserToolboxCustomizeDone(true);
+ } catch (e) {}
}
- }
- if (!buttonAdded) {
- buttons.push("takeaction-toolbarbutton");
- }
-
- toolbar.currentSet = buttons.toString();
- toolbar.ownerDocument.persist(toolbar.id, "currentset");
- BrowserToolboxCustomizeDone(true);
+ } catch(e) {}
},
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-28 17:25:33
|
Revision: 13
http://take-action.svn.sourceforge.net/take-action/?rev=13&view=rev
Author: jorgevillalobos
Date: 2009-03-28 17:25:20 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
Updated the Mac OS icon a little bit, and added the required CSS to show the button in the 3 main systems. Tested on Mac and looks OK. Haven't tested the rest yet.
Modified Paths:
--------------
trunk/art/toolbar-mac.xcf
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/chrome/skin/mac/toolbar.png
trunk/implementation/src/chrome.manifest
Added Paths:
-----------
trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.dtd
trunk/implementation/src/chrome/skin/mac/taToolbar.css
trunk/implementation/src/chrome/skin/unix/taToolbar.css
trunk/implementation/src/chrome/skin/win/taToolbar.css
Modified: trunk/art/toolbar-mac.xcf
===================================================================
(Binary files differ)
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-28 16:57:44 UTC (rev 12)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-28 17:25:20 UTC (rev 13)
@@ -16,6 +16,9 @@
- limitations under the License.
-->
+<?xml-stylesheet type="text/css"
+ href="chrome://takeaction-os/skin/taToolbar.css" ?>
+
<!DOCTYPE overlay [
<!ENTITY % overlayDTD SYSTEM "chrome://takeaction/locale/taBrowserOverlay.dtd" >
%overlayDTD;
@@ -47,9 +50,9 @@
</menupopup>
<toolbarpalette id="BrowserToolbarPalette">
- <toolbarbutton
- id="takeaction-toolbarbutton"
- label="Take Action"/>
+ <toolbarbutton id="takeaction-toolbarbutton"
+ label="&takeaction.button.label;"
+ oncommand="toggleSidebar('takeaction-broadcaster-view-sidebar');" />
</toolbarpalette>
</overlay>
Added: trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.dtd
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.dtd (rev 0)
+++ trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.dtd 2009-03-28 17:25:20 UTC (rev 13)
@@ -0,0 +1,17 @@
+<!--
+ - Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+<!ENTITY takeaction.button.label "Take Action">
Added: trunk/implementation/src/chrome/skin/mac/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/mac/taToolbar.css (rev 0)
+++ trunk/implementation/src/chrome/skin/mac/taToolbar.css 2009-03-28 17:25:20 UTC (rev 13)
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+/* The second and third selectors at the bottom are necessary to prevent
+ conflicts with installed themes. */
+#takeaction-toolbarbutton,
+window:not([active="true"]) #takeaction-toolbarbutton,
+toolbar[iconsize="small"] #takeaction-toolbarbutton {
+ list-style-image: url("chrome://takeaction-os/skin/toolbar.png");
+ -moz-image-region: rect(0px, 36px, 23px, 0px);
+}
+
+#takeaction-toolbarbutton[disabled="true"] {
+ -moz-image-region: rect(23px, 36px, 46px, 0px);
+}
+
+#takeaction-toolbarbutton:not([disabled="true"]):hover:active {
+ -moz-image-region: rect(46px, 36px, 69px, 0px);
+}
Modified: trunk/implementation/src/chrome/skin/mac/toolbar.png
===================================================================
(Binary files differ)
Added: trunk/implementation/src/chrome/skin/unix/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/unix/taToolbar.css (rev 0)
+++ trunk/implementation/src/chrome/skin/unix/taToolbar.css 2009-03-28 17:25:20 UTC (rev 13)
@@ -0,0 +1,28 @@
+/**
+ * Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+/* The second and third selectors at the bottom are necessary to prevent
+ conflicts with installed themes. */
+#takeaction-toolbarbutton,
+window:not([active="true"]) #takeaction-toolbarbutton,
+toolbar[iconsize="small"] #takeaction-toolbarbutton {
+ list-style-image: url("chrome://takeaction-os/skin/toolbar.png");
+ -moz-image-region: rect(0px, 24px, 24px, 0px);
+}
+
+#takeaction-toolbarbutton[disabled="true"] {
+ -moz-image-region: rect(24px, 24px, 48px, 0px);
+}
Added: trunk/implementation/src/chrome/skin/win/taToolbar.css
===================================================================
--- trunk/implementation/src/chrome/skin/win/taToolbar.css (rev 0)
+++ trunk/implementation/src/chrome/skin/win/taToolbar.css 2009-03-28 17:25:20 UTC (rev 13)
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+/* The second and third selectors at the bottom are necessary to prevent
+ conflicts with installed themes. */
+#takeaction-toolbarbutton,
+window:not([active="true"]) #takeaction-toolbarbutton,
+toolbar[iconsize="small"] #takeaction-toolbarbutton {
+ list-style-image: url("chrome://takeaction-os/skin/toolbar.png");
+ -moz-image-region: rect(0px, 24px, 24px, 0px);
+}
+
+#takeaction-toolbarbutton:not([disabled="true"]):hover,
+#takeaction-toolbarbutton:not([disabled="true"]):hover:active {
+ -moz-image-region: rect(24px, 24px, 48px, 0px);
+}
+#takeaction-toolbarbutton[disabled="true"] {
+ -moz-image-region: rect(48px, 24px, 72px, 0px);
+}
Modified: trunk/implementation/src/chrome.manifest
===================================================================
--- trunk/implementation/src/chrome.manifest 2009-03-28 16:57:44 UTC (rev 12)
+++ trunk/implementation/src/chrome.manifest 2009-03-28 17:25:20 UTC (rev 13)
@@ -16,10 +16,19 @@
content takeaction jar:chrome/takeaction.jar!/content/
-skin takeaction classic/1.0 jar:chrome/takeaction.jar!/skin/
+skin takeaction classic/1.0 jar:chrome/takeaction.jar!/skin/
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/unix/
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ os=WINNT
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ os=OS2
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ os=BeOS
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ os=riscos
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ os=NTO
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/mac/ os=Darwin
+skin takeaction-os classic/1.0 jar:chrome/takeaction.jar!/skin/win/ application={a463f10c-3994-11da-9945-000d60ca027b}
locale takeaction en-US jar:chrome/takeaction.jar!/locale/en-US/
resource takeaction resources/
-overlay chrome://browser/content/browser.xul chrome://takeaction/content/taBrowserOverlay.xul
+overlay chrome://browser/content/browser.xul chrome://takeaction/content/taBrowserOverlay.xul
+style chrome://global/content/customizeToolbar.xul chrome://takeaction-os/skin/taToolbar.css
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-28 16:57:54
|
Revision: 12
http://take-action.svn.sourceforge.net/take-action/?rev=12&view=rev
Author: jorgevillalobos
Date: 2009-03-28 16:57:44 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
Added first versions of the toolbar icons.
Added Paths:
-----------
trunk/art/
trunk/art/toolbar-mac.xcf
trunk/art/toolbar-unix.xcf
trunk/art/toolbar-win.xcf
trunk/implementation/src/chrome/skin/mac/
trunk/implementation/src/chrome/skin/mac/toolbar.png
trunk/implementation/src/chrome/skin/unix/
trunk/implementation/src/chrome/skin/unix/toolbar.png
trunk/implementation/src/chrome/skin/win/
trunk/implementation/src/chrome/skin/win/toolbar.png
Added: trunk/art/toolbar-mac.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/art/toolbar-mac.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/art/toolbar-unix.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/art/toolbar-unix.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/art/toolbar-win.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/art/toolbar-win.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/implementation/src/chrome/skin/mac/toolbar.png
===================================================================
(Binary files differ)
Property changes on: trunk/implementation/src/chrome/skin/mac/toolbar.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/implementation/src/chrome/skin/unix/toolbar.png
===================================================================
(Binary files differ)
Property changes on: trunk/implementation/src/chrome/skin/unix/toolbar.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/implementation/src/chrome/skin/win/toolbar.png
===================================================================
(Binary files differ)
Property changes on: trunk/implementation/src/chrome/skin/win/toolbar.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-28 04:25:07
|
Revision: 11
http://take-action.svn.sourceforge.net/take-action/?rev=11&view=rev
Author: jenrique7
Date: 2009-03-28 04:24:57 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
Improved the code that extracts "relevant" terms from the page. It now works somewhat better.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/chrome/content/taSearchResultBox.xml
trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
trunk/implementation/src/chrome/skin/taSearchResultBox.css
trunk/implementation/src/chrome/skin/taSidebar.css
trunk/implementation/src/resources/taAPI.js
trunk/implementation/src/resources/taEntities.js
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-28 04:24:57 UTC (rev 11)
@@ -104,29 +104,44 @@
let metaNodes;
let metaName;
- // Include the page title in the search terms
- let searchTerms = title;
+ let searchTerms = null;
- // Add terms from the keywords meta tag
+ // Look for the keywords meta tag
metaNodes = currentDoc.getElementsByTagName("meta");
for (let i = 0; i < metaNodes.length; i++) {
metaName = String(metaNodes[i].getAttribute("name"));
+
if (metaName.match(/keywords/i)) {
- searchTerms += " " + metaNodes[i].getAttribute("content");
+ searchTerms = metaNodes[i].getAttribute("content");
break;
}
}
+ // If no keywords, use the doc title as a last resort
+ if (!searchTerms) {
+ searchTerms = currentDoc.title;
+ }
+
+ // Split terms by comma, and add only the first 3 at the most
+ let searchTermsArray = searchTerms.split(",");
+ searchTerms = "";
+ for (let i = 0; i < searchTermsArray.length && i < 3; i++) {
+ searchTerms += searchTermsArray[i] + " ";
+ }
+
// Convert search terms string as space-separated
searchTerms = searchTerms.replace(/[^a-z0-9]/gi, " ");
searchTerms = searchTerms.replace(/\s+/gi, " ");
+ alert("Search terms for this page: " + searchTerms);
+
// Do the search
let that = this;
let searchQuery = new TakeAction.SearchQuery();
searchQuery.setQuery(searchTerms);
searchQuery.setMatch(TakeAction.API.MATCH_ANY);
searchQuery.setLimit(10);
+ searchQuery.setCreatedDays(TakeAction.API.CREATED_DAYS_ALL);
TakeAction.API.search(
searchQuery,
function(aSearchResults) {
Modified: trunk/implementation/src/chrome/content/taSearchResultBox.xml
===================================================================
--- trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-28 04:24:57 UTC (rev 11)
@@ -41,8 +41,10 @@
<xul:hbox>
<xul:label class="description" xbl:inherits="value=description" crop="end"/>
</xul:hbox>
- <xul:hbox>
- <xul:label class="url" xbl:inherits="value=url"/>
+ <xul:hbox class="info">
+ <xul:label class="site" xbl:inherits="value=site"/>
+ <xul:label value="-"/>
+ <xul:label class="actionType" xbl:inherits="value=actionType"/>
</xul:hbox>
</xul:vbox>
</content>
@@ -73,7 +75,8 @@
this._stripHtmlTags(this._searchResult.title));
this.setAttribute("description",
this._stripHtmlTags(this._searchResult.description));
- this.setAttribute("url", this._searchResult.url);
+ this.setAttribute("actionType", this._searchResult.actionTypeName);
+ this.setAttribute("site", this._searchResult.siteName);
]]>
</setter>
</property>
Modified: trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/chrome/locale/en-US/taBrowserOverlay.properties 2009-03-28 04:24:57 UTC (rev 11)
@@ -28,3 +28,12 @@
takeaction.options.title = Take Action Options
takeaction.optionsUnix.title = Take Action Preferences
+
+takeaction.actionType.1 = Group Fundraiser
+takeaction.actionType.2 = Campaign
+takeaction.actionType.3 = Pledged Action
+takeaction.actionType.4 = Event
+takeaction.actionType.5 = Affinity Group
+takeaction.actionType.6 = Volunteer
+takeaction.actionType.7 = Micro-credit Loan
+takeaction.actionType.8 = Petition
Modified: trunk/implementation/src/chrome/skin/taSearchResultBox.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSearchResultBox.css 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/chrome/skin/taSearchResultBox.css 2009-03-28 04:24:57 UTC (rev 11)
@@ -33,7 +33,15 @@
font-size: 0.9em;
}
-.url {
+.info label {
font-size: 0.9em;
+ margin-right: 0px !important;
+}
+
+.actionType {
color: #008000;
}
+
+.site {
+ color: #000080;
+}
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-28 04:24:57 UTC (rev 11)
@@ -14,7 +14,7 @@
* limitations under the License.
**/
-#takeaction-sidebar-results-box {
+#takeaction-sidebar-thisPage-actions {
background: #ccc;
overflow: auto;
}
Modified: trunk/implementation/src/resources/taAPI.js
===================================================================
--- trunk/implementation/src/resources/taAPI.js 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/resources/taAPI.js 2009-03-28 04:24:57 UTC (rev 11)
@@ -47,7 +47,7 @@
get CREATED_DAYS_7() { return 7; },
get CREATED_DAYS_14() { return 14; },
get CREATED_DAYS_30() { return 30; },
- get CREATED_DAYS_ALL() { return "All"; },
+ get CREATED_DAYS_ALL() { return "all"; },
/* Possible values for the match field in search queries */
get MATCH_ANY() { return "any"; },
Modified: trunk/implementation/src/resources/taEntities.js
===================================================================
--- trunk/implementation/src/resources/taEntities.js 2009-03-28 01:26:06 UTC (rev 10)
+++ trunk/implementation/src/resources/taEntities.js 2009-03-28 04:24:57 UTC (rev 11)
@@ -167,9 +167,11 @@
aTitle, aDescription, aSite, aUrl, aActionType, aLocation, aCreationDate) {
this.title = aTitle;
this.description = aDescription;
- this.site = aSite;
+ this.siteName = aSite.name;
+ this.siteId = aSite.id;
this.url = aUrl;
- this.actionType = aActionType;
+ this.actionTypeName = aActionType.name;
+ this.actionTypeId = aActionType.id;
this.location = aLocation;
this.creationDate = aCreationDate;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-28 01:26:24
|
Revision: 10
http://take-action.svn.sourceforge.net/take-action/?rev=10&view=rev
Author: jenrique7
Date: 2009-03-28 01:26:06 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
The toolbar button and the sidebar are now notified of the search results of the current page. However, we need to figure out a better way of obtaining relevant terms for the current page; using the title and the keywords does not work very well because a lot of irrelevant results are returned by the API.
Added code to install the toolbar button during the first run, but haven't tested it thoroughly.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/chrome/content/taSearchResultBox.xml
trunk/implementation/src/chrome/content/taSidebar.js
trunk/implementation/src/chrome/content/taSidebar.xul
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-25 01:58:49 UTC (rev 9)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-28 01:26:06 UTC (rev 10)
@@ -41,9 +41,41 @@
this._logger = Log4Moz.repository.getLogger("TakeActionChrome.BrowserOverlay");
this._logger.level = Log4Moz.Level["All"];
this._logger.debug("init");
+
+ // Perform first run operations
+ let extension = Application.extensions.get(TakeAction.EXTENSION_UUID);
+ if (extension.firstRun) {
+ this._installToolbarButton();
+ }
},
/**
+ * Installs the toolbar button the first time the extension is run.
+ */
+ _installToolbarButton : function() {
+ this._logger.trace("_installToolbarButton");
+
+ let toolbar = document.getElementById("nav-bar");
+ let buttons = toolbar.currentSet.split(",");
+ let buttonAdded = false;
+
+ for (let i = 0; i < buttons.length; i++) {
+ if (buttons[i] == "home-button") {
+ buttons.splice(i+1, 0, "takeaction-toolbarbutton");
+ buttonAdded = true;
+ break;
+ }
+ }
+ if (!buttonAdded) {
+ buttons.push("takeaction-toolbarbutton");
+ }
+
+ toolbar.currentSet = buttons.toString();
+ toolbar.ownerDocument.persist(toolbar.id, "currentset");
+ BrowserToolboxCustomizeDone(true);
+ },
+
+ /**
* Unloads the object.
*/
uninit : function() {
@@ -94,7 +126,7 @@
let searchQuery = new TakeAction.SearchQuery();
searchQuery.setQuery(searchTerms);
searchQuery.setMatch(TakeAction.API.MATCH_ANY);
- searchQuery.setLimit(50);
+ searchQuery.setLimit(10);
TakeAction.API.search(
searchQuery,
function(aSearchResults) {
@@ -136,10 +168,21 @@
_notifySearchResults : function(aSearchResults) {
this._logger.trace("_notifySearchResults");
+ // Get sidebar and verify that it is opened at this moment
+ let sidebarWindow = document.getElementById("sidebar").contentWindow;
+ if (sidebarWindow.location.href ==
+ "chrome://takeaction/content/taSidebar.xul") {
+ // Pass the search results to the sidebar
+ sidebarWindow.TakeActionChrome.Sidebar.
+ loadThisPageActions(aSearchResults);
+ }
+
+ // Set the search result count in the toolbar button
+ let toolbarButton = document.getElementById("takeaction-toolbarbutton");
if (typeof(aSearchResults) == 'object') {
- alert("TODO: Notify the results for this page. Number of results: " + aSearchResults.length);
+ toolbarButton.setAttribute("label", "Results: " + aSearchResults.length);
} else {
- alert("TODO: Notify that this page's results are being loaded");
+ toolbarButton.setAttribute("label", "Loading...");
}
}
};
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-25 01:58:49 UTC (rev 9)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-28 01:26:06 UTC (rev 10)
@@ -46,4 +46,10 @@
observes="takeaction-broadcaster-view-sidebar" />
</menupopup>
+ <toolbarpalette id="BrowserToolbarPalette">
+ <toolbarbutton
+ id="takeaction-toolbarbutton"
+ label="Take Action"/>
+ </toolbarpalette>
+
</overlay>
Modified: trunk/implementation/src/chrome/content/taSearchResultBox.xml
===================================================================
--- trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-25 01:58:49 UTC (rev 9)
+++ trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-28 01:26:06 UTC (rev 10)
@@ -81,6 +81,9 @@
<method name="_stripHtmlTags">
<parameter name="aString"/>
<body><![CDATA[
+ // TODO: This is throwing a "mal-formed" error sometimes,
+ // even with the try-catch block.
+ return aString;
try {
let div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
div.innerHTML = aString;
Modified: trunk/implementation/src/chrome/content/taSidebar.js
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.js 2009-03-25 01:58:49 UTC (rev 9)
+++ trunk/implementation/src/chrome/content/taSidebar.js 2009-03-28 01:26:06 UTC (rev 10)
@@ -39,22 +39,11 @@
* Initializes the object.
*/
init : function() {
- let that = this;
-
this._logger = Log4Moz.repository.getLogger("TakeActionChrome.Sidebar");
this._logger.level = Log4Moz.Level["All"];
this._logger.debug("init");
- // TODO: Test code
- let searchQuery = new TakeAction.SearchQuery();
- searchQuery.setQuery("recycle");
- searchQuery.addActionType(TakeAction.API.ACTION_TYPE_CAMPAIGN);
- searchQuery.excludeActionType(TakeAction.API.ACTION_TYPE_EVENT);
- searchQuery.setCreatedDays(TakeAction.API.CREATED_DAYS_14);
- searchQuery.setMatch(TakeAction.API.MATCH_ANY);
- TakeAction.API.search(
- searchQuery,
- function(aSearchResults) { that._searchLoad(aSearchResults); });
+ this.loadRecentActions();
},
/**
@@ -65,18 +54,64 @@
},
/**
- * Handles the response from the TakeAction.API.search method.
- * @param aSearchResults The array of social actions search results
+ * Loads the social actions search results in the "This Page" tab.
+ * @param aSearchResults The search results for this (the current) page.
*/
- _searchLoad : function(aSearchResults) {
- this._logger.trace("_searchLoad");
+ loadThisPageActions : function(aSearchResults) {
+ this._logger.debug("loadThisPageActions");
- let container = document.getElementById("takeaction-sidebar-results-box");
+ if (typeof(aSearchResults) == 'object') {
+ let container =
+ document.getElementById("takeaction-sidebar-thisPage-actions");
+ this._loadActions(aSearchResults, container);
+ }
+ },
+
+ /**
+ * Loads the most recent actions (empty API query).
+ */
+ loadRecentActions : function() {
+ this._logger.debug("loadRecentActions");
+
+ let that = this;
+ let searchQuery = new TakeAction.SearchQuery();
+
+ TakeAction.API.search(
+ searchQuery,
+ function(aSearchResults) {
+ that._loadRecentActionsCallback(aSearchResults); });
+ },
+
+ /**
+ * Handles the response from the API call made in the loadRecentActions
+ * method. Loads the search results in the "Recent" tab.
+ * @param aSearchResults The search result array.
+ */
+ _loadRecentActionsCallback : function(aSearchResults) {
+ this._logger.trace("_loadRecentActionsCallback");
+
+ let container =
+ document.getElementById("takeaction-sidebar-recent-actions");
+ this._loadActions(aSearchResults, container);
+ },
+
+ /**
+ * Loads the given search results in the given container, creating a
+ * tasearchresultbox binding to display each one.
+ * @param aSearchResults The API search results to load.
+ * @param aContainer The container element in which results will be loaded.
+ */
+ _loadActions : function(aSearchResults, aContainer) {
+ this._logger.trace("_loadActions");
+
+ while (aContainer.firstChild) {
+ aContainer.removeChild(aContainer.firstChild);
+ }
+
let searchResultBox = null;
-
for (let i = 0; i < aSearchResults.length; i++) {
searchResultBox = document.createElement("tasearchresultbox");
- container.appendChild(searchResultBox);
+ aContainer.appendChild(searchResultBox);
searchResultBox.searchResult = aSearchResults[i];
}
Modified: trunk/implementation/src/chrome/content/taSidebar.xul
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-25 01:58:49 UTC (rev 9)
+++ trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-28 01:26:06 UTC (rev 10)
@@ -41,11 +41,13 @@
</tabs>
<tabpanels>
<tabpanel>
- <vbox id="takeaction-sidebar-results-box" flex="1"/>
+ <vbox id="takeaction-sidebar-thisPage-actions" flex="1"/>
</tabpanel>
<tabpanel>
+ <vbox id="takeaction-sidebar-recent-actions" flex="1"/>
</tabpanel>
<tabpanel>
+ <vbox id="takeaction-sidebar-search-actions" flex="1"/>
</tabpanel>
</tabpanels>
</tabbox>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-25 01:58:51
|
Revision: 9
http://take-action.svn.sourceforge.net/take-action/?rev=9&view=rev
Author: jenrique7
Date: 2009-03-25 01:58:49 +0000 (Wed, 25 Mar 2009)
Log Message:
-----------
Fixed how search terms are extracted from the loaded pages.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/resources/taEntities.js
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-20 06:21:41 UTC (rev 8)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-25 01:58:49 UTC (rev 9)
@@ -85,12 +85,16 @@
}
}
+ // Convert search terms string as space-separated
+ searchTerms = searchTerms.replace(/[^a-z0-9]/gi, " ");
+ searchTerms = searchTerms.replace(/\s+/gi, " ");
+
// Do the search
let that = this;
let searchQuery = new TakeAction.SearchQuery();
searchQuery.setQuery(searchTerms);
searchQuery.setMatch(TakeAction.API.MATCH_ANY);
- searchQuery.setLimit(100);
+ searchQuery.setLimit(50);
TakeAction.API.search(
searchQuery,
function(aSearchResults) {
Modified: trunk/implementation/src/resources/taEntities.js
===================================================================
--- trunk/implementation/src/resources/taEntities.js 2009-03-20 06:21:41 UTC (rev 8)
+++ trunk/implementation/src/resources/taEntities.js 2009-03-25 01:58:49 UTC (rev 9)
@@ -143,6 +143,9 @@
if (this.match)
parameters.push("match=" + this.match);
+ if (this.limit)
+ parameters.push("limit=" + this.limit);
+
if (this.order)
parameters.push("order=" + this.order);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-20 06:21:52
|
Revision: 8
http://take-action.svn.sourceforge.net/take-action/?rev=8&view=rev
Author: jenrique7
Date: 2009-03-20 06:21:41 +0000 (Fri, 20 Mar 2009)
Log Message:
-----------
Tabs and documents are now monitored and search results of the Social Actions API are fetched using the documents' title and keywords. Some alerts where left where the code that notifies the sidebar and the toolbar button should be placed.
Search results are not being returned correctly though. We need to figure out exactly how to set multiple search terms in the API query.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.js
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/resources/taEntities.js
Added Paths:
-----------
trunk/implementation/src/chrome/content/taPageListener.js
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.js
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-17 01:29:22 UTC (rev 7)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.js 2009-03-20 06:21:41 UTC (rev 8)
@@ -15,6 +15,7 @@
**/
Components.utils.import("resource://takeaction/taCommon.js");
+Components.utils.import("resource://takeaction/taAPI.js");
/**
* TakeAction chrome namespace.
@@ -40,9 +41,6 @@
this._logger = Log4Moz.repository.getLogger("TakeActionChrome.BrowserOverlay");
this._logger.level = Log4Moz.Level["All"];
this._logger.debug("init");
-
- //gBrowser.addEventListener(
- // "pageshow", function(aEvent) { that._onPageLoad(aEvent); }, true);
},
/**
@@ -50,17 +48,96 @@
*/
uninit : function() {
this._logger.debug("uninit");
- }
+ },
/**
- * Handles the page load event for all pages loaded in the window. This is
- * done to search for actions.
- * @param aEvent The event that triggered this action.
+ * Loads actions for the current page (content.document). Actions are cached
+ * inside the document so that they are loaded only once.
*/
- /*_onPageLoad : function(aEvent) {
- // XXX: no logging here for performance purposes.
- let doc = aEvent.originalTarget;
- }*/
+ loadActionsForCurrentPage : function() {
+ this._logger.debug("loadActionsForCurrentPage");
+
+ let currentDoc = content.document;
+
+ // Check whether this page already has injected results (actions)
+ if (currentDoc.TakeActionResults) {
+ this._notifySearchResults(currentDoc.TakeActionResults);
+ return;
+ }
+
+ // Check if the document has finished loading (i.e. title available)
+ // TODO: Check whether there's a better comparison
+ let title = String(currentDoc.title);
+ if (title.length > 0) {
+
+ let metaNodes;
+ let metaName;
+ // Include the page title in the search terms
+ let searchTerms = title;
+
+ // Add terms from the keywords meta tag
+ metaNodes = currentDoc.getElementsByTagName("meta");
+ for (let i = 0; i < metaNodes.length; i++) {
+ metaName = String(metaNodes[i].getAttribute("name"));
+ if (metaName.match(/keywords/i)) {
+ searchTerms += " " + metaNodes[i].getAttribute("content");
+ break;
+ }
+ }
+
+ // Do the search
+ let that = this;
+ let searchQuery = new TakeAction.SearchQuery();
+ searchQuery.setQuery(searchTerms);
+ searchQuery.setMatch(TakeAction.API.MATCH_ANY);
+ searchQuery.setLimit(100);
+ TakeAction.API.search(
+ searchQuery,
+ function(aSearchResults) {
+ that._searchLoad(aSearchResults, currentDoc);
+ });
+
+ // Set a temporary flag in the document to avoid multiple API calls
+ currentDoc.TakeActionResults = true;
+ this._notifySearchResults(true);
+ }
+ },
+
+ /**
+ * Load handler for the TakeAction.API.search method. Sets the received
+ * results in the target document. If the target document is the current
+ * document, the loadActionsForCurrentPage method is called to notify that
+ * the search has finished.
+ * @param aSearchResults The search results for the given target document.
+ * @param aTargetDocument The document for which the search results were
+ * fetched.
+ */
+ _searchLoad : function(aSearchResults, aTargetDocument) {
+ this._logger.trace("_searchLoad");
+
+ aTargetDocument.TakeActionResults = aSearchResults;
+
+ if (content.document == aTargetDocument) {
+ this.loadActionsForCurrentPage();
+ }
+ },
+
+ /**
+ * Notifies the sidebar and the toolbar button of the search results for the
+ * current page.
+ * @param aSearchResults The array of search results for the current page.
+ * May be anything other than an array though, which means that the search
+ * results are pending.
+ */
+ _notifySearchResults : function(aSearchResults) {
+ this._logger.trace("_notifySearchResults");
+
+ if (typeof(aSearchResults) == 'object') {
+ alert("TODO: Notify the results for this page. Number of results: " + aSearchResults.length);
+ } else {
+ alert("TODO: Notify that this page's results are being loaded");
+ }
+ }
};
window.addEventListener(
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-17 01:29:22 UTC (rev 7)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-20 06:21:41 UTC (rev 8)
@@ -25,6 +25,8 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript"
+ src="chrome://takeaction/content/taPageListener.js" />
+ <script type="application/x-javascript"
src="chrome://takeaction/content/taBrowserOverlay.js" />
<broadcasterset id="mainBroadcasterSet">
Added: trunk/implementation/src/chrome/content/taPageListener.js
===================================================================
--- trunk/implementation/src/chrome/content/taPageListener.js (rev 0)
+++ trunk/implementation/src/chrome/content/taPageListener.js 2009-03-20 06:21:41 UTC (rev 8)
@@ -0,0 +1,133 @@
+/**
+ * Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+Components.utils.import("resource://takeaction/taCommon.js");
+
+/**
+ * TakeAction chrome namespace.
+ */
+if (typeof(TakeActionChrome) == 'undefined') {
+ var TakeActionChrome = {};
+};
+
+/**
+ * Tab page progress listener.
+ */
+TakeActionChrome.PageListener = {
+
+ /* Logger for this object. */
+ _logger : null,
+
+ /**
+ * Initializes and registers the progress listener.
+ */
+ init : function() {
+ let that = this;
+
+ this._logger = Log4Moz.repository.getLogger("TakeActionChrome.PageListener");
+ this._logger.level = Log4Moz.Level["All"];
+ this._logger.debug("init");
+
+ _onPageShow = function(aEvent) { that.onPageShow(aEvent); };
+
+ window.getBrowser().
+ addEventListener("pageshow", this.onPageShow, false);
+ window.getBrowser().
+ addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATE_ALL);
+ },
+
+ /**
+ * Uninitializes and removes the progress listener.
+ */
+ uninit : function() {
+ this._logger.debug("uninit");
+
+ window.getBrowser().removeEventListener("pageshow", this.onPageShow);
+ window.getBrowser().removeProgressListener(this);
+ },
+
+ /**
+ * Handler for the page show event.
+ * @param aEvent The object holding details of the event.
+ */
+ onPageShow : function(aEvent) {
+ // XXX: there is no logging here for efficiency reasons.
+
+ // Load actions only if the loaded page is the one currently displayed
+ if (content.document == aEvent.target) {
+ TakeActionChrome.BrowserOverlay.loadActionsForCurrentPage();
+ }
+ },
+
+ /**
+ * Called when the location of the window being watched changes.
+ * @param aWebProgress The nsIWebProgress instance that fired the
+ * notification.
+ * @param aRequest The associated nsIRequest. This may be null in some cases.
+ * @param aLocation The URI of the location that is being loaded.
+ */
+ onLocationChange : function(aWebProgress, aRequest, aLocation) {
+ // XXX: there is no logging here for efficiency reasons.
+
+ TakeActionChrome.BrowserOverlay.loadActionsForCurrentPage();
+ },
+
+ /**
+ * Notification indicating the state has changed for one of the requests
+ * associated with webProgress. IGNORED
+ * @param aWebProgress The nsIWebProgress instance that fired the
+ * notification.
+ * @param aRequest The nsIRequest that has changed state.
+ * @param aStateFlags Flags indicating the new state.
+ * @param aStatus: Error status code associated with the state change.
+ */
+ onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {
+ },
+
+ /**
+ * Notification that the progress has changed for one of the requests
+ * associated with webProgress. IGNORED
+ */
+ onProgressChange : function (aWebProgress, aRequest, aCurSelfProgress,
+ aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {
+ },
+
+ /**
+ * Notification called for security progress. IGNORED
+ */
+ onSecurityChange : function(aWebProgress, aRequest, aState) {
+ },
+
+ /**
+ * Notification that the status of a request has changed. IGNORED
+ */
+ onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {
+ },
+
+ QueryInterface : function(aIID){
+ if (aIID.equals(Ci.nsIWebProgressListener) ||
+ aIID.equals(Ci.nsISupportsWeakReference) ||
+ aIID.equals(Ci.nsISupports)) {
+ return this;
+ }
+ throw Cr.NS_NOINTERFACE;
+ }
+};
+
+window.addEventListener("load",
+ function() { TakeActionChrome.PageListener.init(); }, false);
+window.addEventListener("unload",
+ function() { TakeActionChrome.PageListener.uninit(); }, false);
Modified: trunk/implementation/src/resources/taEntities.js
===================================================================
--- trunk/implementation/src/resources/taEntities.js 2009-03-17 01:29:22 UTC (rev 7)
+++ trunk/implementation/src/resources/taEntities.js 2009-03-20 06:21:41 UTC (rev 8)
@@ -125,7 +125,7 @@
let parameters = [];
if (this.query)
- parameters.push("q=" + this.query);
+ parameters.push("q=" + encodeURIComponent(this.query));
if (this.actionTypes.length > 0)
parameters.push("action_types=" + this.actionTypes.toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2009-03-17 01:29:26
|
Revision: 7
http://take-action.svn.sourceforge.net/take-action/?rev=7&view=rev
Author: jorgevillalobos
Date: 2009-03-17 01:29:22 +0000 (Tue, 17 Mar 2009)
Log Message:
-----------
Added simple tabs to the sidebar. There's still lots of CSS to be applied there, probably hiding the labels and using icons and nicer styles...
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taBrowserOverlay.xul
trunk/implementation/src/chrome/content/taSidebar.xul
trunk/implementation/src/chrome/skin/taSidebar.css
Added Paths:
-----------
trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd
Modified: trunk/implementation/src/chrome/content/taBrowserOverlay.xul
===================================================================
--- trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-17 01:11:26 UTC (rev 6)
+++ trunk/implementation/src/chrome/content/taBrowserOverlay.xul 2009-03-17 01:29:22 UTC (rev 7)
@@ -27,7 +27,7 @@
<script type="application/x-javascript"
src="chrome://takeaction/content/taBrowserOverlay.js" />
- <broadcasterset id="mainBroadcasterSet">
+ <broadcasterset id="mainBroadcasterSet">
<broadcaster
id="takeaction-broadcaster-view-sidebar"
autoCheck="false"
@@ -36,12 +36,12 @@
group="sidebar"
sidebarurl="chrome://takeaction/content/taSidebar.xul"
oncommand="toggleSidebar('takeaction-broadcaster-view-sidebar');" />
- </broadcasterset>
+ </broadcasterset>
- <menupopup id="viewSidebarMenu">
+ <menupopup id="viewSidebarMenu">
<menuitem
id="takeaction-menu-view-sidebar"
observes="takeaction-broadcaster-view-sidebar" />
- </menupopup>
+ </menupopup>
</overlay>
Modified: trunk/implementation/src/chrome/content/taSidebar.xul
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-17 01:11:26 UTC (rev 6)
+++ trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-17 01:29:22 UTC (rev 7)
@@ -17,15 +17,36 @@
-->
<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
-<?xml-stylesheet type="text/css" href="chrome://takeaction/skin/taSidebar.css" ?>
-<?xml-stylesheet type="text/css" href="chrome://takeaction/content/bindings.css" ?>
+<?xml-stylesheet type="text/css"
+ href="chrome://takeaction/skin/taSidebar.css" ?>
+<?xml-stylesheet type="text/css"
+ href="chrome://takeaction/content/bindings.css" ?>
-<window id="takeaction-sidebar"
+<!DOCTYPE page SYSTEM "chrome://takeaction/locale/taSidebar.dtd" >
+
+<page id="takeaction-sidebar"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript"
src="chrome://takeaction/content/taSidebar.js" />
- <vbox id="takeaction-sidebar-results-box" flex="1"/>
-
-</window>
+ <tabbox id="takeaction-tabbox">
+ <tabs>
+ <tab label="&takeaction.onThisPage.label;"
+ accesskey="&takeaction.onThisPage.accesskey;" selected="true" />
+ <tab label="&takeaction.recent.label;"
+ accesskey="&takeaction.recent.accesskey;" />
+ <tab label="&takeaction.search.label;"
+ accesskey="&takeaction.search.accesskey;" />
+ </tabs>
+ <tabpanels>
+ <tabpanel>
+ <vbox id="takeaction-sidebar-results-box" flex="1"/>
+ </tabpanel>
+ <tabpanel>
+ </tabpanel>
+ <tabpanel>
+ </tabpanel>
+ </tabpanels>
+ </tabbox>
+</page>
Added: trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd
===================================================================
--- trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd (rev 0)
+++ trunk/implementation/src/chrome/locale/en-US/taSidebar.dtd 2009-03-17 01:29:22 UTC (rev 7)
@@ -0,0 +1,24 @@
+<!--
+ - Copyright 2009 Jose Enrique Bolanos, Jorge Villalobos
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+<!ENTITY takeaction.onThisPage.label "This Page">
+<!ENTITY takeaction.onThisPage.accesskey "P">
+
+<!ENTITY takeaction.search.label "Search">
+<!ENTITY takeaction.search.accesskey "S">
+
+<!ENTITY takeaction.recent.label "Recent">
+<!ENTITY takeaction.recent.accesskey "R">
Modified: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-17 01:11:26 UTC (rev 6)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-17 01:29:22 UTC (rev 7)
@@ -18,3 +18,9 @@
background: #ccc;
overflow: auto;
}
+
+#takeaction-tabbox,
+#takeaction-tabbox > tabpanels,
+#takeaction-tabbox > tabpanels > tabpanel {
+ -moz-box-flex: 1;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-15 23:22:58
|
Revision: 5
http://take-action.svn.sourceforge.net/take-action/?rev=5&view=rev
Author: jenrique7
Date: 2009-03-15 23:22:48 +0000 (Sun, 15 Mar 2009)
Log Message:
-----------
Added a binding to display search results. We need to limit the width of the box and crop the title and description.
Modified Paths:
--------------
trunk/implementation/src/chrome/Makefile.in
trunk/implementation/src/chrome/content/bindings.css
trunk/implementation/src/chrome/content/taSidebar.js
trunk/implementation/src/chrome/content/taSidebar.xul
trunk/implementation/src/resources/taEntities.js
Added Paths:
-----------
trunk/implementation/src/chrome/content/taSearchResultBox.xml
trunk/implementation/src/chrome/skin/taSearchResultBox.css
trunk/implementation/src/chrome/skin/taSidebar.css
Modified: trunk/implementation/src/chrome/Makefile.in
===================================================================
--- trunk/implementation/src/chrome/Makefile.in 2009-03-10 05:15:44 UTC (rev 4)
+++ trunk/implementation/src/chrome/Makefile.in 2009-03-15 23:22:48 UTC (rev 5)
@@ -41,6 +41,8 @@
$(wildcard $(jar_source_root)/content/*.xul) \
$(wildcard $(jar_source_root)/content/*.xml) \
$(wildcard $(jar_source_root)/content/*.css) \
+ $(wildcard $(jar_source_root)/skin/*.css) \
+ $(wildcard $(jar_source_root)/skin/*.png) \
$(wildcard $(jar_source_root)/skin/*/*.css) \
$(wildcard $(jar_source_root)/skin/*/*.png) \
$(wildcard $(jar_source_root)/locale/*/*.dtd) \
Modified: trunk/implementation/src/chrome/content/bindings.css
===================================================================
--- trunk/implementation/src/chrome/content/bindings.css 2009-03-10 05:15:44 UTC (rev 4)
+++ trunk/implementation/src/chrome/content/bindings.css 2009-03-15 23:22:48 UTC (rev 5)
@@ -27,6 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
-/*taactionbox {
- -moz-binding: url("chrome://takeaction/content/taActionBox.xml#takeaction-action-box");
-}*/
+tasearchresultbox {
+ -moz-binding: url("chrome://takeaction/content/taSearchResultBox.xml#takeaction-search-result-box");
+}
Added: trunk/implementation/src/chrome/content/taSearchResultBox.xml
===================================================================
--- trunk/implementation/src/chrome/content/taSearchResultBox.xml (rev 0)
+++ trunk/implementation/src/chrome/content/taSearchResultBox.xml 2009-03-15 23:22:48 UTC (rev 5)
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+
+<!--
+ - Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+ - All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions are met:
+ -
+ - * Redistributions of source code must retain the above copyright notice,
+ - this list of conditions and the following disclaimer.
+ - * 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.
+ - * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names
+ - of its contributors may be used to endorse or promote products derived
+ - from this software without specific prior written permission.
+ -
+ - 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.
+ -->
+<!--
+<!DOCTYPE binding [
+ <!ENTITY % fmTrackInfoDTD SYSTEM
+ "chrome://firefm/locale/fmTrackInfo.dtd" >
+ %fmTrackInfoDTD;
+]>
+-->
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- Search result box -->
+ <binding id="takeaction-search-result-box">
+ <resources>
+ <stylesheet src="chrome://takeaction/skin/taSearchResultBox.css" />
+ </resources>
+
+ <content>
+ <xul:vbox class="outerbox">
+ <xul:hbox>
+ <xul:label class="title" xbl:inherits="value=title" crop="end"/>
+ </xul:hbox>
+ <xul:hbox>
+ <xul:label class="description" xbl:inherits="value=description" crop="end"/>
+ </xul:hbox>
+ <xul:hbox>
+ <xul:label class="url" xbl:inherits="value=url"/>
+ </xul:hbox>
+ </xul:vbox>
+ </content>
+
+ <implementation>
+ <!-- Logger for this object -->
+ <field name="_logger" />
+ <!-- Search result object displayed by this binding -->
+ <field name="_searchResult">null</field>
+
+ <constructor><![CDATA[
+ this._logger = Log4Moz.repository.getLogger("TakeAction.SearchResultBox");
+ this._logger.level = Log4Moz.Level["All"];
+ this._logger.debug("init");
+
+ ]]>
+ </constructor>
+
+ <property name="searchResult">
+ <getter><![CDATA[
+ return this._searchResult;
+ ]]>
+ </getter>
+ <setter><![CDATA[
+ this._searchResult = val;
+
+ this.setAttribute("title",
+ this._stripHtmlTags(this._searchResult.title));
+ this.setAttribute("description",
+ this._stripHtmlTags(this._searchResult.description));
+ this.setAttribute("url", this._searchResult.url);
+ ]]>
+ </setter>
+ </property>
+
+ <method name="_stripHtmlTags">
+ <parameter name="aString"/>
+ <body><![CDATA[
+ try {
+ let div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+ div.innerHTML = aString;
+ return div.textContent;
+ } catch (ex) {
+ return aString;
+ }
+ ]]>
+ </body>
+ </method>
+
+ </implementation>
+ </binding>
+
+</bindings>
Modified: trunk/implementation/src/chrome/content/taSidebar.js
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.js 2009-03-10 05:15:44 UTC (rev 4)
+++ trunk/implementation/src/chrome/content/taSidebar.js 2009-03-15 23:22:48 UTC (rev 5)
@@ -84,13 +84,15 @@
_searchLoad : function(aSearchResults) {
this._logger.trace("_searchLoad");
- // TODO: Test code
- let str = "Results: " + aSearchResults.length + "\r\n\r\n";
+ let container = document.getElementById("takeaction-sidebar-results-box");
+ let searchResultBox = null;
+
for (let i = 0; i < aSearchResults.length; i++) {
- str += aSearchResults[i].title + "\r\n";
+ searchResultBox = document.createElement("tasearchresultbox");
+ container.appendChild(searchResultBox);
+
+ searchResultBox.searchResult = aSearchResults[i];
}
-
- document.getElementById('takeaction-textbox-response').value = str;
}
};
Modified: trunk/implementation/src/chrome/content/taSidebar.xul
===================================================================
--- trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-10 05:15:44 UTC (rev 4)
+++ trunk/implementation/src/chrome/content/taSidebar.xul 2009-03-15 23:22:48 UTC (rev 5)
@@ -30,6 +30,8 @@
-->
<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
+<?xml-stylesheet type="text/css" href="chrome://takeaction/skin/taSidebar.css" ?>
+<?xml-stylesheet type="text/css" href="chrome://takeaction/content/bindings.css" ?>
<window id="takeaction-sidebar"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -37,6 +39,6 @@
<script type="application/x-javascript"
src="chrome://takeaction/content/taSidebar.js" />
- <textbox flex="1" multiline="true" readonly="true" id="takeaction-textbox-response"/>
+ <vbox id="takeaction-sidebar-results-box" flex="1"/>
</window>
Added: trunk/implementation/src/chrome/skin/taSearchResultBox.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSearchResultBox.css (rev 0)
+++ trunk/implementation/src/chrome/skin/taSearchResultBox.css 2009-03-15 23:22:48 UTC (rev 5)
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names
+ * of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 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.
+ **/
+
+.outerbox {
+ border-bottom: thin dotted #ccc;
+ padding: 2px;
+ background: #fff;
+}
+
+.outerbox:hover {
+ background: #f0f0f0;
+}
+
+.title {
+ font-size: 1.1em;
+ font-weight: bold;
+}
+
+.description {
+ font-size: 0.9em;
+}
+
+.url {
+ font-size: 0.9em;
+ color: #008000;
+}
Added: trunk/implementation/src/chrome/skin/taSidebar.css
===================================================================
--- trunk/implementation/src/chrome/skin/taSidebar.css (rev 0)
+++ trunk/implementation/src/chrome/skin/taSidebar.css 2009-03-15 23:22:48 UTC (rev 5)
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2008, Jose Enrique Bolanos, Jorge Villalobos
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Jose Enrique Bolanos, Jorge Villalobos nor the names
+ * of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 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.
+ **/
+
+#takeaction-sidebar-results-box {
+ background: #ccc;
+ overflow: auto;
+}
Modified: trunk/implementation/src/resources/taEntities.js
===================================================================
--- trunk/implementation/src/resources/taEntities.js 2009-03-10 05:15:44 UTC (rev 4)
+++ trunk/implementation/src/resources/taEntities.js 2009-03-15 23:22:48 UTC (rev 5)
@@ -174,11 +174,11 @@
* Actions API.
*/
TakeAction.SearchResult = function(
- aTitle, aDescription, aSite, aURL, aActionType, aLocation, aCreationDate) {
+ aTitle, aDescription, aSite, aUrl, aActionType, aLocation, aCreationDate) {
this.title = aTitle;
this.description = aDescription;
this.site = aSite;
- this.URL = aURL;
+ this.url = aUrl;
this.actionType = aActionType;
this.location = aLocation;
this.creationDate = aCreationDate;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2009-03-10 05:15:59
|
Revision: 4
http://take-action.svn.sourceforge.net/take-action/?rev=4&view=rev
Author: jenrique7
Date: 2009-03-10 05:15:44 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
Added a couple of entities for search results and queries.
Modified the API object to use these entity methods.
Added constants and logic to handle the API rules.
Modified Paths:
--------------
trunk/implementation/src/chrome/content/taSidebar.js
trunk/implementation/src/resources/taAPI.js
Added Paths:
-----------
trunk/implementation/src/resources/taEntities.js
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Jose E. <jen...@gm...> - 2009-03-10 02:52:26
|
prueba -- Jose Enrique |