Merge branch 'dev-life' into dev
Conflicts: app/init.go app/service/UserService.go conf/app.conf conf/routes mongodb_backup/leanote_install_data/albums.metadata.json mongodb_backup/leanote_install_data/attachs.metadata.json mongodb_backup/leanote_install_data/blog_comments.metadata.json mongodb_backup/leanote_install_data/blog_likes.metadata.json mongodb_backup/leanote_install_data/blog_singles.metadata.json mongodb_backup/leanote_install_data/configs.bson mongodb_backup/leanote_install_data/configs.metadata.json mongodb_backup/leanote_install_data/email_logs.metadata.json mongodb_backup/leanote_install_data/files.metadata.json mongodb_backup/leanote_install_data/find_pwds.metadata.json mongodb_backup/leanote_install_data/group_users.metadata.json mongodb_backup/leanote_install_data/groups.metadata.json mongodb_backup/leanote_install_data/has_share_notes.metadata.json mongodb_backup/leanote_install_data/leanote.ShareNotes.metadata.json mongodb_backup/leanote_install_data/leanote.has_share_notes.metadata.jso n mongodb_backup/leanote_install_data/note_content_histories.metadata.json mongodb_backup/leanote_install_data/note_contents.metadata.json mongodb_backup/leanote_install_data/note_images.metadata.json mongodb_backup/leanote_install_data/notebooks.bson mongodb_backup/leanote_install_data/notebooks.metadata.json mongodb_backup/leanote_install_data/notes.bson mongodb_backup/leanote_install_data/notes.metadata.json mongodb_backup/leanote_install_data/reports.metadata.json mongodb_backup/leanote_install_data/sessions.metadata.json mongodb_backup/leanote_install_data/share_notebooks.metadata.json mongodb_backup/leanote_install_data/share_notes.metadata.json mongodb_backup/leanote_install_data/suggestions.metadata.json mongodb_backup/leanote_install_data/system.indexes.bson mongodb_backup/leanote_install_data/tag_count.metadata.json mongodb_backup/leanote_install_data/tags.metadata.json mongodb_backup/leanote_install_data/themes.metadata.json mongodb_backup/leanote_install_data/tokens.metadata.json mongodb_backup/leanote_install_data/user_blogs.metadata.json mongodb_backup/leanote_install_data/users.bson mongodb_backup/leanote_install_data/users.metadata.json public/blog/themes/default/theme.json public/blog/themes/elegant/theme.json public/blog/themes/nav_fixed/theme.json public/images/logo/leanote_icon_blue.jpg public/js/app/note-min.js public/js/app/note.js public/js/app/notebook-min.js public/js/app/notebook.js public/js/app/tag-min.js public/js/app/tag.js public/tinymce/plugins/paste/plugin.dev.js public/tinymce/plugins/spellchecker/plugin.min.js public/tinymce/tinymce.dev.js public/tinymce/tinymce.jquery.dev.js
This commit is contained in:
commit
5fae5dd10e
510 files changed
+7769
-2623
No files matched your search
@@ -1,230 +0,0 @@
|
||||
// for editor.
|
||||
// drag image to editor
|
||||
// Copyright leaui
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
define('leaui_image', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
// 当url改变时, 得到图片的大小
|
||||
function getImageSize(url, callback) {
|
||||
var img = document.createElement('img');
|
||||
|
||||
function done(width, height) {
|
||||
img.parentNode.removeChild(img);
|
||||
callback({width: width, height: height});
|
||||
}
|
||||
|
||||
img.onload = function() {
|
||||
done(img.clientWidth, img.clientHeight);
|
||||
};
|
||||
|
||||
img.onerror = function() {
|
||||
done();
|
||||
};
|
||||
|
||||
img.src = url;
|
||||
|
||||
var style = img.style;
|
||||
style.visibility = 'hidden';
|
||||
style.position = 'fixed';
|
||||
style.bottom = style.left = 0;
|
||||
style.width = style.height = 'auto';
|
||||
|
||||
document.body.appendChild(img);
|
||||
}
|
||||
|
||||
var i = 1;
|
||||
function insertImage(data) {
|
||||
var editor = tinymce.activeEditor;
|
||||
var dom = editor.dom;
|
||||
|
||||
var renderImage = function(data2) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var d = {};
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + (i++);
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
tinymce.activeEditor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
|
||||
function callback (wh) {
|
||||
if(wh && wh.width) {
|
||||
if(wh.width > 600) {
|
||||
wh.width = 600;
|
||||
}
|
||||
data2.width = wh.width;
|
||||
}
|
||||
dom.setAttrib(imgElm, 'src', data2.src);
|
||||
dom.setAttrib(imgElm, 'width', data2.width);
|
||||
if(data2.title) {
|
||||
dom.setAttrib(imgElm, 'title', data2.title);
|
||||
}
|
||||
|
||||
dom.setAttrib(imgElm, 'id', null);
|
||||
};
|
||||
getImageSize(data.src, callback);
|
||||
}
|
||||
|
||||
//-------------
|
||||
// outputImage?fileId=123232323
|
||||
var fileId = "";
|
||||
fileIds = data.src.split("fileId=")
|
||||
if(fileIds.length == 2 && fileIds[1].length == "53aecf8a8a039a43c8036282".length) {
|
||||
fileId = fileIds[1];
|
||||
}
|
||||
if(fileId) {
|
||||
// 得到fileId, 如果这个笔记不是我的, 那么肯定是协作的笔记, 那么需要将图片copy给原note owner
|
||||
var curNote = Note.getCurNote();
|
||||
if(curNote && curNote.UserId != UserInfo.UserId) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/file/outputImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
})(data);
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
}
|
||||
|
||||
var initUploader = function() {
|
||||
var ul = $('#upload ul');
|
||||
|
||||
$('#drop a').click(function() {
|
||||
// trigger to show file select
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
// Initialize the jQuery File Upload plugin
|
||||
$('#upload').fileupload({
|
||||
dataType: 'json',
|
||||
acceptFileTypes: /(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,
|
||||
maxFileSize: 210000,
|
||||
|
||||
// This element will accept file drag/drop uploading
|
||||
dropZone: $('#drop'),
|
||||
formData: function(form) {
|
||||
return [{name: 'albumId', value: ""}]
|
||||
},
|
||||
// This function is called when a file is added to the queue;
|
||||
// either via the browse button, or via drag/drop:
|
||||
add: function(e, data) {
|
||||
var tpl = $('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.find('div').append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
data.context = tpl.appendTo(ul);
|
||||
|
||||
// data.form[0].action += "&album_id=" + $("#albumsForUpload").val();
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR = data.submit();
|
||||
},
|
||||
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.remove();
|
||||
// life
|
||||
var data2 = {src: urlPrefix + "/file/outputImage?fileId=" + data.result.Id}
|
||||
insertImage(data2);
|
||||
} else {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
}
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent the default action when a file is dropped on the window
|
||||
$(document).on('drop dragover', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Helper function that formats the file sizes
|
||||
function formatFileSize(bytes) {
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
function showUpload() {
|
||||
$("#upload").css("z-index", 12);
|
||||
var top = +$("#mceToolbar").css("height").slice(0, -2); // px
|
||||
$("#upload").css("top", top - 8);
|
||||
$("#upload").show();
|
||||
}
|
||||
|
||||
function hideUpload() {
|
||||
$("#upload").css("z-index", 0).css("top", "auto").hide();
|
||||
}
|
||||
|
||||
// drag css
|
||||
$(document).bind('dragover', function (e) {
|
||||
var dropZone = $('#drop'),
|
||||
timeout = window.dropZoneTimeout;
|
||||
if (!timeout) {
|
||||
dropZone.addClass('in');
|
||||
showUpload();
|
||||
} else {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var found = false,
|
||||
node = e.target;
|
||||
do {
|
||||
if (node === dropZone[0]) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
} while (node != null);
|
||||
if (found) {
|
||||
dropZone.addClass('hover');
|
||||
} else {
|
||||
dropZone.removeClass('hover');
|
||||
}
|
||||
window.dropZoneTimeout = setTimeout(function () {
|
||||
window.dropZoneTimeout = null;
|
||||
dropZone.removeClass('in hover');
|
||||
hideUpload();
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
initUploader();
|
||||
});
|
||||
@@ -117,4 +117,8 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: 81dccd126cf777c058d698320fb736ed
|
||||
<<<<<<< HEAD
|
||||
// $hash: 81dccd126cf777c058d698320fb736ed
|
||||
=======
|
||||
// $hash: eead586884e827fb28480c335ab9d3fc
|
||||
>>>>>>> dev-life
|
||||
@@ -114,4 +114,4 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: 0dea0ce031907f908bd45feb13483a36
|
||||
// $hash: 69eeaf44413967796526c27a57f9e5c3
|
||||
+5
-1
@@ -1 +1,5 @@
|
||||
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=c[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,o){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(o===t)throw"invalid module definition, definition function must be specified";n(r,function(){c[e]=o.apply(null,arguments)})}function o(t){for(var n=e,r=t.split(/[.\/]/),o=0;o<r.length;++o){if(!n[r[o]])return;n=n[r[o]]}return n}function i(n){for(var r=0;r<n.length;r++){for(var o=e,i=n[r],a=i.split(/[.\/]/),l=0;l<a.length-1;++l)o[a[l]]===t&&(o[a[l]]={}),o=o[a[l]];o[a[a.length-1]]=c[i]}}var c={};r("tinymce/spellcheckerplugin/DomTextMatcher",[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(p[e.nodeName]&&!h[e.nodeName])return"";if(t="",(h[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function i(e,t,n){var r,o,i,c,a=[],l=0,d=e,s=t.shift(),u=0;e:for(;;){if((h[d.nodeName]||g[d.nodeName])&&l++,3===d.nodeType&&(!o&&d.length+l>=s[1]?(o=d,c=s[1]-l):r&&a.push(d),!r&&d.length+l>s[0]&&(r=d,i=s[0]-l),l+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:c,innerNodes:a,match:s[2],matchIndex:u}),l-=o.length-c,r=null,o=null,a=[],s=t.shift(),u++,!s)break}else{if((!p[d.nodeName]||h[d.nodeName])&&d.firstChild){d=d.firstChild;continue}if(d.nextSibling){d=d.nextSibling;continue}}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}function c(e){var t;if("function"!=typeof e){var n=e.nodeType?e:f.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(f.createTextNode(e)),r}}else t=e;return function(e){var n,r,o,i=e.startNode,c=e.endNode,a=e.matchIndex;if(i===c){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=f.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var d=t(e.match[0],a);return o.insertBefore(d,l),e.endNodeIndex<l.length&&(r=f.createTextNode(l.data.substring(e.endNodeIndex)),o.insertBefore(r,l)),l.parentNode.removeChild(l),d}n=f.createTextNode(i.data.substring(0,e.startNodeIndex)),r=f.createTextNode(c.data.substring(e.endNodeIndex));for(var s=t(i.data.substring(e.startNodeIndex),a),u=[],h=0,p=e.innerNodes.length;p>h;++h){var g=e.innerNodes[h],m=t(g.data,a);g.parentNode.replaceChild(m,g),u.push(m)}var v=t(c.data.substring(0,e.endNodeIndex),a);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(s,i),o.removeChild(i),o=c.parentNode,o.insertBefore(v,c),o.insertBefore(r,c),o.removeChild(c),v}}function a(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),m=t,this}function l(e){for(var t=0,n=m.length;n>t&&e(m[t],t)!==!1;t++);return this}function d(e){return m.length&&(v=m.length,i(t,m,c(e))),this}var s,u,f,h,p,g,m=[],v=0;if(f=t.ownerDocument,h=n.getBlockElements(),p=n.getWhiteSpaceElements(),g=n.getShortEndedElements(),u=o(t),u&&e.global)for(;s=e.exec(u);)m.push(r(s));return{text:u,count:v,matches:m,each:l,filter:a,mark:d}}}),r("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/JSONRequest","tinymce/util/URI"],function(e,t,n,r,o,i,c){t.add("spellchecker",function(t,a){function l(e){for(var t in e)return!1;return!0}function d(e,i){var c=[],a=m[i];n.each(a,function(e){c.push({text:e,onclick:function(){t.insertContent(e),u()}})}),c.push.apply(c,[{text:"-"},{text:"Ignore",onclick:function(){h(e,i)}},{text:"Ignore all",onclick:function(){h(e,i,!0)}},{text:"Finish",onclick:p}]),x=new r({items:c,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){x.remove(),x=null}}),x.renderTo(document.body);var l=o.DOM.getPos(t.getContentAreaContainer()),d=t.dom.getPos(e);l.x+=d.x,l.y+=d.y,x.moveTo(l.x,l.y+e.offsetHeight)}function s(){function n(e){return t.setProgressState(!1),l(e)?(t.windowManager.alert("No misspellings found"),void(v=!1)):(m=e,o.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),o=null,void t.fire("SpellcheckStart"))}function r(e,n,r){i.sendRPC({url:new c(a).toAbsolute(N.spellchecker_rpc_url),method:e,params:{lang:N.spellchecker_language||"en",words:n},success:function(e){r(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),o=null,v=!1}})}var o,d=[],s={};if(v)return void p();v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„]+',"gLine truncated
|
||||
<<<<<<< HEAD
|
||||
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=c[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,o){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(o===t)throw"invalid module definition, definition function must be specified";n(r,function(){c[e]=o.apply(null,arguments)})}function o(t){for(var n=e,r=t.split(/[.\/]/),o=0;o<r.length;++o){if(!n[r[o]])return;n=n[r[o]]}return n}function i(n){for(var r=0;r<n.length;r++){for(var o=e,i=n[r],a=i.split(/[.\/]/),l=0;l<a.length-1;++l)o[a[l]]===t&&(o[a[l]]={}),o=o[a[l]];o[a[a.length-1]]=c[i]}}var c={};r("tinymce/spellcheckerplugin/DomTextMatcher",[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(p[e.nodeName]&&!h[e.nodeName])return"";if(t="",(h[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function i(e,t,n){var r,o,i,c,a=[],l=0,d=e,s=t.shift(),u=0;e:for(;;){if((h[d.nodeName]||g[d.nodeName])&&l++,3===d.nodeType&&(!o&&d.length+l>=s[1]?(o=d,c=s[1]-l):r&&a.push(d),!r&&d.length+l>s[0]&&(r=d,i=s[0]-l),l+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:c,innerNodes:a,match:s[2],matchIndex:u}),l-=o.length-c,r=null,o=null,a=[],s=t.shift(),u++,!s)break}else{if((!p[d.nodeName]||h[d.nodeName])&&d.firstChild){d=d.firstChild;continue}if(d.nextSibling){d=d.nextSibling;continue}}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}function c(e){var t;if("function"!=typeof e){var n=e.nodeType?e:f.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(f.createTextNode(e)),r}}else t=e;return function(e){var n,r,o,i=e.startNode,c=e.endNode,a=e.matchIndex;if(i===c){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=f.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var d=t(e.match[0],a);return o.insertBefore(d,l),e.endNodeIndex<l.length&&(r=f.createTextNode(l.data.substring(e.endNodeIndex)),o.insertBefore(r,l)),l.parentNode.removeChild(l),d}n=f.createTextNode(i.data.substring(0,e.startNodeIndex)),r=f.createTextNode(c.data.substring(e.endNodeIndex));for(var s=t(i.data.substring(e.startNodeIndex),a),u=[],h=0,p=e.innerNodes.length;p>h;++h){var g=e.innerNodes[h],m=t(g.data,a);g.parentNode.replaceChild(m,g),u.push(m)}var v=t(c.data.substring(0,e.endNodeIndex),a);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(s,i),o.removeChild(i),o=c.parentNode,o.insertBefore(v,c),o.insertBefore(r,c),o.removeChild(c),v}}function a(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),m=t,this}function l(e){for(var t=0,n=m.length;n>t&&e(m[t],t)!==!1;t++);return this}function d(e){return m.length&&(v=m.length,i(t,m,c(e))),this}var s,u,f,h,p,g,m=[],v=0;if(f=t.ownerDocument,h=n.getBlockElements(),p=n.getWhiteSpaceElements(),g=n.getShortEndedElements(),u=o(t),u&&e.global)for(;s=e.exec(u);)m.push(r(s));return{text:u,count:v,matches:m,each:l,filter:a,mark:d}}}),r("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/JSONRequest","tinymce/util/URI"],function(e,t,n,r,o,i,c){t.add("spellchecker",function(t,a){function l(e){for(var t in e)return!1;return!0}function d(e,i){var c=[],a=m[i];n.each(a,function(e){c.push({text:e,onclick:function(){t.insertContent(e),u()}})}),c.push.apply(c,[{text:"-"},{text:"Ignore",onclick:function(){h(e,i)}},{text:"Ignore all",onclick:function(){h(e,i,!0)}},{text:"Finish",onclick:p}]),x=new r({items:c,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){x.remove(),x=null}}),x.renderTo(document.body);var l=o.DOM.getPos(t.getContentAreaContainer()),d=t.dom.getPos(e);l.x+=d.x,l.y+=d.y,x.moveTo(l.x,l.y+e.offsetHeight)}function s(){function n(e){return t.setProgressState(!1),l(e)?(t.windowManager.alert("No misspellings found"),void(v=!1)):(m=e,o.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),o=null,void t.fire("SpellcheckStart"))}function r(e,n,r){i.sendRPC({url:new c(a).toAbsolute(N.spellchecker_rpc_url),method:e,params:{lang:N.spellchecker_language||"en",words:n},success:function(e){r(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),o=null,v=!1}})}var o,d=[],s={};if(v)return void p();v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„]+',"gLine truncated
|
||||
=======
|
||||
!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i<e.length;++i){if(n=l[e[i]]||r(e[i]),!n)throw"module definition dependecy not found: "+e[i];o.push(n)}t.apply(null,o)}function o(e,o,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(o===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(o,function(){l[e]=i.apply(null,arguments)})}function i(e){return!!l[e]}function r(t){for(var n=e,o=t.split(/[.\/]/),i=0;i<o.length;++i){if(!n[o[i]])return;n=n[o[i]]}return n}function a(n){for(var o=0;o<n.length;o++){for(var i=e,r=n[o],a=r.split(/[.\/]/),s=0;s<a.length-1;++s)i[a[s]]===t&&(i[a[s]]={}),i=i[a[s]];i[a[a.length-1]]=l[r]}}var l={},s="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",d="tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",m="tinymce/dom/DOMUtils",p="tinymce/util/JSONRequest",g="tinymce/util/URI";o(s,[],function(){return function(e,t,n){function o(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function i(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(t="",(g[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=i(e);while(e=e.nextSibling);return t}function r(e,t,n){var o,i,r,a,l=[],s=0,c=e,d=t.shift(),u=0;e:for(;;){if((g[c.nodeName]||v[c.nodeName])&&s++,3===c.nodeType&&(!i&&c.length+s>=d[1]?(i=c,a=d[1]-s):o&&l.push(c),!o&&c.length+s>d[0]&&(o=c,r=d[0]-s),s+=c.length),o&&i){if(c=n({startNode:o,startNodeIndex:r,endNode:i,endNodeIndex:a,innerNodes:l,match:d[2],matchIndex:u}),s-=i.length-a,o=null,i=null,l=[],d=t.shift(),u++,!d)break}else{if((!h[c.nodeName]||g[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:p.createElement(e);t=function(e,t){var o=n.cloneNode(!1);return o.setAttribute("data-mce-index",t),e&&o.appendChild(p.createTextNode(e)),o}}else t=e;return function o(e){var n,o,i,r=e.startNode,a=e.endNode,l=e.matchIndex;if(r===a){var s=r;i=s.parentNode,e.startNodeIndex>0&&(n=p.createTextNode(s.data.substring(0,e.startNodeIndex)),i.insertBefore(n,s));var c=t(e.match[0],l);return i.insertBefore(c,s),e.endNodeIndex<s.length&&(o=p.createTextNode(s.data.substring(e.endNodeIndex)),i.insertBefore(o,s)),s.parentNode.removeChild(s),c}n=p.createTextNode(r.data.substring(0,e.startNodeIndex)),o=p.createTextNode(a.data.substring(e.endNodeIndex));for(var d=t(r.data.substring(e.startNodeIndex),l),u=[],f=0,m=e.innerNodes.length;m>f;++f){var g=e.innerNodes[f],h=t(g.data,l);g.parentNode.replaceChild(h,g),u.push(h)}var v=t(a.data.substring(0,e.endNodeIndex),l);return i=r.parentNode,i.insertBefore(n,r),i.insertBefore(d,r),i.removeChild(r),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(o,a),i.removeChild(a),v}}function l(e){var t=[];return s(function(n,o){e(n,o)&&t.push(n)}),u=t,this}function s(e){for(var t=0,n=u.length;n>t&&e(u[t],t)!==!1;t++);return this}function c(e){return u.length&&(m=u.length,r(t,u,a(e))),this}var d,u=[],f,m=0,p,g,h,v;if(p=t.ownerDocument,g=n.getBlockElements(),h=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=i(t),f&&e.global)for(;d=e.exec(f);)u.push(o(d));return{text:f,count:m,matches:u,each:s,filter:l,mark:c}}}),o(c,[s,d,u,f,m,p,g],function(e,t,n,o,i,r,a){t.add("spellchecker",function(t,l){function s(e){for(var t in e)return!1;return!0}function c(e,r){var a=[],l=h[r];n.each(l,function(e){a.push({text:e,onclick:function(){t.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){m(e,r)}},{text:"Ignore all",onclick:function(){m(e,r,!0)}},{text:"Finish",onclick:p}]),b=new o({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){b.remove(),b=null}}),b.renderTo(document.body);var s=i.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(e);s.x+=c.x,s.y+=c.y,b.moveTo(s.x,s.y+e.offsetHeight)}function d(){function n(e){return t.setProgressState(!1),s(e)?(t.windowManager.alert("No misspellings found"),void(v=!1)):(h=e,i.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),i=null,void t.fire("SpellcheckStart"))}function o(e,n,o){r.sendRPC({url:new a(l).toAbsolute(y.spellchecker_rpc_url),method:e,params:{lang:y.spellchecker_language||"en",words:n},success:function(e){o(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),i=null,v=!1}})}var i,c=[],d={};if(v)return void p();v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7
Line truncated
|
||||
>>>>>>> dev-life
|
||||
@@ -116,4 +116,4 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: 03d011b56beb69dc9e64484e888e2704
|
||||
// $hash: cc4206b9f467adfd42760ee5a6c3606f
|
||||
@@ -1831,7 +1831,7 @@ define("tinymce/tableplugin/Plugin", [
|
||||
function insertTable(cols, rows) {
|
||||
var y, x, html;
|
||||
|
||||
html = '<table><tbody>';
|
||||
html = '<table style="width: 100%"><tbody>';
|
||||
|
||||
for (y = 0; y < rows; y++) {
|
||||
html += '<tr>';
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/tableplugin/TableGrid",c="tinymce/util/Tools",d="tinymce/Env",u="tinymce/tableplugin/Quirks",f="tinymce/util/VK",p="tinymce/tableplugin/CellSelection",m="tinymce/dom/TreeWalker",h="tinymce/tableplugin/Plugin",g="tinymce/PluginManager";r(l,[c,d],function(e,t){function n(e,t){return parseInt(e.getAttribute(t)||1,10)}var r=e.each;return function(i,o){function a(){var e=0;R=[],r(["thead","tbody","tfoot"],function(t){var i=H.select("> "+t+" tr",o);r(i,function(i,o){o+=e,r(H.select("> td, > th",i),function(e,r){var i,a,s,l;if(R[o])for(;R[o][r];)r++;for(s=n(e,"rowspan"),l=n(e,"colspan"),a=o;o+s>a;a++)for(R[a]||(R[a]=[]),i=r;r+l>i;i++)R[a][i]={part:t,real:a==o&&i==r,elm:e,rowspan:s,colspan:l}})}),e+=i.length})}function s(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function l(e,t){var n;return n=R[t],n?n[e]:void 0}function c(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(H.hasClass(e.elm,"mce-item-selected")||e==L)}function u(){var e=[];return r(o.rows,function(t){r(t.cells,function(n){return H.hasClass(n,"mce-item-selected")||n==L.elm?(e.push(t),!1):void 0})}),e}function f(){var e=H.createRng();e.setStartAfter(o),e.setEndAfter(o),M.setRng(e),H.remove(o)}function p(n){var o,a={};return i.settings.table_clone_elements!==!1&&(a=e.makeMap((i.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(n,function(e){var i;return 3==e.nodeType?(r(H.getParents(e.parentNode,null,n).reverse(),function(e){a[e.nodeName]&&(e=s(e,!1),o?i&&i.appendChild(e):o=i=e,i=e)}),i&&(i.innerHTML=t.ie?" ":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),n=s(n,!1),c(n,"rowSpan",1),c(n,"colSpan",1),o?n.appendChild(o):t.ie||(n.innerHTML='<br data-mce-bogus="1" />'),n}function m(){var e=H.createRng(),t;return r(H.select("tr",o),function(e){0===e.cells.length&&H.remove(e)}),0===H.select("tr",o).length?(e.setStartBefore(o),e.setEndBefore(o),M.setRng(e),void H.remove(o)):(r(H.select("thead,tbody,tfoot",o),function(e){0===e.rows.length&&H.remove(e)}),a(),t=R[Math.min(R.length-1,A.y)],void(t&&(M.select(t[Math.min(t.length-1,A.x)].elm,!0),M.collapse(!0))))}function h(e,t,n,r){var i,o,a,s,l;for(i=R[t][e].elm.parentNode,a=1;n>=a;a++)if(i=H.getNext(i,"tr")){for(o=e;o>=0;o--)if(l=R[t+a][o].elm,l.parentNode==i){for(s=1;r>=s;s++)H.insertAfter(p(l),l);break}if(-1==o)for(s=1;r>=s;s++)i.insertBefore(p(i.cells[0]),i.cells[0])}}function g(){r(R,function(e,t){r(e,function(e,r){var i,o,a;if(d(e)&&(e=e.elm,i=n(e,"colspan"),o=n(e,"rowspan"),i>1||o>1)){for(c(e,"rowSpan",1),c(e,"colSpan",1),a=0;i-1>a;a++)H.insertAfter(p(e),e);h(r,t,o-1,i)}})})}function v(t,n,i){var o,s,u,f,p,h,v,y,b,C,x;if(t?(o=k(t),s=o.x,u=o.y,f=s+(n-1),p=u+(i-1)):(A=B=null,r(R,function(e,t){r(e,function(e,n){d(e)&&(A||(A={x:n,y:t}),B={x:n,y:t})})}),s=A.x,u=A.y,f=B.x,p=B.y),y=l(s,u),b=l(f,p),y&&b&&y.part==b.part){for(g(),a(),y=l(s,u).elm,c(y,"colSpan",f-s+1),c(y,"rowSpan",p-u+1),v=u;p>=v;v++)for(h=s;f>=h;h++)R[v]&&R[v][h]&&(t=R[v][h].elm,t!=y&&(C=e.grep(t.childNodes),r(C,function(e){y.appendChild(e)}),C.length&&(C=e.grep(y.childNodes),x=0,r(C,function(e){"BR"==e.nodeName&&H.getAttrib(e,"data-mce-bogus")&&x++<C.length-1&&y.removeChild(e)})),H.remove(t)));m()}}function y(e){var t,i,o,a,l,u,f,m,h;for(r(R,function(n,i){return r(n,function(n){return d(n)&&(n=n.elm,l=n.parentNode,u=s(l,!1),t=i,e)?!1:void 0}),e?!t:void 0}),a=0;a<R[0].length;a++)if(R[t][a]&&(i=R[t][a].elm,i!=o)){if(e){if(t>0&&R[t-1][a]&&(m=R[t-1][a].elm,h=n(m,"rowSpan"),h>1)){c(m,"rowSpan",h+1);continue}}else if(h=n(i,"rowspan"),h>1){c(i,"rowSpan",h+1);continue}f=p(i),c(f,"colSpan",i.colSpan),u.appendChild(f),o=i}u.hasChildNodes()&&(e?l.parentNode.insertBefore(u,l):H.insertAfter(u,l))}function b(e){var t,i;r(R,function(n){return r(n,function(n,r){return d(n)&&(t=r,e)?!1:void 0}),e?!t:void 0}),r(R,function(r,o){var a,s,l;r[t]&&(a=r[t].elm,a!=i&&(l=n(a,"colspan"),s=n(a,"rowspan"),1==l?e?(a.parentNode.insertBefore(p(a),a),h(t,o,s-1,l)):(H.insertAfter(p(a),a),h(t,o,s-1,l)):c(a,"colSpan",a.colSpan+1),i=a))})}function C(){var t=[];r(R,function(i){r(i,function(i,o){d(i)&&-1===e.inArray(t,o)&&(r(R,function(e){var t=e[o].elm,rLine truncated
|
||||
!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i<e.length;++i){if(n=l[e[i]]||r(e[i]),!n)throw"module definition dependecy not found: "+e[i];o.push(n)}t.apply(null,o)}function o(e,o,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(o===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(o,function(){l[e]=r.apply(null,arguments)})}function r(t){for(var n=e,o=t.split(/[.\/]/),r=0;r<o.length;++r){if(!n[o[r]])return;n=n[o[r]]}return n}function i(n){for(var o=0;o<n.length;o++){for(var r=e,i=n[o],a=i.split(/[.\/]/),c=0;c<a.length-1;++c)r[a[c]]===t&&(r[a[c]]={}),r=r[a[c]];r[a[a.length-1]]=l[i]}}var l={};o("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env"],function(e,t){function n(e,t){return parseInt(e.getAttribute(t)||1,10)}var o=e.each;return function(r,i){function l(){var e=0;B=[],o(["thead","tbody","tfoot"],function(t){var r=E.select("> "+t+" tr",i);o(r,function(r,i){i+=e,o(E.select("> td, > th",r),function(e,o){var r,l,a,c;if(B[i])for(;B[i][o];)o++;for(a=n(e,"rowspan"),c=n(e,"colspan"),l=i;i+a>l;l++)for(B[l]||(B[l]=[]),r=o;o+c>r;r++)B[l][r]={part:t,real:l==i&&r==o,elm:e,rowspan:a,colspan:c}})}),e+=r.length})}function a(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=B[t],n?n[e]:void 0}function s(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(E.hasClass(e.elm,"mce-item-selected")||e==D)}function u(){var e=[];return o(i.rows,function(t){o(t.cells,function(n){return E.hasClass(n,"mce-item-selected")||n==D.elm?(e.push(t),!1):void 0})}),e}function m(){var e=E.createRng();e.setStartAfter(i),e.setEndAfter(i),I.setRng(e),E.remove(i)}function f(n){var i,l={};return r.settings.table_clone_elements!==!1&&(l=e.makeMap((r.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(n,function(e){var r;return 3==e.nodeType?(o(E.getParents(e.parentNode,null,n).reverse(),function(e){l[e.nodeName]&&(e=a(e,!1),i?r&&r.appendChild(e):i=r=e,r=e)}),r&&(r.innerHTML=t.ie?" ":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),n=a(n,!1),s(n,"rowSpan",1),s(n,"colSpan",1),i?n.appendChild(i):t.ie||(n.innerHTML='<br data-mce-bogus="1" />'),n}function g(){var e,t=E.createRng();return o(E.select("tr",i),function(e){0===e.cells.length&&E.remove(e)}),0===E.select("tr",i).length?(t.setStartBefore(i),t.setEndBefore(i),I.setRng(t),void E.remove(i)):(o(E.select("thead,tbody,tfoot",i),function(e){0===e.rows.length&&E.remove(e)}),l(),e=B[Math.min(B.length-1,k.y)],void(e&&(I.select(e[Math.min(e.length-1,k.x)].elm,!0),I.collapse(!0))))}function p(e,t,n,o){var r,i,l,a,c;for(r=B[t][e].elm.parentNode,l=1;n>=l;l++)if(r=E.getNext(r,"tr")){for(i=e;i>=0;i--)if(c=B[t+l][i].elm,c.parentNode==r){for(a=1;o>=a;a++)E.insertAfter(f(c),c);break}if(-1==i)for(a=1;o>=a;a++)r.insertBefore(f(r.cells[0]),r.cells[0])}}function h(){o(B,function(e,t){o(e,function(e,o){var r,i,l;if(d(e)&&(e=e.elm,r=n(e,"colspan"),i=n(e,"rowspan"),r>1||i>1)){for(s(e,"rowSpan",1),s(e,"colSpan",1),l=0;r-1>l;l++)E.insertAfter(f(e),e);p(o,t,i-1,r)}})})}function b(t,n,r){var i,a,u,m,f,p,b,v,w,y,x;if(t?(i=T(t),a=i.x,u=i.y,m=a+(n-1),f=u+(r-1)):(k=M=null,o(B,function(e,t){o(e,function(e,n){d(e)&&(k||(k={x:n,y:t}),M={x:n,y:t})})}),a=k.x,u=k.y,m=M.x,f=M.y),v=c(a,u),w=c(m,f),v&&w&&v.part==w.part){for(h(),l(),v=c(a,u).elm,s(v,"colSpan",m-a+1),s(v,"rowSpan",f-u+1),b=u;f>=b;b++)for(p=a;m>=p;p++)B[b]&&B[b][p]&&(t=B[b][p].elm,t!=v&&(y=e.grep(t.childNodes),o(y,function(e){v.appendChild(e)}),y.length&&(y=e.grep(v.childNodes),x=0,o(y,function(e){"BR"==e.nodeName&&E.getAttrib(e,"data-mce-bogus")&&x++<y.length-1&&v.removeChild(e)})),E.remove(t)));g()}}function v(e){var t,r,i,l,c,u,m,g,p;for(o(B,function(n,r){return o(n,function(n){return d(n)&&(n=n.elm,c=n.parentNode,u=a(c,!1),t=r,e)?!1:void 0}),e?!t:void 0}),l=0;l<B[0].length;l++)if(B[t][l]&&(r=B[t][l].elm,r!=i)){if(e){if(t>0&&B[t-1][l]&&(g=B[t-1][l].elm,p=n(g,"rowSpan"),p>1)){s(g,"rowSpan",p+1);continue}}else if(p=n(r,"rowspan"),p>1){s(r,"rowSpan",p+1);continue}m=f(r),s(m,"colSpan",r.colSpan),u.appendChild(m),i=r}u.hasChildNodes()&&(e?c.parentNode.insertBefore(u,c):E.insertAfter(u,c))}function w(e){var t,r;o(B,function(n){return o(n,function(n,o){return d(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),o(B,function(o,i){var l,a,c;o[t]&&(l=o[t].elm,l!=r&&(c=n(l,"colspan"),a=n(l,"rowspan"),1==c?e?(l.parentNode.insertBefore(f(l),l),p(t,i,a-1,c)):(E.insertAfter(f(l),l),p(t,i,a-1,c)):s(l,"colSpan",l.colSpan+1),r=l))})}function y(){var t=[];o(B,function(r){o(r,function(r,i){d(r)&&-1===e.inArray(t,i)&&(o(B,function(e){var t,o=e[i].elm;t=n(o,"colSpan"),t>1?s(o,"colSpan",t-1):E.remove(o)}),t.push(i))})}),g()}function x(){function e(e){var t,r,i;t=E.getNext(e,"tr"),o(e.cells,function(e){var t=n(e,"rowSpan");t>1&&(s(e,"rowSpan",t-1),r=T(e),p(r.x,Line truncated
|
||||
Reference in new issue
Block a user