Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Dev 1.2.6 doc #3244

Open
wants to merge 110 commits into
base: dev-1.5.0
Choose a base branch
from
Open
Changes from 7 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
0f49506
[fix]by Jinqn
carsonxu Aug 21, 2013
ea125ec
[fix]by Jinqn
carsonxu Aug 22, 2013
e0d54a0
[fixed] by xuheng
Aug 23, 2013
7cdaab8
文档更新
HanCong03 Aug 26, 2013
8b09e01
注释完善
HanCong03 Aug 26, 2013
dc72b62
文档view
HanCong03 Aug 26, 2013
ddabd5c
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Aug 26, 2013
8beec9d
[fixed] by xuheng
Aug 26, 2013
7d494cc
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Aug 26, 2013
fba40e3
[fix]by Jinqn
carsonxu Aug 26, 2013
88879d5
[fix]by Jinqn
carsonxu Aug 26, 2013
7cf8068
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Aug 26, 2013
46ed724
by zhanyi
campaign Aug 26, 2013
89bbb8e
文档
HanCong03 Aug 26, 2013
efe41db
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Aug 26, 2013
736f405
重编译api
HanCong03 Aug 26, 2013
c5ac757
[fix]by Jinqn
carsonxu Aug 26, 2013
4cb95f7
文档+插件文档示例
HanCong03 Aug 27, 2013
d2ef4d1
[fix]by Jinqn
carsonxu Aug 27, 2013
9ec6e60
[fix]by Jinqn
carsonxu Aug 27, 2013
45c6f18
[fix]by Jinqn
carsonxu Aug 27, 2013
991970d
[fix]by Jinqn
carsonxu Aug 27, 2013
b877ad0
[fixed] by xuheng
Aug 28, 2013
78459bd
修改
HanCong03 Aug 28, 2013
7a74361
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Aug 28, 2013
0da884b
[fixed] by xuheng
Aug 28, 2013
41b41e4
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Aug 28, 2013
692dcec
插件文档
HanCong03 Aug 28, 2013
fd078f8
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Aug 28, 2013
c0e7a97
文档 Range提交
HanCong03 Aug 28, 2013
284204c
Range 文档
HanCong03 Aug 29, 2013
7ed5c84
整体文档build
HanCong03 Aug 29, 2013
7cbfcbc
[fixed] by xuheng
Aug 29, 2013
3e70cd8
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Aug 29, 2013
932d3cc
文档修改
HanCong03 Aug 29, 2013
bcf7dd3
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Aug 29, 2013
65f8d78
[fix]by Jinqn
carsonxu Aug 30, 2013
f590565
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Aug 30, 2013
e2c06b0
[fixed] by xuheng
Aug 30, 2013
322cc75
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Aug 30, 2013
5730711
[fix]by Jinqn
carsonxu Aug 30, 2013
40d3e63
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Aug 30, 2013
5910012
[fix]by Jinqn
carsonxu Aug 30, 2013
c5e7bc3
[fix]by Jinqn
carsonxu Aug 30, 2013
3181816
文档fix
HanCong03 Aug 30, 2013
19de848
文档修改
HanCong03 Aug 30, 2013
104a196
最新文档提交
HanCong03 Aug 30, 2013
4910e8d
[fixed] by xuheng
Aug 30, 2013
b39089d
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Aug 30, 2013
051d5fd
[fixed] by xuheng
Aug 30, 2013
1dd432a
[fix]by Jinqn
carsonxu Aug 30, 2013
f02d38b
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Aug 30, 2013
62e1a7d
文档微调
HanCong03 Aug 30, 2013
78bfd5d
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 1, 2013
ec2855f
修改样式引用路径
HanCong03 Sep 2, 2013
9fb38a2
[fixed] by xuheng
Sep 2, 2013
d1b4ab3
[fixed] by xuheng
Sep 2, 2013
acec179
[fixed] by xuheng
Sep 2, 2013
7fdd4ed
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 2, 2013
82ce4fe
文档微调
HanCong03 Sep 4, 2013
76363d5
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Sep 4, 2013
cb5201c
文档更新
HanCong03 Sep 5, 2013
c989d8f
[fixed] by xuheng
Sep 5, 2013
5ec74b7
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Sep 5, 2013
3aa2a17
[fixed] by xuheng
Sep 5, 2013
11c1357
[fixed] by xuheng
Sep 5, 2013
64c9442
[fixed] by xuheng
Sep 5, 2013
c9c3d21
[fixed] by xuheng
Sep 5, 2013
d98a094
[fixed] by xuheng
Sep 5, 2013
82101d6
[fixed] by xuheng
Sep 5, 2013
d805ab2
[fixed] by xuheng
Sep 5, 2013
163a746
[fixed] by xuheng
Sep 5, 2013
caa563d
[fix]by Jinqn
carsonxu Sep 5, 2013
8d54132
[fix]by Jinqn
carsonxu Sep 5, 2013
59e21b2
文档调整
HanCong03 Sep 5, 2013
3651937
合并
HanCong03 Sep 5, 2013
125f1c6
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Sep 5, 2013
1a6a963
[fix]by Jinqn
carsonxu Sep 5, 2013
17df1b7
文档合并
HanCong03 Sep 5, 2013
8eee6e5
段落修改
HanCong03 Sep 6, 2013
9ddbe45
[fixed] by xuheng
Sep 6, 2013
801d7ee
Merge remote-tracking branch 'origin/dev-1.2.6-doc' into dev-1.2.6-doc
Sep 6, 2013
f7d918b
[fixed] by xuheng
Sep 6, 2013
95a86a7
视频修改
HanCong03 Sep 6, 2013
a6047d8
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Sep 6, 2013
09e52f8
替换KeyValueMap类型为Object类型
HanCong03 Sep 6, 2013
3f5dfde
命令部分文档微调
HanCong03 Sep 6, 2013
3e31be2
by Jinqn
Sep 9, 2013
a81456c
by Jinqn
Sep 9, 2013
8102d84
文档修改
HanCong03 Sep 9, 2013
4bf497c
[fix]by Jinqn
carsonxu Sep 10, 2013
7c8d02b
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
carsonxu Sep 10, 2013
16e831d
by Jinqn
Sep 10, 2013
0ff0e84
文档修改
HanCong03 Sep 11, 2013
3972664
Merge branch 'dev-1.2.6-doc' of github.com:campaign/ueditor into dev-…
HanCong03 Sep 11, 2013
7c13b40
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
Sep 12, 2013
aa1da20
by Jinqn
Sep 12, 2013
ab53d75
by Jinqn
Sep 12, 2013
186d26c
插件文档完善
HanCong03 Sep 22, 2013
b53718e
文档bug修改
HanCong03 Sep 23, 2013
0f8aa9e
文档补充
HanCong03 Sep 24, 2013
131b9b1
文档完善
HanCong03 Sep 24, 2013
31334a8
文档升级
HanCong03 Sep 25, 2013
3768202
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 25, 2013
646f544
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 25, 2013
43ec0c9
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 25, 2013
4f521ed
图片命令修改
HanCong03 Sep 25, 2013
21f36d0
Merge branch 'dev-1.2.6-doc' of https://github.com/campaign/ueditor i…
campaign Sep 25, 2013
3f39b9a
文档微调
HanCong03 Sep 25, 2013
93f2412
文档vigia
HanCong03 Sep 26, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 64 additions & 32 deletions _src/core/ajax.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/**
* @file
* @name UE.ajax
* @short Ajax
* @desc UEditor内置的ajax请求模块
* @import core/utils.js
* @user: taoqili
* @date: 11-8-18
* @time: 下午3:18
* @module UE.ajax
* @since 1.2.6.1
*/

/**
* 提供对ajax请求的支持
* @module UE.ajax
*/
UE.ajax = function() {
/**
* 创建一个ajaxRequest对象
*/

//创建一个ajaxRequest对象
var fnStr = 'XMLHttpRequest()';
try {
new ActiveXObject("Msxml2.XMLHTTP");
@@ -26,7 +25,7 @@ UE.ajax = function() {
var creatAjaxRequest = new Function('return new ' + fnStr);


/**
/*
* 将json参数转化成适合ajax提交的参数列表
* @param json
*/
@@ -46,30 +45,63 @@ UE.ajax = function() {


return {
/**
* @name request
* @desc 发出ajax请求,ajaxOpt中默认包含method,timeout,async,data,onsuccess以及onerror等六个,支持自定义添加参数
* @grammar UE.ajax.request(url,ajaxOpt);
/**
* 根据给定的参数项,向指定的url发起一个ajax请求。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求
* 成功, 则调用onsuccess回调, 失败则调用 onerror 回调
* @method request
* @param { URLString } url ajax请求的url地址
* @param { PlainObject } ajaxOptions ajax请求选项的key-value对象,支持的选项如下:
* @example
* UE.ajax.request('http://www.xxxx.com/test.php',{
* //可省略,默认POST
* method:'POST',
* //可以自定义参数
* content:'这里是提交的内容',
* //也可以直接传json,但是只能命名为data,否则当做一般字符串处理
* data:{
* name:'UEditor',
* age:'1'
* }
* onsuccess:function(xhr){
* console.log(xhr.responseText);
* ```javascript
* //向sayhello.php发起一个异步的Ajax GET请求, 请求超时时间为10s, 请求完成后执行相应的回调。
* UE.ajax.requeset( 'sayhello.php', {
*
* //请求方法。可选值: 'GET', 'POST',默认值是'POST'
* method: 'GET',
*
* //超时时间。 默认为5000, 单位是ms
* timeout: 10000,
*
* //是否是异步请求。 true为异步请求, false为同步请求
* async: true,
*
* //请求携带的数据。如果请求为GET请求, data会经过stringify后附加到请求url之后。
* data: {
* name: 'ueditor'
* },
*
* //请求成功后的回调, 该回调接受当前的XMLHttpRequest对象作为参数。
* onsuccess: function ( xhr ) {
* console.log( xhr.responseText );
* },
* onerror:function(xhr){
* console.log(xhr.responseText);
*
* //请求失败或者超时后的回调。
* onerror: function ( xhr ) {
* alert( 'Ajax请求失败' );
* }
* })
* @param ajaxOptions
*/
*
* } );
* ```
*/

/**
* 根据给定的参数项发起一个ajax请求, 参数项里必须包含一个url地址。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求
* 成功, 则调用onsuccess回调, 失败则调用 onerror 回调。
* @method request
* @warning 如果在参数项里未提供一个key为“url”的地址值,则该请求将直接退出。
* @param { PlainObject } ajaxOptions ajax请求选项的key-value对象,支持的选项如下:
* @example
* ```javascript
*
* //向sayhello.php发起一个异步的Ajax POST请求, 请求超时时间为5s, 请求完成后不执行任何回调。
* UE.ajax.requeset( 'sayhello.php', {
*
* //请求的地址, 该项是必须的。
* url: 'sayhello.php'
*
* } );
* ```
*/
request:function(url, ajaxOptions) {
var ajaxRequest = creatAjaxRequest(),
//是否超时
185 changes: 128 additions & 57 deletions _src/core/browser.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,85 @@
/**
* 浏览器判断模块
* @file
* @name UE.browser
* @short Browser
* @desc UEditor中采用的浏览器判断模块
* @module UE.browser
* @since 1.2.6.1
*/

/**
* 提供浏览器检测的模块
* @unfile
* @module UE.browser
*/
var browser = UE.browser = function(){
var agent = navigator.userAgent.toLowerCase(),
opera = window.opera,
browser = {

/**
* 检测浏览器是否为IE
* @name ie
* @grammar UE.browser.ie => true|false
* @property {boolean} ie 检测当前浏览器是否为IE
* @example
* ```javascript
* if ( UE.browser.ie ) {
* console.log( '当前浏览器是IE' );
* }
* ```
*/
ie : !!window.ActiveXObject,

/**
* 检测浏览器是否为Opera
* @name opera
* @grammar UE.browser.opera => true|false
* @property {boolean} opera 检测当前浏览器是否为Opera
* @example
* ```javascript
* if ( UE.browser.opera ) {
* console.log( '当前浏览器是Opera' );
* }
* ```
*/
opera : ( !!opera && opera.version ),

/**
* 检测浏览器是否为webkit内核
* @name webkit
* @grammar UE.browser.webkit => true|false
* @property {boolean} webkit 检测当前浏览器是否是webkit内核的浏览器
* @example
* ```javascript
* if ( UE.browser.webkit ) {
* console.log( '当前浏览器是webkit内核浏览器' );
* }
* ```
*/
webkit : ( agent.indexOf( ' applewebkit/' ) > -1 ),

/**
* 检测浏览器是否为mac系统下的浏览器
* @name mac
* @grammar UE.browser.mac => true|false
* @property {boolean} mac 检测当前浏览器是否是运行在mac平台下
* @example
* ```javascript
* if ( UE.browser.mac ) {
* console.log( '当前浏览器运行在mac平台下' );
* }
* ```
*/
mac : ( agent.indexOf( 'macintosh' ) > -1 ),

/**
* 检测浏览器是否处于怪异模式
* @name quirks
* @grammar UE.browser.quirks => true|false
* @property {boolean} quirks 检测当前浏览器是否处于“怪异模式”下
* @example
* ```javascript
* if ( UE.browser.quirks ) {
* console.log( '当前浏览器运行处于“怪异模式”' );
* }
* ```
*/
quirks : ( document.compatMode == 'BackCompat' )
};

/**
* 检测浏览器是否处为gecko内核
* @name gecko
* @grammar UE.browser.gecko => true|false
*/
* @property {boolean} gecko 检测当前浏览器内核是否是gecko内核
* @example
* ```javascript
* if ( UE.browser.gecko ) {
* console.log( '当前浏览器内核是gecko内核' );
* }
* ```
*/
browser.gecko =( navigator.product == 'Gecko' && !browser.webkit && !browser.opera );

var version = 0;
@@ -56,37 +88,63 @@ var browser = UE.browser = function(){
if ( browser.ie ){
version = parseFloat( agent.match( /msie (\d+)/ )[1] );
/**
* 检测浏览器是否为 IE9 模式
* @name ie9Compat
* @grammar UE.browser.ie9Compat => true|false
* @property { boolean } ie9Compat 检测浏览器模式是否为 IE9 兼容模式
* @warning 如果浏览器不是IE, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.ie9Compat ) {
* console.log( '当前浏览器运行在IE9兼容模式下' );
* }
* ```
*/
browser.ie9Compat = document.documentMode == 9;

/**
* 检测浏览器是否为 IE8 浏览器
* @name ie8
* @grammar UE.browser.ie8 => true|false
* @property { boolean } ie8 检测浏览器是否是IE8浏览器
* @warning 如果浏览器不是IE, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.ie8 ) {
* console.log( '当前浏览器是IE8浏览器' );
* }
* ```
*/
browser.ie8 = !!document.documentMode;

/**
* 检测浏览器是否为 IE8 模式
* @name ie8Compat
* @grammar UE.browser.ie8Compat => true|false
* @property { boolean } ie8Compat 检测浏览器模式是否为 IE8 兼容模式
* @warning 如果浏览器不是IE, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.ie8Compat ) {
* console.log( '当前浏览器运行在IE8兼容模式下' );
* }
* ```
*/
browser.ie8Compat = document.documentMode == 8;

/**
* 检测浏览器是否运行在 兼容IE7模式
* @name ie7Compat
* @grammar UE.browser.ie7Compat => true|false
* @property { boolean } ie7Compat 检测浏览器模式是否为 IE7 兼容模式
* @warning 如果浏览器不是IE, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.ie7Compat ) {
* console.log( '当前浏览器运行在IE7兼容模式下' );
* }
* ```
*/
browser.ie7Compat = ( ( version == 7 && !document.documentMode )
|| document.documentMode == 7 );

/**
* 检测浏览器是否IE6模式或怪异模式
* @name ie6Compat
* @grammar UE.browser.ie6Compat => true|false
* @property { boolean } ie6Compat 检测浏览器模式是否为 IE6 模式 或者怪异模式
* @warning 如果浏览器不是IE, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.ie6Compat ) {
* console.log( '当前浏览器运行在IE6模式或者怪异模式下' );
* }
* ```
*/
browser.ie6Compat = ( version < 7 || browser.quirks );

@@ -101,18 +159,30 @@ var browser = UE.browser = function(){
version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 ) * 1;
}
}

/**
* 检测浏览器是否为chrome
* @name chrome
* @grammar UE.browser.chrome => true|false
* @property { Number } chrome 检测当前浏览器是否为Chrome, 如果是,则返回Chrome的大版本号
* @warning 如果浏览器不是chrome, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.chrome ) {
* console.log( '当前浏览器是Chrome' );
* }
* ```
*/
if (/chrome\/(\d+\.\d)/i.test(agent)) {
browser.chrome = + RegExp['\x241'];
}

/**
* 检测浏览器是否为safari
* @name safari
* @grammar UE.browser.safari => true|false
* @property { Number } safari 检测当前浏览器是否为Safari, 如果是,则返回Safari的大版本号
* @warning 如果浏览器不是safari, 则该值为undefined
* @example
* ```javascript
* if ( UE.browser.safari ) {
* console.log( '当前浏览器是Safari' );
* }
* ```
*/
if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && !/chrome/i.test(agent)){
browser.safari = + (RegExp['\x241'] || RegExp['\x242']);
@@ -128,27 +198,28 @@ var browser = UE.browser = function(){
version = parseFloat( agent.match( / applewebkit\/(\d+)/ )[1] );

/**
* 浏览器版本判断
* IE系列返回值为5,6,7,8,9,10等
* gecko系列会返回10900,158900等.
* webkit系列会返回其build号 (如 522等).
* @name version
* @grammar UE.browser.version => number
* @property { Number } version 检测当前浏览器版本号
* @remind
* <ul>
* <li>IE系列返回值为5,6,7,8,9,10等</li>
* <li>gecko系列会返回10900,158900等</li>
* <li>webkit系列会返回其build号 (如 522等)</li>
* </ul>
* @example
* if ( UE.browser.ie && UE.browser.version == 6 ){
* alert( "Ouch!居然是万恶的IE6!" );
* }
* ```javascript
* console.log( '当前浏览器版本号是: ' + UE.browser.version );
* ```
*/
browser.version = version;

/**
* 是否是兼容模式的浏览器
* @name isCompatible
* @grammar UE.browser.isCompatible => true|false
* @property { boolean } isCompatible 检测当前浏览器是否能够与UEditor良好兼容
* @example
* if ( UE.browser.isCompatible ){
* alert( "你的浏览器相当不错哦!" );
* ```javascript
* if ( UE.browser.isCompatible ) {
* console.log( '浏览器与UEditor能够良好兼容' );
* }
* ```
*/
browser.isCompatible =
!browser.mobile && (
Loading