diff --git a/db/slife.sql b/db/slife.sql index 057aa15..4b92311 100644 --- a/db/slife.sql +++ b/db/slife.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50625 File Encoding : 65001 -Date: 2017-11-21 11:20:41 +Date: 2017-11-21 20:21:25 */ SET FOREIGN_KEY_CHECKS=0; @@ -680,12 +680,17 @@ CREATE TABLE `blog_content` ( `allow_comment` int(1) DEFAULT '0' COMMENT '开启评论', `status` int(1) DEFAULT NULL COMMENT '状态', `author` varchar(100) DEFAULT NULL COMMENT '作者', + `del_flag` char(1) DEFAULT NULL, + `remark` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章内容'; +) ENGINE=InnoDB AUTO_INCREMENT=932945048711651331 DEFAULT CHARSET=utf8 COMMENT='文章内容'; -- ---------------------------- -- Records of blog_content -- ---------------------------- +INSERT INTO `blog_content` VALUES ('932908253420650498', '1', '1', '2017-11-21 17:47:15', '2017-11-21 17:47:15', null, null, null, null, null, '0', null, null, 'Y', null); +INSERT INTO `blog_content` VALUES ('932944200837292033', '1', '1', '2017-11-21 20:10:05', '2017-11-21 20:10:05', null, null, null, null, null, '0', null, null, 'Y', null); +INSERT INTO `blog_content` VALUES ('932944379099406337', '1', '1', '2017-11-21 20:10:48', '2017-11-21 20:10:48', null, null, null, null, null, '0', null, null, 'Y', null); -- ---------------------------- -- Table structure for sys_area @@ -4513,6 +4518,22 @@ INSERT INTO `sys_log` VALUES ('932577564624130049', '1', '1', '2017-11-20 19:53: INSERT INTO `sys_log` VALUES ('932802233776152577', '1', '1', '2017-11-21 10:45:58', '2017-11-21 10:45:58', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '130'); INSERT INTO `sys_log` VALUES ('932802256786104321', '1', '1', '2017-11-21 10:46:03', '2017-11-21 10:46:03', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '12'); INSERT INTO `sys_log` VALUES ('932802271050932225', '1', '1', '2017-11-21 10:46:07', '2017-11-21 10:46:07', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '10'); +INSERT INTO `sys_log` VALUES ('932871114540638210', '1', '1', '2017-11-21 15:19:40', '2017-11-21 15:19:40', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '394'); +INSERT INTO `sys_log` VALUES ('932871294262370305', '1', '1', '2017-11-21 15:20:23', '2017-11-21 15:20:23', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '18'); +INSERT INTO `sys_log` VALUES ('932936051002580993', '1', '1', '2017-11-21 19:37:42', '2017-11-21 19:37:42', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '42'); +INSERT INTO `sys_log` VALUES ('932936799203500034', '1', '1', '2017-11-21 19:40:41', '2017-11-21 19:40:41', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '18'); +INSERT INTO `sys_log` VALUES ('932936823287193602', '1', '1', '2017-11-21 19:40:46', '2017-11-21 19:40:46', null, 'Y', null, null, 'com.slife.controller.SysOfficeController.list()', '127.0.0.1', '获取组织用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[],\"searchParams\":{\"search_eq_sys_office_id\":\"\"},\"total\":0}', 'admin', '超级管理员', '167'); +INSERT INTO `sys_log` VALUES ('932936854866108418', '1', '1', '2017-11-21 19:40:54', '2017-11-21 19:40:54', null, 'Y', null, null, 'com.slife.controller.SysOfficeController.list()', '127.0.0.1', '获取组织用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[],\"searchParams\":{\"search_eq_sys_office_id\":\"\"},\"total\":0}', 'admin', '超级管理员', '13'); +INSERT INTO `sys_log` VALUES ('932936872700289025', '1', '1', '2017-11-21 19:40:58', '2017-11-21 19:40:58', null, 'Y', null, null, 'com.slife.controller.SysOfficeController.list()', '127.0.0.1', '获取组织用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[],\"searchParams\":{\"search_eq_sys_office_id\":\"\"},\"total\":0}', 'admin', '超级管理员', '7'); +INSERT INTO `sys_log` VALUES ('932938937665200129', '1', '1', '2017-11-21 19:49:11', '2017-11-21 19:49:11', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '10'); +INSERT INTO `sys_log` VALUES ('932939548758515713', '1', '1', '2017-11-21 19:51:36', '2017-11-21 19:51:36', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '36'); +INSERT INTO `sys_log` VALUES ('932939601057292290', '1', '1', '2017-11-21 19:51:49', '2017-11-21 19:51:49', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '9'); +INSERT INTO `sys_log` VALUES ('932939755005026305', '1', '1', '2017-11-21 19:52:25', '2017-11-21 19:52:25', null, 'Y', null, null, 'com.slife.controller.SysRoleController.list()', '127.0.0.1', '获角色列表', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"code\":\"superadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":1,\"name\":\"超级管理员\",\"remark\":\"1\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"sanguoadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":2,\"name\":\"三国管理员\",\"remark\":\"2\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"Y\"},{\"code\":\"shuihuadmin\",\"dataScope\":\"DATA_SCOPE_SELF\",\"delFlag\":\"Y\",\"id\":3,\"name\":\"水浒管理员\",\"remark\":\"3\",\"sysMenuList\":[],\"sysOfficeList\":[],\"useable\":\"N\"}],\"searchParams\":{\"search_like_code\":\"\",\"search_eq_useable\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":3}', 'admin', '超级管理员', '7'); +INSERT INTO `sys_log` VALUES ('932942418576855041', '1', '1', '2017-11-21 20:03:00', '2017-11-21 20:03:00', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '12'); +INSERT INTO `sys_log` VALUES ('932942463971807233', '1', '1', '2017-11-21 20:03:11', '2017-11-21 20:03:11', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '18'); +INSERT INTO `sys_log` VALUES ('932943353789206529', '1', '1', '2017-11-21 20:06:43', '2017-11-21 20:06:43', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '19'); +INSERT INTO `sys_log` VALUES ('932943428175187969', '1', '1', '2017-11-21 20:07:01', '2017-11-21 20:07:01', null, 'Y', null, null, 'com.slife.controller.SysUserController.list()', '127.0.0.1', '获取用户列表数据', '{\"pageNumber\":1,\"pageSize\":10,\"rows\":[{\"admin\":false,\"createDate\":1509959472000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"admin@qq.com\",\"id\":927463363798847489,\"loginFlag\":\"Y\",\"loginName\":\"1233333333\",\"mobile\":\"\",\"name\":\"4444444444444444\",\"no\":\"1111111111\",\"password\":\"95ef966a79b95992a30c71ce51a0aa492f9012684c598a8425d34043\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508158484000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"009@qq.com\",\"id\":919909472932597761,\"loginFlag\":\"Y\",\"loginName\":\"4421\",\"mobile\":\"\",\"name\":\"3434\",\"no\":\"009q\",\"password\":\"78d8590291ab5b46916fc9be69d410427d6249695efbf6b07a98bf38\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150820408445233705.jpg\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1508146149000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"007@qq.com\",\"id\":919857736771661825,\"loginFlag\":\"Y\",\"loginName\":\"007\",\"mobile\":\"\",\"name\":\"007\",\"no\":\"007\",\"password\":\"430d9b8aa8a085d53598302ff949b919947cfe6d11555b75f335622e\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/15081461345698302.jpg\",\"remark\":\"\",\"updateDate\":1508146149000,\"updateId\":1},{\"admin\":false,\"createDate\":1508141533000,\"createId\":919837257709088770,\"delFlag\":\"Y\",\"email\":\"005@qq.com\",\"id\":919838376048947202,\"loginFlag\":\"Y\",\"loginName\":\"005\",\"mobile\":\"\",\"name\":\"005\",\"no\":\"005\",\"password\":\"9d31202fd0fd1067da48005d63ee434fbcda2695c8b5a4ef8d8479e3\",\"phone\":\"\",\"photo\":\"/attach/avatar/s/150814151366288150.png\",\"remark\":\"\",\"updateDate\":1508141533000,\"updateId\":919837257709088770},{\"admin\":false,\"createDate\":1508141267000,\"createId\":919834003923234818,\"delFlag\":\"Y\",\"email\":\"004@qq.com\",\"id\":919837257709088770,\"loginFlag\":\"Y\",\"loginName\":\"004\",\"mobile\":\"\",\"name\":\"004\",\"no\":\"004\",\"password\":\"f7aacea53f9a692eaac000294b2836ac18ae406400ed586f7be8631a\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1508141267000,\"updateId\":919834003923234818},{\"admin\":false,\"createDate\":1505475937000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"002@qq.com\",\"id\":908658055538475008,\"loginFlag\":\"Y\",\"loginName\":\"003\",\"mobile\":\"\",\"name\":\"123456\",\"no\":\"12\",\"password\":\"b0f62ba08c7fbc15a56a56efa0bf441ee4d467b50128a6544f7a779f\",\"phone\":\"\",\"photo\":\"/img/log9.png\",\"remark\":\"\",\"updateDate\":1505475937000,\"updateId\":1},{\"admin\":false,\"createDate\":1505475572000,\"createId\":1,\"delFlag\":\"Y\",\"email\":\"hztest@qq.com\",\"id\":908656522709106688,\"loginFlag\":\"Y\",\"loginName\":\"test2\",\"mobile\":\"\",\"name\":\"测试2\",\"no\":\"1\",\"password\":\"7cbc0e9134b14f24820dc3d693a1b0b63799e63faaa9f37545076786\",\"phone\":\"1\",\"photo\":\"/attach/avatar/s/151073783884114535.png\",\"remark\":\"\"},{\"admin\":false,\"createDate\":1490939182000,\"delFlag\":\"Y\",\"email\":\"122741483@qq.com\",\"id\":1,\"loginFlag\":\"Y\",\"loginName\":\"admin\",\"mobile\":\"13248754856\",\"name\":\"超级管理员\",\"no\":\"1\",\"password\":\"c5be5a475c0883d737da8351f7d8295b0cfd94356e8e831f953a4499\",\"phone\":\"0788-2548756\",\"photo\":\"/img/log9.png\",\"remark\":\"描述信息\",\"sysCompanyId\":1,\"updateDate\":1507812252000,\"updateId\":1}],\"searchParams\":{\"search_eq_login_name\":\"\",\"search_eq_no\":\"\",\"search_like_name\":\"\"},\"sorts\":{\"createDate\":\"desc\"},\"total\":8}', 'admin', '超级管理员', '14'); +INSERT INTO `sys_log` VALUES ('932945642033713153', '1', '1', '2017-11-21 20:15:49', '2017-11-21 20:15:49', null, 'Y', null, null, 'com.slife.controller.BlogContentController.delete()', '127.0.0.1', '批量删除博客', '[932945048711651330]', 'admin', '超级管理员', '131'); -- ---------------------------- -- Table structure for sys_menu @@ -4557,9 +4578,9 @@ INSERT INTO `sys_menu` VALUES ('21', null, null, null, null, null, 'Y', '20', ' INSERT INTO `sys_menu` VALUES ('22', null, null, null, null, null, 'Y', '20', '日志', 'MENU', '/monitor/log', null, 'glyphicon glyphicon-star', 'Y', 'd', '20.22', '2', null); INSERT INTO `sys_menu` VALUES ('23', null, null, null, null, null, 'Y', '20', '系统配置', 'MENU', '/monitor/conf', null, 'glyphicon glyphicon-star', 'Y', 'd', '20.23', '3', null); INSERT INTO `sys_menu` VALUES ('24', null, null, null, null, null, 'Y', '20', 'api接口', 'MENU', '/swagger-ui.html', null, 'glyphicon glyphicon-star', 'Y', 'd', '20.24', '4', null); -INSERT INTO `sys_menu` VALUES ('922649953047375874', '1', null, '2017-10-24 10:24:25', null, null, 'Y', '0', '博客', 'MENU', '/bolg', null, 'glyphicon glyphicon-comment', 'Y', 'blog', '922649953047375874.', '4', null); -INSERT INTO `sys_menu` VALUES ('922652123016687617', '1', null, '2017-10-24 10:33:03', null, null, 'Y', '922649953047375874', '博客列表', 'MENU', '/blog/content', null, 'glyphicon glyphicon-th-list', 'Y', 'blog', '922649953047375874.922652123016687617.', '1', null); -INSERT INTO `sys_menu` VALUES ('932802213060485122', '1', '1', '2017-11-21 10:45:53', '2017-11-21 10:45:53', null, 'Y', '922649953047375874', '添加博客', 'MENU', '/blog/content/detail/create', null, 'glyphicon glyphicon-plus-sign', 'Y', 'blog', '922649953047375874.932802213060485122.', '2', null); +INSERT INTO `sys_menu` VALUES ('25', '1', null, '2017-10-24 10:24:25', null, null, 'Y', '0', '博客', 'MENU', '/blog', null, 'glyphicon glyphicon-comment', 'Y', 'blog', '25.', '4', null); +INSERT INTO `sys_menu` VALUES ('26', '1', null, '2017-10-24 10:33:03', null, null, 'Y', '25', '博客列表', 'MENU', '/blog/content', null, 'glyphicon glyphicon-th-list', 'Y', 'blog', '25.26.', '1', null); +INSERT INTO `sys_menu` VALUES ('27', '1', '1', '2017-11-21 10:45:53', '2017-11-21 10:45:53', null, 'Y', '25', '添加博客', 'MENU', '/blog/content/detail/create', null, 'glyphicon glyphicon-plus-sign', 'N', 'blog', '25.27.', '2', null); -- ---------------------------- -- Table structure for sys_office @@ -4650,9 +4671,9 @@ INSERT INTO `sys_role_sys_menu` VALUES ('21', '1'); INSERT INTO `sys_role_sys_menu` VALUES ('22', '1'); INSERT INTO `sys_role_sys_menu` VALUES ('23', '1'); INSERT INTO `sys_role_sys_menu` VALUES ('24', '1'); -INSERT INTO `sys_role_sys_menu` VALUES ('922649953047375874', '1'); -INSERT INTO `sys_role_sys_menu` VALUES ('922652123016687617', '1'); -INSERT INTO `sys_role_sys_menu` VALUES ('932802213060485122', '1'); +INSERT INTO `sys_role_sys_menu` VALUES ('25', '1'); +INSERT INTO `sys_role_sys_menu` VALUES ('26', '1'); +INSERT INTO `sys_role_sys_menu` VALUES ('27', '1'); INSERT INTO `sys_role_sys_menu` VALUES ('1', '2'); INSERT INTO `sys_role_sys_menu` VALUES ('2', '2'); INSERT INTO `sys_role_sys_menu` VALUES ('3', '2'); diff --git a/dec/9.jpg b/dec/9.jpg new file mode 100644 index 0000000..063189f Binary files /dev/null and b/dec/9.jpg differ diff --git a/slife-blog/src/main/java/com/slife/controller/BlogContentController.java b/slife-blog/src/main/java/com/slife/controller/BlogContentController.java index d01231a..b9d74c4 100644 --- a/slife-blog/src/main/java/com/slife/controller/BlogContentController.java +++ b/slife-blog/src/main/java/com/slife/controller/BlogContentController.java @@ -1,9 +1,12 @@ package com.slife.controller; +import com.slife.annotation.SLog; import com.slife.base.controller.BaseController; +import com.slife.base.entity.ReturnDTO; import com.slife.base.vo.DataTable; import com.slife.entity.BlogContent; import com.slife.service.IBlogContentService; +import com.slife.util.ReturnDTOUtil; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -12,6 +15,8 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; /** * @author chen @@ -44,12 +49,33 @@ public class BlogContentController extends BaseController { } @ApiOperation(value = "进入博客编辑界面", notes = "进入博客编辑界面") - @GetMapping(value = "/insert") - public String create(Model model, HttpServletRequest request) { + @GetMapping(value = "/detail/{action}") + public String create(@PathVariable("action") String action, Model model, HttpServletRequest request) { + model.addAttribute("action", action); model.addAttribute("url", request.getContextPath() + "/blog/content/"); return "blog/detail"; } + @ApiOperation(value = "添加博客", notes = "添加博客") + @PostMapping(value = "/create") + @ResponseBody + public ReturnDTO create(BlogContent blogContent) { + blogContentService.insert(blogContent); + return ReturnDTOUtil.success(); + } + + @SLog("批量删除博客") + @ApiOperation(value = "批量删除博客", notes = "批量删除博客") + @PostMapping(value = "/delete") + @ResponseBody + public ReturnDTO delete(@RequestParam("ids") List ids, ServletRequest request) { + boolean success = blogContentService.deleteBatchIds(ids); + if (success) { + return ReturnDTOUtil.success(); + } + return ReturnDTOUtil.fail(); + + } } diff --git a/slife-blog/src/main/java/com/slife/entity/BlogContent.java b/slife-blog/src/main/java/com/slife/entity/BlogContent.java index 39f1497..ce1dffb 100644 --- a/slife-blog/src/main/java/com/slife/entity/BlogContent.java +++ b/slife-blog/src/main/java/com/slife/entity/BlogContent.java @@ -3,6 +3,7 @@ package com.slife.entity; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableName; import com.slife.base.entity.BaseEntity; +import com.slife.base.entity.DataEntity; import org.hibernate.validator.constraints.NotBlank; import java.io.Serializable; @@ -16,7 +17,7 @@ import java.io.Serializable; * Describe: 博客 */ @TableName("blog_content") -public class BlogContent extends BaseEntity { +public class BlogContent extends DataEntity { @Override diff --git a/slife-blog/src/main/resources/templates/blog/detail.ftl b/slife-blog/src/main/resources/templates/blog/detail.ftl index 7f3a518..1045d8b 100644 --- a/slife-blog/src/main/resources/templates/blog/detail.ftl +++ b/slife-blog/src/main/resources/templates/blog/detail.ftl @@ -1,30 +1,15 @@ 博客编辑 - - - + + - - - - - - - - - - - - - - + + - - + @@ -37,8 +22,8 @@

发布文章

-
- + +
@@ -78,28 +63,14 @@
- -
-
- - -
-
- 返回列表 + 返回列表 + class="btn btn-primary waves-effect waves-light" type="submit">保存文章
@@ -108,12 +79,125 @@ - + + + + + diff --git a/slife-blog/src/main/resources/templates/blog/list.ftl b/slife-blog/src/main/resources/templates/blog/list.ftl index 417a864..ecb1f87 100644 --- a/slife-blog/src/main/resources/templates/blog/list.ftl +++ b/slife-blog/src/main/resources/templates/blog/list.ftl @@ -42,6 +42,12 @@ + + + + diff --git a/slife-web/src/main/java/com/slife/config/sitemesh/WebSiteMeshFilter.java b/slife-web/src/main/java/com/slife/config/sitemesh/WebSiteMeshFilter.java index 966a61c..f85e7b3 100644 --- a/slife-web/src/main/java/com/slife/config/sitemesh/WebSiteMeshFilter.java +++ b/slife-web/src/main/java/com/slife/config/sitemesh/WebSiteMeshFilter.java @@ -15,7 +15,7 @@ public class WebSiteMeshFilter extends ConfigurableSiteMeshFilter { /** 需要装饰的访问路径 */ private String contentPath="/sys/user,/sys/menu,/sys/dict,/sys/role,/sys/office,/sys/,/index,/monitor/*," + - "/blog/content,/404"; + "/blog/content**,/404"; /** 装饰器页面路径 */ diff --git a/slife-web/src/main/resources/static/css/plugins/summernote/font/summernote.woff b/slife-web/src/main/resources/static/css/plugins/summernote/font/summernote.woff new file mode 100644 index 0000000..2b21d9d Binary files /dev/null and b/slife-web/src/main/resources/static/css/plugins/summernote/font/summernote.woff differ diff --git a/slife-web/src/main/resources/static/css/plugins/summernote/summernote-0.8.8.css b/slife-web/src/main/resources/static/css/plugins/summernote/summernote-0.8.8.css new file mode 100644 index 0000000..4971a21 --- /dev/null +++ b/slife-web/src/main/resources/static/css/plugins/summernote/summernote-0.8.8.css @@ -0,0 +1 @@ +@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("./font/summernote.eot?0d0d5fac99cc8774d89eb08b1a8323c4");src:url("./font/summernote.eot?#iefix") format("embedded-opentype"),url("./font/summernote.woff?0d0d5fac99cc8774d89eb08b1a8323c4") format("woff"),url("./font/summernote.ttf?0d0d5fac99cc8774d89eb08b1a8323c4") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:"summernote";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrow-circle-down:before{content:"\f108"}.note-icon-arrow-circle-left:before{content:"\f109"}.note-icon-arrow-circle-right:before{content:"\f10a"}.note-icon-arrow-circle-up:before{content:"\f10b"}.note-icon-arrows-alt:before{content:"\f10c"}.note-icon-arrows-h:before{content:"\f10d"}.note-icon-arrows-v:before{content:"\f10e"}.note-icon-bold:before{content:"\f10f"}.note-icon-caret:before{content:"\f110"}.note-icon-chain-broken:before{content:"\f111"}.note-icon-circle:before{content:"\f112"}.note-icon-close:before{content:"\f113"}.note-icon-code:before{content:"\f114"}.note-icon-col-after:before{content:"\f115"}.note-icon-col-before:before{content:"\f116"}.note-icon-col-remove:before{content:"\f117"}.note-icon-eraser:before{content:"\f118"}.note-icon-font:before{content:"\f119"}.note-icon-frame:before{content:"\f11a"}.note-icon-italic:before{content:"\f11b"}.note-icon-link:before{content:"\f11c"}.note-icon-magic:before{content:"\f11d"}.note-icon-menu-check:before{content:"\f11e"}.note-icon-minus:before{content:"\f11f"}.note-icon-orderedlist:before{content:"\f120"}.note-icon-pencil:before{content:"\f121"}.note-icon-picture:before{content:"\f122"}.note-icon-question:before{content:"\f123"}.note-icon-redo:before{content:"\f124"}.note-icon-row-above:before{content:"\f125"}.note-icon-row-below:before{content:"\f126"}.note-icon-row-remove:before{content:"\f127"}.note-icon-special-character:before{content:"\f128"}.note-icon-square:before{content:"\f129"}.note-icon-strikethrough:before{content:"\f12a"}.note-icon-subscript:before{content:"\f12b"}.note-icon-summernote:before{content:"\f12c"}.note-icon-superscript:before{content:"\f12d"}.note-icon-table:before{content:"\f12e"}.note-icon-text-height:before{content:"\f12f"}.note-icon-trash:before{content:"\f130"}.note-icon-underline:before{content:"\f131"}.note-icon-undo:before{content:"\f132"}.note-icon-unorderedlist:before{content:"\f133"}.note-icon-video:before{content:"\f134"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:white;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:white}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:8px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style h1,.panel-heading.note-toolbar .note-style h1,.note-popover .popover-content .note-style h2,.panel-heading.note-toolbar .note-style h2,.note-popover .popover-content .note-style h3,.panel-heading.note-toolbar .note-style h3,.note-popover .popover-content .note-style h4,.panel-heading.note-toolbar .note-style h4,.note-popover .popover-content .note-style h5,.panel-heading.note-toolbar .note-style h5,.note-popover .popover-content .note-style h6,.panel-heading.note-toolbar .note-style h6,.note-popover .popover-content .note-style blockquote,.panel-heading.note-toolbar .note-style blockquote{margin:0}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu,.panel-heading.note-toolbar .note-color .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:white;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0} \ No newline at end of file diff --git a/slife-web/src/main/resources/static/js/plugins/summernote/summernote-zh-CN.min.js b/slife-web/src/main/resources/static/js/plugins/summernote/summernote-zh-CN.min.js new file mode 100644 index 0000000..d2fd03d --- /dev/null +++ b/slife-web/src/main/resources/static/js/plugins/summernote/summernote-zh-CN.min.js @@ -0,0 +1,3 @@ +/*! Summernote v0.8.8 | (c) 2013- Alan Hong and other contributors | MIT license */ + +!function(a){a.extend(a.summernote.lang,{"zh-CN":{font:{bold:"粗体",italic:"斜体",underline:"下划线",clear:"清除格式",height:"行高",name:"字体",strikethrough:"删除线",subscript:"下标",superscript:"上标",size:"字号"},image:{image:"图片",insert:"插入图片",resizeFull:"缩放至 100%",resizeHalf:"缩放至 50%",resizeQuarter:"缩放至 25%",floatLeft:"靠左浮动",floatRight:"靠右浮动",floatNone:"取消浮动",shapeRounded:"形状: 圆角",shapeCircle:"形状: 圆",shapeThumbnail:"形状: 缩略图",shapeNone:"形状: 无",dragImageHere:"将图片拖拽至此处",selectFromFiles:"从本地上传",maximumFileSize:"文件大小最大值",maximumFileSizeError:"文件大小超出最大值。",url:"图片地址",remove:"移除图片"},video:{video:"视频",videoLink:"视频链接",insert:"插入视频",url:"视频地址",providers:"(优酷, 腾讯, Instagram, DailyMotion, Youtube等)"},link:{link:"链接",insert:"插入链接",unlink:"去除链接",edit:"编辑链接",textToDisplay:"显示文本",url:"链接地址",openInNewWindow:"在新窗口打开"},table:{table:"表格"},hr:{insert:"水平线"},style:{style:"样式",p:"普通",blockquote:"引用",pre:"代码",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},lists:{unordered:"无序列表",ordered:"有序列表"},options:{help:"帮助",fullscreen:"全屏",codeview:"源代码"},paragraph:{paragraph:"段落",outdent:"减少缩进",indent:"增加缩进",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},color:{recent:"最近使用",more:"更多",background:"背景",foreground:"前景",transparent:"透明",setTransparent:"透明",reset:"重置",resetToDefault:"默认"},shortcut:{shortcuts:"快捷键",close:"关闭",textFormatting:"文本格式",action:"动作",paragraphFormatting:"段落格式",documentStyle:"文档样式",extraKeys:"额外按键"},history:{undo:"撤销",redo:"重做"},help:{insertParagraph:"插入段落",undo:"撤销",redo:"重做",tab:"增加缩进",untab:"减少缩进",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",removeFormat:"清除格式",justifyLeft:"左对齐",justifyCenter:"居中对齐",justifyRight:"右对齐",justifyFull:"两端对齐",insertUnorderedList:"无序列表",insertOrderedList:"有序列表",outdent:"减少缩进",indent:"增加缩进",formatPara:"设置选中内容样式为 普通",formatH1:"设置选中内容样式为 标题1",formatH2:"设置选中内容样式为 标题2",formatH3:"设置选中内容样式为 标题3",formatH4:"设置选中内容样式为 标题4",formatH5:"设置选中内容样式为 标题5",formatH6:"设置选中内容样式为 标题6",insertHorizontalRule:"插入水平线","linkDialog.show":"显示链接对话框"}}})}(jQuery); \ No newline at end of file diff --git a/slife-web/src/main/resources/static/js/plugins/summernote/summernote.js b/slife-web/src/main/resources/static/js/plugins/summernote/summernote.js new file mode 100644 index 0000000..c815e9c --- /dev/null +++ b/slife-web/src/main/resources/static/js/plugins/summernote/summernote.js @@ -0,0 +1,7987 @@ +/** + * Super simple wysiwyg editor v0.8.8 + * http://summernote.org/ + * + * summernote.js + * Copyright 2013- Alan Hong. and other contributors + * summernote may be freely distributed under the MIT license./ + * + * Date: 2017-09-09T11:03Z + */ +(function (factory) { + /* global define */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery); + } +}(function ($) { + 'use strict'; + + var isSupportAmd = typeof define === 'function' && define.amd; + + /** + * returns whether font is installed or not. + * + * @param {String} fontName + * @return {Boolean} + */ + var isFontInstalled = function (fontName) { + var testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS'; + var $tester = $('
').css({ + position: 'absolute', + left: '-9999px', + top: '-9999px', + fontSize: '200px' + }).text('mmmmmmmmmwwwwwww').appendTo(document.body); + + var originalWidth = $tester.css('fontFamily', testFontName).width(); + var width = $tester.css('fontFamily', fontName + ',' + testFontName).width(); + + $tester.remove(); + + return originalWidth !== width; + }; + + var userAgent = navigator.userAgent; + var isMSIE = /MSIE|Trident/i.test(userAgent); + var browserVersion; + if (isMSIE) { + var matches = /MSIE (\d+[.]\d+)/.exec(userAgent); + if (matches) { + browserVersion = parseFloat(matches[1]); + } + matches = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(userAgent); + if (matches) { + browserVersion = parseFloat(matches[1]); + } + } + + var isEdge = /Edge\/\d+/.test(userAgent); + + var hasCodeMirror = !!window.CodeMirror; + if (!hasCodeMirror && isSupportAmd) { + // Webpack + if (typeof __webpack_require__ === 'function') { // jshint ignore:line + try { + // If CodeMirror can't be resolved, `require.resolve` will throw an + // exception and `hasCodeMirror` won't be set to `true`. + require.resolve('codemirror'); + hasCodeMirror = true; + } catch (e) { + // do nothing + } + } else if (typeof require !== 'undefined') { + // Browserify + if (typeof require.resolve !== 'undefined') { + try { + // If CodeMirror can't be resolved, `require.resolve` will throw an + // exception and `hasCodeMirror` won't be set to `true`. + require.resolve('codemirror'); + hasCodeMirror = true; + } catch (e) { + // do nothing + } + // Almond/Require + } else if (typeof require.specified !== 'undefined') { + hasCodeMirror = require.specified('codemirror'); + } + } + } + + var isSupportTouch = + (('ontouchstart' in window) || + (navigator.MaxTouchPoints > 0) || + (navigator.msMaxTouchPoints > 0)); + + /** + * @class core.agent + * + * Object which check platform and agent + * + * @singleton + * @alternateClassName agent + */ + var agent = { + isMac: navigator.appVersion.indexOf('Mac') > -1, + isMSIE: isMSIE, + isEdge: isEdge, + isFF: !isEdge && /firefox/i.test(userAgent), + isPhantom: /PhantomJS/i.test(userAgent), + isWebkit: !isEdge && /webkit/i.test(userAgent), + isChrome: !isEdge && /chrome/i.test(userAgent), + isSafari: !isEdge && /safari/i.test(userAgent), + browserVersion: browserVersion, + jqueryVersion: parseFloat($.fn.jquery), + isSupportAmd: isSupportAmd, + isSupportTouch: isSupportTouch, + hasCodeMirror: hasCodeMirror, + isFontInstalled: isFontInstalled, + isW3CRangeSupport: !!document.createRange + }; + + /** + * @class core.func + * + * func utils (for high-order func's arg) + * + * @singleton + * @alternateClassName func + */ + var func = (function () { + var eq = function (itemA) { + return function (itemB) { + return itemA === itemB; + }; + }; + + var eq2 = function (itemA, itemB) { + return itemA === itemB; + }; + + var peq2 = function (propName) { + return function (itemA, itemB) { + return itemA[propName] === itemB[propName]; + }; + }; + + var ok = function () { + return true; + }; + + var fail = function () { + return false; + }; + + var not = function (f) { + return function () { + return !f.apply(f, arguments); + }; + }; + + var and = function (fA, fB) { + return function (item) { + return fA(item) && fB(item); + }; + }; + + var self = function (a) { + return a; + }; + + var invoke = function (obj, method) { + return function () { + return obj[method].apply(obj, arguments); + }; + }; + + var idCounter = 0; + + /** + * generate a globally-unique id + * + * @param {String} [prefix] + */ + var uniqueId = function (prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + /** + * returns bnd (bounds) from rect + * + * - IE Compatibility Issue: http://goo.gl/sRLOAo + * - Scroll Issue: http://goo.gl/sNjUc + * + * @param {Rect} rect + * @return {Object} bounds + * @return {Number} bounds.top + * @return {Number} bounds.left + * @return {Number} bounds.width + * @return {Number} bounds.height + */ + var rect2bnd = function (rect) { + var $document = $(document); + return { + top: rect.top + $document.scrollTop(), + left: rect.left + $document.scrollLeft(), + width: rect.right - rect.left, + height: rect.bottom - rect.top + }; + }; + + /** + * returns a copy of the object where the keys have become the values and the values the keys. + * @param {Object} obj + * @return {Object} + */ + var invertObject = function (obj) { + var inverted = {}; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + inverted[obj[key]] = key; + } + } + return inverted; + }; + + /** + * @param {String} namespace + * @param {String} [prefix] + * @return {String} + */ + var namespaceToCamel = function (namespace, prefix) { + prefix = prefix || ''; + return prefix + namespace.split('.').map(function (name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + }).join(''); + }; + + /** + * Returns a function, that, as long as it continues to be invoked, will not + * be triggered. The function will be called after it stops being called for + * N milliseconds. If `immediate` is passed, trigger the function on the + * leading edge, instead of the trailing. + * @param {Function} func + * @param {Number} wait + * @param {Boolean} immediate + * @return {Function} + */ + var debounce = function (func, wait, immediate) { + var timeout; + return function () { + var context = this, args = arguments; + var later = function () { + timeout = null; + if (!immediate) { + func.apply(context, args); + } + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + func.apply(context, args); + } + }; + }; + + return { + eq: eq, + eq2: eq2, + peq2: peq2, + ok: ok, + fail: fail, + self: self, + not: not, + and: and, + invoke: invoke, + uniqueId: uniqueId, + rect2bnd: rect2bnd, + invertObject: invertObject, + namespaceToCamel: namespaceToCamel, + debounce: debounce + }; + })(); + + /** + * @class core.list + * + * list utils + * + * @singleton + * @alternateClassName list + */ + var list = (function () { + /** + * returns the first item of an array. + * + * @param {Array} array + */ + var head = function (array) { + return array[0]; + }; + + /** + * returns the last item of an array. + * + * @param {Array} array + */ + var last = function (array) { + return array[array.length - 1]; + }; + + /** + * returns everything but the last entry of the array. + * + * @param {Array} array + */ + var initial = function (array) { + return array.slice(0, array.length - 1); + }; + + /** + * returns the rest of the items in an array. + * + * @param {Array} array + */ + var tail = function (array) { + return array.slice(1); + }; + + /** + * returns item of array + */ + var find = function (array, pred) { + for (var idx = 0, len = array.length; idx < len; idx ++) { + var item = array[idx]; + if (pred(item)) { + return item; + } + } + }; + + /** + * returns true if all of the values in the array pass the predicate truth test. + */ + var all = function (array, pred) { + for (var idx = 0, len = array.length; idx < len; idx ++) { + if (!pred(array[idx])) { + return false; + } + } + return true; + }; + + /** + * returns index of item + */ + var indexOf = function (array, item) { + return $.inArray(item, array); + }; + + /** + * returns true if the value is present in the list. + */ + var contains = function (array, item) { + return indexOf(array, item) !== -1; + }; + + /** + * get sum from a list + * + * @param {Array} array - array + * @param {Function} fn - iterator + */ + var sum = function (array, fn) { + fn = fn || func.self; + return array.reduce(function (memo, v) { + return memo + fn(v); + }, 0); + }; + + /** + * returns a copy of the collection with array type. + * @param {Collection} collection - collection eg) node.childNodes, ... + */ + var from = function (collection) { + var result = [], idx = -1, length = collection.length; + while (++idx < length) { + result[idx] = collection[idx]; + } + return result; + }; + + /** + * returns whether list is empty or not + */ + var isEmpty = function (array) { + return !array || !array.length; + }; + + /** + * cluster elements by predicate function. + * + * @param {Array} array - array + * @param {Function} fn - predicate function for cluster rule + * @param {Array[]} + */ + var clusterBy = function (array, fn) { + if (!array.length) { return []; } + var aTail = tail(array); + return aTail.reduce(function (memo, v) { + var aLast = last(memo); + if (fn(last(aLast), v)) { + aLast[aLast.length] = v; + } else { + memo[memo.length] = [v]; + } + return memo; + }, [[head(array)]]); + }; + + /** + * returns a copy of the array with all false values removed + * + * @param {Array} array - array + * @param {Function} fn - predicate function for cluster rule + */ + var compact = function (array) { + var aResult = []; + for (var idx = 0, len = array.length; idx < len; idx ++) { + if (array[idx]) { aResult.push(array[idx]); } + } + return aResult; + }; + + /** + * produces a duplicate-free version of the array + * + * @param {Array} array + */ + var unique = function (array) { + var results = []; + + for (var idx = 0, len = array.length; idx < len; idx ++) { + if (!contains(results, array[idx])) { + results.push(array[idx]); + } + } + + return results; + }; + + /** + * returns next item. + * @param {Array} array + */ + var next = function (array, item) { + var idx = indexOf(array, item); + if (idx === -1) { return null; } + + return array[idx + 1]; + }; + + /** + * returns prev item. + * @param {Array} array + */ + var prev = function (array, item) { + var idx = indexOf(array, item); + if (idx === -1) { return null; } + + return array[idx - 1]; + }; + + return { head: head, last: last, initial: initial, tail: tail, + prev: prev, next: next, find: find, contains: contains, + all: all, sum: sum, from: from, isEmpty: isEmpty, + clusterBy: clusterBy, compact: compact, unique: unique }; + })(); + + + var NBSP_CHAR = String.fromCharCode(160); + var ZERO_WIDTH_NBSP_CHAR = '\ufeff'; + + /** + * @class core.dom + * + * Dom functions + * + * @singleton + * @alternateClassName dom + */ + var dom = (function () { + /** + * @method isEditable + * + * returns whether node is `note-editable` or not. + * + * @param {Node} node + * @return {Boolean} + */ + var isEditable = function (node) { + return node && $(node).hasClass('note-editable'); + }; + + /** + * @method isControlSizing + * + * returns whether node is `note-control-sizing` or not. + * + * @param {Node} node + * @return {Boolean} + */ + var isControlSizing = function (node) { + return node && $(node).hasClass('note-control-sizing'); + }; + + /** + * @method makePredByNodeName + * + * returns predicate which judge whether nodeName is same + * + * @param {String} nodeName + * @return {Function} + */ + var makePredByNodeName = function (nodeName) { + nodeName = nodeName.toUpperCase(); + return function (node) { + return node && node.nodeName.toUpperCase() === nodeName; + }; + }; + + /** + * @method isText + * + * + * + * @param {Node} node + * @return {Boolean} true if node's type is text(3) + */ + var isText = function (node) { + return node && node.nodeType === 3; + }; + + /** + * @method isElement + * + * + * + * @param {Node} node + * @return {Boolean} true if node's type is element(1) + */ + var isElement = function (node) { + return node && node.nodeType === 1; + }; + + /** + * ex) br, col, embed, hr, img, input, ... + * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements + */ + var isVoid = function (node) { + return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT/.test(node.nodeName.toUpperCase()); + }; + + var isPara = function (node) { + if (isEditable(node)) { + return false; + } + + // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph + return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase()); + }; + + var isHeading = function (node) { + return node && /^H[1-7]/.test(node.nodeName.toUpperCase()); + }; + + var isPre = makePredByNodeName('PRE'); + + var isLi = makePredByNodeName('LI'); + + var isPurePara = function (node) { + return isPara(node) && !isLi(node); + }; + + var isTable = makePredByNodeName('TABLE'); + + var isData = makePredByNodeName('DATA'); + + var isInline = function (node) { + return !isBodyContainer(node) && + !isList(node) && + !isHr(node) && + !isPara(node) && + !isTable(node) && + !isBlockquote(node) && + !isData(node); + }; + + var isList = function (node) { + return node && /^UL|^OL/.test(node.nodeName.toUpperCase()); + }; + + var isHr = makePredByNodeName('HR'); + + var isCell = function (node) { + return node && /^TD|^TH/.test(node.nodeName.toUpperCase()); + }; + + var isBlockquote = makePredByNodeName('BLOCKQUOTE'); + + var isBodyContainer = function (node) { + return isCell(node) || isBlockquote(node) || isEditable(node); + }; + + var isAnchor = makePredByNodeName('A'); + + var isParaInline = function (node) { + return isInline(node) && !!ancestor(node, isPara); + }; + + var isBodyInline = function (node) { + return isInline(node) && !ancestor(node, isPara); + }; + + var isBody = makePredByNodeName('BODY'); + + /** + * returns whether nodeB is closest sibling of nodeA + * + * @param {Node} nodeA + * @param {Node} nodeB + * @return {Boolean} + */ + var isClosestSibling = function (nodeA, nodeB) { + return nodeA.nextSibling === nodeB || + nodeA.previousSibling === nodeB; + }; + + /** + * returns array of closest siblings with node + * + * @param {Node} node + * @param {function} [pred] - predicate function + * @return {Node[]} + */ + var withClosestSiblings = function (node, pred) { + pred = pred || func.ok; + + var siblings = []; + if (node.previousSibling && pred(node.previousSibling)) { + siblings.push(node.previousSibling); + } + siblings.push(node); + if (node.nextSibling && pred(node.nextSibling)) { + siblings.push(node.nextSibling); + } + return siblings; + }; + + /** + * blank HTML for cursor position + * - [workaround] old IE only works with   + * - [workaround] IE11 and other browser works with bogus br + */ + var blankHTML = agent.isMSIE && agent.browserVersion < 11 ? ' ' : '
'; + + /** + * @method nodeLength + * + * returns #text's text size or element's childNodes size + * + * @param {Node} node + */ + var nodeLength = function (node) { + if (isText(node)) { + return node.nodeValue.length; + } + + if (node) { + return node.childNodes.length; + } + + return 0; + + }; + + /** + * returns whether node is empty or not. + * + * @param {Node} node + * @return {Boolean} + */ + var isEmpty = function (node) { + var len = nodeLength(node); + + if (len === 0) { + return true; + } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) { + // ex)


,
+ return true; + } else if (list.all(node.childNodes, isText) && node.innerHTML === '') { + // ex)

, + return true; + } + + return false; + }; + + /** + * padding blankHTML if node is empty (for cursor position) + */ + var paddingBlankHTML = function (node) { + if (!isVoid(node) && !nodeLength(node)) { + node.innerHTML = blankHTML; + } + }; + + /** + * find nearest ancestor predicate hit + * + * @param {Node} node + * @param {Function} pred - predicate function + */ + var ancestor = function (node, pred) { + while (node) { + if (pred(node)) { return node; } + if (isEditable(node)) { break; } + + node = node.parentNode; + } + return null; + }; + + /** + * find nearest ancestor only single child blood line and predicate hit + * + * @param {Node} node + * @param {Function} pred - predicate function + */ + var singleChildAncestor = function (node, pred) { + node = node.parentNode; + + while (node) { + if (nodeLength(node) !== 1) { break; } + if (pred(node)) { return node; } + if (isEditable(node)) { break; } + + node = node.parentNode; + } + return null; + }; + + /** + * returns new array of ancestor nodes (until predicate hit). + * + * @param {Node} node + * @param {Function} [optional] pred - predicate function + */ + var listAncestor = function (node, pred) { + pred = pred || func.fail; + + var ancestors = []; + ancestor(node, function (el) { + if (!isEditable(el)) { + ancestors.push(el); + } + + return pred(el); + }); + return ancestors; + }; + + /** + * find farthest ancestor predicate hit + */ + var lastAncestor = function (node, pred) { + var ancestors = listAncestor(node); + return list.last(ancestors.filter(pred)); + }; + + /** + * returns common ancestor node between two nodes. + * + * @param {Node} nodeA + * @param {Node} nodeB + */ + var commonAncestor = function (nodeA, nodeB) { + var ancestors = listAncestor(nodeA); + for (var n = nodeB; n; n = n.parentNode) { + if ($.inArray(n, ancestors) > -1) { return n; } + } + return null; // difference document area + }; + + /** + * listing all previous siblings (until predicate hit). + * + * @param {Node} node + * @param {Function} [optional] pred - predicate function + */ + var listPrev = function (node, pred) { + pred = pred || func.fail; + + var nodes = []; + while (node) { + if (pred(node)) { break; } + nodes.push(node); + node = node.previousSibling; + } + return nodes; + }; + + /** + * listing next siblings (until predicate hit). + * + * @param {Node} node + * @param {Function} [pred] - predicate function + */ + var listNext = function (node, pred) { + pred = pred || func.fail; + + var nodes = []; + while (node) { + if (pred(node)) { break; } + nodes.push(node); + node = node.nextSibling; + } + return nodes; + }; + + /** + * listing descendant nodes + * + * @param {Node} node + * @param {Function} [pred] - predicate function + */ + var listDescendant = function (node, pred) { + var descendants = []; + pred = pred || func.ok; + + // start DFS(depth first search) with node + (function fnWalk(current) { + if (node !== current && pred(current)) { + descendants.push(current); + } + for (var idx = 0, len = current.childNodes.length; idx < len; idx++) { + fnWalk(current.childNodes[idx]); + } + })(node); + + return descendants; + }; + + /** + * wrap node with new tag. + * + * @param {Node} node + * @param {Node} tagName of wrapper + * @return {Node} - wrapper + */ + var wrap = function (node, wrapperName) { + var parent = node.parentNode; + var wrapper = $('<' + wrapperName + '>')[0]; + + parent.insertBefore(wrapper, node); + wrapper.appendChild(node); + + return wrapper; + }; + + /** + * insert node after preceding + * + * @param {Node} node + * @param {Node} preceding - predicate function + */ + var insertAfter = function (node, preceding) { + var next = preceding.nextSibling, parent = preceding.parentNode; + if (next) { + parent.insertBefore(node, next); + } else { + parent.appendChild(node); + } + return node; + }; + + /** + * append elements. + * + * @param {Node} node + * @param {Collection} aChild + */ + var appendChildNodes = function (node, aChild) { + $.each(aChild, function (idx, child) { + node.appendChild(child); + }); + return node; + }; + + /** + * returns whether boundaryPoint is left edge or not. + * + * @param {BoundaryPoint} point + * @return {Boolean} + */ + var isLeftEdgePoint = function (point) { + return point.offset === 0; + }; + + /** + * returns whether boundaryPoint is right edge or not. + * + * @param {BoundaryPoint} point + * @return {Boolean} + */ + var isRightEdgePoint = function (point) { + return point.offset === nodeLength(point.node); + }; + + /** + * returns whether boundaryPoint is edge or not. + * + * @param {BoundaryPoint} point + * @return {Boolean} + */ + var isEdgePoint = function (point) { + return isLeftEdgePoint(point) || isRightEdgePoint(point); + }; + + /** + * returns whether node is left edge of ancestor or not. + * + * @param {Node} node + * @param {Node} ancestor + * @return {Boolean} + */ + var isLeftEdgeOf = function (node, ancestor) { + while (node && node !== ancestor) { + if (position(node) !== 0) { + return false; + } + node = node.parentNode; + } + + return true; + }; + + /** + * returns whether node is right edge of ancestor or not. + * + * @param {Node} node + * @param {Node} ancestor + * @return {Boolean} + */ + var isRightEdgeOf = function (node, ancestor) { + if (!ancestor) { + return false; + } + while (node && node !== ancestor) { + if (position(node) !== nodeLength(node.parentNode) - 1) { + return false; + } + node = node.parentNode; + } + + return true; + }; + + /** + * returns whether point is left edge of ancestor or not. + * @param {BoundaryPoint} point + * @param {Node} ancestor + * @return {Boolean} + */ + var isLeftEdgePointOf = function (point, ancestor) { + return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor); + }; + + /** + * returns whether point is right edge of ancestor or not. + * @param {BoundaryPoint} point + * @param {Node} ancestor + * @return {Boolean} + */ + var isRightEdgePointOf = function (point, ancestor) { + return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor); + }; + + /** + * returns offset from parent. + * + * @param {Node} node + */ + var position = function (node) { + var offset = 0; + while ((node = node.previousSibling)) { + offset += 1; + } + return offset; + }; + + var hasChildren = function (node) { + return !!(node && node.childNodes && node.childNodes.length); + }; + + /** + * returns previous boundaryPoint + * + * @param {BoundaryPoint} point + * @param {Boolean} isSkipInnerOffset + * @return {BoundaryPoint} + */ + var prevPoint = function (point, isSkipInnerOffset) { + var node, offset; + + if (point.offset === 0) { + if (isEditable(point.node)) { + return null; + } + + node = point.node.parentNode; + offset = position(point.node); + } else if (hasChildren(point.node)) { + node = point.node.childNodes[point.offset - 1]; + offset = nodeLength(node); + } else { + node = point.node; + offset = isSkipInnerOffset ? 0 : point.offset - 1; + } + + return { + node: node, + offset: offset + }; + }; + + /** + * returns next boundaryPoint + * + * @param {BoundaryPoint} point + * @param {Boolean} isSkipInnerOffset + * @return {BoundaryPoint} + */ + var nextPoint = function (point, isSkipInnerOffset) { + var node, offset; + + if (nodeLength(point.node) === point.offset) { + if (isEditable(point.node)) { + return null; + } + + node = point.node.parentNode; + offset = position(point.node) + 1; + } else if (hasChildren(point.node)) { + node = point.node.childNodes[point.offset]; + offset = 0; + } else { + node = point.node; + offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1; + } + + return { + node: node, + offset: offset + }; + }; + + /** + * returns whether pointA and pointB is same or not. + * + * @param {BoundaryPoint} pointA + * @param {BoundaryPoint} pointB + * @return {Boolean} + */ + var isSamePoint = function (pointA, pointB) { + return pointA.node === pointB.node && pointA.offset === pointB.offset; + }; + + /** + * returns whether point is visible (can set cursor) or not. + * + * @param {BoundaryPoint} point + * @return {Boolean} + */ + var isVisiblePoint = function (point) { + if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) { + return true; + } + + var leftNode = point.node.childNodes[point.offset - 1]; + var rightNode = point.node.childNodes[point.offset]; + if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) { + return true; + } + + return false; + }; + + /** + * @method prevPointUtil + * + * @param {BoundaryPoint} point + * @param {Function} pred + * @return {BoundaryPoint} + */ + var prevPointUntil = function (point, pred) { + while (point) { + if (pred(point)) { + return point; + } + + point = prevPoint(point); + } + + return null; + }; + + /** + * @method nextPointUntil + * + * @param {BoundaryPoint} point + * @param {Function} pred + * @return {BoundaryPoint} + */ + var nextPointUntil = function (point, pred) { + while (point) { + if (pred(point)) { + return point; + } + + point = nextPoint(point); + } + + return null; + }; + + /** + * returns whether point has character or not. + * + * @param {Point} point + * @return {Boolean} + */ + var isCharPoint = function (point) { + if (!isText(point.node)) { + return false; + } + + var ch = point.node.nodeValue.charAt(point.offset - 1); + return ch && (ch !== ' ' && ch !== NBSP_CHAR); + }; + + /** + * @method walkPoint + * + * @param {BoundaryPoint} startPoint + * @param {BoundaryPoint} endPoint + * @param {Function} handler + * @param {Boolean} isSkipInnerOffset + */ + var walkPoint = function (startPoint, endPoint, handler, isSkipInnerOffset) { + var point = startPoint; + + while (point) { + handler(point); + + if (isSamePoint(point, endPoint)) { + break; + } + + var isSkipOffset = isSkipInnerOffset && + startPoint.node !== point.node && + endPoint.node !== point.node; + point = nextPoint(point, isSkipOffset); + } + }; + + /** + * @method makeOffsetPath + * + * return offsetPath(array of offset) from ancestor + * + * @param {Node} ancestor - ancestor node + * @param {Node} node + */ + var makeOffsetPath = function (ancestor, node) { + var ancestors = listAncestor(node, func.eq(ancestor)); + return ancestors.map(position).reverse(); + }; + + /** + * @method fromOffsetPath + * + * return element from offsetPath(array of offset) + * + * @param {Node} ancestor - ancestor node + * @param {array} offsets - offsetPath + */ + var fromOffsetPath = function (ancestor, offsets) { + var current = ancestor; + for (var i = 0, len = offsets.length; i < len; i++) { + if (current.childNodes.length <= offsets[i]) { + current = current.childNodes[current.childNodes.length - 1]; + } else { + current = current.childNodes[offsets[i]]; + } + } + return current; + }; + + /** + * @method splitNode + * + * split element or #text + * + * @param {BoundaryPoint} point + * @param {Object} [options] + * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false + * @param {Boolean} [options.isNotSplitEdgePoint] - default: false + * @return {Node} right node of boundaryPoint + */ + var splitNode = function (point, options) { + var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML; + var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint; + + // edge case + if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) { + if (isLeftEdgePoint(point)) { + return point.node; + } else if (isRightEdgePoint(point)) { + return point.node.nextSibling; + } + } + + // split #text + if (isText(point.node)) { + return point.node.splitText(point.offset); + } else { + var childNode = point.node.childNodes[point.offset]; + var clone = insertAfter(point.node.cloneNode(false), point.node); + appendChildNodes(clone, listNext(childNode)); + + if (!isSkipPaddingBlankHTML) { + paddingBlankHTML(point.node); + paddingBlankHTML(clone); + } + + return clone; + } + }; + + /** + * @method splitTree + * + * split tree by point + * + * @param {Node} root - split root + * @param {BoundaryPoint} point + * @param {Object} [options] + * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false + * @param {Boolean} [options.isNotSplitEdgePoint] - default: false + * @return {Node} right node of boundaryPoint + */ + var splitTree = function (root, point, options) { + // ex) [#text, ,

] + var ancestors = listAncestor(point.node, func.eq(root)); + + if (!ancestors.length) { + return null; + } else if (ancestors.length === 1) { + return splitNode(point, options); + } + + return ancestors.reduce(function (node, parent) { + if (node === point.node) { + node = splitNode(point, options); + } + + return splitNode({ + node: parent, + offset: node ? dom.position(node) : nodeLength(parent) + }, options); + }); + }; + + /** + * split point + * + * @param {Point} point + * @param {Boolean} isInline + * @return {Object} + */ + var splitPoint = function (point, isInline) { + // find splitRoot, container + // - inline: splitRoot is a child of paragraph + // - block: splitRoot is a child of bodyContainer + var pred = isInline ? isPara : isBodyContainer; + var ancestors = listAncestor(point.node, pred); + var topAncestor = list.last(ancestors) || point.node; + + var splitRoot, container; + if (pred(topAncestor)) { + splitRoot = ancestors[ancestors.length - 2]; + container = topAncestor; + } else { + splitRoot = topAncestor; + container = splitRoot.parentNode; + } + + // if splitRoot is exists, split with splitTree + var pivot = splitRoot && splitTree(splitRoot, point, { + isSkipPaddingBlankHTML: isInline, + isNotSplitEdgePoint: isInline + }); + + // if container is point.node, find pivot with point.offset + if (!pivot && container === point.node) { + pivot = point.node.childNodes[point.offset]; + } + + return { + rightNode: pivot, + container: container + }; + }; + + var create = function (nodeName) { + return document.createElement(nodeName); + }; + + var createText = function (text) { + return document.createTextNode(text); + }; + + /** + * @method remove + * + * remove node, (isRemoveChild: remove child or not) + * + * @param {Node} node + * @param {Boolean} isRemoveChild + */ + var remove = function (node, isRemoveChild) { + if (!node || !node.parentNode) { return; } + if (node.removeNode) { return node.removeNode(isRemoveChild); } + + var parent = node.parentNode; + if (!isRemoveChild) { + var nodes = []; + var i, len; + for (i = 0, len = node.childNodes.length; i < len; i++) { + nodes.push(node.childNodes[i]); + } + + for (i = 0, len = nodes.length; i < len; i++) { + parent.insertBefore(nodes[i], node); + } + } + + parent.removeChild(node); + }; + + /** + * @method removeWhile + * + * @param {Node} node + * @param {Function} pred + */ + var removeWhile = function (node, pred) { + while (node) { + if (isEditable(node) || !pred(node)) { + break; + } + + var parent = node.parentNode; + remove(node); + node = parent; + } + }; + + /** + * @method replace + * + * replace node with provided nodeName + * + * @param {Node} node + * @param {String} nodeName + * @return {Node} - new node + */ + var replace = function (node, nodeName) { + if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) { + return node; + } + + var newNode = create(nodeName); + + if (node.style.cssText) { + newNode.style.cssText = node.style.cssText; + } + + appendChildNodes(newNode, list.from(node.childNodes)); + insertAfter(newNode, node); + remove(node); + + return newNode; + }; + + var isTextarea = makePredByNodeName('TEXTAREA'); + + /** + * @param {jQuery} $node + * @param {Boolean} [stripLinebreaks] - default: false + */ + var value = function ($node, stripLinebreaks) { + var val = isTextarea($node[0]) ? $node.val() : $node.html(); + if (stripLinebreaks) { + return val.replace(/[\n\r]/g, ''); + } + return val; + }; + + /** + * @method html + * + * get the HTML contents of node + * + * @param {jQuery} $node + * @param {Boolean} [isNewlineOnBlock] + */ + var html = function ($node, isNewlineOnBlock) { + var markup = value($node); + + if (isNewlineOnBlock) { + var regexTag = /<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g; + markup = markup.replace(regexTag, function (match, endSlash, name) { + name = name.toUpperCase(); + var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) && + !!endSlash; + var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name); + + return match + ((isEndOfInlineContainer || isBlockNode) ? '\n' : ''); + }); + markup = $.trim(markup); + } + + return markup; + }; + + var posFromPlaceholder = function (placeholder) { + var $placeholder = $(placeholder); + var pos = $placeholder.offset(); + var height = $placeholder.outerHeight(true); // include margin + + return { + left: pos.left, + top: pos.top + height + }; + }; + + var attachEvents = function ($node, events) { + Object.keys(events).forEach(function (key) { + $node.on(key, events[key]); + }); + }; + + var detachEvents = function ($node, events) { + Object.keys(events).forEach(function (key) { + $node.off(key, events[key]); + }); + }; + + /** + * @method isCustomStyleTag + * + * assert if a node contains a "note-styletag" class, + * which implies that's a custom-made style tag node + * + * @param {Node} an HTML DOM node + */ + var isCustomStyleTag = function (node) { + return node && !dom.isText(node) && list.contains(node.classList, 'note-styletag'); + }; + + return { + /** @property {String} NBSP_CHAR */ + NBSP_CHAR: NBSP_CHAR, + /** @property {String} ZERO_WIDTH_NBSP_CHAR */ + ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR, + /** @property {String} blank */ + blank: blankHTML, + /** @property {String} emptyPara */ + emptyPara: '

' + blankHTML + '

', + makePredByNodeName: makePredByNodeName, + isEditable: isEditable, + isControlSizing: isControlSizing, + isText: isText, + isElement: isElement, + isVoid: isVoid, + isPara: isPara, + isPurePara: isPurePara, + isHeading: isHeading, + isInline: isInline, + isBlock: func.not(isInline), + isBodyInline: isBodyInline, + isBody: isBody, + isParaInline: isParaInline, + isPre: isPre, + isList: isList, + isTable: isTable, + isData: isData, + isCell: isCell, + isBlockquote: isBlockquote, + isBodyContainer: isBodyContainer, + isAnchor: isAnchor, + isDiv: makePredByNodeName('DIV'), + isLi: isLi, + isBR: makePredByNodeName('BR'), + isSpan: makePredByNodeName('SPAN'), + isB: makePredByNodeName('B'), + isU: makePredByNodeName('U'), + isS: makePredByNodeName('S'), + isI: makePredByNodeName('I'), + isImg: makePredByNodeName('IMG'), + isTextarea: isTextarea, + isEmpty: isEmpty, + isEmptyAnchor: func.and(isAnchor, isEmpty), + isClosestSibling: isClosestSibling, + withClosestSiblings: withClosestSiblings, + nodeLength: nodeLength, + isLeftEdgePoint: isLeftEdgePoint, + isRightEdgePoint: isRightEdgePoint, + isEdgePoint: isEdgePoint, + isLeftEdgeOf: isLeftEdgeOf, + isRightEdgeOf: isRightEdgeOf, + isLeftEdgePointOf: isLeftEdgePointOf, + isRightEdgePointOf: isRightEdgePointOf, + prevPoint: prevPoint, + nextPoint: nextPoint, + isSamePoint: isSamePoint, + isVisiblePoint: isVisiblePoint, + prevPointUntil: prevPointUntil, + nextPointUntil: nextPointUntil, + isCharPoint: isCharPoint, + walkPoint: walkPoint, + ancestor: ancestor, + singleChildAncestor: singleChildAncestor, + listAncestor: listAncestor, + lastAncestor: lastAncestor, + listNext: listNext, + listPrev: listPrev, + listDescendant: listDescendant, + commonAncestor: commonAncestor, + wrap: wrap, + insertAfter: insertAfter, + appendChildNodes: appendChildNodes, + position: position, + hasChildren: hasChildren, + makeOffsetPath: makeOffsetPath, + fromOffsetPath: fromOffsetPath, + splitTree: splitTree, + splitPoint: splitPoint, + create: create, + createText: createText, + remove: remove, + removeWhile: removeWhile, + replace: replace, + html: html, + value: value, + posFromPlaceholder: posFromPlaceholder, + attachEvents: attachEvents, + detachEvents: detachEvents, + isCustomStyleTag: isCustomStyleTag + }; + })(); + + /** + * @param {jQuery} $note + * @param {Object} options + * @return {Context} + */ + var Context = function ($note, options) { + var self = this; + + var ui = $.summernote.ui; + this.memos = {}; + this.modules = {}; + this.layoutInfo = {}; + this.options = options; + + /** + * create layout and initialize modules and other resources + */ + this.initialize = function () { + this.layoutInfo = ui.createLayout($note, options); + this._initialize(); + $note.hide(); + return this; + }; + + /** + * destroy modules and other resources and remove layout + */ + this.destroy = function () { + this._destroy(); + $note.removeData('summernote'); + ui.removeLayout($note, this.layoutInfo); + }; + + /** + * destory modules and other resources and initialize it again + */ + this.reset = function () { + var disabled = self.isDisabled(); + this.code(dom.emptyPara); + this._destroy(); + this._initialize(); + + if (disabled) { + self.disable(); + } + }; + + this._initialize = function () { + // add optional buttons + var buttons = $.extend({}, this.options.buttons); + Object.keys(buttons).forEach(function (key) { + self.memo('button.' + key, buttons[key]); + }); + + var modules = $.extend({}, this.options.modules, $.summernote.plugins || {}); + + // add and initialize modules + Object.keys(modules).forEach(function (key) { + self.module(key, modules[key], true); + }); + + Object.keys(this.modules).forEach(function (key) { + self.initializeModule(key); + }); + }; + + this._destroy = function () { + // destroy modules with reversed order + Object.keys(this.modules).reverse().forEach(function (key) { + self.removeModule(key); + }); + + Object.keys(this.memos).forEach(function (key) { + self.removeMemo(key); + }); + // trigger custom onDestroy callback + this.triggerEvent('destroy', this); + }; + + this.code = function (html) { + var isActivated = this.invoke('codeview.isActivated'); + + if (html === undefined) { + this.invoke('codeview.sync'); + return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html(); + } else { + if (isActivated) { + this.layoutInfo.codable.val(html); + } else { + this.layoutInfo.editable.html(html); + } + $note.val(html); + this.triggerEvent('change', html); + } + }; + + this.isDisabled = function () { + return this.layoutInfo.editable.attr('contenteditable') === 'false'; + }; + + this.enable = function () { + this.layoutInfo.editable.attr('contenteditable', true); + this.invoke('toolbar.activate', true); + this.triggerEvent('disable', false); + }; + + this.disable = function () { + // close codeview if codeview is opend + if (this.invoke('codeview.isActivated')) { + this.invoke('codeview.deactivate'); + } + this.layoutInfo.editable.attr('contenteditable', false); + this.invoke('toolbar.deactivate', true); + + this.triggerEvent('disable', true); + }; + + this.triggerEvent = function () { + var namespace = list.head(arguments); + var args = list.tail(list.from(arguments)); + + var callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')]; + if (callback) { + callback.apply($note[0], args); + } + $note.trigger('summernote.' + namespace, args); + }; + + this.initializeModule = function (key) { + var module = this.modules[key]; + module.shouldInitialize = module.shouldInitialize || func.ok; + if (!module.shouldInitialize()) { + return; + } + + // initialize module + if (module.initialize) { + module.initialize(); + } + + // attach events + if (module.events) { + dom.attachEvents($note, module.events); + } + }; + + this.module = function (key, ModuleClass, withoutIntialize) { + if (arguments.length === 1) { + return this.modules[key]; + } + + this.modules[key] = new ModuleClass(this); + + if (!withoutIntialize) { + this.initializeModule(key); + } + }; + + this.removeModule = function (key) { + var module = this.modules[key]; + if (module.shouldInitialize()) { + if (module.events) { + dom.detachEvents($note, module.events); + } + + if (module.destroy) { + module.destroy(); + } + } + + delete this.modules[key]; + }; + + this.memo = function (key, obj) { + if (arguments.length === 1) { + return this.memos[key]; + } + this.memos[key] = obj; + }; + + this.removeMemo = function (key) { + if (this.memos[key] && this.memos[key].destroy) { + this.memos[key].destroy(); + } + + delete this.memos[key]; + }; + + /** + *Some buttons need to change their visual style immediately once they get pressed + */ + this.createInvokeHandlerAndUpdateState = function (namespace, value) { + return function (event) { + self.createInvokeHandler(namespace, value)(event); + self.invoke('buttons.updateCurrentStyle'); + }; + }; + + this.createInvokeHandler = function (namespace, value) { + return function (event) { + event.preventDefault(); + var $target = $(event.target); + self.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target); + }; + }; + + this.invoke = function () { + var namespace = list.head(arguments); + var args = list.tail(list.from(arguments)); + + var splits = namespace.split('.'); + var hasSeparator = splits.length > 1; + var moduleName = hasSeparator && list.head(splits); + var methodName = hasSeparator ? list.last(splits) : list.head(splits); + + var module = this.modules[moduleName || 'editor']; + if (!moduleName && this[methodName]) { + return this[methodName].apply(this, args); + } else if (module && module[methodName] && module.shouldInitialize()) { + return module[methodName].apply(module, args); + } + }; + + return this.initialize(); + }; + + $.fn.extend({ + /** + * Summernote API + * + * @param {Object|String} + * @return {this} + */ + summernote: function () { + var type = $.type(list.head(arguments)); + var isExternalAPICalled = type === 'string'; + var hasInitOptions = type === 'object'; + + var options = hasInitOptions ? list.head(arguments) : {}; + + options = $.extend({}, $.summernote.options, options); + + // Update options + options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]); + options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons); + options.tooltip = options.tooltip === 'auto' ? !agent.isSupportTouch : options.tooltip; + + this.each(function (idx, note) { + var $note = $(note); + if (!$note.data('summernote')) { + var context = new Context($note, options); + $note.data('summernote', context); + $note.data('summernote').triggerEvent('init', context.layoutInfo); + } + }); + + var $note = this.first(); + if ($note.length) { + var context = $note.data('summernote'); + if (isExternalAPICalled) { + return context.invoke.apply(context, list.from(arguments)); + } else if (options.focus) { + context.invoke('editor.focus'); + } + } + + return this; + } + }); + + + var Renderer = function (markup, children, options, callback) { + this.render = function ($parent) { + var $node = $(markup); + + if (options && options.contents) { + $node.html(options.contents); + } + + if (options && options.className) { + $node.addClass(options.className); + } + + if (options && options.data) { + $.each(options.data, function (k, v) { + $node.attr('data-' + k, v); + }); + } + + if (options && options.click) { + $node.on('click', options.click); + } + + if (children) { + var $container = $node.find('.note-children-container'); + children.forEach(function (child) { + child.render($container.length ? $container : $node); + }); + } + + if (callback) { + callback($node, options); + } + + if (options && options.callback) { + options.callback($node); + } + + if ($parent) { + $parent.append($node); + } + + return $node; + }; + }; + + var renderer = { + create: function (markup, callback) { + return function () { + var children = $.isArray(arguments[0]) ? arguments[0] : []; + var options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0]; + if (options && options.children) { + children = options.children; + } + return new Renderer(markup, children, options, callback); + }; + } + }; + + var editor = renderer.create('
'); + var toolbar = renderer.create('
'); + var editingArea = renderer.create('
'); + var codable = renderer.create('