pull/16/head
gqc 5 months ago
parent 95598efd21
commit 7e278636e6

Binary file not shown.

@ -0,0 +1,5 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (Blog)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="R User Library" level="project" />
<orderEntry type="library" name="R Skeletons" level="application" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

@ -0,0 +1,436 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DDLFileAttachmentManager">
<mappings />
<preferences />
</component>
<component name="DBNavigator.Project.DatabaseAssistantManager">
<assistants />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
<enable-sticky-paths value="true" />
<enable-quick-filters value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="JSON_VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="JAVA_CLASS" enabled="true" />
<object-type name="JAVA_FIELD" enabled="true" />
<object-type name="JAVA_METHOD" enabled="true" />
<object-type name="JAVA_RESOURCE" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
<object-type name="CREDENTIAL" enabled="true" />
<object-type name="AI_PROFILE" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
<object-type name="TYPE ATTRIBUTE" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="JSON VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="JAVA CLASS" enabled="true" />
<object-type name="INNER CLASS" enabled="true" />
<object-type name="JAVA FIELD" enabled="true" />
<object-type name="JAVA METHOD" enabled="true" />
<object-type name="JAVA PARAMETER" enabled="true" />
<object-type name="JAVA RESOURCE" enabled="true" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="false" />
<object-type name="CREDENTIAL" enabled="false" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<audit-columns>
<column-names value="" />
<visible value="true" />
<editable value="false" />
</audit-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="YAML" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
<exit-on-changes value="ASK" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="json view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="json view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="json view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="json view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="json view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="json view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="json view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
<mapping file-type-id="JAVA_SOURCE" extensions="sql" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<assistant-settings>
<credential-settings>
<credentials />
</credential-settings>
</assistant-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
</project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

@ -0,0 +1,6 @@
<component name="libraryTable">
<library name="R User Library">
<CLASSES />
<SOURCES />
</library>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Blog)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Blog.iml" filepath="$PROJECT_DIR$/.idea/Blog.iml" />
</modules>
</component>
</project>

@ -0,0 +1,139 @@
"""
Django settings for Blog project.
Generated by 'django-admin startproject' using Django 2.2.24.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
gqc
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '#rbb)%+7w3=5&kj-51b4_d#8y6$v^g9q5lgl@sb$^x*avg7is_'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
gqc# 静态文件配置
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static").replace("\\","/"),
os.path.join(BASE_DIR, '../../static').replace('\\', '/'),
)
gqc# 图片视频资源路径配置
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace("\\", "/")
MEDIA_DIRS = (
os.path.join(BASE_DIR, 'media')
)
gqc# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'HomePage',
'develop' ,
'article' ,
'DjangoUeditor',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'Blog.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'Blog.wsgi.application'
gqc# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'

@ -0,0 +1,32 @@
"""Blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path , re_path
from django.conf.urls import url, include
from .settings import BASE_DIR
from django.views.static import serve
from django.conf import settings
from django.conf.urls.static import static
from HomePage.views import *
urlpatterns = [
path('admin/', admin.site.urls),
path('about/', About, name='aboutsite'),
url(r'^$',include('HomePage.urls')) ,
path('develop/', include('develop.urls') ),
path('article/', include('article.urls')),
path('ueditor/', include('DjangoUeditor.urls')),
re_path(r'^media/upfile/(?P<path>.*)$', serve, {'document_root': BASE_DIR + '/media/upfile'})
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

@ -0,0 +1,16 @@
"""
WSGI config for Blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blog.settings')
application = get_wsgi_application()

@ -0,0 +1,202 @@
# coding:utf-8
try:
# python3
from urllib.request import urljoin as urljoin
except:
# python2
from urllib import basejoin as urljoin
from . import settings as USettings
class UEditorEventHandler(object):
"""用来处理UEditor的事件侦听"""
def on_selectionchange(self):
return ""
def on_contentchange(self):
return ""
def render(self, editorID):
jscode = """
%(editor)s.addListener('%(event)s', function () {
%(event_code)s
});"""
event_codes = []
zjy# 列出所有on_打头的方法然后在ueditor中进行侦听
events = filter(lambda x: x[0:3] == "on_", dir(self))
for event in events:
try:
event_code = getattr(self, event)()
if event_code:
event_code = event_code % {"editor": editorID}
event_codes.append(
jscode % {
"editor": editorID,
"event": event[
3:],
"event_code": event_code})
except:
pass
if len(event_codes) == 0:
return ""
else:
return "\n".join(event_codes)
class UEditorCommand(object):
"""
为前端增加按钮下拉等扩展,
"""
def __init__(self, **kwargs):
self.uiName = kwargs.pop("uiName", "")
self.index = kwargs.pop("index", 0)
self.title = kwargs.pop("title", self.uiName)
self.ajax_url = kwargs.pop("ajax_url", "")
def render_ui(self, editor):
"""" 创建ueditor的ui扩展对象的js代码如button,combo等 """
raise NotImplementedError
def render_ajax_command(self):
""""生成通过ajax调用后端命令的前端ajax代码"""
if not self.ajax_url:
return ""
return u"""
UE.ajax.request( '%(ajax_url)s', {
data: {
name: 'ueditor'
},
onsuccess: function ( xhr ) {%(ajax_success)s},
onerror: function ( xhr ){ %(ajax_error)s }
});
""" % {
"ajax_url": self.ajax_url,
"ajax_success": self.onExecuteAjaxCommand("success"),
"ajax_error": self.onExecuteAjaxCommand("error")
}
def render_command(self):
"""" 返回注册命令的js定义 """
cmd = self.onExecuteCommand()
ajax_cmd = self.render_ajax_command()
queryvalue_command = self.onExecuteQueryvalueCommand()
cmds = []
if cmd or ajax_cmd:
cmds.append(u"""execCommand: function() {
%(exec_cmd)s
%(exec_ajax_cmd)s
}
""" % {"exec_cmd": cmd, "exec_ajax_cmd": ajax_cmd},)
if queryvalue_command:
cmds.append(u"""queryCommandValue:function(){
%s
}""" % queryvalue_command)
if len(cmds) > 0:
return u"""
editor.registerCommand(uiName, {
%s
});
""" % ",".join(cmds)
else:
return ""
def render(self, editorID):
return u"""
UE.registerUI("%(uiName)s", function(editor, uiName) {
%(registerCommand)s
%(uiObject)s
},%(index)s,"%(editor)s");
""" % {
"registerCommand": self.render_command(),
"uiName": self.uiName,
"uiObject": self.render_ui(editorID),
"index": self.index,
"editor": editorID
}
def onExecuteCommand(self):
""" 返回执行Command时的js代码 """
return ""
def onExecuteAjaxCommand(self, state):
""" 返回执行Command时发起Ajax调用成功与失败的js代码 """
return ""
def onExecuteQueryvalueCommand(self):
"""" 返回执行QueryvalueCommand时的js代码 """
return ""
class UEditorButtonCommand(UEditorCommand):
def __init__(self, **kwargs):
self.icon = kwargs.pop("icon", "")
super(UEditorButtonCommand, self).__init__(**kwargs)
def onClick(self):
""""按钮单击js代码默认执行uiName命令默认会调用Command """
return """
editor.execCommand(uiName);
"""
def render_ui(self, editorID):
""" 创建button的js代码: """
return """
var btn = new UE.ui.Button({
name: uiName,
title: "%(title)s",
cssRules: "background-image:url('%(icon)s')!important;",
onclick: function() {
%(onclick)s
}
});
return btn
""" % {
"icon": urljoin(USettings.gSettings.MEDIA_URL, self.icon),
"onclick": self.onClick(),
"title": self.title
}
class UEditorComboCommand(UEditorCommand):
def __init__(self, **kwargs):
self.items = kwargs.pop("items", [])
self.initValue = kwargs.pop("initValue", "")
super(UEditorComboCommand, self).__init__(**kwargs)
def get_items(self):
return self.items
def onSelect(self):
return ""
def render_ui(self, editorID):
""" 创建combo的js代码: """
return """
var combox = new UE.ui.Combox({
editor:editor,
items:%(items)s,
onselect:function (t, index) {
%(onselect)s
},
title:'%(title)s',
initValue:'%(initValue)s'
});
return combox;
""" % {
"title": self.title,
"items": str(self.get_items()),
"onselect": self.onSelect(),
"initValue": self.initValue
}
class UEditorDialogCommand(UEditorCommand):
pass

@ -0,0 +1,65 @@
# coding: utf-8
from django import forms
from widgets import UEditorWidget
from DjangoUeditor.models import UEditorField as ModelUEditorField
class UEditorField(forms.CharField):
def __init__(
self,
label,
width=600,
height=300,
toolbars="full",
imagePath="",
filePath="",
upload_settings={},
settings={},
command=None,
event_handler=None,
*args,
**kwargs):
uSettings = locals().copy()
del uSettings["self"], uSettings[
"label"], uSettings["args"], uSettings["kwargs"]
kwargs["widget"] = UEditorWidget(attrs=uSettings)
kwargs["label"] = label
super(UEditorField, self).__init__(*args, **kwargs)
zjy# def UpdateUploadPath(model_form, model_inst=None):
# """ 遍历model字段如果是UEditorField则需要重新计算路径 """
# if model_inst is not None:
# try:
# for field in model_inst._meta.fields:
# if isinstance(field, ModelUEditorField):
# model_form.__getitem__(
# field.name).field.widget.recalc_path(model_inst)
# except:
# pass
zjy# 修改前
def UpdateUploadPath(model_form, model_inst=None):
""" 遍历model字段如果是UEditorField则需要重新计算路径 """
if not model_inst:
try:
for field in model_inst._meta.fields:
if isinstance(field, ModelUEditorField):
model_form.__getitem__(
field.name).field.widget.recalc_path(model_inst)
except:
pass
class UEditorModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(UEditorModelForm, self).__init__(*args, **kwargs)
try:
if "instance" in kwargs:
UpdateUploadPath(self, kwargs["instance"])
else:
UpdateUploadPath(self, None)
except Exception:
pass

@ -0,0 +1,48 @@
# coding: utf-8
from django.db import models
from django.contrib.admin import widgets as admin_widgets
from .widgets import UEditorWidget, AdminUEditorWidget
class UEditorField(models.TextField):
"""
百度HTML编辑器字段,初始化时可以提供以下参数
initial:初始内容
toolbars:提供工具按钮列表,取值为列表['bold', 'italic'],取值为mini,normal,full代表小一般全部
imagePath:图片上传的路径,"images/",实现上传到"{{MEDIA_ROOT}}/images"文件夹
filePath:附件上传的路径,"files/",实现上传到"{{MEDIA_ROOT}}/files"文件夹
"""
def __init__(
self,
verbose_name=None,
width=600,
height=300,
toolbars="full",
imagePath="",
filePath="",
upload_settings={},
settings={},
command=None,
event_handler=None,
**kwargs):
self.ueditor_settings = locals().copy()
kwargs["verbose_name"] = verbose_name
del self.ueditor_settings["self"], self.ueditor_settings[
"kwargs"], self.ueditor_settings["verbose_name"]
super(UEditorField, self).__init__(**kwargs)
def formfield(self, **kwargs):
defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)}
defaults.update(kwargs)
if defaults['widget'] == admin_widgets.AdminTextareaWidget:
defaults['widget'] = AdminUEditorWidget(
attrs=self.ueditor_settings)
return super(UEditorField, self).formfield(**defaults)
# 以下支持south
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^DjangoUeditor\.models\.UEditorField"])
except:
pass

@ -0,0 +1,215 @@
# coding:utf-8
from django.conf import settings as gSettings # 全局设置
# 工具栏样式,可以添加任意多的模式
TOOLBARS_SETTINGS = {"besttome": [['source',
'undo',
'redo',
'bold',
'italic',
'underline',
'forecolor',
'backcolor',
'superscript',
'subscript',
"justifyleft",
"justifycenter",
"justifyright",
"insertorderedlist",
"insertunorderedlist",
"blockquote",
'formatmatch',
"removeformat",
'autotypeset',
'inserttable',
"pasteplain",
"wordimage",
"searchreplace",
"map",
"preview",
"fullscreen"],
['insertcode',
'paragraph',
"fontfamily",
"fontsize",
'link',
'unlink',
'insertimage',
'insertvideo',
'attachment',
'emotion',
"date",
"time"]],
"mini": [['source',
'|',
'undo',
'redo',
'|',
'bold',
'italic',
'underline',
'formatmatch',
'autotypeset',
'|',
'forecolor',
'backcolor',
'|',
'link',
'unlink',
'|',
'simpleupload',
'attachment']],
"normal": [['source',
'|',
'undo',
'redo',
'|',
'bold',
'italic',
'underline',
'removeformat',
'formatmatch',
'autotypeset',
'|',
'forecolor',
'backcolor',
'|',
'link',
'unlink',
'|',
'simpleupload',
'emotion',
'attachment',
'|',
'inserttable',
'deletetable',
'insertparagraphbeforetable',
'insertrow',
'deleterow',
'insertcol',
'deletecol',
'mergecells',
'mergeright',
'mergedown',
'splittocells',
'splittorows',
'splittocols']]}
# 默认的Ueditor设置请参见ueditor.config.js
UEditorSettings = {
"toolbars": TOOLBARS_SETTINGS["normal"],
"autoFloatEnabled": False,
# 默认保存上传文件的命名方式
"defaultPathFormat": "%(basename)s_%(datetime)s_%(rnd)s.%(extname)s"
}
# 请参阅php文件夹里面的config.json进行配置
UEditorUploadSettings = {
# 上传图片配置项
"imageActionName": "uploadimage", # 执行上传图片的action名称
"imageMaxSize": 10485760, # 上传大小限制单位B,10M
"imageFieldName": "upfile", # * 提交的图片表单名称 */
"imageUrlPrefix": "",
"imagePathFormat": "",
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], # 上传图片格式显示
# 涂鸦图片上传配置项 */
"scrawlActionName": "uploadscrawl", # 执行上传涂鸦的action名称 */
"scrawlFieldName": "upfile", # 提交的图片表单名称 */
"scrawlMaxSize": 10485760, # 上传大小限制单位B 10M
"scrawlUrlPrefix": "",
"scrawlPathFormat": "",
# 截图工具上传 */
"snapscreenActionName": "uploadimage", # 执行上传截图的action名称 */
"snapscreenPathFormat": "",
"snapscreenUrlPrefix": "",
# 抓取远程图片配置 */
"catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
"catcherPathFormat": "",
"catcherActionName": "catchimage", # 执行抓取远程图片的action名称 */
"catcherFieldName": "source", # 提交的图片列表表单名称 */
"catcherMaxSize": 10485760, # 上传大小限制单位B */
# 抓取图片格式显示 */
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
"catcherUrlPrefix": "",
# 上传视频配置 */
"videoActionName": "uploadvideo", # 执行上传视频的action名称 */
"videoPathFormat": "",
"videoFieldName": "upfile", # 提交的视频表单名称 */
"videoMaxSize": 102400000, # 上传大小限制单位B默认100MB */
"videoUrlPrefix": "",
"videoAllowFiles": [
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], # 上传视频格式显示 */
# 上传文件配置 */
"fileActionName": "uploadfile", # controller里,执行上传视频的action名称 */
"filePathFormat": "",
"fileFieldName": "upfile", # 提交的文件表单名称 */
"fileMaxSize": 204800000, # 上传大小限制单位B200MB */
"fileUrlPrefix": "", # 文件访问路径前缀 */
"fileAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp",
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
], # 上传文件格式显示 */
# 列出指定目录下的图片 */
"imageManagerActionName": "listimage", # 执行图片管理的action名称 */
"imageManagerListPath": "",
"imageManagerListSize": 30, # 每次列出文件数量 */
# 列出的文件类型 */
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
"imageManagerUrlPrefix": "", # 图片访问路径前缀 */
# 列出指定目录下的文件 */
"fileManagerActionName": "listfile", # 执行文件管理的action名称 */
"fileManagerListPath": "",
"fileManagerUrlPrefix": "",
"fileManagerListSize": 30, # 每次列出文件数量 */
"fileManagerAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tif", ".psd"
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml",
".exe", ".com", ".dll", ".msi"
] # 列出的文件类型 */
}
# 修改前的
# 更新配置从用户配置文件settings.py重新读入配置UEDITOR_SETTINGS,覆盖默认
# def UpdateUserSettings():
# UserSettings = getattr(gSettings, "UEDITOR_SETTINGS", {}).copy()
# if UserSettings.get("config", None):
# UEditorSettings.update(UserSettings["config"])
# if UserSettings.get("upload", None):
# UEditorUploadSettings.update(UserSettings["upload"])
def UpdateUserSettings():
UserSettings = getattr(gSettings, "UEDITOR_SETTINGS", {}).copy()
if "config" in UserSettings:
UEditorSettings.update(UserSettings["config"])
if "upload" in UserSettings:
UEditorUploadSettings.update(UserSettings["upload"])
# 读取用户Settings文件并覆盖默认配置
UpdateUserSettings()
# 修改前的
# 取得配置项参数
# def GetUeditorSettings(key, default=None):
# if UEditorSettings.get(key, None):
# return UEditorSettings[key]
# else:
# return default
def GetUeditorSettings(key, default=None):
if key in UEditorSettings:
return UEditorSettings[key]
else:
return default

@ -0,0 +1,38 @@
UE.registerUI('button',function(editor,uiName){
//注册按钮执行时的command命令使用命令默认就会带有回退操作
editor.registerCommand(uiName,{
execCommand:function(){
alert('execCommand:' + uiName)
}
});
//创建一个button
var btn = new UE.ui.Button({
//按钮的名字
name:uiName,
//提示
title:uiName,
//需要添加的额外样式指定icon图标这里默认使用一个重复的icon
cssRules :'background-position: -500px 0;',
//点击时执行的命令
onclick:function () {
//这里可以不用执行命令,做你自己的操作也可
editor.execCommand(uiName);
}
});
//当点到编辑内容上时,按钮要做的状态反射
editor.addListener('selectionchange', function () {
var state = editor.queryCommandState(uiName);
if (state == -1) {
btn.setDisabled(true);
btn.setChecked(false);
} else {
btn.setDisabled(false);
btn.setChecked(state);
}
});
//因为你是添加button,所以需要返回这个button
return btn;
}/*index 指定添加到工具栏上的那个位置,默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的默认是页面上所有的编辑器都会添加这个按钮*/);

@ -0,0 +1,69 @@
UE.registerUI('combox',function(editor,uiName){
//注册按钮执行时的command命令,用uiName作为command名字使用命令默认就会带有回退操作
editor.registerCommand(uiName,{
execCommand:function(cmdName,value){
//这里借用fontsize的命令
this.execCommand('fontsize',value + 'px')
},
queryCommandValue:function(){
//这里借用fontsize的查询命令
return this.queryCommandValue('fontsize')
}
});
//创建下拉菜单中的键值对,这里我用字体大小作为例子
var items = [];
for(var i= 0,ci;ci=[10, 11, 12, 14, 16, 18, 20, 24, 36][i++];){
items.push({
//显示的条目
label:'字体:' + ci + 'px',
//选中条目后的返回值
value:ci,
//针对每个条目进行特殊的渲染
renderLabelHtml:function () {
//这个是希望每个条目的字体是不同的
return '<div class="edui-label %%-label" style="line-height:2;font-size:' +
this.value + 'px;">' + (this.label || '') + '</div>';
}
});
}
//创建下来框
var combox = new UE.ui.Combox({
//需要指定当前的编辑器实例
editor:editor,
//添加条目
items:items,
//当选中时要做的事情
onselect:function (t, index) {
//拿到选中条目的值
editor.execCommand(uiName, this.items[index].value);
},
//提示
title:uiName,
//当编辑器没有焦点时combox默认显示的内容
initValue:uiName
});
editor.addListener('selectionchange', function (type, causeByUi, uiReady) {
if (!uiReady) {
var state = editor.queryCommandState(uiName);
if (state == -1) {
combox.setDisabled(true);
} else {
combox.setDisabled(false);
var value = editor.queryCommandValue(uiName);
if(!value){
combox.setValue(uiName);
return;
}
//ie下从源码模式切换回来时字体会带单引号而且会有逗号
value && (value = value.replace(/['"]/g, '').split(',')[0]);
combox.setValue(value);
}
}
});
return combox;
},2/*index 指定添加到工具栏上的那个位置,默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的默认是页面上所有的编辑器都会添加这个按钮*/);

@ -0,0 +1,49 @@
UE.registerUI('dialog',function(editor,uiName){
//创建dialog
var dialog = new UE.ui.Dialog({
//指定弹出层中页面的路径,这里只能支持页面,因为跟addCustomizeDialog.js相同目录所以无需加路径
iframeUrl:'customizeDialogPage.html',
//需要指定当前的编辑器实例
editor:editor,
//指定dialog的名字
name:uiName,
//dialog的标题
title:"这是个测试浮层",
//指定dialog的外围样式
cssRules:"width:600px;height:300px;",
//如果给出了buttons就代表dialog有确定和取消
buttons:[
{
className:'edui-okbutton',
label:'确定',
onclick:function () {
dialog.close(true);
}
},
{
className:'edui-cancelbutton',
label:'取消',
onclick:function () {
dialog.close(false);
}
}
]});
//参考addCustomizeButton.js
var btn = new UE.ui.Button({
name:'dialogbutton' + uiName,
title:'dialogbutton' + uiName,
//需要添加的额外样式指定icon图标这里默认使用一个重复的icon
cssRules :'background-position: -500px 0;',
onclick:function () {
//渲染dialog
dialog.render();
dialog.open();
}
});
return btn;
}/*index 指定添加到工具栏上的那个位置,默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的默认是页面上所有的编辑器都会添加这个按钮*/);

@ -0,0 +1,71 @@
<!DOCTYPE HTML>
<html>
<head>
<title>图表demo</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<!--建议手动加在语言避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../lang/zh-cn/zh-cn.js"></script>
<style type="text/css">
.clear {
clear: both;
}
</style>
</head>
<body>
<div>
<script id="editor" type="text/plain" style="width:1024px;height:500px;">
<h1>测试图表请点击表格, 然后点击工具栏上的“图表”按钮</h1>
<table data-chart="title:2012北京房价趋势图;subTitle:;xTitle:月份;yTitle:金额(元);suffix:元;tip:;dataFormat:1;chartType:0">
<tbody>
<tr>
<th width="90"><br></th>
<th width="90">1月</th>
<th width="90">2月</th>
<th width="90">3月</th>
<th width="90">4月</th>
<th width="90">5月</th>
<th width="90">6月</th>
<th width="90">7月</th>
<th width="90">8月</th>
<th width="90">9月</th>
<th width="91">10月</th>
<th>11月</th>
<th>12月</th>
</tr>
<tr>
<th valign="null" width="90">2012</th>
<td valign="top" width="55">24593</td>
<td valign="top" width="55">24308</td>
<td valign="top" width="55">24932</td>
<td valign="top" width="55">25413</td>
<td valign="top" width="55">25588</td>
<td valign="top" width="55">25948</td>
<td valign="top" width="55">26579</td>
<td valign="top" width="55">27199</td>
<td valign="top" width="55">28392</td>
<td valign="top" width="55">29071</td>
<td valign="top" width="55">29522</td>
<td valign="top" width="55">30158</td>
</tr>
</tbody>
</table>
</script>
</div>
<script type="text/javascript">
//实例化编辑器
var ue = UE.getEditor('editor', {
toolbars: [
[
'charts', 'preview'
]
]
});
</script>
</body>
</html>

@ -0,0 +1,175 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>完整demo</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"> </script>
<!--建议手动加在语言避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../lang/zh-cn/zh-cn.js"></script>
<style type="text/css">
div{
width:100%;
}
</style>
</head>
<body>
<div>
<h1>完整demo</h1>
<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
</div>
<div id="btns">
<div>
<button onclick="getAllHtml()">获得整个html的内容</button>
<button onclick="getContent()">获得内容</button>
<button onclick="setContent()">写入内容</button>
<button onclick="setContent(true)">追加内容</button>
<button onclick="getContentTxt()">获得纯文本</button>
<button onclick="getPlainTxt()">获得带格式的纯文本</button>
<button onclick="hasContent()">判断是否有内容</button>
<button onclick="setFocus()">使编辑器获得焦点</button>
<button onmousedown="isFocus(event)">编辑器是否获得焦点</button>
<button onmousedown="setblur(event)" >编辑器失去焦点</button>
</div>
<div>
<button onclick="getText()">获得当前选中的文本</button>
<button onclick="insertHtml()">插入给定的内容</button>
<button id="enable" onclick="setEnabled()">可以编辑</button>
<button onclick="setDisabled()">不可编辑</button>
<button onclick=" UE.getEditor('editor').setHide()">隐藏编辑器</button>
<button onclick=" UE.getEditor('editor').setShow()">显示编辑器</button>
<button onclick=" UE.getEditor('editor').setHeight(300)">设置高度为300默认关闭了自动长高</button>
</div>
<div>
<button onclick="getLocalData()" >获取草稿箱内容</button>
<button onclick="clearLocalData()" >清空草稿箱</button>
</div>
</div>
<div>
<button onclick="createEditor()">
创建编辑器</button>
<button onclick="deleteEditor()">
删除编辑器</button>
</div>
<script type="text/javascript">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例如果在某个闭包下引用该编辑器直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('editor');
function isFocus(e){
alert(UE.getEditor('editor').isFocus());
UE.dom.domUtils.preventDefault(e)
}
function setblur(e){
UE.getEditor('editor').blur();
UE.dom.domUtils.preventDefault(e)
}
function insertHtml() {
var value = prompt('插入html代码', '');
UE.getEditor('editor').execCommand('insertHtml', value)
}
function createEditor() {
enableBtn();
UE.getEditor('editor');
}
function getAllHtml() {
alert(UE.getEditor('editor').getAllHtml())
}
function getContent() {
var arr = [];
arr.push("使用editor.getContent()方法可以获得编辑器的内容");
arr.push("内容为:");
arr.push(UE.getEditor('editor').getContent());
alert(arr.join("\n"));
}
function getPlainTxt() {
var arr = [];
arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
arr.push("内容为:");
arr.push(UE.getEditor('editor').getPlainTxt());
alert(arr.join('\n'))
}
function setContent(isAppendTo) {
var arr = [];
arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
alert(arr.join("\n"));
}
function setDisabled() {
UE.getEditor('editor').setDisabled('fullscreen');
disableBtn("enable");
}
function setEnabled() {
UE.getEditor('editor').setEnabled();
enableBtn();
}
function getText() {
//当你点击按钮时编辑区域已经失去了焦点如果直接用getText将不会得到内容所以要在选回来然后取得内容
var range = UE.getEditor('editor').selection.getRange();
range.select();
var txt = UE.getEditor('editor').selection.getText();
alert(txt)
}
function getContentTxt() {
var arr = [];
arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
arr.push("编辑器的纯文本内容为:");
arr.push(UE.getEditor('editor').getContentTxt());
alert(arr.join("\n"));
}
function hasContent() {
var arr = [];
arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
arr.push("判断结果为:");
arr.push(UE.getEditor('editor').hasContents());
alert(arr.join("\n"));
}
function setFocus() {
UE.getEditor('editor').focus();
}
function deleteEditor() {
disableBtn();
UE.getEditor('editor').destroy();
}
function disableBtn(str) {
var div = document.getElementById('btns');
var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
for (var i = 0, btn; btn = btns[i++];) {
if (btn.id == str) {
UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
} else {
btn.setAttribute("disabled", "true");
}
}
}
function enableBtn() {
var div = document.getElementById('btns');
var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
for (var i = 0, btn; btn = btns[i++];) {
UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
}
}
function getLocalData () {
alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
}
function clearLocalData () {
UE.getEditor('editor').execCommand( "clearlocaldata" );
alert("已清空草稿箱")
}
</script>
</body>
</html>

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
</head>
<body>
<h1>UEditor自定义插件</h1>
<!--style给定宽度可以影响编辑器的最终宽度-->
<script type="text/plain" id="myEditor">
<p><img src="http://ueditor.baidu.com/website/images/banner-dl.png" alt=""></p>
<p>插件描述:选中图片,在其上单击,会改变图片的边框!</p>
</script>
<script type="text/javascript">
//创建一个在选中的图片单击时添加边框的插件其实质就是在baidu.editor.plugins塞进一个闭包
UE.plugins["addborder"] = function () {
var me = this;
//创建一个改变图片边框的命令
me.commands["addborder"] = {
execCommand:function () {
//获取当前选区
var range = me.selection.getRange();
//选区没闭合的情况下操作
if ( !range.collapsed ) {
//图片判断
var img = range.getClosedNode();
if ( img && img.tagName == "IMG" ) {
//点击切换图片边框
img.style.border = img.style.borderWidth == "5px"?"1px":"5px solid red";
}
}
}
};
//注册一个触发命令的事件,同学们可以在任意地放绑定触发此命令的事件
me.addListener( 'click', function () {
setTimeout(function(){
me.execCommand( "addborder" );
})
} );
};
var editor_a = UE.getEditor('myEditor' );
</script>
</body>
</html>

@ -0,0 +1,105 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<style type="text/css">
#editor {
border: 1px solid #CCC;
width: 1000px
}
#editor_toolbar_box {
background: #F0F0EE;
padding: 2px;
}
#editor_iframe_holder {
border-top: 1px solid #CCC;
border-bottom: 1px solid #CCC;
}
</style>
</head>
<body>
<h1>UEditor自定义toolbar</h1>
<div id="editor">
<div id="editor_toolbar_box">
<div id="editor_toolbar">
<input id="bold" type="button" value="加粗" onclick="myeditor.execCommand('bold')" style="height:24px;line-height:20px"/>
<input id="italic" type="button" value="加斜" onclick="myeditor.execCommand('italic')" style="height:24px;line-height:20px"/>
<select id="fontfamily" onchange="myeditor.execCommand('fontfamily',this.value)">
<option value="宋体,simsun">宋体</option>
<option value="楷体,楷体_gb2312,simkai">楷体</option>
<option value="隶书,simli">隶书</option>
<option value="黑体,simhei">黑体</option>
<option value="andale mono,times">andale mono</option>
<option value="arial,helvetica,sans-serif">arial</option>
<option value="arial black,avant garde">arial black</option>
<option value="comic sans ms,sans-serif">comic sans ms</option>
</select>
<select id="fontsize" onchange="myeditor.execCommand('fontsize',this.value)">
<option value="10pt">10pt</option>
<option value="11pt">11pt</option>
<option value="12pt">12pt</option>
<option value="14pt">14pt</option>
<option value="16pt">16pt</option>
<option value="18pt">18pt</option>
<option value="20pt">20pt</option>
<option value="22pt">22pt</option>
<option value="24pt">24pt</option>
<option value="36pt">36pt</option>
</select>
<input type="button" value="插入html" onclick="insert()" style="height:24px;line-height:20px"/>
<input type="button" value="清除格式" onclick="myeditor.execCommand('removeformat')" style="height:24px;line-height:20px"/>
<input type="button" value="获得编辑器内容" onclick="alert(myeditor.getContent())" style="height:24px;line-height:20px"/>
<input type="button" value="获得编辑器纯文本内容" onclick="alert(myeditor.getContentTxt())" style="height:24px;line-height:20px"/>
</div>
</div>
<div id="editor_iframe_holder" ></div>
</div>
<script type="text/javascript" charset="utf-8">
function $G(id){
return document.getElementById(id);
}
//实例化一个不带ui的编辑器,注意此处的实例化对象是baidu.editor下的Editor而非baidu.editor.ui下的Editor
var myeditor = UE.getEditor('editor_iframe_holder',{
toolbars:[[]],
initialContent: '初始化内容',//初始化编辑器的内容
initialFrameHeight: 200
});
//给编辑器增加一个选中改变的事件,用来判断所选内容以及状态
myeditor.addListener('selectionchange', function (){
var cmdName = ['bold','italic'],//命令列表
fontName = ['fontfamily','fontsize'];//字体设置下拉框列表,此处选择其中两个
//查询每个命令当前的状态,并设置对应状态样式
var i =-1;
while(i++ < cmdName.length-1){
var state = myeditor.queryCommandState(cmdName[i]);
$G(cmdName[i]).style.color = state == 1?"red":"";
}
//依据当前光标所在的字体改变下拉列表的选中值
i = -1;
while(i++<fontName.length-1){
var fstate = myeditor.queryCommandValue(fontName[i]).toLowerCase();
var fselect = $G(fontName[i]);
for(var j= 0;j<fselect.options.length;j++){
if(fselect.options[j].value.toLowerCase().indexOf(fstate.split(",")[0])!=-1){
fselect.options[j].selected = "true";
}
}
}
});
//插入文本
function insert(){
var insertTxt = "插入的文本";
insertTxt = prompt("插入的内容",insertTxt);
insertTxt&&myeditor.execCommand("inserthtml",insertTxt);
}
function execUnderline(cmd){
myeditor.execCommand(cmd);
}
</script>
</body>
</html>

@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<div class="content">
<h1>测试页面</h1>
</div>
<!--页面中一定要引入internal.js为了能直接使用当前打开dialog的实例变量-->
<!--internal.js默认是放到dialogs目录下的-->
<script type="text/javascript" src="../dialogs/internal.js"></script>
<script>
//可以直接使用以下全局变量
//当前打开dialog的实例变量
alert('editor: '+editor);
//一些常用工具
alert('domUtils: '+domUtils);
alert('utils: '+utils);
alert('browser: '+browser);
</script>
</body>
</html>

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>完整demo</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"> </script>
<!--建议手动加在语言避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../lang/zh-cn/zh-cn.js"></script>
<!--添加按钮-->
<script type="text/javascript" charset="utf-8" src="addCustomizeButton.js"></script>
<!--添加下拉菜单-->
<script type="text/javascript" charset="utf-8" src="addCustomizeCombox.js"></script>
<!--添加弹出层-->
<script type="text/javascript" charset="utf-8" src="addCustomizeDialog.js"></script>
<style type="text/css">
.clear {
clear: both;
}
div{
width:100%;
}
</style>
</head>
<body>
<div>
<h1>二次开发demo</h1>
<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
</div>
</body>
<script type="text/javascript">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例如果在某个闭包下引用该编辑器直接调用UE.getEditor('editor')就能拿到相关的实例
UE.getEditor('editor',{
//清空了工具栏
toolbars:[[]]
})
</script>
</html>

@ -0,0 +1,129 @@
/**
* 开发版本的文件导入
*/
(function (){
var paths = [
'editor.js',
'core/browser.js',
'core/utils.js',
'core/EventBase.js',
'core/dtd.js',
'core/domUtils.js',
'core/Range.js',
'core/Selection.js',
'core/Editor.js',
'core/Editor.defaultoptions.js',
'core/loadconfig.js',
'core/ajax.js',
'core/filterword.js',
'core/node.js',
'core/htmlparser.js',
'core/filternode.js',
'core/plugin.js',
'core/keymap.js',
'core/localstorage.js',
'plugins/defaultfilter.js',
'plugins/inserthtml.js',
'plugins/autotypeset.js',
'plugins/autosubmit.js',
'plugins/background.js',
'plugins/image.js',
'plugins/justify.js',
'plugins/font.js',
'plugins/link.js',
'plugins/iframe.js',
'plugins/scrawl.js',
'plugins/removeformat.js',
'plugins/blockquote.js',
'plugins/convertcase.js',
'plugins/indent.js',
'plugins/print.js',
'plugins/preview.js',
'plugins/selectall.js',
'plugins/paragraph.js',
'plugins/directionality.js',
'plugins/horizontal.js',
'plugins/time.js',
'plugins/rowspacing.js',
'plugins/lineheight.js',
'plugins/insertcode.js',
'plugins/cleardoc.js',
'plugins/anchor.js',
'plugins/wordcount.js',
'plugins/pagebreak.js',
'plugins/wordimage.js',
'plugins/dragdrop.js',
'plugins/undo.js',
'plugins/copy.js',
'plugins/paste.js',
'plugins/puretxtpaste.js',
'plugins/list.js',
'plugins/source.js',
'plugins/enterkey.js',
'plugins/keystrokes.js',
'plugins/fiximgclick.js',
'plugins/autolink.js',
'plugins/autoheight.js',
'plugins/autofloat.js',
'plugins/video.js',
'plugins/table.core.js',
'plugins/table.cmds.js',
'plugins/table.action.js',
'plugins/table.sort.js',
'plugins/contextmenu.js',
'plugins/shortcutmenu.js',
'plugins/basestyle.js',
'plugins/elementpath.js',
'plugins/formatmatch.js',
'plugins/searchreplace.js',
'plugins/customstyle.js',
'plugins/catchremoteimage.js',
'plugins/snapscreen.js',
'plugins/insertparagraph.js',
'plugins/webapp.js',
'plugins/template.js',
'plugins/music.js',
'plugins/autoupload.js',
'plugins/autosave.js',
'plugins/charts.js',
'plugins/section.js',
'plugins/simpleupload.js',
'plugins/serverparam.js',
'plugins/insertfile.js',
'ui/ui.js',
'ui/uiutils.js',
'ui/uibase.js',
'ui/separator.js',
'ui/mask.js',
'ui/popup.js',
'ui/colorpicker.js',
'ui/tablepicker.js',
'ui/stateful.js',
'ui/button.js',
'ui/splitbutton.js',
'ui/colorbutton.js',
'ui/tablebutton.js',
'ui/autotypesetpicker.js',
'ui/autotypesetbutton.js',
'ui/cellalignpicker.js',
'ui/pastepicker.js',
'ui/toolbar.js',
'ui/menu.js',
'ui/combox.js',
'ui/dialog.js',
'ui/menubutton.js',
'ui/multiMenu.js',
'ui/shortcutmenu.js',
'ui/breakline.js',
'ui/message.js',
'adapter/editorui.js',
'adapter/editor.js',
'adapter/message.js',
'adapter/autosave.js'
],
baseURL = '../_src/';
for (var i=0,pi;pi = paths[i++];) {
document.write('<script type="text/javascript" src="'+ baseURL + pi +'"></script>');
}
})();

@ -0,0 +1,151 @@
<!DOCTYPE HTML>
<html>
<head>
<title>过滤规则定制化</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<style type="text/css">
.clear {
clear: both;
}
</style>
</head>
<body>
<p>尝试粘贴内容近来这里边不能粘贴任何inline的样式不能有iframe,style,script,embed等标签表格不能嵌套</p>
<div>
<script id="editor" type="text/plain" style="width:500px;height:500px"></script>
</div>
</body>
<script type="text/javascript">
UE.getEditor('editor', {
filterRules: function () {
return{
span:function(node){
if(/Wingdings|Symbol/.test(node.getStyle('font-family'))){
return true;
}else{
node.parentNode.removeChild(node,true)
}
},
p: function(node){
var listTag;
if(node.getAttr('class') == 'MsoListParagraph'){
listTag = 'MsoListParagraph'
}
node.setAttr();
if(listTag){
node.setAttr('class','MsoListParagraph')
}
if(!node.firstChild()){
node.innerHTML(UE.browser.ie ? '&nbsp;' : '<br>')
}
},
div: function (node) {
var tmpNode, p = UE.uNode.createElement('p');
while (tmpNode = node.firstChild()) {
if (tmpNode.type == 'text' || !UE.dom.dtd.$block[tmpNode.tagName]) {
p.appendChild(tmpNode);
} else {
if (p.firstChild()) {
node.parentNode.insertBefore(p, node);
p = UE.uNode.createElement('p');
} else {
node.parentNode.insertBefore(tmpNode, node);
}
}
}
if (p.firstChild()) {
node.parentNode.insertBefore(p, node);
}
node.parentNode.removeChild(node);
},
//$:{}表示不保留任何属性
br: {$: {}},
// a: function (node) {
// if(!node.firstChild()){
// node.parentNode.removeChild(node);
// return;
// }
// node.setAttr();
// node.setAttr('href', '#')
// },
// strong: {$: {}},
// b:function(node){
// node.tagName = 'strong'
// },
// i:function(node){
// node.tagName = 'em'
// },
// em: {$: {}},
// img: function (node) {
// var src = node.getAttr('src');
// node.setAttr();
// node.setAttr({'src':src})
// },
ol:{$: {}},
ul: {$: {}},
dl:function(node){
node.tagName = 'ul';
node.setAttr()
},
dt:function(node){
node.tagName = 'li';
node.setAttr()
},
dd:function(node){
node.tagName = 'li';
node.setAttr()
},
li: function (node) {
var className = node.getAttr('class');
if (!className || !/list\-/.test(className)) {
node.setAttr()
}
var tmpNodes = node.getNodesByTagName('ol ul');
UE.utils.each(tmpNodes,function(n){
node.parentNode.insertAfter(n,node);
})
},
table: function (node) {
UE.utils.each(node.getNodesByTagName('table'), function (t) {
UE.utils.each(t.getNodesByTagName('tr'), function (tr) {
var p = UE.uNode.createElement('p'), child, html = [];
while (child = tr.firstChild()) {
html.push(child.innerHTML());
tr.removeChild(child);
}
p.innerHTML(html.join('&nbsp;&nbsp;'));
t.parentNode.insertBefore(p, t);
})
t.parentNode.removeChild(t)
});
var val = node.getAttr('width');
node.setAttr();
if (val) {
node.setAttr('width', val);
}
},
tbody: {$: {}},
caption: {$: {}},
th: {$: {}},
td: {$: {valign: 1, align: 1,rowspan:1,colspan:1,width:1,height:1}},
tr: {$: {}},
h3: {$: {}},
h2: {$: {}},
//黑名单,以下标签及其子节点都会被过滤掉
'-': 'script style meta iframe embed object'
}
}()
});
</script>
</html>

@ -0,0 +1,39 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<!--加入高亮的js和css文件如果你的编辑器和展示也是一个页面那么高亮的js可以不加载-->
<script type="text/javascript" charset="utf-8" src="../third-party/SyntaxHighlighter/shCore.js"></script>
<link rel="stylesheet" type="text/css" href="../third-party/SyntaxHighlighter/shCoreDefault.css"/>
</head>
<body>
<h1>代码高亮演示</h1>
<h2>获得编辑器实例</h2>
<div style="width:200px">
<pre class="brush:js;toolbar:false;">
UE.getEditor('myEditor');
</pre>
</div>
<!--style给定宽度可以影响编辑器的最终宽度-->
<script type="text/plain" id="myEditor" style="width:500px">
<h3>实例化编辑器</h3>
<pre class="brush:js;toolbar:false;">
UE.getEditor('myEditor');
</pre>
</script>
<script type="text/javascript">
//为了在编辑器之外能展示高亮代码
SyntaxHighlighter.highlight();
UE.getEditor('myEditor');
</script>
</body>
</html>

@ -0,0 +1,118 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
h3{
color:#630000;
}
ul li{
margin: 10px;
}
a:link,a:active,a:visited{
color: #0000EE;
}
a{
text-decoration: none;
}
</style>
</head>
<body>
<h2>UEditor各种实例演示</h2>
<h3>基础示例</h3>
<ul>
<li>
<a href="simpleDemo.html" target="_self">简单示例</a><br/>
使用基础的按钮实现简单的功能
</li>
</ul>
<h3>应用展示</h3>
<ul>
<li>
<a href="submitFormDemo.html" target="_self">表单应用</a><br/>
编辑器的内容通过表单提交到后台
</li>
<li>
<a href="resetDemo.html" target="_self">重置编辑器</a><br/>
将编辑器的内部变量清空,重置。
</li>
<li>
<a href="textareaDemo.html" target="_self">文本域渲染编辑器</a><br/>
将编辑器渲染到文本域,并且将文本域的内容放到编辑器的初始化内容里
</li>
</ul>
<h3>二次开发</h3>
<ul>
<li>
<a style="color:red;" href="customizeToolbarUIDemo.html" target="_self">二次开发例子</a><br/>
添加自定义的普通按钮、下拉菜单按钮、对话框按钮
</li>
<li>
<a href="customToolbarDemo.html" target="_self">自定义Toolbar</a><br/>
用自己的皮肤,设计自己的编辑器
</li>
<li>
<a href="customPluginDemo.html" target="_self">自定义插件</a><br/>
在编辑器的基础上开发自己的插件
</li>
</ul>
<h3>高级案例</h3>
<ul>
<li>
<a href="completeDemo.html" target="_self">完整示例</a><br/>
编辑器的完整功能
</li>
<li>
<a href="charts.html" target="_self" >图表示例</a><br/>
图表功能
</li>
<li>
<a href="sortableDemo.html" target="_self" >表格排序示例</a><br/>
编辑表格,并设置排序后可在展示区域点击排序
</li>
<li>
<a href="sectionDemo.html" target="_self" >目录大纲示例</a><br/>
获取编辑内容的目录大纲,并通过操作目录,更新编辑器内容
</li>
<li>
<a href="multiDemo.html" target="_self">多编辑器实例</a><br/>
一个页面实例化多个编辑器,互不影响
</li>
<li>
<a href="renderInTable.html" target="_self">在表格中渲染编辑器</a><br/>
表格中渲染编辑器
</li>
<li>
<a href="jqueryCompleteDemo.html" target="_self">jquery</a><br/>
jquery中使用编辑器
</li>
<li>
<a href="jqueryValidation.html" target="_self">jqueryValidation</a><br/>
编辑器在jqueryValidation中验证
</li>
<li>
<a href="uparsedemo.html" target="_self">展示页面uparse.js解析</a><br/>
通过调用uparse.js在展示页面中自动解析编辑内容
</li>
<li>
<a href="filterRuleDemo.html" target="_self">过滤规则定制化</a><br/>
通过配置filterRules可以定制黑白名单过滤和转换你要的标签和属性
</li>
<li>
<a href="setWidthHeightDemo.html" target="_self">设置宽高</a><br/>
设置宽高的demo页面
</li>
<li>
<a href="multiEditorWithOneInstance.html" target="_self">多个编辑区使用一个编辑器实例</a><br/>
多个编辑区使用一个编辑器实例
</li>
</ul>
<script type="text/javascript">
var href = location.href;
if(href.indexOf("http") != 0 ){
alert("您当前尚未将UEditor部署到服务器环境部分浏览器下所有弹出框功能的使用会受到限制");
}
</script>
</body>
</html>

@ -0,0 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>使用jquery的完整demo</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js" charset=""></script>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<script>
$(function(){
var ue = UE.getEditor('myEditor');
$('#btn').click(function(){
//手动提交需要手动同步编辑器数据
ue.sync();
$('#form')[0].submit();
});
//--自动切换提交地址----
var version = ue.options.serverUrl || ue.options.imageUrl || "php",
form=$('#form')[0];
if(version.match(/php/)){
form.action="./server/getContent.php";
}else if(version.match(/net/)){
form.action="./server/getContent.ashx";
}else if(version.match(/jsp/)){
form.action="./server/getContent.jsp";
}else if(version.match(/asp/)){
form.action="./server/getContent.asp";
}
})
</script>
</head>
<body>
<form id="form" method="post" target="_blank">
<script type="text/plain" id="myEditor" name="myEditor">
<p>欢迎使用UEditor</p>
</script>
<input type="button" id="btn" value="提交数据">
</form>
</body>
</html>

@ -0,0 +1,63 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Ueditor在jquery validation下的验证</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<script>
$(function(){
UE.getEditor('content');
var validator = $("#myform").submit(function() {
UE.getEditor('content').sync();
}).validate({
ignore: "",
rules: {
title: "required",
content: "required"
},
errorPlacement: function(label, element) {
label.insertAfter(element.is("textarea") ? element.next() : element);
}
});
validator.focusInvalid = function() {
if( this.settings.focusInvalid ) {
try {
var toFocus = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []);
if (toFocus.is("textarea")) {
UE.getEditor('content').focus()
} else {
toFocus.filter(":visible").focus();
}
} catch(e) {
}
}
}
})
</script>
</head>
<body>
<form id="myform" action="">
<h3>Ueditor在jquery validation下的验证</h3>
<label>其他内容</label>
<input name="title" />
<br/>
<label>编辑器</label>
<textarea id="content" name="content" rows="15" cols="80" style="width: 80%"></textarea>
<br />
<input type="submit" name="save" value="Submit" />
</form>
</body>
</html>

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
</head>
<body>
<h1>UEditor多实例</h1>
<!--style给定宽度可以影响编辑器的最终宽度-->
<script type="text/plain" id="myEditor1" style="margin-bottom:100px;">
</script>
<script type="text/plain" id="myEditor2" style="margin-bottom:100px;">
<p>这里我可以写一些输入提示</p>
</script>
<script type="text/plain" id="myEditor3" style="margin-bottom:100px;">
</script>
<script type="text/javascript">
UE.getEditor('myEditor1', {
theme:"default", //皮肤
lang:'zh-cn' //语言
});
UE.getEditor('myEditor2', {
autoClearinitialContent:true, //focus时自动清空初始化时的内容
wordCount:false, //关闭字数统计
elementPathEnabled:false//关闭elementPath
});
UE.getEditor('myEditor3', {
//toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold']],//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
lang:"en"
//更多其他参数请参考ueditor.config.js中的配置项
});
</script>
</body>
</html>

@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<style>
table{margin-bottom:10px;border-collapse:collapse;display:table;border:1px dashed #ddd}
#test td{padding:5px;border: 1px solid #DDD;}
</style>
</head>
<body>
<h1>UEditor多编辑区域一个编辑器实例</h1>
<table id="test">
<tr>
<td width="10%">
编辑区域一
</td>
<td class="content" id="content1"><script id="editor1" type="text/plain" style="width:1024px;height:200px;">内容1</script></td>
</tr>
<tr>
<td>
编辑区域二
</td>
<td class="content" id="content2">内容2</td>
</tr>
<tr>
<td>
编辑区域三
</td>
<td class="content" id="content3">内容3</td>
</tr>
</table>
<script type="text/javascript">
var ue = UE.getEditor('editor1');
ue.ready(function(){
//阻止工具栏的点击向上冒泡
$(this.container).click(function(e){
e.stopPropagation()
})
});
$('.content').click(function(e){
var $target = $(this);
var content = $target.html();
var currentParnet = ue.container.parentNode.parentNode;
var currentContent = ue.getContent();
$target.html('');
$target.append(ue.container.parentNode);
ue.reset();
setTimeout(function(){
ue.setContent(content);
},200)
$(currentParnet).html(currentContent);
})
</script>
</body>
</html>

@ -0,0 +1,26 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<title>表格内实例化编辑器实例</title>
</head>
<body>
<div style="height: 100px"></div>
<div id="div" style="border: 1px solid #fff">
<table border="1">
<caption>表格标题</caption>
<tr><th>标题</th><th>内容</th></tr>
<!--编辑器实例化到表格内部时,请在对应的单元格上明确标注宽度值(百分数或者直接数均可),否则有可能在工具栏浮动等功能状态下出现移位-->
<tr>
<td>中国</td><td width="100%"><textarea id="editor"></textarea></td>
</tr>
</table>
</div>
<script type="text/javascript">
UE.getEditor('editor');
</script>
</body>
</html>

@ -0,0 +1,52 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>重置编辑器</title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<style type="text/css">
#simple {
width: 1000px;
border: 1px solid #ddd;
}
</style>
</head>
<body>
<h2>重置编辑器和销毁编辑器示例</h2>
<div class="content" id="simple"></div>
<p><input type="button" onclick="simple()" value="重置编辑器内部参数"><span id="txt"></span></p>
<p><input id="destroy" type="button" onclick="destroy()" value="销毁编辑器"></p>
<script type="text/javascript" charset="utf-8">
var editor = UE.getEditor('simple');
function simple() {
if(editor){
editor.setContent("编辑器内部变量已经被重置!");
editor.reset();
}
}
function destroy(){
editor.destroy();
editor = null;
clearInterval(timer);
var button = document.getElementById("destroy");
button.value = "重新渲染";
button.onclick = function(){
editor = UE.getEditor('simple');
this.value="销毁编辑器";
this.onclick = destroy;
timer = setInterval( setMsg, 100 );
}
}
function setMsg() {
if(editor && editor.undoManger){
document.getElementById( "txt" ).innerHTML = "编辑器当前保存了 <span style='color: red'> " + editor.undoManger.list.length + " </span>次操作";
}
}
var timer = setInterval( setMsg, 100 );
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,44 @@
<%@ WebHandler Language="C#" Class="getContent" %>
/**
* Created by visual studio 2010
* User: xuheng
* Date: 12-3-6
* Time: 下午21:23
* To get the value of editor and output the value .
*/
using System;
using System.Web;
public class getContent : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/html";
//获取数据
string content = context.Server.HtmlEncode(context.Request.Form["myEditor"]);
//存入数据库或者其他操作
//-------------
//显示
context.Response.Write("<script src='../ueditor.parse.js' type='text/javascript'></script>");
context.Response.Write(
"<script>uParse('.content',{"+
"'rootPath': '../'"+
"})"+
"</script>");
context.Response.Write("Content of First Editor: ");
context.Response.Write("<div class='content'>" + context.Server.HtmlDecode(content) + "</div>");
}
public bool IsReusable {
get {
return false;
}
}
}

@ -0,0 +1,15 @@
<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="../../ueditor.parse.js" type="text/javascript"></script>
<script>
uParse('.content',{
'rootPath': '../'
})
</script>
<%
Dim content
content = Request.Form("myEditor")
Response.Write("第1个编辑器的值")
Response.Write("<div class='content'>" + content + "</div>")
%>

@ -0,0 +1,19 @@
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="../../ueditor.parse.js" type="text/javascript"></script>
<script>
uParse('.content',{
'rootPath': '../'
})
</script>
<%
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String content = request.getParameter("myEditor");
response.getWriter().print("第1个编辑器的值");
response.getWriter().print("<div class='content'>"+content+"</div>");
%>

@ -0,0 +1,19 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="../../ueditor.parse.js" type="text/javascript"></script>
<script>
uParse('.content',{
'rootPath': '../'
})
</script>
<?php
//获取数据
error_reporting(E_ERROR|E_WARNING);
$content = htmlspecialchars(stripslashes($_POST['myEditor']));
//存入数据库或者其他操作
//显示
echo "第1个编辑器的值";
echo "<div class='content'>".htmlspecialchars_decode($content)."</div>";

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<!--建议手动加在语言避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<script type="text/javascript" charset="utf-8" src="../lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<h1>UEditor设置宽高demo</h1>
<h2><span style="color:red">这里的宽高都只是编辑区域的宽高,不包括工具栏的高度和状态栏的高度</span></h2>
<h2>容器给定编辑器的宽高</h2>
<script type="text/plain" id="myEditor" style="width:500px;height:500px"></script>
<div style="clear:both"></div>
<h2>初始化时给定编辑器的宽高</h2>
<script type="text/plain" id="myEditor1" ></script>
<h2>没有工具栏的编辑器</h2>
<div id="myEditor2" style="width:700px;height:300px;border:1px solid #ccc"></div>
<script type="text/javascript">
//根据容器的宽高
//容器给定高度
UE.getEditor('myEditor');
UE.getEditor('myEditor1',{
initialFrameWidth : 600,
initialFrameHeight: 600
});
var noToolbar = new UE.Editor();
noToolbar.render('myEditor2',{
autoFloatEnabled : false
})
</script>
</body>
</html>

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
</head>
<body>
<h1>UEditor简单功能</h1>
<!--style给定宽度可以影响编辑器的最终宽度-->
<script type="text/plain" id="myEditor">
<p>这里我可以写一些输入提示</p>
</script>
<script type="text/javascript">
UE.getEditor('myEditor',{
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold','test']],
//focus时自动清空初始化时的内容
autoClearinitialContent:true,
//关闭字数统计
wordCount:false,
//关闭elementPath
elementPathEnabled:false,
//默认的编辑区域高度
initialFrameHeight:300
//更多其他参数请参考ueditor.config.js中的配置项
})
</script>
</body>
</html>

@ -0,0 +1,86 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="../ueditor.parse.js" type="text/javascript"></script>
<title></title>
</head>
<body>
<h1>表格排序演示</h1>
<p>
<p>
<strong>默认排序方法有五种:</strong><br/>
reversecurrent : 逆序当前<br/>
orderbyasc : 按ASCII字符升序<br/>
reversebyasc : 按ASCII字符降序<br/>
orderbynum : 按数值大小升序<br/>
reversebynum : 按数值大小降序
</p>
<p>
<span style="font-size: 14px; color: rgb(127, 127, 127);">表格data-sort-type属性值为reversebynum<span style="color:#ff511a; font-weight: bold;">按照数值大小降序排序</span>,点击第一行的单元格进行排序。</span>
</p>
<div id="content1" class="content">
<table data-sort="sortEnabled" width="992" class="sortEnabled" data-sort-type="reversebynum">
<tbody>
<tr class="firstRow"> <td width="165">343</td> <td width="165">352</td> <td width="165">323</td> <td width="165">234</td> <td width="165">379</td> <td width="166">782</td> </tr>
<tr> <td width="165">341</td> <td width="165">163</td> <td width="165">422</td> <td width="165">234</td> <td width="165">725</td> <td width="166">833</td> </tr>
<tr> <td width="165">221</td> <td width="165">456</td> <td width="165">335</td> <td width="165">423</td> <td width="165">445</td> <td width="166">793</td> </tr>
<tr> <td width="165">112</td> <td width="165">277</td> <td width="165">563</td> <td width="165">423</td> <td width="165">932</td> <td width="166">425</td> </tr>
<tr> <td width="165">587</td> <td width="165">175</td> <td width="165">159</td> <td width="165">734</td> <td width="165">582</td> <td width="166">458</td> </tr>
</tbody>
</table>
</div>
<p>
<br />
</p>
<p>
<span style="font-size: 14px; color: rgb(127, 127, 127);">自定义排序,<span style="color:#ff511a; font-weight: bold;">按照个位数排序</span>,点击第一行的单元格进行排序。</span>
</p>
<div id="content2" class="content">
<table data-sort="sortEnabled" width="992" class="sortEnabled">
<tbody>
<tr class="firstRow"> <td width="165">343</td> <td width="165">352</td> <td width="165">323</td> <td width="165">234</td> <td width="165">379</td> <td width="166">782</td> </tr>
<tr> <td width="165">341</td> <td width="165">163</td> <td width="165">422</td> <td width="165">234</td> <td width="165">725</td> <td width="166">833</td> </tr>
<tr> <td width="165">221</td> <td width="165">456</td> <td width="165">335</td> <td width="165">423</td> <td width="165">445</td> <td width="166">793</td> </tr>
<tr> <td width="165">112</td> <td width="165">277</td> <td width="165">563</td> <td width="165">423</td> <td width="165">932</td> <td width="166">425</td> </tr>
<tr> <td width="165">587</td> <td width="165">175</td> <td width="165">159</td> <td width="165">734</td> <td width="165">582</td> <td width="166">458</td> </tr>
</tbody>
</table>
</div>
<script>
// 语法
// uParse(selector,[option])
/*
selector支持
id,class,tagName
*/
/*
目前支持的参数
option:
highlightJsUrl 代码高亮相关js的路径 如果展示有代码高亮,必须给定该属性
highlightCssUrl 代码高亮相关css的路径 如果展示有代码高亮,必须给定该属性
liiconpath 自定义列表样式的图标路径,可以不给定,默认'http://bs.baidu.com/listicon/',
listDefaultPaddingLeft : 自定义列表样式的左边宽度 默认'20',
customRule 可以传入你自己的处理规则函数,函数第一个参数是容器节点
*/
uParse('#content1',{
rootPath : '../'
})
uParse('#content2',{
rootPath : '../',
tableSortCompareFn: function(td1, td2){
var value1 = td1.innerText||td1.textContent,
value2 = td2.innerText||td2.textContent;
return parseInt(value1) % 10 > parseInt(value2) % 10;
}
})
</script>
</body>
</html>

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<style type="text/css">
body{
font-size:14px;
}
</style>
</head>
<body>
<h2>UEditor提交示例</h2>
<form id="form" method="post" target="_blank">
<script type="text/plain" id="myEditor" name="myEditor">
<p>欢迎使用UEditor</p>
</script>
<input type="submit" value="通过input的submit提交">
</form>
<p>
从1.2.6开始会自动同步数据无需再手动调用sync方法
<button onclick="document.getElementById('form').submit()">通过js调用submit提交</button>
</p>
<script type="text/javascript">
var editor_a = UE.getEditor('myEditor',{initialFrameHeight:500});
//--自动切换提交地址----
var doc=document,
version = editor_a.options.serverUrl || editor_a.options.imageUrl || "php",
form=doc.getElementById("form");
if(version.match(/php/)){
form.action="./server/getContent.php";
}else if(version.match(/net/)){
form.action="./server/getContent.ashx";
}else if(version.match(/jsp/)){
form.action="./server/getContent.jsp";
}else if(version.match(/asp/)){
form.action="./server/getContent.asp";
}
//-----
</script>
</body>
</html>

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<style type="text/css">
#myEditor{
width: 500px;
height: 300px;
}
</style>
</head>
<body>
<h1>文本域渲染编辑器</h1>
<!--style给定宽度可以影响编辑器的最终宽度-->
<textarea id="myEditor">这里是原始的textarea中的内容可以从数据中读取</textarea>
<br/>
<input type="button" onclick="render()" value="渲染编辑器">
<script type="text/javascript">
//渲染编辑器
function render(){
UE.getEditor('myEditor')
}
</script>
</body>
</html>

@ -0,0 +1,204 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="../ueditor.parse.js"></script>
<title></title>
</head>
<body>
<h1>解析编辑的内容</h1>
<div class="content" style="width:200px">
<ol class="custom_cn2 list-paddingleft-1"><li class="list-cn-3-1 list-cn2-paddingleft-1"><p>这里可以书写,编辑器的初始内容</p></li></ol><ul class="custom_dash list-paddingleft-1"><li class="list-dash list-dash-paddingleft"><p>sdfas</p></li></ul><ol class="custom_cn2 list-paddingleft-1"><ol style="list-style-type: decimal; " class=" list-paddingleft-3"><li><p>dfas</p></li></ol><li class="list-cn-3-1 list-cn2-paddingleft-1"><p>dfa</p></li><ol style="list-style-type: decimal; " class=" list-paddingleft-3"><li><p>sdfadf</p></li></ol></ol>
<p>
这里可以书写,编辑器的初始内容
</p>
<p>
<video class="video-js vjs-default-skin" data-setup="{}" controls preload="none" width="640" height="264"
src="http://video-js.zencoder.com/oceans-clip.mp4"
poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
</video>
</p>
<pre class="brush:js;toolbar:false;">
moveToBookmark:function (bookmark) {
var start = bookmark.id ? this.document.getElementById(bookmark.start) : bookmark.start,
end = bookmark.end && bookmark.id ? this.document.getElementById(bookmark.end) : bookmark.end;
this.setStartBefore(start);
domUtils.remove(start);
if (end) {
this.setEndBefore(end);
domUtils.remove(end);
} else {
this.collapse(true);
}
return this;
},
</pre>
<ol class="custom_cn2 list-paddingleft-1">
<li class="list-cn-3-1 list-cn2-paddingleft-1">
<p>
dfasdf
</p>
</li>
<li class="list-cn-3-2 list-cn2-paddingleft-1">
<p>
asd
</p>
</li>
<li class="list-cn-3-3 list-cn2-paddingleft-1">
<p>
fa
</p>
</li>
<li class="list-cn-3-4 list-cn2-paddingleft-1">
<p>
sdfa
</p>
</li>
<li class="list-cn-3-5 list-cn2-paddingleft-1">
<p>
sdfa
</p>
</li>
</ol>
</div>
<div id="content" class="content">
<table width="960">
<caption>
sdf<br />
</caption>
<tbody>
<tr>
<th valign="null">
sdf<br />
</th>
<th valign="null">
sdf<br />
</th>
<th valign="null">
<br />
</th>
<th valign="null">
<br />
</th>
<th valign="null">
<br />
</th>
<th valign="null">
<br />
</th>
<th valign="null">
<br />
</th>
</tr>
<tr>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
</tr>
<tr>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
<td width="116" valign="top">
<br />
</td>
</tr>
</tbody>
</table>
</div>
<div class="content_background">
<h1>
UEditor
</h1>
<h2>
简介
</h2>
<p>
UEditor是由百度WEB前端研发部开发的所见即所得的开源富文本编辑器具有轻量、可定制、用户体验优秀等特点。开源基于BSD协议所有源代码在协议允许范围内可自由修改和使用。百度UEditor的推出可以帮助不少网站开者在开发富文本编辑器所遇到的难题节约开发者因开发富文本编辑器所需要的大量时间有效降低了企业的开发成本。
</p>
<h2>
特点<br/>
</h2>
<p>
1、核心层提供了编辑器底层的一些方法和概念如DOM树操作、Selection、Range等。
</p>
<p>
2、在核心层之上覆盖的是命令插件层。之所以叫命令插件层是因为UEditor中所有的功能型实现都是通过这一层中的命令和插件来完成的并且各个命令和插件之间基本互不耦合——使用者需要使用哪个功能就导入哪个功能对应的命令或者插件文件完全不用考虑另外那些杂七杂八的JS文件极少数插件除外关于这些插件下文会整理出一个依赖列表来供同学们参考
</p>
<p>
理论上来讲所有的命令都是可以用插件来代替的但是依然将两者分开的主要原因是命令都是一些静态的方法无需随editor实例初始化从而优化了编辑器的性能。而插件随编辑器的初始化而初始化性能上会有少许的影响但相比命令而言插件能够完成更加复杂的功能。其中最主要的一个特点是在插件内部既可以为编辑器注册命令也可以为编辑器绑定监听事件。这个特点使得为编辑器添加任何功能都可以在插件中独立完成。
</p>
<p>
3、在命令插件层之上则是UI层。UEditor的UI设计与核心层和命令插件层几乎完全解耦简单的几个配置就可以为编辑器在界面上添加额外的UI元素和功能具体的配置下面将会深入阐述。
</p>
<p>
<br/>
</p>
<p style="display:none;" data-background="background-repeat:no-repeat;background-position:center center;background-color:#C3D69B;background-image:url(http://www.baidu.com/img/bdlogo.gif);">
<br/>
</p>
</div>
<script>
// 语法
// uParse(selector,[option])
/*
selector支持
id,class,tagName
*/
/*
目前支持的参数
option:
highlightJsUrl 代码高亮相关js的路径 如果展示有代码高亮,必须给定该属性
highlightCssUrl 代码高亮相关css的路径 如果展示有代码高亮,必须给定该属性
liiconpath 自定义列表样式的图标路径,可以不给定,默认'http://bs.baidu.com/listicon/',
listDefaultPaddingLeft : 自定义列表样式的左边宽度 默认'20',
customRule 可以传入你自己的处理规则函数,函数第一个参数是容器节点
*/
uParse('.content',{
rootPath : '../'
})
uParse('.content_background',{
rootPath : '../'
})
</script>
</body>
</html>

@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
*{color: #838383;margin: 0;padding: 0}
html,body {font-size: 12px;overflow: hidden; }
.content{padding:5px 0 0 15px;}
input{width:210px;height:21px;line-height:21px;margin-left: 4px;}
</style>
</head>
<body>
<div class="content">
<span><var id="lang_input_anchorName"></var></span><input id="anchorName" value="" />
</div>
<script type="text/javascript" src="../internal.js"></script>
<script type="text/javascript">
var anchorInput = $G('anchorName'),
node = editor.selection.getRange().getClosedNode();
if(node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))){
anchorInput.value = node;
}
anchorInput.onkeydown = function(evt){
evt = evt || window.event;
if(evt.keyCode == 13){
editor.execCommand('anchor', anchorInput.value);
dialog.close();
domUtils.preventDefault(evt)
}
};
dialog.onok = function (){
editor.execCommand('anchor', anchorInput.value);
dialog.close();
};
$focus(anchorInput);
</script>
</body>
</html>

@ -0,0 +1,681 @@
@charset "utf-8";
/* dialog样式 */
.wrapper {
zoom: 1;
width: 630px;
*width: 626px;
height: 380px;
margin: 0 auto;
padding: 10px;
position: relative;
font-family: sans-serif;
}
/*tab样式框大小*/
.tabhead {
float:left;
}
.tabbody {
width: 100%;
height: 346px;
position: relative;
clear: both;
}
.tabbody .panel {
position: absolute;
width: 0;
height: 0;
background: #fff;
overflow: hidden;
display: none;
}
.tabbody .panel.focus {
width: 100%;
height: 346px;
display: block;
}
/* 上传附件 */
.tabbody #upload.panel {
width: 0;
height: 0;
overflow: hidden;
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
background: #fff;
display: block;
}
.tabbody #upload.panel.focus {
width: 100%;
height: 346px;
display: block;
clip: auto;
}
#upload .queueList {
margin: 0;
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
}
#upload p {
margin: 0;
}
.element-invisible {
width: 0 !important;
height: 0 !important;
border: 0;
padding: 0;
margin: 0;
overflow: hidden;
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
}
#upload .placeholder {
margin: 10px;
border: 2px dashed #e6e6e6;
*border: 0px dashed #e6e6e6;
height: 172px;
padding-top: 150px;
text-align: center;
background: url(./images/image.png) center 70px no-repeat;
color: #cccccc;
font-size: 18px;
position: relative;
top:0;
*top: 10px;
}
#upload .placeholder .webuploader-pick {
font-size: 18px;
background: #00b7ee;
border-radius: 3px;
line-height: 44px;
padding: 0 30px;
*width: 120px;
color: #fff;
display: inline-block;
margin: 0 auto 20px auto;
cursor: pointer;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
#upload .placeholder .webuploader-pick-hover {
background: #00a2d4;
}
#filePickerContainer {
text-align: center;
}
#upload .placeholder .flashTip {
color: #666666;
font-size: 12px;
position: absolute;
width: 100%;
text-align: center;
bottom: 20px;
}
#upload .placeholder .flashTip a {
color: #0785d1;
text-decoration: none;
}
#upload .placeholder .flashTip a:hover {
text-decoration: underline;
}
#upload .placeholder.webuploader-dnd-over {
border-color: #999999;
}
#upload .filelist {
list-style: none;
margin: 0;
padding: 0;
overflow-x: hidden;
overflow-y: auto;
position: relative;
height: 300px;
}
#upload .filelist:after {
content: '';
display: block;
width: 0;
height: 0;
overflow: hidden;
clear: both;
}
#upload .filelist li {
width: 113px;
height: 113px;
background: url(./images/bg.png);
text-align: center;
margin: 9px 0 0 9px;
*margin: 6px 0 0 6px;
position: relative;
display: block;
float: left;
overflow: hidden;
font-size: 12px;
}
#upload .filelist li p.log {
position: relative;
top: -45px;
}
#upload .filelist li p.title {
position: absolute;
top: 0;
left: 0;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
top: 5px;
text-indent: 5px;
text-align: left;
}
#upload .filelist li p.progress {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
height: 8px;
overflow: hidden;
z-index: 50;
margin: 0;
border-radius: 0;
background: none;
-webkit-box-shadow: 0 0 0;
}
#upload .filelist li p.progress span {
display: none;
overflow: hidden;
width: 0;
height: 100%;
background: #1483d8 url(./images/progress.png) repeat-x;
-webit-transition: width 200ms linear;
-moz-transition: width 200ms linear;
-o-transition: width 200ms linear;
-ms-transition: width 200ms linear;
transition: width 200ms linear;
-webkit-animation: progressmove 2s linear infinite;
-moz-animation: progressmove 2s linear infinite;
-o-animation: progressmove 2s linear infinite;
-ms-animation: progressmove 2s linear infinite;
animation: progressmove 2s linear infinite;
-webkit-transform: translateZ(0);
}
@-webkit-keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
@-moz-keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
@keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
#upload .filelist li p.imgWrap {
position: relative;
z-index: 2;
line-height: 113px;
vertical-align: middle;
overflow: hidden;
width: 113px;
height: 113px;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webit-transition: 200ms ease-out;
-moz-transition: 200ms ease-out;
-o-transition: 200ms ease-out;
-ms-transition: 200ms ease-out;
transition: 200ms ease-out;
}
#upload .filelist li p.imgWrap.notimage {
margin-top: 0;
width: 111px;
height: 111px;
border: 1px #eeeeee solid;
}
#upload .filelist li p.imgWrap.notimage i.file-preview {
margin-top: 15px;
}
#upload .filelist li img {
width: 100%;
}
#upload .filelist li p.error {
background: #f43838;
color: #fff;
position: absolute;
bottom: 0;
left: 0;
height: 28px;
line-height: 28px;
width: 100%;
z-index: 100;
display:none;
}
#upload .filelist li .success {
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 40px;
width: 100%;
z-index: 200;
background: url(./images/success.png) no-repeat right bottom;
background-image: url(./images/success.gif) \9;
}
#upload .filelist li.filePickerBlock {
width: 113px;
height: 113px;
background: url(./images/image.png) no-repeat center 12px;
border: 1px solid #eeeeee;
border-radius: 0;
}
#upload .filelist li.filePickerBlock div.webuploader-pick {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
opacity: 0;
background: none;
font-size: 0;
}
#upload .filelist div.file-panel {
position: absolute;
height: 0;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
top: 0;
left: 0;
overflow: hidden;
z-index: 300;
}
#upload .filelist div.file-panel span {
width: 24px;
height: 24px;
display: inline;
float: right;
text-indent: -9999px;
overflow: hidden;
background: url(./images/icons.png) no-repeat;
background: url(./images/icons.gif) no-repeat \9;
margin: 5px 1px 1px;
cursor: pointer;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#upload .filelist div.file-panel span.rotateLeft {
display:none;
background-position: 0 -24px;
}
#upload .filelist div.file-panel span.rotateLeft:hover {
background-position: 0 0;
}
#upload .filelist div.file-panel span.rotateRight {
display:none;
background-position: -24px -24px;
}
#upload .filelist div.file-panel span.rotateRight:hover {
background-position: -24px 0;
}
#upload .filelist div.file-panel span.cancel {
background-position: -48px -24px;
}
#upload .filelist div.file-panel span.cancel:hover {
background-position: -48px 0;
}
#upload .statusBar {
height: 45px;
border-bottom: 1px solid #dadada;
margin: 0 10px;
padding: 0;
line-height: 45px;
vertical-align: middle;
position: relative;
}
#upload .statusBar .progress {
border: 1px solid #1483d8;
width: 198px;
background: #fff;
height: 18px;
position: absolute;
top: 12px;
display: none;
text-align: center;
line-height: 18px;
color: #6dbfff;
margin: 0 10px 0 0;
}
#upload .statusBar .progress span.percentage {
width: 0;
height: 100%;
left: 0;
top: 0;
background: #1483d8;
position: absolute;
}
#upload .statusBar .progress span.text {
position: relative;
z-index: 10;
}
#upload .statusBar .info {
display: inline-block;
font-size: 14px;
color: #666666;
}
#upload .statusBar .btns {
position: absolute;
top: 7px;
right: 0;
line-height: 30px;
}
#filePickerBtn {
display: inline-block;
float: left;
}
#upload .statusBar .btns .webuploader-pick,
#upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-uploading,
#upload .statusBar .btns .uploadBtn.state-paused {
background: #ffffff;
border: 1px solid #cfcfcf;
color: #565656;
padding: 0 18px;
display: inline-block;
border-radius: 3px;
margin-left: 10px;
cursor: pointer;
font-size: 14px;
float: left;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#upload .statusBar .btns .webuploader-pick-hover,
#upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-uploading:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #f0f0f0;
}
#upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-paused{
background: #00b7ee;
color: #fff;
border-color: transparent;
}
#upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover{
background: #00a2d4;
}
#upload .statusBar .btns .uploadBtn.disabled {
pointer-events: none;
filter:alpha(opacity=60);
-moz-opacity:0.6;
-khtml-opacity: 0.6;
opacity: 0.6;
}
/* 图片管理样式 */
#online {
width: 100%;
height: 336px;
padding: 10px 0 0 0;
}
#online #fileList{
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
position: relative;
}
#online ul {
display: block;
list-style: none;
margin: 0;
padding: 0;
}
#online li {
float: left;
display: block;
list-style: none;
padding: 0;
width: 113px;
height: 113px;
margin: 0 0 9px 9px;
*margin: 0 0 6px 6px;
background-color: #eee;
overflow: hidden;
cursor: pointer;
position: relative;
}
#online li.clearFloat {
float: none;
clear: both;
display: block;
width:0;
height:0;
margin: 0;
padding: 0;
}
#online li img {
cursor: pointer;
}
#online li div.file-wrapper {
cursor: pointer;
position: absolute;
display: block;
width: 111px;
height: 111px;
border: 1px solid #eee;
background: url("./images/bg.png") repeat;
}
#online li div span.file-title{
display: block;
padding: 0 3px;
margin: 3px 0 0 0;
font-size: 12px;
height: 13px;
color: #555555;
text-align: center;
width: 107px;
white-space: nowrap;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
}
#online li .icon {
cursor: pointer;
width: 113px;
height: 113px;
position: absolute;
top: 0;
left: 0;
z-index: 2;
border: 0;
background-repeat: no-repeat;
}
#online li .icon:hover {
width: 107px;
height: 107px;
border: 3px solid #1094fa;
}
#online li.selected .icon {
background-image: url(images/success.png);
background-image: url(images/success.gif) \9;
background-position: 75px 75px;
}
#online li.selected .icon:hover {
width: 107px;
height: 107px;
border: 3px solid #1094fa;
background-position: 72px 72px;
}
/* 在线文件的文件预览图标 */
i.file-preview {
display: block;
margin: 10px auto;
width: 70px;
height: 70px;
background-image: url("./images/file-icons.png");
background-image: url("./images/file-icons.gif") \9;
background-position: -140px center;
background-repeat: no-repeat;
}
i.file-preview.file-type-dir{
background-position: 0 center;
}
i.file-preview.file-type-file{
background-position: -140px center;
}
i.file-preview.file-type-filelist{
background-position: -210px center;
}
i.file-preview.file-type-zip,
i.file-preview.file-type-rar,
i.file-preview.file-type-7z,
i.file-preview.file-type-tar,
i.file-preview.file-type-gz,
i.file-preview.file-type-bz2{
background-position: -280px center;
}
i.file-preview.file-type-xls,
i.file-preview.file-type-xlsx{
background-position: -350px center;
}
i.file-preview.file-type-doc,
i.file-preview.file-type-docx{
background-position: -420px center;
}
i.file-preview.file-type-ppt,
i.file-preview.file-type-pptx{
background-position: -490px center;
}
i.file-preview.file-type-vsd{
background-position: -560px center;
}
i.file-preview.file-type-pdf{
background-position: -630px center;
}
i.file-preview.file-type-txt,
i.file-preview.file-type-md,
i.file-preview.file-type-json,
i.file-preview.file-type-htm,
i.file-preview.file-type-xml,
i.file-preview.file-type-html,
i.file-preview.file-type-js,
i.file-preview.file-type-css,
i.file-preview.file-type-php,
i.file-preview.file-type-jsp,
i.file-preview.file-type-asp{
background-position: -700px center;
}
i.file-preview.file-type-apk{
background-position: -770px center;
}
i.file-preview.file-type-exe{
background-position: -840px center;
}
i.file-preview.file-type-ipa{
background-position: -910px center;
}
i.file-preview.file-type-mp4,
i.file-preview.file-type-swf,
i.file-preview.file-type-mkv,
i.file-preview.file-type-avi,
i.file-preview.file-type-flv,
i.file-preview.file-type-mov,
i.file-preview.file-type-mpg,
i.file-preview.file-type-mpeg,
i.file-preview.file-type-ogv,
i.file-preview.file-type-webm,
i.file-preview.file-type-rm,
i.file-preview.file-type-rmvb{
background-position: -980px center;
}
i.file-preview.file-type-ogg,
i.file-preview.file-type-wav,
i.file-preview.file-type-wmv,
i.file-preview.file-type-mid,
i.file-preview.file-type-mp3{
background-position: -1050px center;
}
i.file-preview.file-type-jpg,
i.file-preview.file-type-jpeg,
i.file-preview.file-type-gif,
i.file-preview.file-type-bmp,
i.file-preview.file-type-png,
i.file-preview.file-type-psd{
background-position: -140px center;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save