commit
b7a6330507
9 changed files with 128 additions and 0 deletions
@ -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. |
@ -0,0 +1,4 @@
|
||||
include AUTHORS |
||||
include LICENSE |
||||
include README.md |
||||
recursive-include ckeditor_extensions/static * |
@ -0,0 +1,7 @@
|
||||
# django-ckeditor-extensions |
||||
|
||||
## Usage |
||||
|
||||
CKEDITOR.replace('editor', { |
||||
extraPlugins: 'soft-hyphen-shortcut-key' |
||||
}); |
After Width: | Height: | Size: 181 B |
@ -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 = '­'; |
||||
|
||||
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' |
||||
); |
||||
} |
||||
}); |
@ -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…
Reference in new issue