Browse Source

Initial import.

master 0.1
Erik Stein 7 years ago
commit
b7a6330507
  1. 2
      CHANGES
  2. 8
      LICENSE
  3. 4
      MANIFEST.in
  4. 7
      README.md
  5. 0
      ckeditor_extensions/__init__.py
  6. 1
      ckeditor_extensions/_version.py
  7. 4
      ckeditor_extensions/static/ckeditor/ckeditor/plugins/soft-hyphen-shortcut/images/button.svg
  8. 27
      ckeditor_extensions/static/ckeditor/ckeditor/plugins/soft-hyphen-shortcut/plugin.js
  9. 75
      setup.py

2
CHANGES

@ -0,0 +1,2 @@
0.1 2018-08-25
- Initial release

8
LICENSE

@ -0,0 +1,8 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

4
MANIFEST.in

@ -0,0 +1,4 @@
include AUTHORS
include LICENSE
include README.md
recursive-include ckeditor_extensions/static *

7
README.md

@ -0,0 +1,7 @@
# django-ckeditor-extensions
## Usage
CKEDITOR.replace('editor', {
extraPlugins: 'soft-hyphen-shortcut-key'
});

0
ckeditor_extensions/__init__.py

1
ckeditor_extensions/_version.py

@ -0,0 +1 @@
__version__ = '0.1'

4
ckeditor_extensions/static/ckeditor/ckeditor/plugins/soft-hyphen-shortcut/images/button.svg

@ -0,0 +1,4 @@
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M19 13H5v-2h14v2z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>

After

Width:  |  Height:  |  Size: 181 B

27
ckeditor_extensions/static/ckeditor/ckeditor/plugins/soft-hyphen-shortcut/plugin.js

@ -0,0 +1,27 @@
// https://stackoverflow.com/questions/34491100/keyboard-shortcut-to-insert-text-soft-hyphen-with-ckeditor
// Add soft-hyphen shortcut
CKEDITOR.plugins.add('soft-hyphen-shortcut', {
init: function (editor) {
var softHyphenUnicodeChar = '\u00AD';
var softHyphenEntity = '&shy;';
editor.addCommand('insertSoftHyphen', {
exec: function (editor, data) {
editor.insertHtml(softHyphenEntity);
}
});
editor.ui.addButton('InsertSoftHyphen', {
label: "Shy",
command: 'insertSoftHyphen',
icon: this.path + 'images/button.svg'
});
// FIXME keystroke value 189, 173?
editor.setKeystroke(
CKEDITOR.CTRL + CKEDITOR.SHIFT + 173, 'insertSoftHyphen'
);
}
});

75
setup.py

@ -0,0 +1,75 @@
#!/usr/bin/env python
from io import open
from setuptools import setup, find_packages
import os
import re
import subprocess
"""
Use `git tag -a -m "Release 1.0.0" 1.0.0` to tag a release; `python setup.py --version`
to update the _version.py file.
"""
def get_version(prefix):
if os.path.exists('.git'):
parts = subprocess.check_output(['git', 'describe', '--tags']).decode().strip().split('-')
if len(parts) == 3:
version = '{}.{}+{}'.format(*parts)
else:
version = parts[0]
version_py = "__version__ = '{}'".format(version)
_version = os.path.join(prefix, '_version.py')
if not os.path.exists(_version) or open(_version).read().strip() != version_py:
with open(_version, 'w') as fd:
fd.write(version_py)
return version
else:
for f in ('_version.py', '__init__.py'):
f = os.path.join(prefix, f)
if os.path.exists(f):
with open(f) as fd:
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fd.read()))
if 'version' in metadata:
break
return metadata['version']
def read(filename):
path = os.path.join(os.path.dirname(__file__), filename)
with open(path, encoding='utf-8') as handle:
return handle.read()
setup(
name='django-ckeditor-extensions',
version=get_version('ckeditor_extensions'),
description='',
long_description=read('README.md'),
author='Erik Stein',
author_email='erik@classlibrary.net',
url='https://projects.c--y.net/erik/django-ckeditor-extensions/',
license='MIT License',
platforms=['OS Independent'],
packages=find_packages(
exclude=['tests', 'testapp'],
),
include_package_data=True,
install_requires=[
# 'django<2', commented out to make `pip install -U` easier
'django-ckeditor',
],
classifiers=[
# "Development Status :: 3 - Alpha",
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities',
],
zip_safe=False,
)
Loading…
Cancel
Save