Skip to main content

ftw.candlestick

Project description

Introduction

The name candlestick comes from the times when the telephone had just been invented. One of the first models of a telephone was a stick which was placed on a table where the speaker could talk into it.

docs/candlestick.jpg

This module provides a javascript library to automatically generate phone links. A treeWalker walks through the whole DOM and collects all textNodes. If a node matches a phone number the number will be replaced with a <a href="tel:phonenumber">Your phonenumber</a> link. Existing links or input fields are not affected.

By default the candlestick.integration.js is loaded which converts all phone numbers in the body.

Compatibility

Plone 4.3.x Plone 5.1.x

Installation

  • Add the package to your buildout configuration:

[instance]
eggs +=
    ...
    ftw.candlestick

Development

Python:

  1. Fork this repo

  2. Clone your fork

  3. Shell: ln -s development.cfg buidlout.cfg

  4. Shell: python boostrap.py

  5. Shell: bin/buildout

Or start an instance by running bin/instance fg.

Client library

Getting Started

The client library depends on Grunt. Assuming you already have Node.js installed on your system, run the following command:

sudo npm install -g grunt

To install the dependencies, run the following command:

npm install

And with npm you get the following packages:

  • Grunt - JavaScript task runner.

  • Babel - ES6 Transpiler.

  • Browserify - Dependency Bundler

  • Karma - JavaScript test runner.

  • Jasmine - JavaScript test suite.

  • Chai - JavaScript Assertion Library.

Usage

Run the following command to re-build the library:

grunt build

Run the following command to watch for changes which trigger a rebuild:

grunt

Build options

See https://github.com/substack/browserify-handbook for more information about browserify.

Source Maps

Browserify comes with a built-in support to generate source maps. It is already enabled by default, but feel free to disable source maps. Refer to this article to enable source maps in Google Chrome, if you haven’t already done so.

Tests

Run all tests

grunt test

Run a specific test

grunt test --grep="Name of your test"

Initialization

Converts all phone numbers to links

window.candlestick();

Changelog

1.1.1 (2019-09-23)

  • Add profile (and uninstall profile) for Plone 5. [djowett-ftw]

  • Update README.rst to improve English and note Plone5.1 compatibility. [djowett-ftw]

1.1.0 (2019-09-04)

  • Test against Plone 5.1.x. [mbaechtold]

  • Add HISTORY.txt to long description. [busykoala]

1.0.5 (2018-01-11)

  • Compile javascript sources. [Kevin Bieri]

1.0.4 (2017-12-13)

  • IBAN number are no longer recognized as phone numbers. [Kevin Bieri]

1.0.3 (2017-03-23)

  • Fix parson of phonenumbers.

    • No longer allow too short phonenumbers

    • Allow phone numbers with varying spaces around number groups

    [Kevin Bieri]

  • Move phonenumbers samples to testing section. [Kevin Bieri]

  • Fix readme. [Kevin Bieri]

1.0.2 (2017-03-10)

  • Fix parse and replace issues.

    • Parentheses should not be included in the phone links.

    • Trailing text should not be ignored.

    [Kevin Bieri]

1.0.1 (2017-01-13)

  • Fix error in treeWalker on Internet Explorer >= 9. [Kevin Bieri]

1.0.0 (2016-11-30)

  • Initial implementation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftw.candlestick-1.1.1.tar.gz (158.0 kB view details)

Uploaded Source

File details

Details for the file ftw.candlestick-1.1.1.tar.gz.

File metadata

  • Download URL: ftw.candlestick-1.1.1.tar.gz
  • Upload date:
  • Size: 158.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.16

File hashes

Hashes for ftw.candlestick-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6cea2effb171d0634a2571a7cdfd7b816134e645c23cc70cfb89df54e3f98785
MD5 d83a5c46a3cf623361952644a46a91d5
BLAKE2b-256 695fd16cbb15434255634afb52ea3728b039007ea9831a0da2f070f08841a5c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page