Skip to content

Commit

Permalink
Add examples for chapter 12
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Jun 25, 2024
1 parent 000d01a commit 56bec8b
Show file tree
Hide file tree
Showing 405 changed files with 50,688 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ flask run # 或 pdm run flask run
- 第 4 章:`ch4`
- 第 5 章:`ch5``notebook`
- 第 7 章:`longtalk``album`
- 第 12 章:`assets``cache`

*在书中相应位置会包含运行示例程序的提示。*
1 change: 1 addition & 0 deletions examples/assets/.flaskenv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FLASK_DEBUG=1
44 changes: 44 additions & 0 deletions examples/assets/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from flask import Flask, render_template
from flask_assets import Environment, Bundle
from flask_ckeditor import CKEditor


app = Flask(__name__)
app.secret_key = 'dev key'

assets = Environment(app)
ckeditor = CKEditor(app)

css = Bundle('css/bootstrap.min.css',
'css/bootstrap.css',
'css/dropzone.min.css',
'css/jquery.Jcrop.min.css',
'css/style.css',
filters='cssmin', output='gen/packed.css')

js = Bundle('js/jquery.min.js',
'js/popper.min.js',
'js/bootstrap.min.js',
'js/bootstrap.js',
'js/moment-with-locales.min.js',
'js/dropzone.min.js',
'js/jquery.Jcrop.min.js',
filters='jsmin', output='gen/packed.js')

assets.register('js_all', js)
assets.register('css_all', css)


@app.route('/')
def index():
return render_template('index.html')


@app.route('/foo')
def unoptimized():
return render_template('unoptimized.html')


@app.route('/bar')
def optimized():
return render_template('optimized.html')
1,469 changes: 1,469 additions & 0 deletions examples/assets/static/ckeditor/CHANGES.md

Large diffs are not rendered by default.

1,420 changes: 1,420 additions & 0 deletions examples/assets/static/ckeditor/LICENSE.md

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions examples/assets/static/ckeditor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CKEditor 4
==========

Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
http://ckeditor.com - See LICENSE.md for license information.

CKEditor is a text editor to be used inside web pages. It's not a replacement
for desktop text editors like Word or OpenOffice, but a component to be used as
part of web applications and websites.

## Documentation

The full editor documentation is available online at the following address:
http://docs.ckeditor.com

## Installation

Installing CKEditor is an easy task. Just follow these simple steps:

1. **Download** the latest version from the CKEditor website:
http://ckeditor.com. You should have already completed this step, but be
sure you have the very latest version.
2. **Extract** (decompress) the downloaded file into the root of your website.

**Note:** CKEditor is by default installed in the `ckeditor` folder. You can
place the files in whichever you want though.

## Checking Your Installation

The editor comes with a few sample pages that can be used to verify that
installation proceeded properly. Take a look at the `samples` directory.

To test your installation, just call the following page at your website:

http://<your site>/<CKEditor installation path>/samples/index.html

For example:

http://www.example.com/ckeditor/samples/index.html
10 changes: 10 additions & 0 deletions examples/assets/static/ckeditor/adapters/jquery.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions examples/assets/static/ckeditor/build-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/

/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time to build CKEditor again.
*
* If you would like to build CKEditor online again
* (for example to upgrade), visit one the following links:
*
* (1) http://ckeditor.com/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) http://ckeditor.com/builder/65b7556a252134a633858afb266aefb6
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) http://ckeditor.com/builder/download/65b7556a252134a633858afb266aefb6
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/

var CKBUILDER_CONFIG = {
skin: 'moono-lisa',
preset: 'standard',
ignore: [
'.DS_Store',
'.bender',
'.editorconfig',
'.gitattributes',
'.gitignore',
'.idea',
'.jscsrc',
'.jshintignore',
'.jshintrc',
'.mailmap',
'.travis.yml',
'bender-err.log',
'bender-out.log',
'bender.ci.js',
'bender.js',
'dev',
'gruntfile.js',
'less',
'node_modules',
'package.json',
'tests'
],
plugins : {
'a11yhelp' : 1,
'about' : 1,
'basicstyles' : 1,
'blockquote' : 1,
'codesnippet' : 1,
'contextmenu' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'filebrowser' : 1,
'floatingspace' : 1,
'format' : 1,
'horizontalrule' : 1,
'htmlwriter' : 1,
'image' : 1,
'indentlist' : 1,
'link' : 1,
'list' : 1,
'magicline' : 1,
'markdown' : 1,
'maximize' : 1,
'pastefromword' : 1,
'pastetext' : 1,
'removeformat' : 1,
'resize' : 1,
'scayt' : 1,
'showborders' : 1,
'sourcearea' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
'table' : 1,
'tableselection' : 1,
'tabletools' : 1,
'toolbar' : 1,
'undo' : 1,
'uploadimage' : 1,
'wsc' : 1,
'wysiwygarea' : 1
},
languages : {
'de' : 1,
'en' : 1,
'es' : 1,
'fr' : 1,
'ja' : 1,
'ko' : 1,
'zh' : 1,
'zh-cn' : 1
}
};
Loading

0 comments on commit 56bec8b

Please sign in to comment.