Giter Club home page Giter Club logo

cc-license-chooser's Introduction

cc-license-chooser

This is the Creative Commons JavaScript license selector in the form of a JavaScript widget.

Web browsers can only be expected to load a single file from us.

Code of conduct

CODE_OF_CONDUCT.md:

The Creative Commons team is committed to fostering a welcoming community. This project and all other Creative Commons open source projects are governed by our Code of Conduct. Please report unacceptable behavior to [email protected] per our reporting guidelines.

Contributing

See CONTRIBUTING.md.

Updates

This is an updated version of the JavaScript license chooser.

  • It only shows 4.0 licenses
  • It can show CC0 as well
  • Only in en_US right now

If you're already using the code, you might find this hosted version useful:

Overview

The code is structured as follows:

  • An HTML page includes complete.js, which PHP renders
    • they can pass a variable on the query string to set the language, which is why we involve PHP
    • an alternate design would be to include different static files: complete.en.js, etc.
  • complete.js loads the CSS and static JS files that hardly change
  • complete.js loads template.js.var (for Apache Content Negotiation to pick a language) or template.js.LANG_ID if a language was specified

All of our JS and HTML and CSS is prefixed with cc_js_ to avoid namespace collisions with others' applications.

Every night, if you run make -s here, it'll update the translations and jurisdiction info.

Local Development

To run this project locally, install Python requirements listed in requirements.txt using: pip install -r requirements.txt.

SimpleTAL is not available on PyPI and must be installed manually by downloading the latest release and installing it using python setup.py install (make sure to download the Python 2.7 compatible release, not the latest release). Using a virtualenv is recommended, if you don't install SimpleTAL in a virtualenv, you may have to add its install location to your environment's PYTHONPATH.

Renamed

This project was previously named LicenseChooser.js. The name was updated to cc-license-chooser in 2019 March to follow current JavaScript best practices.

Old Version

The old version of the JavaScript license chooser:

Credits

I’m not familiar with the all license options, so I don’t even bother. Everything on posted this site is public domain (http://www.phpied.com/html2dom/)

cc-license-chooser's People

Contributors

aayushdutt avatar betapundit avatar brenoferreira avatar brylie avatar dependabot[bot] avatar kgodey avatar mattl avatar possumbilities avatar sp35 avatar syeda-mal avatar tim-kilian avatar timidrobot avatar zackkrida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc-license-chooser's Issues

Introduce node js with bundler and transpiler

feature request
I would like to have a library that I can install via common package manager like npm or yarn. That could generate and bundle the resulting js with a wide range browser compatibility.

Describe the solution you'd like
First step to get rid of the php and the python bundlers could be to introduce node with webpack and babel for example.

Describe alternatives you've considered
I would also suggest to build a vue component and create a widget with the vue-custom-element package.

Example Web App needs update

Issues:

  1. The example app is having many examples but there is no way to transition easily from one example to another.
  2. Instead of using window alerts, a better method of displaying information would be to display it inline.
  3. The website style and text is not very appealing. A better look can make it way more usable.
  4. Code structure and formatting need to be fixed.

image

Improve HTML+RDFa template

Improvements include:

  • structured parable and machine-readable RDFa data (instead of a series of disjointed data fragments) [test by pasting template here]
  • clarifies what object is described/licensed (the URL in the about attribute on the root element)
  • make better use of Dublin Core properties
  • better accessibility, license name set as img[alt] (compression will reduce the long repeated string to virtually nothing)
  • the badge image is kept outside the root span element to prevent simplistic implementations from wrongly assuming the license applies to it rather than the resource in the about attribute.
  • HTTPS by default (pages load faster as it avoids the redirect and people aren’t exposed to an unencrypted connection)

Suggested updated template (pretty printed here for discussion):

<a href="http://creativecommons.org/licenses/by/4.0/"><img
   alt="Creative Commons Attribution 4.0 International License"
    style="border-width:0"
   src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /></a>
<br/>
<span about="https://www.example.com/image.jpeg"
      datatype="dct:Image"
      prefix="cc: http://creativecommons.org/ns# dc: http://purl.org/dc/terms/# dct: http://purl.org/dc/dcmitype/#">
  <span property="dc:RightsStatement">
    <span property="dc:title">Example Document</span>
     by
     <a href="https://www.example.com/about"
        property="cc:attributionName cc:attributionURL dc:rightsHolder">John Human</a>
      is licensed under a
      <a rel="license"
         property="dc:license"
         href="https://creativecommons.org/licenses/by/4.0/">Creative Commons
           Attribution 4.0 International License</a>.
  </span>
</spam>

Current template for reference:

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
<img alt="Creative Commons License" style="border-width:0"
     src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /></a>
<br />
<span xmlns:dct="http://purl.org/dc/terms/"
      href="http://purl.org/dc/dcmitype/Image"
      property="dct:title"
      rel="dct:type">Example Document</span>
by
<a xmlns:cc="http://creativecommons.org/ns#"
   href="https://www.example.com/about"
   property="cc:attributionName"
   rel="cc:attributionURL">John Human</a>
is licensed under a
<a rel="license"
   href="http://creativecommons.org/licenses/by/4.0/">Creative Commons
     Attribution 4.0 International License</a>.

Widget no longer displays

"Dear colleagues,

does somebody of you have the Creative Commons License Chooser plugin (https://wiki.creativecommons.org/wiki/LicenseChooser.js) implemented at some part of your websites/services? If so, is the plugin still working as intended? Just wondering because it is not displayed in our backend any more despite the code of the particular part where we are using it not having been changed for years...

Best,
Stefan, Archives Portal Europe"

It seems like the legacy CC API is up and running, so we will have to do some investigation to figure out why the widget is no longer working.

So far, this is the only copy of it out in the wild that I can find.

8

Description

Reproduction

  1. See error.

Expectation

Screenshots

Environment

  • Device: (eg. iPhone Xs; laptop)
  • OS: (eg. iOS 13.5; Fedora 32)
  • Browser: (eg. Safari; Firefox)
  • Version: (eg. 13; 73)
  • Other info: (eg. display resolution, ease-of-access settings)

Additional context

Resolution

  • I would be interested in resolving this bug.

Moderninze Python files style/syntax

Update Python files for more modern style/syntax:

Please only modify files that:

  1. you can run successfully before modifying
  2. you can run successfully after modifying

Rename project to cc-license-chooser from LicenseChooser.js

Feature request*
The common naming for javascript related projects is the kebab case and I think its a good idea to go with the convention.

Describe the solution you'd like
Rename the project to cc-license-chooser-js or cc-license-chooser.

Additional context
Could be also great for future distributing on package managers.

Variables referenced before assignment in msgfmt.py

Describe the bug
When working on #14 , I found that the variables msgid, and msgstr are undefined on lines 122, and 134 in license_xsl/i18n/msgfmt.py. I am not sure what exactly these variables are meant to reference, but I've been all through the file and can't find where they might come from...

To Reproduce
Steps to reproduce the behavior:

  1. Go to the root dir of this repo
  2. $ flake8 license_xsl/i18n/msgfmt.py
  3. See error(s)

Or, use any other linter.

Expected behavior
The variable(s) referenced should be defined in the scope they are used

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.2 LTS
  • flake8 Version: 3.7.7
  • CPython 2.7.15rc1

[Bug] Full-Text Omission, Logo Issues

Sorry for brevity, I have a deadline but have been looking for a place to report these bugs.

  • The Icons don't work on Chrome or Safari with MacOS. Every icon is for CC-BY for Rich Text regardless of license options. Only exception I found so far is CC 0.
  • The full-text licenses for Rich Text and Print Work and Media do not include the words "Creative Commons" in the license. This is arguably permissible for the license terms but poor practice for CC understanding and brand visibility.

master

Description

Reproduction

  1. See error.

Expectation

Screenshots

Environment

  • Device: (eg. iPhone Xs; laptop)
  • OS: (eg. iOS 13.5; Fedora 32)
  • Browser: (eg. Safari; Firefox)
  • Version: (eg. 13; 73)
  • Other info: (eg. display resolution, ease-of-access settings)

Additional context

Resolution

  • I would be interested in resolving this bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.