Commit 2793e370 authored by techird's avatar techird

Merge branch 'clean-up' into dev

parents 8c5c6f52 19006c0a
{
"directory": "lib"
}
\ No newline at end of file
...@@ -5,7 +5,3 @@ ...@@ -5,7 +5,3 @@
dist/ dist/
node_modules/ node_modules/
_drafts/ _drafts/
native-support/archive/src/tmp/
native-support/archive/upload/
ui/theme/default/css/*.css
ui/theme/default/css/*.css.map
\ No newline at end of file
[submodule "lib/kity"] [submodule "lib/kity"]
path = lib/kity path = lib/kity
url = https://github.com/fex-team/kity url = https://github.com/fex-team/kity
[submodule "lib/fui"] [submodule "lib/promise"]
path = lib/fui path = lib/promise
url = https://github.com/fex-team/fui url = https://github.com/jakearchibald/es6-promise
[submodule "lib/fio"]
path = lib/fio
url = https://github.com/fex-team/fio
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"disallowSpacesInsideParentheses": true, "disallowSpacesInsideParentheses": true,
// 行尾「MUST NOT」使用空格 // 行尾「MUST NOT」使用空格
"disallowTrailingWhitespace": false, "disallowTrailingWhitespace": true,
// 每行「MUST NOT」超过 120 个字符 // 每行「MUST NOT」超过 120 个字符
"maximumLineLength": 120, "maximumLineLength": 120,
......
...@@ -10,27 +10,7 @@ ...@@ -10,27 +10,7 @@
"browser": true, "browser": true,
"boss": true, "boss": true,
"predef" : [ "predef" : [
"module", "define",
"require",
"console",
"kity",
"KityMinder",
"KM",
"Minder",
"MinderNode",
"MinderEvent",
"Command",
"KITYMINDER_CONFIG",
"keymap",
"Utils",
"utils",
"$",
"KM",
"keymap",
"baidu",
"browser",
"FUI",
"fio",
"Promise" "Promise"
] ]
} }
\ No newline at end of file
# KityMinder 更新日志 # KityMinder-Core 更新日志
## v1.3.2
### 功能更新
1. 支持全屏查看模式
2. 添加「视图」选项卡
3. 添加文件管理功能(移动、回收站、重命名)
4. 分享文件允许再次编辑
5. 支持「百度图片」搜索插入
6. 支持保存及导出到 XMind 和 FreeMind 格式
### 体验优化
1. 脑图加载时打开上次编辑的文件,而不是优先打开草稿箱
2. 修改展开按钮位置
## v1.3.1
### 功能更新
1. 添加了「展开全部节点」和「收起到一级节点」的菜单项
2. 添加了错误信息收集窗口
### BUG 修复
1. 缓存问题导致打开旧文件
2. 保存失败后草稿箱仍删除的问题
### 体验优化
1. 去除 alert,改用通知条来提示信息或错误
## v1.3.0
### 功能更新
1. 全新的 Ribbon 风格 UI 界面
2. 思维导图模板下,智能选择子节点的布局
3. 文本输入支持软回车(`Shift` + `Enter`)换行
4. 打开和保存文件到网盘支持目录选择和创建
5. 增加了逻辑结构图的模板
6. 增加视野导航控件的支持,并且支持 `Ctrl` + `方向键` 来导航视野
7. 分享的文件支持列出以及取消(登陆后)
8. 移动端分享页面的查看
9. 编辑过程支持自动保存(仅限已保存到网盘过的文件)
10. 点击超链接跳转前提示连接地址
11. 直接搜索节点(右上角搜索框或 `Ctrl` + `F`
12. 增加了「紧凑」系列的皮肤
### BUG 修复
1. 修复文字不能删空的 BUG
## v1.2.1
### 体验优化
1. 较大提升了文件载入和操作的性能
2. 拖动时不显示子节点和连接线
3. 文字输入细节体验优化
4. 历史回退使用动画回退
5. 美化帮助窗口的样式
### BUG 修复
1. 修复 F2 不能编辑的 BUG
2. 修复按 Shift + Tab 页面溢出的 BUG
## v1.2.0
### 新功能
1. 允许节点自由拖动
2. 允许节点排序(包括拖动以及快捷键 Alt + Up 和 Alt + Down)
3. 节点上插入在线图片(暂不支持本地图片)
4. 节点上添加资源标签(分配负责人)
5. 支持节点复制粘贴
6. 支持换肤,添加了 “文艺清新” 系列的几个皮肤
### 体验优化
1. 界面重新设计,更加美观
2. 布局性能有较大的提高
3. 调整了文字输入的交互
4. 添加了布局时的动画效果
5. 扩大了超链接的点击范围
6. 优先级增加至 9 个,进度增加至 9 个
7. 支持ipad编辑
### BUG 修复
1. 修复 XSS 攻击问题(超链接和图片)
2. 修复导入损坏文件报错的问题
3. 修复新版 Chrome 下载扩展名错误问题
4. 修复 SVG 和 PNG 在缩放之后导出不全的问题
5. 修复缩放后选区闪烁的问题
6. 修复分享内容无法更新的问题 说明:需要再次点击分享创建更新链接
## v1.1.3.2
### Hot Fix
1. 修复新版 Chrome 浏览器无法导出正确文件格式的问题([#77](https://github.com/fex-team/kityminder/issues/77)
## v1.1.3.1
### Hot Fix
1. 修复某些输入法下输入英文的问题
2. 添加网盘操作(加载列表、保存文件等)失败后重试的机制
## v1.1.3
### 功能更新
1. 保存时可自定义文件名
2. 添加/删除超链接,导入第三方格式支持超链接
3. 选中节点时,按F2直接进入文字编辑状态
4. "展开全部节点""收起全部节点"功能
5. 当前选中的高亮的节点可直接进行文字编辑
6. 右键选中节点,显示编辑节点的菜单
7. 可指定放大缩小的百分比
## 问题修复
1. 修复当滚动鼠标滚轮时,光标不跟着移动的问题
2. 优化了拖拽节点操作体验
3. 修复回退操作后所选节点未回选问题
4. 修复回退操作后展开收起的节点没有记录问题
5. 优化了输入文字时的卡顿效果
6. 优化了当输入中文时,中文显示位置与光标距离过远的问题
7. html标签转码问题
8. 修复撤销按钮点击后,重做按钮还是不可点问题
## v1.1.2
### 功能更新
1. **支持本地格式文件导入**
* 支持文件拖拽和网盘文件导入
* 格式支持 xmind/freemind/mindmanager,其他格式暂不支持
2. 新增节点移动到视野中
3. 当前文件名加到 Title 中
4. 分享链接直接到粘贴板(针对已经支持的浏览器)
5. 分享到社交网络
6. 用户登出功能
7. 添加只读模式,配置项 readOnly,添加动态调用接口setEnabled,setDisabled
8. 优化当下拉菜单不可执行时,下拉菜单按钮会自动变灰
9. 添加了新的logo图标
### 问题修复
1. 导出 png 和 svg 图片时,文本中如果包含 ` ` 字符会报错的问题
2. 删除中心节点导致页面卡住
3. 文件在IE下无法导出(.txt,.svg,.km)
4. 拖入文件导入之后,草稿箱和社会化文件名不同步
5. 仅有根节点时,将其删除,再添加节点报错
6. 本地部署,127.0.0.1退出后不能登录
7. 去掉了“导出”菜单上的打勾
8. 修复了firefox下光标定位到文字最后空格,光标不跟着移动问题
9. 修复在页面失去焦点时光标不消失
10. 优化了光标定位和闪烁时常
## v1.1.1
### 功能更新
1. 添加文件操作快捷键支持:
* 新建脑图(`Ctrl` + `N`
* 保存脑图到云端(`Ctrl` + `S`
* 分享脑图(`Ctrl` + `Shift` + `S`
2. 草稿功能升级为草稿箱
3. 添加了帮助菜单
### 问题修复
1. 修复切换文件时,回复历史没有清空的问题
2. 修复在添加 markers 时,会出现 js 报错的问题
3. 仅有根节点,将其删除,再添加节点报错
## v1.1.0
### 功能更新
1. 添加了剪贴板操作的支持
2. 添加了本地自动保存草稿的功能
3. 优化了文字选中效果
4. 改进了文字输入体验
### 功能调整
1. 视野定位功能抽取为 camera 命令,并且创建新文件和打开文件会把视野定位到根节点
### 问题修复
1. 修正了 bottom 主题的位置问题
2. 修正了子节点全部删除后展开/收缩标志依然存在画布上的问题
3. 修复了 bottom 主题的键盘导航出错的问题
4. 滚轮缩放的问题
## v1.0.1
### 问题修复
1. 修复 png 导出问题。
## v1.0.0 ## v1.0.0
首个版本发布,包括基本的编辑功能。 完成从[原仓库](https://github.com/fex-team/kityminder)的代码迁移
/*----------------------------------------------------- /* global require, module */
* livereload Default Setting
*-----------------------------------------------------*/
'use strict';
var path = require('path'); var path = require('path');
/*-----------------------------------------------------
* Module Setting
*-----------------------------------------------------*/
module.exports = function(grunt) { module.exports = function(grunt) {
'use strict';
// These plugins provide necessary tasks. // These plugins provide necessary tasks.
/* [Build plugin & task ] ------------------------------------*/ /* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-module-dependence');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-autoprefixer');
var banner = '/*!\n' + var banner = '/*!\n' +
' * ====================================================\n' + ' * ====================================================\n' +
...@@ -32,152 +22,29 @@ module.exports = function(grunt) { ...@@ -32,152 +22,29 @@ module.exports = function(grunt) {
' * ====================================================\n' + ' * ====================================================\n' +
' */\n\n'; ' */\n\n';
var packs = ['index', 'edit', 'share', 'm-share'];
var sources = require('./import.js');
var srcPath = 'src/';
var distPath = 'dist/';
var distPages = ['index', 'edit', 'viewshare', 'm-share'].map(function(name) {
return distPath + name + '.html';
});
var concatConfigs = {};
packs.forEach(function(pack) {
concatConfigs[pack] = {
options: {
banner: banner + '(function(window) {\n\n',
footer: '\n\n})(window)',
sourceMap: true,
sourceMapStyle: 'link'
},
src: sources.filter(function(source) {
return source.pack == '*' || source.pack.split('|').indexOf(pack) !== -1;
}).map(function(source) {
return source.path;
}),
dest: distPath + 'kityminder.' + pack + '.js'
};
});
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
// Metadata. // Metadata.
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
clean: ['dist', 'native-support/upload', 'native-support/src/tmp'], dependence: {
concat: concatConfigs,
uglify: {
minimize: {
options: { options: {
banner: banner, base: 'src',
sourceMap: true entrance: 'kityminder'
},
files: (function() {
var files = {};
packs.forEach(function(pack) {
files[distPath + 'kityminder.' + pack + '.min.js'] = distPath + 'kityminder.' + pack + '.js';
});
return files;
})()
}
},
copy: {
dir: {
files: [{
src: [
'ui/theme/**/css/*.css',
'ui/theme/**/css/*.css.map',
'ui/theme/**/images/*',
'lang/**/*',
'static/**/*',
'native-support/**/*',
'lib/ZeroClipboard.swf',
'lib/inflate.js',
'lib/source-map.min.js',
'index.html',
'edit.html',
'viewshare.html',
'm-share.html',
'download.php'
],
dest: distPath
}]
}, },
km_config: { merge: {
expand: true,
src: 'kityminder.config.js',
dest: distPath
},
mise: {
files: [{ files: [{
src: ['LICENSE', 'favicon.ico', 'README.md', 'CHANGELOG.md'], src: 'src/**/*.js',
dest: distPath dest: 'release/kityminder.all.js'
}]
}
},
replace: {
online: {
src: distPages,
overwrite: true,
replacements: [{
from: /import\.js\?pack=([\w-]+)\"/,
to: 'kityminder.$1.min.js"'
}]
},
noCache: {
src: distPages,
overwrite: true,
replacements: [{
from: /src=\"(.+?)\.js\"/ig,
to: 'src="$1.js?_=' + (+new Date()) + '"'
}] }]
} }
},
watch: {
less: {
files: ['ui/theme/**/*.less'],
tasks: ['less:compile', 'autoprefixer']
}
},
less: {
compile: {
files: {
'ui/theme/default/css/default.all.temp.css': [
'ui/theme/default/css/import.less'
]
},
options: {
sourceMap: true,
sourceMapFilename: 'ui/theme/default/css/default.all.temp.css.map',
sourceMapBasepath: 'ui/theme/default/css/'
}
}
},
autoprefixer: {
all: {
options: {
map: true
},
src: 'ui/theme/default/css/default.all.temp.css',
dest: 'ui/theme/default/css/default.all.css'
}
} }
}); });
// Build task(s). // Build task(s).
grunt.registerTask('default', ['clean', 'concat', 'uglify', 'less', 'autoprefixer', 'copy', 'replace']); grunt.registerTask('default', ['dependence']);
grunt.registerTask('dev', ['less', 'autoprefixer', 'watch']);
}; };
\ No newline at end of file
{
"name": "kityminder-core",
"title": "Kity Minder Core",
"description": "Powerful online mind graphic visualization and editor (command based)",
"version": "1.3.6",
"main": "src/kityminder.js",
"keywords": ["kityminder", "kity", "svg"],
"homepage": "https://github.com/fex-team/kityminder-core",
"devDependencies": {
"seajs": "~2.3.0"
},
"licenses": [{
"type": "BSD",
"url": "https://github.com/fex-team/kityminder-core/blob/dev/LICENSE"
}],
"bugs": {
"url": "https://github.com/fex-team/kityminder-core/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/fex-team/kityminder-core.git"
},
"author": {
"name": "Baidu FEX",
"url": "http://fex.baidu.com"
}
}
\ No newline at end of file
# 导入导出功能设计
## 名词
* 本地格式
指一种公开的脑图编码格式,如 XMind、FreeMind、MinderManager、PDF等。下文代码中,local 表示本地格式字符串或二进制流(Blob)。
* Json格式
指 KityMinder 自身使用的 JS 内存对象,是带数据的树结构。数据结构如下:
```js
// A <MinderNode> is:
{
"data" : {...},
"children" : [<MinderNode>, <MinderNode>, ...]
}
```
下文代码中,json 表示 json 格式字符串。
* 编码
把 Json 格式转换为一种本地格式的过程
* 解码
把一种本地格式解析回 Json 格式的过程
* 协议
协议包含名称(作为标识)、编码方法(encode)、解码方法(decode)、识别判断(recognize)。解码方法是可选项,因为对于某些协议可以只支持导出而不需支持导入(如 PDF )。识别判断也是可选的,识别判断用于快速判断一个字符串或 Blob 是否改协议的本地数据,这个方法用于自动识别未知格式的协议。如果不提供这个方法,那么将不能把未知格式识别为该协议的格式,所以建议提供。
## 协议注册
使用 `KityMinder` 上的静态方法 `registerProtocal()` 来注册协议。
```js
KityMinder.registerProtocal( "xmind", function() {
return {
encode: function( json ) {
// return local;
},
decode: function( local ) {
// return json;
},
recognize: function( local ) {
// return bool;
}
}
});
```
## 协议使用
使用 `KityMinder` 上的静态方法 `findProtocal()` 来获取协议。
```js
var pXMind = KityMinder.findProtocal( "xmind" );
if (pXMind && pXMind.encode) {
local = pXMind.encode( json );
}
```
## 协议枚举
使用 `KityMinder` 上的静态方法 `getSupportedProtocals()` 来获取支持的协议列表。
```js
var supported = KityMinder.getSupportedProtocals();
// supported == [ 'xmind', 'txt', 'pdf', ... ]
```
## 导入导出接口
导入导出接口名称与原来架构的保持一致,只是参数有所调整。
### 导入
```js
minder.importData( local [, protocalName] );
```
导入数据需要提供读取到的本地数据,如果指明协议,则直接用指明的协议来解析;否则尝试去识别本地数据的协议格式。
### 导出
```js
var exported = minder.exportData( [protocalName] );
```
使用指定的协议来导出数据,如果不指定,则导出成 Json 格式。
#脑图提测-上线流程
###前提
* 测试的浏览器版本默认涵盖Chrome/FireFox/IE9+
* 对全部功能的测试都涵盖快捷键和菜单两种操作方式
* 目前只进行PC端的测试
### 提测前确认
* 确认大家的代码全部成功提交,在<a href='fex.baidu.com/kityminder.dist'>fex.baidu.com/kityminder.dist</a>上可运行
* 统一github上issue和项目文件夹里的CHANGELOG.md的修改点
###新上线功能测试
* 根据CHANGELOG.md的列表测试本次待上线功能
###回归测试
* 每次上线需要回归测试的点:
1.导入功能
第三方格式:包括xmind/freemind/mindmanager
kityMinder自带格式:.km,.txt
加载最近脑图:打开应用时自动加载最近编辑的脑图
从网盘中加载:点选文件列表中的文件可以从网盘中加载相应的内容
---
2.导出功能
文本格式:.km,.txt
图片格式:.png,.svg
保存到网盘:1)保存操作可用 2)网盘中存在相应的文件
---
3.分享功能
复制分享链接:1)保证分享链接能够成功复制,2)复制的链接能够成功打开
分享到社交网络:1)分享按钮可点 2)分享到社交网络的内容可看
---
4.编辑功能
文本编辑: 1)光标定位在任何情况下都与编辑区中的文字相符 2)字体、字号、颜色、加粗加斜可用 3)文本拖动框选功能 4)复制粘贴
---
Icon:1) 选中节点的时候,Icon面板上的选项根据节点上的标签自动高亮 2)点击面板上的选项可添加Icon 3)点击高亮的选项可以删除节点上的Icon
---
5. 历史记录
UNDO/REDO
---
*6. 切换主题、节点拖动
###上线前确认
* 当前标识的版本是否与待上线版本相符
* 待上线文件夹中的内容是否与测试通过的版本相符
###上线
* 版本上线
* 对线上版本进行主要功能测试,保证可用
1. 分享功能
2. 保存功能
\ No newline at end of file
KityMinder 渲染和布局重构方案
=====
## 背景
当前的节点渲染和布局把很多部分的功能都揉在一起来实现,维护和添加新功能都比较困难,所以决定把现有的 layout.js、layout.default.js 和 layout.bottom.js 重构。
## 约定
为了不产生误会,下面约定一些词汇的意思。
样式:对节点或脑图其他内容的外观的描述。
渲染:对节点的绘制的过程。渲染参照的坐标系是节点画布的坐标系。
布局:对节点定位的过程,发生在渲染之后。定位使用的坐标系是脑图画布的坐标系。
节点树多边形:表示一个节点以及其子树所占的多边形区域。
## 样式、渲染和布局的梳理
### Theme
负责注册和管理样式。
注册样式:
```js
KityMinder.registerTheme( 'default', {
'root-padding': [30, 20],
'root-color': 'black',
'root-background': '#A4c5c0',
'root-stroke': 'none',
'root-radius': 4,
'root-space': [10, 5],
'root-font-family': 'Arial',
'root-font-size': 14,
'main-connect-width': 2,
'main-connect-color': 'white',
'main-connect-type': 'arc',
'sub-connect-type': 'fold'
...
});
```
切换样式:
```js
minder.useTheme('default');
```
读取样式:
```js
minder.getStyle('root-radius'); // returns 4
```
```js
node.getStyle('radius'); // node.getType() 返回 'root', 会自动拼接样式项,返回 4
node.getStyle('padding-left'); // returns 20 发现结尾是 '-left'、'-right' 等的会自动找到样式表描述的数组按照 CSS 的方式查找值
```
### Render
Render 负责渲染工作。
对于一个节点,有两个渲染容器(以前是多个),一个是通过 `getContentGroup()` 来获取的内容容器,一个是通过 `getDecorationGroup()` 来获得的装饰容器。布局的时候,内容容器最终决定该节点的渲染大小,装饰容器里的内容会被忽略。
节点的渲染分步进行,按顺序描述是:`center`, `left`, `right`, `top`, `bottom`。之前渲染这五个步骤是通过事件的形式来通知,每次渲染都清除了原本的内容重新创建节点,造成性能浪费。修改渲染的机制,改成从模块直接注册渲染的节:
```js
KityMinder.registerModule( 'MyModule', {
commands: { ... },
events: { ... },
renderers: {
left: kity.createClass( 'MyRenderer', {
base: Renderer,
create: function(node) {
this.content = new kity.Group();
// 添加元素
node.getContentGroup().addShape(this.content);
},
update: function(node) {
var content = this.content;
// update content
// 需要返回更新后内容所占的矩形区域,简单的返回形式是 return this.content.getRenderBox();
return {
x: 30,
y: -30,
width: 24,
height: 24
};
}
}
}
});
```
`renderers` 节来描述渲染器,节的 `key` 指定渲染器使用的阶段,节的 `value` 给出渲染器的类。渲染器需要继承 `Renderer` 类,并且实现两个抽象方法:`create()``update()`
`create` 方法只会在节点创建的时候调用一次,此时应该创建渲染所需要的元素,并且附加到节点上。
`update` 方法会在节点需要重新渲染的时候被调用,此时可以选择隐藏、显示或更新元素。
在渲染过程中,节点提供下述信息:
- `node.getStyle(name)` 获得节点当前的某个样式描述
- `node.getContentBox()` 获得节点当前已渲染的内容在节点的 ConentGroup 的坐标系中所占的矩形区域。
- `node.getType()` 获得节点的类型('root' | 'main' | 'sub')
要触发一个节点的渲染,直接调用 'node.render()' 即可。
### Layout
Layout 负责布局工作,布局一般发生在渲染之后。对一个节点的布局,指的是排列其子树。
允许多种布局,布局注册的方式如下:
```js
KityMinder.registerLayout('default', kity.createClass('DefaultLayout', {
base: Layout,
doLayout: function(node) {
// do layout
}
}));
```
让节点布局的方式是调用节点的 `node.layout([name])` 方法。该方法的执行过程如下:
- 调用 `node.getLayout()` 获得节点的布局名称
- 如果节点中的 data 包含布局名称,返回该布局名称,否则下一步
- 如果节点是根节点,返回 KityMinder.getDefaultLayout()
- 返回父节点的 `getLayout()`
- 根据布局名称获得相应的布局方法,把节点作为参数传进去调用
<?php
/**
* 导出文件代理
*
* @author Jinqn, techird
*/
$type = $_REQUEST['type'];
if (isset($_REQUEST['content'])) {
$content = $_REQUEST['content'];
if ($type == 'base64') {
$content = base64_decode($content);
}
$filename = htmlspecialchars($_REQUEST["filename"]);
if (!$filename) {
$filename = "kikyminder";
}
if (isset($_REQUEST['iehack'])) {
$filename = urlencode($filename);
}
header("Content-type: application/octet-stream; charset=utf8; name=".urlencode($filename));
header("Accept-Length: ".strlen($content));
header("Content-Length: ".strlen($content));
header("Content-Disposition: attachment; filename=".$filename);
header('Content-Description: File Transfer');
if (isset($_REQUEST['stamp'])) {
setcookie($_REQUEST['stamp'], 1, time() + 30);
}
echo $content;
} else {
echo 'Empty Content!';
}
?>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="title" content="百度脑图(KityMinder)">
<meta name="keyword" content="kityminder,脑图,思维导图,kity,svg,minder,百度,fex,前端,在线">
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>百度脑图 - 便捷的思维编辑工具</title>
<script src="import.js?pack=edit" charset="utf-8"></script>
<script src="kityminder.config.js" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<link href="ui/theme/default/css/default.all.css" type="text/css" rel="stylesheet" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed">
</head>
<body>
<div id="content-wrapper">
<div id="panel"></div>
<div id="kityminder" onselectstart="return false">
</div>
<div id="about">
<svg id="km-cat" viewBox="0 0 1200 1200" width="32px" height="32px">
<g id="cat-face">
<path d="M1066.769,368.482L1119.5,80L830,131.611C760.552,97.29,682.35,77.999,599.641,77.999
c-82.424,0-160.371,19.161-229.641,53.26L81,81l50.769,289l0,0c-33.792,69.019-52.77,146.612-52.77,228.641
c0,287.542,233.099,520.642,520.642,520.642s520.642-233.099,520.642-520.642C1120.282,516.011,1101.028,437.88,1066.769,368.482z"
/>
</g>
<g id="cat-eye">
<path style="fill:#FFFFFF;" d="M920.255,371C794.746,371,693,472.746,693,598.255s101.746,227.255,227.255,227.255
s227.255-101.746,227.255-227.255S1045.765,371,920.255,371z M920,746c-80.081,0-145-64.919-145-145s64.919-145,145-145
s145,64.919,145,145S1000.081,746,920,746z"/>
<path style="fill:#FFFFFF;" d="M276.255,371C150.746,371,49,472.746,49,598.255s101.746,227.255,227.255,227.255
s227.255-101.746,227.255-227.255S401.765,371,276.255,371z M276,745c-80.081,0-145-64.919-145-145s64.919-145,145-145
s145,64.919,145,145S356.081,745,276,745z"/>
</g>
</svg>
KityMinder
<a id="km-version"
href="https://github.com/fex-team/kityminder/blob/dev/CHANGELOG.md"
target="blank"
tabindex="-1">
</a>
under
<a href="https://raw.githubusercontent.com/fex-team/kityminder/dev/LICENSE"
target="_blank"
tabindex="-1">BSD License
</a>.
Powered by f-cube,
<a href="http://fex.baidu.com"
target="_blank"
tabindex="-1">FEX
</a> |
<a href="https://github.com/fex-team/kityminder.git"
target="_blank"
tabindex="-1">Source
</a>
<a href="https://github.com/fex-team/kityminder/issues/new"
target="_blank"
tabindex="-1">Bug
</a> |
<a href="mailto:kity@baidu.com"
target="_blank"
tabindex="-1">Contact Us
</a>
</div>
</div>
</body>
<!--脑图启动代码-->
<script>
/* global km:true, ZeroClipboard:true, zip:true */
/* jshint browser:true */
$(function() {
/* 依赖库初始化 */
zip.inflateJSPath = 'lib/inflate.js';
});
// create km instance
km = KM.getMinder('kityminder', window.KITYMINDER_CONFIG);
// init ui for instance
km.initUI();
// New Version Notify
$(function() {
var lastVersion = localStorage.lastKMVersion;
$('#km-version').text( 'v' + KM.version );
if (lastVersion != KM.version) {
$( '#km-version' ).addClass( 'new-version' );
localStorage.lastKMVersion = KM.version;
}
});
</script>
<!--社会分享代码-->
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdMini":"2","bdMiniList":[],"bdPic":"","bdStyle":"1","bdSize":"32"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
</script>
<!--Baidu Tongji Code-->
<script type="text/javascript">
if (document.domain == 'naotu.baidu.com') {
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0703917f224067c887f3664479a03887' type='text/javascript'%3E%3C/script%3E"));
}
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>KityMinder Example</title>
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<style type="text/css">
body {
margin: 0;
padding: 0;
height: 100%;
}
.km_receiver {
background: white;
border: 1px solid #999;
}
#minder-view {
position: absolute;
border: 1px solid #ccc;
left: 10px;
top: 10px;
bottom: 10px;
right: 210px;
}
</style>
</head>
<body>
<div id="minder-view"></div>
</body>
<!-- *************************** Module 形式加载引入 **************************** -->
<script type="text/javascript" src="lib/seajs/dist/sea-debug.js"></script>
<script type="text/javascript">
/* global seajs */
seajs.config({
base: './src'
});
define('start', function(require) {
var Minder = require('kityminder').Minder;
// 创建 km 实例
var km = window.km = new Minder({
renderTo: 'minder-view'
});
});
seajs.use('start');
</script>
<!-- *********************** 打包文件引入(需要先 grunt 发布) ************************* -->
<!--
<script type="text/javascript" src="../release/kityminder.all.min.js">
<script type="text/javascript">
// 创建 km 实例
window.km = new kityminder.Minder('minder-view');
</script>
-->
</html>
\ No newline at end of file
This diff is collapsed.
/**
* Created by zhangbo21 on 14-9-10.
*/
/**
* 开发版本的文件导入
*/
(function() {
var paths = [
/* 依赖库 */
'lib/jquery-2.1.1.js',
'lib/jquery.transit.min.js',
'lib/promise-1.0.0.js',
'lib/fui/dev-lib/jhtmls.min.js',
'lib/fui/dist/fui.all.js',
/* Kity 依赖库 */
'lib/kity/dist/kity.js',
/* 核心代码 */
'src/core/kityminder.js',
'src/core/utils.js',
'src/core/browser.js',
'src/core/minder.js',
'src/core/option.js',
'src/core/event.js',
'src/core/status.js',
'src/core/paper.js',
'src/core/readonly.js',
'src/core/command.js',
'src/core/node.js',
'src/core/module.js',
'src/core/data.js',
'src/core/compatibility.js',
'src/core/render.js',
'src/core/connect.js',
'src/core/theme.js',
'src/core/layout.js',
'src/core/template.js',
'src/core/select.js',
'src/core/lang.js',
'src/core/defaultoptions.js',
'src/core/preference.js',
'src/core/keymap.js',
'src/core/key.js',
'src/core/contextmenu.js',
/* 布局 */
'src/layout/mind.js',
'src/layout/filetree.js',
'src/layout/btree.js',
/* 连线 */
'src/connect/bezier.js',
'src/connect/poly.js',
'src/connect/arc.js',
'src/connect/under.js',
'src/connect/l.js',
/* 皮肤 */
'src/theme/default.js',
'src/theme/snow.js',
'src/theme/fresh.js',
/* 模板 */
'src/template/default.js',
'src/template/structure.js',
'src/template/filetree.js',
'src/template/right.js',
/* 模块 */
'src/module/node.js',
'src/module/text.js',
'src/module/expand.js',
'src/module/outline.js',
'src/module/geometry.js',
'src/module/progress.js',
'src/module/priority.js',
'src/module/image.js',
'src/module/resource.js',
'src/module/view.js',
'src/module/dragtree.js',
'src/module/keyboard.js',
'src/module/select.js',
'src/module/basestyle.js',
'src/module/font.js',
'src/module/zoom.js',
'src/module/hyperlink.js',
'src/module/arrange.js',
'src/module/paste.js',
'src/module/style.js',
/* 格式支持 */
'src/protocol/plain.js',
'src/protocol/json.js',
'src/protocol/png.js',
'src/protocol/svg.js',
/* UI 基础 */
'ui/ui.js',
'ui/eve.js',
'ui/fuix.js',
// 'ui/fiox.js',
'ui/doc.js',
/* UI 组件 */
// 'ui/widget/commandbutton.js',
// 'ui/widget/commandbuttonset.js',
// 'ui/widget/commandinputmenu.js',
// 'ui/widget/friendlytimespan.js',
// 'ui/widget/locallist.js',
// 'ui/widget/netdiskfinder.js',
'ui/widget/menutab.js',
/* UI 菜单 */
// 'ui/menu/menu.js',
// 'ui/menu/header.js',
/* UI 菜单 - 新建 */
// 'ui/menu/new/new.js',
/* UI 菜单 - 打开 */
// 'ui/menu/open/open.js',
// 'ui/menu/open/recent.js',
// 'ui/menu/open/netdisk.js',
// 'ui/menu/open/local.js',
// 'ui/menu/open/draft.js',
/* UI 菜单 - 保存 */
// 'ui/menu/save/save.js',
// 'ui/menu/save/netdisk.js',
// 'ui/menu/save/download.js',
/* UI 菜单 - 分享 */
// 'ui/menu/share/share.js',
'ui/menu/share/m-share.js',
/* UI Top Bar */
// 'ui/topbar/history.js',
// 'ui/topbar/user.js',
// 'ui/topbar/search.js',
'ui/topbar/m-logo.js',
'ui/topbar/switch-view.js',
'ui/topbar/title.js'
/* UI Ribbon */
// 'ui/ribbon/tabs.js',
/* UI Ribbon「思路」面板 */
// 'ui/ribbon/idea/insert.js',
// 'ui/ribbon/idea/arrange.js',
// 'ui/ribbon/idea/operation.js',
// 'ui/ribbon/idea/attachment.js',
// 'ui/ribbon/idea/link.js',
// 'ui/ribbon/idea/image.js',
// 'ui/ribbon/idea/priority.js',
// 'ui/ribbon/idea/progress.js',
// 'ui/ribbon/idea/resource.js',
/* UI Ribbon「展示」面板 */
// 'ui/ribbon/appearence/template.js',
// 'ui/ribbon/appearence/theme.js',
// 'ui/ribbon/appearence/layout.js',
// 'ui/ribbon/appearence/style.js',
// 'ui/ribbon/appearence/font.js',
// 'ui/ribbon/appearence/color.js',
/* UI Ribbon「视图」面板 */
// 'ui/ribbon/view/level.js'
];
if (typeof(module) === 'object' && module.exports) {
module.exports = paths;
} else if (document) {
while (paths.length) {
/* jshint browser:true */
window.document.write('<script type="text/javascript" src="' + paths.shift() + '"></script>');
}
}
})();
\ No newline at end of file
/**
* 开发版本的文件导入
*/
(function() {
/* 可能的文件路径,已按照依赖关系排序 */
var paths = [
/* 依赖库 */
'lib/jquery-2.1.1.js',
'lib/jquery.transit.min.js',
'lib/promise-1.0.0.js',
'lib/fui/dev-lib/jhtmls.min.js',
'lib/fui/dist/fui.all.js',
/* Kity 依赖库 */
'lib/kity/dist/kity.js',
/* 核心代码 */
'src/core/kityminder.js',
'src/core/utils.js',
'src/core/browser.js',
'src/core/minder.js',
'src/core/option.js',
'src/core/event.js',
'src/core/status.js',
'src/core/paper.js',
'src/core/readonly.js',
'src/core/command.js',
'src/core/node.js',
'src/core/module.js',
'src/core/data.js',
'src/core/compatibility.js',
'src/core/render.js',
'src/core/connect.js',
'src/core/theme.js',
'src/core/layout.js',
'src/core/template.js',
'src/core/select.js',
'src/core/lang.js',
'src/core/defaultoptions.js',
'src/core/preference.js',
'src/core/keymap.js',
'src/core/key.js',
'src/core/contextmenu.js',
/* 布局 */
'src/layout/default.js',
'src/layout/default.connect.js',
'src/layout/bottom.js',
'src/layout/filetree.js',
/* 皮肤 */
'src/theme/default.js',
'src/theme/snow.js',
'src/theme/fresh.js',
/* 模板 */
'src/template/structure.js',
/* 模块 */
'src/module/node.js',
'src/module/text.js',
'src/module/expand.js',
'src/module/outline.js',
'src/module/geometry.js',
'src/module/progress.js',
'src/module/priority.js',
'src/module/image.js',
'src/module/resource.js',
'src/module/view.js',
'src/module/dragtree.js',
'src/module/keyboard.js',
'src/module/select.js',
'src/module/basestyle.js',
'src/module/font.js',
'src/module/zoom.js',
'src/module/hyperlink.js',
'src/module/arrange.js',
'src/module/paste.js',
'src/module/style.js',
/* 格式支持 */
'src/protocol/plain.js',
'src/protocol/json.js',
'src/protocol/png.js',
'src/protocol/svg.js',
/* UI 基础 */
'ui/ui.js',
'ui/eve.js',
'ui/fuix.js',
// 'ui/fiox.js',
'ui/doc.js',
/* UI 组件 */
// 'ui/widget/commandbutton.js',
// 'ui/widget/commandbuttonset.js',
// 'ui/widget/commandinputmenu.js',
// 'ui/widget/friendlytimespan.js',
// 'ui/widget/locallist.js',
// 'ui/widget/netdiskfinder.js',
'ui/widget/menutab.js',
/* UI 菜单 */
'ui/menu/menu.js',
'ui/menu/header.js',
/* UI 菜单 - 新建 */
// 'ui/menu/new/new.js',
/* UI 菜单 - 打开 */
// 'ui/menu/open/open.js',
// 'ui/menu/open/recent.js',
// 'ui/menu/open/netdisk.js',
// 'ui/menu/open/local.js',
// 'ui/menu/open/draft.js',
/* UI 菜单 - 保存 */
'ui/menu/save/save.js',
// 'ui/menu/save/netdisk.js',
'ui/menu/save/download.js',
/* UI 菜单 - 分享 */
// 'ui/menu/share/share.js',
'ui/menu/share/view.js',
/* UI Top Bar */
// 'ui/topbar/history.js',
// 'ui/topbar/user.js',
'ui/topbar/search.js',
'ui/topbar/title.js',
/* UI Ribbon */
// 'ui/ribbon/tabs.js',
/* UI Ribbon「思路」面板 */
// 'ui/ribbon/idea/insert.js',
// 'ui/ribbon/idea/arrange.js',
// 'ui/ribbon/idea/operation.js',
// 'ui/ribbon/idea/attachment.js',
// 'ui/ribbon/idea/link.js',
// 'ui/ribbon/idea/image.js',
// 'ui/ribbon/idea/priority.js',
// 'ui/ribbon/idea/progress.js',
// 'ui/ribbon/idea/resource.js',
/* UI Ribbon「展示」面板 */
// 'ui/ribbon/appearence/template.js',
// 'ui/ribbon/appearence/theme.js',
// 'ui/ribbon/appearence/layout.js',
// 'ui/ribbon/appearence/style.js',
// 'ui/ribbon/appearence/font.js',
// 'ui/ribbon/appearence/color.js',
/* UI Ribbon「视图」面板 */
// 'ui/ribbon/view/level.js'
];
if (typeof(module) === 'object' && module.exports) {
module.exports = paths;
} else if (document) {
while (paths.length) {
/* jshint browser:true */
window.document.write('<script type="text/javascript" src="' + paths.shift() + '"></script>');
}
}
})();
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="title" content="百度脑图(KityMinder) - 控制创意,如此简单">
<meta name="keyword" content="kityminder,脑图,思维导图,kity,svg,minder,百度,fex,前端,在线">
<meta name="description" content="百度脑图,便捷的脑图编辑工具 - 控制创意,如此简单。让您在线上直接创建、保存并分享你的思路。免安装 云存储 易分享 体验舒适 功能丰富">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>百度脑图 - 便捷的思维编辑工具</title>
<script src="import.js?pack=index"></script>
<script>
$(function() {
var pattern = /(?:shareId|share_id)=(\w+)([&#]|$)/;
var match = pattern.exec(window.location) || pattern.exec(document.referrer);
if (match) {
window.location.href = 'viewshare.html?shareId=' + match[1];
return;
}
/* 初始化网盘使用的 APP 身份 */
fio.user.init({
apiKey: 'wiE55BGOG8BkGnpPs6UNtPbb'
});
var $a = $('p.login a').hide();
function loadingAnimate(on) {
if (on) {
$('hr').addClass('loading');
loadingAnimate.timer = setTimeout(function() {
$('hr').addClass('animated');
}, 660);
} else {
clearTimeout(loadingAnimate.timer);
$('hr').removeClass('loading animated');
}
}
loadingAnimate(true);
fio.user.check().then(function(user) {
if (user) {
window.location.href = 'edit.html';
}
else {
$a.fadeIn(800);
loadingAnimate(false);
}
});
$('p.login a').click(function() {
var urlparts = window.location.href.split('/');
urlparts.pop();
urlparts = urlparts.join('/');
fio.user.login({
redirectUrl: urlparts + '/edit.html',
remember: 7 * 24 * 60 * 60
});
loadingAnimate(true);
});
function preload(url) {
return new Promise(function(resolve, reject) {
var img = new Image();
img.onload = resolve;
img.onerror = reject;
img.src = url;
});
}
preload('ui/theme/default/images/indexbackground.jpg').then(function() {
$('div.background').addClass('loaded');
});
});
</script>
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed">
<style>
body, html {
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
font-size: 0;
line-height: 0;
z-index: -2;
}
body {
background: #99806B;
overflow: auto;
}
::-webkit-selection {
background: #FFEFEF;
color: #4A4F5D;
}
::-moz-selection {
background: #FFEFEF;
color: #4A4F5D;
}
::-ms-selection {
background: #FFEFEF;
color: #4A4F5D;
}
::selection {
background: #FFEFEF;
color: #4A4F5D;
}
div.background {
opacity: 0;
display: block;
background: url(ui/theme/default/images/indexbackground.jpg) no-repeat;
background-size: cover;
position: absolute;
z-index: -1;
left: -10px;
top: -10px;
right: -10px;
bottom: -10px;
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-mz-filter: blur(5px);
-o-filter: blur(5px);
filter: url(ui/theme/default/images/blur.svg#blur);
filter: blur(5px);
-webkit-transition: opacity 1.5s ease;
transition: opacity 1.5s ease;
}
div.background.loaded {
opacity: 1;
}
h1:before {
content: ' ';
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .5);
z-index: -1;
}
h1, p {
font-weight: 100;
font-family: Arial, "Microsoft Yahei", "Heiti SC", sans-serif;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1 {
margin: 0;
margin-top: 100px;
color: white;
font-size: 50px;
line-height: 1.4em;
}
h1 span {
font-size: 0.6em;
}
p span {
font-size: 12px;
display: block;
margin-top: 30px;
color: rgba(255, 255, 255, .7);
text-shadow: 0 0 1px rgba(0, 0, 0, .5);
}
hr {
height: 0;
border: none;
border-bottom: 1px solid #F98183;
width: 110px;
margin: 40px auto;
-webkit-transition: -webkit-transform 0.66s ease;
transition: transform 0.66s ease;
-webkit-backface-visibility: hidden;
}
hr.loading {
-webkit-transform: translate3d(100px, 0, 0);
transform: translate3d(100px, 0, 0);
}
hr.animated {
-webkit-animation: slide 1.33s ease-in-out infinite alternate;
animation: slide 1.33s ease-in-out infinite alternate;
}
@-webkit-keyframes slide {
0% {
-webkit-transform: translate3d(100px, 0, 0);
transform: translate3d(100px, 0, 0);
}
100% {
-webkit-transform: translate3d(-100px, 0, 0);
transform: translate3d(-100px, 0, 0);
}
}
@keyframes slide {
0% {
-webkit-transform: translate3d(100px, 0, 0);
transform: translate3d(100px, 0, 0);
}
100% {
-webkit-transform: translate3d(-100px, 0, 0);
transform: translate3d(-100px, 0, 0);
}
}
p.description {
color: #CCC;
font-size: 20px;
line-height: 1.8em;
}
p.login a {
display: inline-block;
width: 200px;
height: 60px;
background: #F98183;
font-size: 24px;
line-height: 60px;
text-align: center;
border-radius: 30px;
color: white;
text-shadow: 0 1px 0 #F8474F;
cursor: pointer;
position: relative;
overflow: hidden;
margin-top: 50px;
-webkit-user-select: none;
-moz-user-select: none;
-mz-user-select: none;
user-select: none;
}
p.login a:active {
background: #FF6161;
-webkit-transform: scale(0.95);
transform: scale(0.95);
}
p.login a:before {
content: ' ';
display: block;
background: rgba(255, 255, 255, .2);
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: 30px;
transform: scale(0, 1);
-webkit-transform: scale(0, 1);
transition: transform 0.3s ease;
-webkit-transition: -webkit-transform 0.3s ease;
}
p.login a:hover:before {
transform: scale(1, 1);
-webkit-transform: scale(1, 1);
}
</style>
</head>
<body>
<div class="background"></div>
<h1>百度脑图 <br/> <span>控制创意,如此简单</span></h1>
<hr />
<p class="description">
免安装 云存储 易分享<br/>
舒适的体验 丰富的功能<br/>
</p>
<p class="login">
<a>马上开启</a>
<span>使用百度账号登录</span>
</p>
</body>
<!--Baidu Tongji Code-->
<script type="text/javascript">
if (document.domain == 'naotu.baidu.com') {
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0703917f224067c887f3664479a03887' type='text/javascript'%3E%3C/script%3E"));
}
</script>
</html>
\ No newline at end of file
(function() {
window.KITYMINDER_CONFIG = {
// 定义
//modules: [],
// 只读模式,默认是false
readOnly: false,
// 默认主题
defaultTemplate: 'default',
// 默认皮肤
defaultTheme: 'fresh-blue',
// 最大可回退的次数,默认 20
maxUndoCount: 20,
// 语言,默认是 'zh-cn'
lang: 'zh-cn',
// 配置放大缩小的比例
// zoom: [10, 20, 30, 50, 80, 100, 120, 150, 200],
// 图片尺寸限制
maxImageWidth: 200,
maxImageHeight: 200,
// 修改后自动保存时间间隔(单位:秒);设置为 false 不自动保存
autoSave: 2
};
})();
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Copyright (c) 2010-2011 Gabe Lerner (gabelerner@gmail.com) - http://code.google.com/p/canvg/
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
* @license Use it if you like it
*/
function RGBColor(color_string)
{
this.ok = false;
// strip any leading #
if (color_string.charAt(0) == '#') { // remove # if any
color_string = color_string.substr(1,6);
}
color_string = color_string.replace(/ /g,'');
color_string = color_string.toLowerCase();
// before getting into regexps, try simple matches
// and overwrite the input
var simple_colors = {
aliceblue: 'f0f8ff',
antiquewhite: 'faebd7',
aqua: '00ffff',
aquamarine: '7fffd4',
azure: 'f0ffff',
beige: 'f5f5dc',
bisque: 'ffe4c4',
black: '000000',
blanchedalmond: 'ffebcd',
blue: '0000ff',
blueviolet: '8a2be2',
brown: 'a52a2a',
burlywood: 'deb887',
cadetblue: '5f9ea0',
chartreuse: '7fff00',
chocolate: 'd2691e',
coral: 'ff7f50',
cornflowerblue: '6495ed',
cornsilk: 'fff8dc',
crimson: 'dc143c',
cyan: '00ffff',
darkblue: '00008b',
darkcyan: '008b8b',
darkgoldenrod: 'b8860b',
darkgray: 'a9a9a9',
darkgreen: '006400',
darkkhaki: 'bdb76b',
darkmagenta: '8b008b',
darkolivegreen: '556b2f',
darkorange: 'ff8c00',
darkorchid: '9932cc',
darkred: '8b0000',
darksalmon: 'e9967a',
darkseagreen: '8fbc8f',
darkslateblue: '483d8b',
darkslategray: '2f4f4f',
darkturquoise: '00ced1',
darkviolet: '9400d3',
deeppink: 'ff1493',
deepskyblue: '00bfff',
dimgray: '696969',
dodgerblue: '1e90ff',
feldspar: 'd19275',
firebrick: 'b22222',
floralwhite: 'fffaf0',
forestgreen: '228b22',
fuchsia: 'ff00ff',
gainsboro: 'dcdcdc',
ghostwhite: 'f8f8ff',
gold: 'ffd700',
goldenrod: 'daa520',
gray: '808080',
green: '008000',
greenyellow: 'adff2f',
honeydew: 'f0fff0',
hotpink: 'ff69b4',
indianred : 'cd5c5c',
indigo : '4b0082',
ivory: 'fffff0',
khaki: 'f0e68c',
lavender: 'e6e6fa',
lavenderblush: 'fff0f5',
lawngreen: '7cfc00',
lemonchiffon: 'fffacd',
lightblue: 'add8e6',
lightcoral: 'f08080',
lightcyan: 'e0ffff',
lightgoldenrodyellow: 'fafad2',
lightgrey: 'd3d3d3',
lightgreen: '90ee90',
lightpink: 'ffb6c1',
lightsalmon: 'ffa07a',
lightseagreen: '20b2aa',
lightskyblue: '87cefa',
lightslateblue: '8470ff',
lightslategray: '778899',
lightsteelblue: 'b0c4de',
lightyellow: 'ffffe0',
lime: '00ff00',
limegreen: '32cd32',
linen: 'faf0e6',
magenta: 'ff00ff',
maroon: '800000',
mediumaquamarine: '66cdaa',
mediumblue: '0000cd',
mediumorchid: 'ba55d3',
mediumpurple: '9370d8',
mediumseagreen: '3cb371',
mediumslateblue: '7b68ee',
mediumspringgreen: '00fa9a',
mediumturquoise: '48d1cc',
mediumvioletred: 'c71585',
midnightblue: '191970',
mintcream: 'f5fffa',
mistyrose: 'ffe4e1',
moccasin: 'ffe4b5',
navajowhite: 'ffdead',
navy: '000080',
oldlace: 'fdf5e6',
olive: '808000',
olivedrab: '6b8e23',
orange: 'ffa500',
orangered: 'ff4500',
orchid: 'da70d6',
palegoldenrod: 'eee8aa',
palegreen: '98fb98',
paleturquoise: 'afeeee',
palevioletred: 'd87093',
papayawhip: 'ffefd5',
peachpuff: 'ffdab9',
peru: 'cd853f',
pink: 'ffc0cb',
plum: 'dda0dd',
powderblue: 'b0e0e6',
purple: '800080',
red: 'ff0000',
rosybrown: 'bc8f8f',
royalblue: '4169e1',
saddlebrown: '8b4513',
salmon: 'fa8072',
sandybrown: 'f4a460',
seagreen: '2e8b57',
seashell: 'fff5ee',
sienna: 'a0522d',
silver: 'c0c0c0',
skyblue: '87ceeb',
slateblue: '6a5acd',
slategray: '708090',
snow: 'fffafa',
springgreen: '00ff7f',
steelblue: '4682b4',
tan: 'd2b48c',
teal: '008080',
thistle: 'd8bfd8',
tomato: 'ff6347',
turquoise: '40e0d0',
violet: 'ee82ee',
violetred: 'd02090',
wheat: 'f5deb3',
white: 'ffffff',
whitesmoke: 'f5f5f5',
yellow: 'ffff00',
yellowgreen: '9acd32'
};
for (var key in simple_colors) {
if (color_string == key) {
color_string = simple_colors[key];
}
}
// emd of simple type-in colors
// array of color definition objects
var color_defs = [
{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
process: function (bits){
return [
parseInt(bits[1]),
parseInt(bits[2]),
parseInt(bits[3])
];
}
},
{
re: /^(\w{2})(\w{2})(\w{2})$/,
example: ['#00ff00', '336699'],
process: function (bits){
return [
parseInt(bits[1], 16),
parseInt(bits[2], 16),
parseInt(bits[3], 16)
];
}
},
{
re: /^(\w{1})(\w{1})(\w{1})$/,
example: ['#fb0', 'f0f'],
process: function (bits){
return [
parseInt(bits[1] + bits[1], 16),
parseInt(bits[2] + bits[2], 16),
parseInt(bits[3] + bits[3], 16)
];
}
}
];
// search through the definitions to find a match
for (var i = 0; i < color_defs.length; i++) {
var re = color_defs[i].re;
var processor = color_defs[i].process;
var bits = re.exec(color_string);
if (bits) {
channels = processor(bits);
this.r = channels[0];
this.g = channels[1];
this.b = channels[2];
this.ok = true;
}
}
// validate/cleanup values
this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
// some getters
this.toRGB = function () {
return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
}
this.toHex = function () {
var r = this.r.toString(16);
var g = this.g.toString(16);
var b = this.b.toString(16);
if (r.length == 1) r = '0' + r;
if (g.length == 1) g = '0' + g;
if (b.length == 1) b = '0' + b;
return '#' + r + g + b;
}
// help
this.getHelpXML = function () {
var examples = new Array();
// add regexps
for (var i = 0; i < color_defs.length; i++) {
var example = color_defs[i].example;
for (var j = 0; j < example.length; j++) {
examples[examples.length] = example[j];
}
}
// add type-in colors
for (var sc in simple_colors) {
examples[examples.length] = sc;
}
var xml = document.createElement('ul');
xml.setAttribute('id', 'rgbcolor-examples');
for (var i = 0; i < examples.length; i++) {
try {
var list_item = document.createElement('li');
var list_color = new RGBColor(examples[i]);
var example_div = document.createElement('div');
example_div.style.cssText =
'margin: 3px; '
+ 'border: 1px solid black; '
+ 'background:' + list_color.toHex() + '; '
+ 'color:' + list_color.toHex()
;
example_div.appendChild(document.createTextNode('test'));
var list_item_value = document.createTextNode(
' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
);
list_item.appendChild(example_div);
list_item.appendChild(list_item_value);
xml.appendChild(list_item);
} catch(e){}
}
return xml;
}
}
Subproject commit 7ae9c078b3c3504d5cf421a493113bf6fda3e362
Subproject commit 5abfcd8d5ece0bcece486dec435288ec7bcd281d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(function($) {
/**
* 让 jQuery 支持 Blob 类型
*/
$.ajaxTransport('+*', function(options, originalOptions, jqXHR) {
if (window.FormData && ((options.dataType &&
(options.dataType === 'blob' || options.dataType === 'arraybuffer')) ||
(options.data && ((window.Blob && options.data instanceof Blob) ||
(window.ArrayBuffer && options.data instanceof ArrayBuffer)))
)) {
return {
/**
* Return a transport capable of sending and/or receiving blobs - in this case, we instantiate
* a new XMLHttpRequest and use it to actually perform the request, and funnel the result back
* into the jquery complete callback (such as the success function, done blocks, etc.)
*
* @param headers
* @param completeCallback
*/
send: function(headers, completeCallback) {
var xhr = new XMLHttpRequest(),
url = options.url || window.location.href,
type = options.type || 'GET',
dataType = options.dataType || 'text',
data = options.data || null,
async = options.async || true,
key;
xhr.addEventListener('load', function() {
var response = {},
status, isSuccess;
isSuccess = xhr.status >= 200 && xhr.status < 300 || xhr.status === 304;
if (isSuccess) {
response[dataType] = xhr.response;
} else {
// In case an error occured we assume that the response body contains
// text data - so let's convert the binary data to a string which we can
// pass to the complete callback.
response.text = String.fromCharCode.apply(null, new Uint8Array(xhr.response));
}
completeCallback(xhr.status, xhr.statusText, response, xhr.getAllResponseHeaders());
});
xhr.open(type, url, async);
xhr.responseType = dataType;
for (key in headers) {
if (headers.hasOwnProperty(key)) xhr.setRequestHeader(key, headers[key]);
}
xhr.send(data);
},
abort: function() {
jqXHR.abort();
}
};
}
});
})(window.jQuery);
\ No newline at end of file
(function(t,e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){module.exports=e(require("jquery"))}else{e(t.jQuery)}})(this,function(t){t.transit={version:"0.9.12",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var e=document.createElement("div");var n={};function i(t){if(t in e.style)return t;var n=["Moz","Webkit","O","ms"];var i=t.charAt(0).toUpperCase()+t.substr(1);for(var r=0;r<n.length;++r){var s=n[r]+i;if(s in e.style){return s}}}function r(){e.style[n.transform]="";e.style[n.transform]="rotateY(90deg)";return e.style[n.transform]!==""}var s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;n.transition=i("transition");n.transitionDelay=i("transitionDelay");n.transform=i("transform");n.transformOrigin=i("transformOrigin");n.filter=i("Filter");n.transform3d=r();var a={transition:"transitionend",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var o=n.transitionEnd=a[n.transition]||null;for(var u in n){if(n.hasOwnProperty(u)&&typeof t.support[u]==="undefined"){t.support[u]=n[u]}}e=null;t.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeInCubic:"cubic-bezier(.550,.055,.675,.190)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};t.cssHooks["transit:transform"]={get:function(e){return t(e).data("transform")||new f},set:function(e,i){var r=i;if(!(r instanceof f)){r=new f(r)}if(n.transform==="WebkitTransform"&&!s){e.style[n.transform]=r.toString(true)}else{e.style[n.transform]=r.toString()}t(e).data("transform",r)}};t.cssHooks.transform={set:t.cssHooks["transit:transform"].set};t.cssHooks.filter={get:function(t){return t.style[n.filter]},set:function(t,e){t.style[n.filter]=e}};if(t.fn.jquery<"1.8"){t.cssHooks.transformOrigin={get:function(t){return t.style[n.transformOrigin]},set:function(t,e){t.style[n.transformOrigin]=e}};t.cssHooks.transition={get:function(t){return t.style[n.transition]},set:function(t,e){t.style[n.transition]=e}}}p("scale");p("scaleX");p("scaleY");p("translate");p("rotate");p("rotateX");p("rotateY");p("rotate3d");p("perspective");p("skewX");p("skewY");p("x",true);p("y",true);function f(t){if(typeof t==="string"){this.parse(t)}return this}f.prototype={setFromString:function(t,e){var n=typeof e==="string"?e.split(","):e.constructor===Array?e:[e];n.unshift(t);f.prototype.set.apply(this,n)},set:function(t){var e=Array.prototype.slice.apply(arguments,[1]);if(this.setter[t]){this.setter[t].apply(this,e)}else{this[t]=e.join(",")}},get:function(t){if(this.getter[t]){return this.getter[t].apply(this)}else{return this[t]||0}},setter:{rotate:function(t){this.rotate=b(t,"deg")},rotateX:function(t){this.rotateX=b(t,"deg")},rotateY:function(t){this.rotateY=b(t,"deg")},scale:function(t,e){if(e===undefined){e=t}this.scale=t+","+e},skewX:function(t){this.skewX=b(t,"deg")},skewY:function(t){this.skewY=b(t,"deg")},perspective:function(t){this.perspective=b(t,"px")},x:function(t){this.set("translate",t,null)},y:function(t){this.set("translate",null,t)},translate:function(t,e){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(t!==null&&t!==undefined){this._translateX=b(t,"px")}if(e!==null&&e!==undefined){this._translateY=b(e,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var t=(this.scale||"1,1").split(",");if(t[0]){t[0]=parseFloat(t[0])}if(t[1]){t[1]=parseFloat(t[1])}return t[0]===t[1]?t[0]:t},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var e=0;e<=3;++e){if(t[e]){t[e]=parseFloat(t[e])}}if(t[3]){t[3]=b(t[3],"deg")}return t}},parse:function(t){var e=this;t.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,n,i){e.setFromString(n,i)})},toString:function(t){var e=[];for(var i in this){if(this.hasOwnProperty(i)){if(!n.transform3d&&(i==="rotateX"||i==="rotateY"||i==="perspective"||i==="transformOrigin")){continue}if(i[0]!=="_"){if(t&&i==="scale"){e.push(i+"3d("+this[i]+",1)")}else if(t&&i==="translate"){e.push(i+"3d("+this[i]+",0)")}else{e.push(i+"("+this[i]+")")}}}}return e.join(" ")}};function c(t,e,n){if(e===true){t.queue(n)}else if(e){t.queue(e,n)}else{t.each(function(){n.call(this)})}}function l(e){var i=[];t.each(e,function(e){e=t.camelCase(e);e=t.transit.propertyMap[e]||t.cssProps[e]||e;e=h(e);if(n[e])e=h(n[e]);if(t.inArray(e,i)===-1){i.push(e)}});return i}function d(e,n,i,r){var s=l(e);if(t.cssEase[i]){i=t.cssEase[i]}var a=""+y(n)+" "+i;if(parseInt(r,10)>0){a+=" "+y(r)}var o=[];t.each(s,function(t,e){o.push(e+" "+a)});return o.join(", ")}t.fn.transition=t.fn.transit=function(e,i,r,s){var a=this;var u=0;var f=true;var l=t.extend(true,{},e);if(typeof i==="function"){s=i;i=undefined}if(typeof i==="object"){r=i.easing;u=i.delay||0;f=typeof i.queue==="undefined"?true:i.queue;s=i.complete;i=i.duration}if(typeof r==="function"){s=r;r=undefined}if(typeof l.easing!=="undefined"){r=l.easing;delete l.easing}if(typeof l.duration!=="undefined"){i=l.duration;delete l.duration}if(typeof l.complete!=="undefined"){s=l.complete;delete l.complete}if(typeof l.queue!=="undefined"){f=l.queue;delete l.queue}if(typeof l.delay!=="undefined"){u=l.delay;delete l.delay}if(typeof i==="undefined"){i=t.fx.speeds._default}if(typeof r==="undefined"){r=t.cssEase._default}i=y(i);var p=d(l,i,r,u);var h=t.transit.enabled&&n.transition;var b=h?parseInt(i,10)+parseInt(u,10):0;if(b===0){var g=function(t){a.css(l);if(s){s.apply(a)}if(t){t()}};c(a,f,g);return a}var m={};var v=function(e){var i=false;var r=function(){if(i){a.unbind(o,r)}if(b>0){a.each(function(){this.style[n.transition]=m[this]||null})}if(typeof s==="function"){s.apply(a)}if(typeof e==="function"){e()}};if(b>0&&o&&t.transit.useTransitionEnd){i=true;a.bind(o,r)}else{window.setTimeout(r,b)}a.each(function(){if(b>0){this.style[n.transition]=p}t(this).css(l)})};var z=function(t){this.offsetWidth;v(t)};c(a,f,z);return this};function p(e,i){if(!i){t.cssNumber[e]=true}t.transit.propertyMap[e]=n.transform;t.cssHooks[e]={get:function(n){var i=t(n).css("transit:transform");return i.get(e)},set:function(n,i){var r=t(n).css("transit:transform");r.setFromString(e,i);t(n).css({"transit:transform":r})}}}function h(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function b(t,e){if(typeof t==="string"&&!t.match(/^[\-0-9\.]+$/)){return t}else{return""+t+e}}function y(e){var n=e;if(typeof n==="string"&&!n.match(/^[\-0-9\.]+/)){n=t.fx.speeds[n]||t.fx.speeds._default}return b(n,"ms")}t.transit.getTransitionValue=d;return t});
\ No newline at end of file
/*
### jQuery XML to JSON Plugin v1.3 - 2013-02-18 ###
* http://www.fyneworks.com/ - diego@fyneworks.com
* Licensed under http://en.wikipedia.org/wiki/MIT_License
###
Website: http://www.fyneworks.com/jquery/xml-to-json/
*//*
# INSPIRED BY: http://www.terracoder.com/
AND: http://www.thomasfrank.se/xml_to_json.html
AND: http://www.kawa.net/works/js/xml/objtree-e.html
*//*
This simple script converts XML (document of code) into a JSON object. It is the combination of 2
'xml to json' great parsers (see below) which allows for both 'simple' and 'extended' parsing modes.
*/
// Avoid collisions
;if(window.jQuery) (function($){
// Add function to jQuery namespace
$.extend({
// converts xml documents and xml text to json object
xml2json: function(xml, extended) {
if(!xml) return {}; // quick fail
//### PARSER LIBRARY
// Core function
function parseXML(node, simple){
if(!node) return null;
var txt = '', obj = null, att = null;
var nt = node.nodeType, nn = jsVar(node.localName || node.nodeName);
var nv = node.text || node.nodeValue || '';
/*DBG*/ //if(window.console) console.log(['x2j',nn,nt,nv.length+' bytes']);
if(node.childNodes){
if(node.childNodes.length>0){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'CHILDREN',node.childNodes]);
$.each(node.childNodes, function(n,cn){
var cnt = cn.nodeType, cnn = jsVar(cn.localName || cn.nodeName);
var cnv = cn.text || cn.nodeValue || '';
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>a',cnn,cnt,cnv]);
if(cnt == 8){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>b',cnn,'COMMENT (ignore)']);
return; // ignore comment node
}
else if(cnt == 3 || cnt == 4 || !cnn){
// ignore white-space in between tags
if(cnv.match(/^\s+$/)){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>c',cnn,'WHITE-SPACE (ignore)']);
return;
};
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>d',cnn,'TEXT']);
txt += cnv.replace(/^\s+/,'').replace(/\s+$/,'');
// make sure we ditch trailing spaces from markup
}
else{
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>e',cnn,'OBJECT']);
obj = obj || {};
if(obj[cnn]){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>f',cnn,'ARRAY']);
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
if(!obj[cnn].length) obj[cnn] = myArr(obj[cnn]);
obj[cnn] = myArr(obj[cnn]);
obj[cnn][ obj[cnn].length ] = parseXML(cn, true/* simple */);
obj[cnn].length = obj[cnn].length;
}
else{
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>g',cnn,'dig deeper...']);
obj[cnn] = parseXML(cn);
};
};
});
};//node.childNodes.length>0
};//node.childNodes
if(node.attributes){
if(node.attributes.length>0){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'ATTRIBUTES',node.attributes])
att = {}; obj = obj || {};
$.each(node.attributes, function(a,at){
var atn = jsVar(at.name), atv = at.value;
att[atn] = atv;
if(obj[atn]){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'ARRAY']);
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
//if(!obj[atn].length) obj[atn] = myArr(obj[atn]);//[ obj[ atn ] ];
obj[cnn] = myArr(obj[cnn]);
obj[atn][ obj[atn].length ] = atv;
obj[atn].length = obj[atn].length;
}
else{
/*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'TEXT']);
obj[atn] = atv;
};
});
//obj['attributes'] = att;
};//node.attributes.length>0
};//node.attributes
if(obj){
obj = $.extend( (txt!='' ? new String(txt) : {}),/* {text:txt},*/ obj || {}/*, att || {}*/);
//txt = (obj.text) ? (typeof(obj.text)=='object' ? obj.text : [obj.text || '']).concat([txt]) : txt;
txt = (obj.text) ? ([obj.text || '']).concat([txt]) : txt;
if(txt) obj.text = txt;
txt = '';
};
var out = obj || txt;
//console.log([extended, simple, out]);
if(extended){
if(txt) out = {};//new String(out);
txt = out.text || txt || '';
if(txt) out.text = txt;
if(!simple) out = myArr(out);
};
return out;
};// parseXML
// Core Function End
// Utility functions
var jsVar = function(s){ return String(s || '').replace(/-/g,"_"); };
// NEW isNum function: 01/09/2010
// Thanks to Emile Grau, GigaTecnologies S.L., www.gigatransfer.com, www.mygigamail.com
function isNum(s){
// based on utility function isNum from xml2json plugin (http://www.fyneworks.com/ - diego@fyneworks.com)
// few bugs corrected from original function :
// - syntax error : regexp.test(string) instead of string.test(reg)
// - regexp modified to accept comma as decimal mark (latin syntax : 25,24 )
// - regexp modified to reject if no number before decimal mark : ".7" is not accepted
// - string is "trimmed", allowing to accept space at the beginning and end of string
var regexp=/^((-)?([0-9]+)(([\.\,]{0,1})([0-9]+))?$)/
return (typeof s == "number") || regexp.test(String((s && typeof s == "string") ? jQuery.trim(s) : ''));
};
// OLD isNum function: (for reference only)
//var isNum = function(s){ return (typeof s == "number") || String((s && typeof s == "string") ? s : '').test(/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/); };
var myArr = function(o){
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
//if(!o.length) o = [ o ]; o.length=o.length;
if(!$.isArray(o)) o = [ o ]; o.length=o.length;
// here is where you can attach additional functionality, such as searching and sorting...
return o;
};
// Utility functions End
//### PARSER LIBRARY END
// Convert plain text to xml
if(typeof xml=='string') xml = $.text2xml(xml);
// Quick fail if not xml (or if this is a node)
if(!xml.nodeType) return;
if(xml.nodeType == 3 || xml.nodeType == 4) return xml.nodeValue;
// Find xml root node
var root = (xml.nodeType == 9) ? xml.documentElement : xml;
// Convert xml to json
var out = parseXML(root, true /* simple */);
// Clean-up memory
xml = null; root = null;
// Send output
return out;
},
// Convert text to XML DOM
text2xml: function(str) {
// NOTE: I'd like to use jQuery for this, but jQuery makes all tags uppercase
//return $(xml)[0];
/* prior to jquery 1.9 */
/*
var out;
try{
var xml = ((!$.support.opacity && !$.support.style))?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();
xml.async = false;
}catch(e){ throw new Error("XML Parser could not be instantiated") };
try{
if((!$.support.opacity && !$.support.style)) out = (xml.loadXML(str))?xml:false;
else out = xml.parseFromString(str, "text/xml");
}catch(e){ throw new Error("Error parsing XML string") };
return out;
*/
/* jquery 1.9+ */
return $.parseXML(str);
}
}); // extend $
})(jQuery);
\ No newline at end of file
Subproject commit 36b51b090c28d9d362f00e1023fcb3dc6317585d Subproject commit b1fcdefccfb10ab2d1dce672a07bced54e05f949
This diff is collapsed.
This diff is collapsed.
{
"name": "seajs",
"version": "2.3.0",
"main": "./dist/sea.js",
"ignore": [
"**/.*",
"docs",
"lib",
"src",
"tests",
"CNAME",
"component.json",
"CONTRIBUTING.md",
"index.html",
"Makefile",
"package.json",
"README.md"
],
"homepage": "https://github.com/seajs/seajs",
"_release": "2.3.0",
"_resolution": {
"type": "version",
"tag": "2.3.0",
"commit": "9c6299636991fbca73a9aa7b2eb152c6e8614854"
},
"_source": "git://github.com/seajs/seajs.git",
"_target": "~2.3.0",
"_originalSource": "seajs"
}
\ No newline at end of file
Copyright (c) 2008-2011 Pivotal Labs MIT LICENSE
Copyright (c) 2009 - 2099 Frank Wang, http://seajs.org/
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
...@@ -18,3 +20,5 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ...@@ -18,3 +20,5 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
return array(
'savepath' => dirname( __FILE__ ) . '/upload/'
);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment