[cc-commits] [SCM] GSoC 2010 Firefox Extension project (branch master) updated. 3fea0f321d5d54b2fedea7ae8b8cb3f2bb497d0f
git version control
git at a7.creativecommons.org
Thu Jul 15 06:13:46 EDT 2010
The branch, master has been updated
via 3fea0f321d5d54b2fedea7ae8b8cb3f2bb497d0f (commit)
from 155b816be927b54d0cff8d37a4877129bf1c1066 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3fea0f321d5d54b2fedea7ae8b8cb3f2bb497d0f
Author: Igor Lukanin <mail at igor.lukanin.name>
Date: Thu Jul 15 16:13:39 2010 +0600
The "Page Info" dialog update: the prohibitions of the license are displayed using CC API
-----------------------------------------------------------------------
Summary of changes (followed by patch):
content/pageInfo.xul | 23 ++++++++++++++++++++---
doc/FUNCSPEC | 3 ++-
locale/en-US/locale.properties | 6 ++++++
locale/ru-RU/locale.properties | 6 ++++++
module/ccffext.js | 12 ++++++++++--
5 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/content/pageInfo.xul b/content/pageInfo.xul
index e41d056..54a7f1e 100644
--- a/content/pageInfo.xul
+++ b/content/pageInfo.xul
@@ -77,7 +77,7 @@
var convertStrings = function(strings,part)
{
var converted = [];
-
+
for (let i = 0; i < strings.length; ++i)
{
let name = strings[i].toLowerCase().replace(/[^a-z]/g,"");
@@ -150,7 +150,7 @@
const licensePermTitle = document.createElement("label");
licensePermTitle.setAttribute("class","line-title");
licensePermTitle.setAttribute("value",
- ccffext.l10n.get("object.license.permissions.title.label"));
+ ccffext.l10n.get("object.license.permissions.title.label"));
licensePermLine.appendChild(licensePermTitle);
const licensePermValue = document.createElement("label");
@@ -164,12 +164,29 @@
const licenseReqTitle = document.createElement("label");
licenseReqTitle.setAttribute("class","line-title");
licenseReqTitle.setAttribute("value",
- ccffext.l10n.get("object.license.requirements.title.label"));
+ ccffext.l10n.get("object.license.requirements.title.label"));
licenseReqLine.appendChild(licenseReqTitle);
const licenseReqValue = document.createElement("label");
licenseReqValue.setAttribute("value",convertStrings(license.requirements,"requirements"));
licenseReqLine.appendChild(licenseReqValue);
+
+ if (0 < license.prohibitions.length)
+ {
+ const licenseProhLine = document.createElement("hbox");
+ licenseProhLine.setAttribute("class","line");
+ topLine.appendChild(licenseProhLine);
+
+ const licenseProhTitle = document.createElement("label");
+ licenseProhTitle.setAttribute("class","line-title");
+ licenseProhTitle.setAttribute("value",
+ ccffext.l10n.get("object.license.prohibitions.title.label"));
+ licenseProhLine.appendChild(licenseProhTitle);
+
+ const licenseProhValue = document.createElement("label");
+ licenseProhValue.setAttribute("value",convertStrings(license.prohibitions,"prohibitions"));
+ licenseProhLine.appendChild(licenseProhValue);
+ }
}
// Eventually switch to the tab
diff --git a/doc/FUNCSPEC b/doc/FUNCSPEC
index 6b3d334..889595c 100644
--- a/doc/FUNCSPEC
+++ b/doc/FUNCSPEC
@@ -26,7 +26,7 @@ Any software is made to provide ways to solve a specific problem of its end user
+ The name of the license
- Standard СС icon(s)
+ Hyperlink to the extended information about the license
- ± The summary of permissions, requirements and prohibitions
+ + The summary of permissions, requirements and prohibitions
- The way to obtain the attribution information (a context menu-enabled button)
- Licensed objects` highlighting
@@ -50,6 +50,7 @@ The extension may use information defined by:
+ SourceCode
+ Copyleft
+ LesserCopyleft
+ + CommercialUse
- http://purl.org/dc/elements/1.1/#
- http://xmlns.com/foaf/0.1/#
diff --git a/locale/en-US/locale.properties b/locale/en-US/locale.properties
index 1f707d1..7c2b425 100644
--- a/locale/en-US/locale.properties
+++ b/locale/en-US/locale.properties
@@ -69,6 +69,12 @@ object.license.requirements.copyleft.label=copyleft
# The Lesser Copyleft requirement of the license for the object
object.license.requirements.lessercopyleft.label=lesser copyleft
+# The prohibitions of the license for the object
+object.license.prohibitions.title.label=Prohibitions:
+
+# The Commercial Use prohibition of the license for the object
+object.license.prohibitions.commercialuse.label=commercial use
+
# The location bar icon
diff --git a/locale/ru-RU/locale.properties b/locale/ru-RU/locale.properties
index ba87c3e..34eceb2 100644
--- a/locale/ru-RU/locale.properties
+++ b/locale/ru-RU/locale.properties
@@ -71,6 +71,12 @@ object.license.requirements.copyleft.label=copyleft
# TODO
object.license.requirements.lessercopyleft.label=lesser copyleft
+# The prohibitions of the license for the object
+object.license.prohibitions.title.label=ÐапÑеÑаеÑÑÑ:
+
+# The Commercial Use prohibition of the license for the object
+object.license.prohibitions.commercialuse.label=коммеÑÑеÑкое иÑполÑзование
+
# The location bar icon
diff --git a/module/ccffext.js b/module/ccffext.js
index d2b1c64..496831f 100644
--- a/module/ccffext.js
+++ b/module/ccffext.js
@@ -276,7 +276,8 @@ var ccffext =
name : undefined,
uri : undefined,
permissions : [],
- requirements : []
+ requirements : [],
+ prohibitions: []
};
for (let i = 0, pairs = ccffext.objects.getPairs(document,object); i < pairs.length; ++i)
@@ -297,7 +298,7 @@ var ccffext =
xhr.send();
if (4 == xhr.readyState && 200 == xhr.status)
{
- ccffext.log(xhr.responseText);
+// ccffext.log(xhr.responseText);
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Components.interfaces.nsIDOMParser);
@@ -318,6 +319,13 @@ var ccffext =
license.requirements.push(reqs[i].getAttribute("rdf:resource")
.replace("http://creativecommons.org/ns#",""));
}
+
+ let prohs = doc.getElementsByTagName("prohibits");
+ for (let i = 0; i < prohs.length / 2; ++i)
+ {
+ license.prohibitions.push(prohs[i].getAttribute("rdf:resource")
+ .replace("http://creativecommons.org/ns#",""));
+ }
}
}
hooks/post-receive
--
GSoC 2010 Firefox Extension project
More information about the cc-commits
mailing list