mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Merge remote branch 'johns/master'
This commit is contained in:
commit
9eb1fecfa7
16 changed files with 1329 additions and 2561 deletions
|
@ -176,7 +176,7 @@ function Ace2Editor() {
|
|||
//iframeHTML.push($$INCLUDE_CSS_Q("editor.css syntax.css inner.css"));
|
||||
|
||||
iframeHTML.push($$INCLUDE_CSS_Q("/static/css/editor.css"));
|
||||
iframeHTML.push($$INCLUDE_CSS_Q("/static/css/syntax.cs"));
|
||||
iframeHTML.push($$INCLUDE_CSS_Q("/static/css/syntax.css"));
|
||||
iframeHTML.push($$INCLUDE_CSS_Q("/static/css/inner.css"));
|
||||
|
||||
//iframeHTML.push(INCLUDE_JS_Q_DEV("ace2_common_dev.js"));
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
function OUTER(gscope) {
|
||||
|
||||
var DEBUG=true;//$$ build script replaces the string "var DEBUG=true;//$$" with "var DEBUG=false;"
|
||||
|
||||
var DEBUG=false;//$$ build script replaces the string "var DEBUG=true;//$$" with "var DEBUG=false;"
|
||||
// changed to false
|
||||
var isSetUp = false;
|
||||
|
||||
var THE_TAB = ' ';//4
|
||||
|
@ -73,8 +73,8 @@ function OUTER(gscope) {
|
|||
var iframePadTop = EDIT_BODY_PADDING_TOP;
|
||||
var iframePadBottom = 0, iframePadRight = 0;
|
||||
|
||||
var console = (DEBUG && top.console);
|
||||
if (! console) {
|
||||
var console = (DEBUG && window.console);
|
||||
if (! window.console) {
|
||||
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
|
||||
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
||||
console = {};
|
||||
|
@ -82,6 +82,7 @@ function OUTER(gscope) {
|
|||
console[names[i]] = function() {};
|
||||
//console.error = function(str) { alert(str); };
|
||||
}
|
||||
|
||||
var PROFILER = window.PROFILER;
|
||||
if (!PROFILER) {
|
||||
PROFILER = function() { return {start:noop, mark:noop, literal:noop, end:noop, cancel:noop}; };
|
||||
|
@ -767,7 +768,7 @@ function OUTER(gscope) {
|
|||
else {
|
||||
setAttributeOnSelection('author', '');
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
function execCommand(cmd) {
|
||||
|
@ -1311,7 +1312,7 @@ function OUTER(gscope) {
|
|||
|
||||
isTimeUp = (isTimeUp || function() { return false; });
|
||||
|
||||
if (DEBUG && top.DONT_INCORP || window.DEBUG_DONT_INCORP) return false;
|
||||
if (DEBUG && window.DONT_INCORP || window.DEBUG_DONT_INCORP) return false;
|
||||
|
||||
var p = PROFILER("incorp", false);
|
||||
|
||||
|
@ -2998,7 +2999,7 @@ function OUTER(gscope) {
|
|||
}
|
||||
|
||||
function handleKeyEvent(evt) {
|
||||
if (DEBUG && top.DONT_INCORP) return;
|
||||
// if (DEBUG && window.DONT_INCORP) return;
|
||||
|
||||
if (! isEditable) return;
|
||||
|
||||
|
|
18
static/js/json.js
Normal file
18
static/js/json.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
|
||||
Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
|
||||
f(this.getUTCMonth()+1)+'-'+
|
||||
f(this.getUTCDate())+'T'+
|
||||
f(this.getUTCHours())+':'+
|
||||
f(this.getUTCMinutes())+':'+
|
||||
f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
|
||||
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
|
||||
(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
|
||||
if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
|
||||
a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
|
||||
return'['+a.join(',')+']';}
|
||||
if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
|
||||
return'{'+a.join(',')+'}';}}
|
||||
return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
|
||||
return filter(k,v);}
|
||||
if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
|
||||
throw new SyntaxError('parseJSON');}};}();}
|
|
@ -208,7 +208,7 @@ var pad = {
|
|||
padeditor.init(postAceInit, pad.padOptions.view || {});
|
||||
|
||||
paduserlist.init(pad.myUserInfo);
|
||||
padchat.init(clientVars.chatHistory, pad.myUserInfo);
|
||||
// padchat.init(clientVars.chatHistory, pad.myUserInfo);
|
||||
padconnectionstatus.init();
|
||||
padmodals.init();
|
||||
|
||||
|
@ -236,12 +236,12 @@ var pad = {
|
|||
notifyChangeName: function(newName) {
|
||||
pad.myUserInfo.name = newName;
|
||||
pad.collabClient.updateUserInfo(pad.myUserInfo);
|
||||
padchat.handleUserJoinOrUpdate(pad.myUserInfo);
|
||||
//padchat.handleUserJoinOrUpdate(pad.myUserInfo);
|
||||
},
|
||||
notifyChangeColor: function(newColorId) {
|
||||
pad.myUserInfo.colorId = newColorId;
|
||||
pad.collabClient.updateUserInfo(pad.myUserInfo);
|
||||
padchat.handleUserJoinOrUpdate(pad.myUserInfo);
|
||||
//padchat.handleUserJoinOrUpdate(pad.myUserInfo);
|
||||
},
|
||||
notifyChangeTitle: function(newTitle) {
|
||||
pad.collabClient.sendClientMessage({
|
||||
|
@ -311,15 +311,15 @@ var pad = {
|
|||
},
|
||||
handleUserJoin: function(userInfo) {
|
||||
paduserlist.userJoinOrUpdate(userInfo);
|
||||
padchat.handleUserJoinOrUpdate(userInfo);
|
||||
//padchat.handleUserJoinOrUpdate(userInfo);
|
||||
},
|
||||
handleUserUpdate: function(userInfo) {
|
||||
paduserlist.userJoinOrUpdate(userInfo);
|
||||
padchat.handleUserJoinOrUpdate(userInfo);
|
||||
//padchat.handleUserJoinOrUpdate(userInfo);
|
||||
},
|
||||
handleUserLeave: function(userInfo) {
|
||||
paduserlist.userLeave(userInfo);
|
||||
padchat.handleUserLeave(userInfo);
|
||||
//padchat.handleUserLeave(userInfo);
|
||||
},
|
||||
handleClientMessage: function(msg) {
|
||||
if (msg.type == 'suggestUserName') {
|
||||
|
@ -330,7 +330,7 @@ var pad = {
|
|||
}
|
||||
}
|
||||
else if (msg.type == 'chat') {
|
||||
padchat.receiveChat(msg);
|
||||
//padchat.receiveChat(msg);
|
||||
}
|
||||
else if (msg.type == 'padtitle') {
|
||||
paddocbar.changeTitle(msg.title);
|
||||
|
@ -531,8 +531,6 @@ var pad = {
|
|||
'/static/img/jun09/pad/sharebox4.gif',
|
||||
'/static/img/jun09/pad/sharedistri.gif',
|
||||
'/static/img/jun09/pad/colorpicker.gif',
|
||||
'/static/img/jun09/pad/docbarstates.png',
|
||||
'/static/img/jun09/pad/overlay.png'
|
||||
];
|
||||
function loadNextImage() {
|
||||
if (images.length == 0) {
|
||||
|
|
|
@ -78,6 +78,49 @@ var padeditbar = (function(){
|
|||
},
|
||||
toolbarClick: function(cmd) {
|
||||
if (self.isEnabled()) {
|
||||
if (cmd == 'showusers') {
|
||||
// show users shows the current users on teh pad
|
||||
// get current height
|
||||
var editbarheight = $('#editbar').css('height');
|
||||
if (editbarheight == "36px"){
|
||||
// increase the size of the editbar
|
||||
$('#editbar').animate({height:'72px'});
|
||||
$('#editorcontainerbox').animate({top:'72px'});
|
||||
$('#embed').hide();
|
||||
$('#users').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
// increase the size of the editbar
|
||||
$('#editbar').animate({height:'36px'});
|
||||
$('#editorcontainerbox').animate({top:'36px'});
|
||||
$('#users').hide();
|
||||
}
|
||||
}
|
||||
if (cmd == 'embed') {
|
||||
// embed shows the embed link
|
||||
// get current height
|
||||
var editbarheight = $('#editbar').css('height');
|
||||
if (editbarheight == "36px"){
|
||||
// increase the size of the editbar
|
||||
$('#editbar').animate({height:'72px'});
|
||||
$('#editorcontainerbox').animate({top:'72px'});
|
||||
// hide the users
|
||||
$('#users').hide();
|
||||
// get the pad url
|
||||
padurl = document.location;
|
||||
// change the div contents to include the pad url in an input box
|
||||
$('#embed').html('<div id="embedcode">Embed code:<input id="embedinput" type="text" value="<iframe src="'+padurl+'" width=500 height=400>"</iframe>></div>');
|
||||
$('#embed').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
// increase the size of the editbar
|
||||
$('#editbar').animate({height:'36px'});
|
||||
$('#editorcontainerbox').animate({top:'36px'});
|
||||
$('#embed').hide();
|
||||
}
|
||||
}
|
||||
if (cmd == 'save') {
|
||||
padsavedrevs.saveNow();
|
||||
} else {
|
||||
|
@ -119,4 +162,4 @@ var padeditbar = (function(){
|
|||
}
|
||||
};
|
||||
return self;
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -76,15 +76,6 @@ var padmodals = (function() {
|
|||
$("#feedbackbutton").click(function() {
|
||||
self.showFeedback();
|
||||
});
|
||||
|
||||
$("#uservoicelinks a").click(function() {
|
||||
self.hideModal();
|
||||
return true;
|
||||
});
|
||||
$("#feedbackemails a").each(function() {
|
||||
var node = $(this);
|
||||
node.attr('href', "mailto:"+node.attr('href')+"@etherpad.com");
|
||||
});
|
||||
},
|
||||
initShareBox: function() {
|
||||
$("#sharebutton, #nootherusers a").click(function() {
|
||||
|
|
|
@ -14,6 +14,42 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var colorPickerOpen = false;
|
||||
|
||||
function getColorPickerSwatchIndex(jnode) {
|
||||
return Number(jnode.get(0).className.match(/\bn([0-9]+)\b/)[1])-1;
|
||||
}
|
||||
function closeColorPicker(accept) {
|
||||
if (accept) {
|
||||
var newColorId = getColorPickerSwatchIndex($("#mycolorpicker .picked"));
|
||||
if (newColorId >= 0) { // fails on NaN
|
||||
myUserInfo.colorId = newColorId;
|
||||
pad.notifyChangeColor(newColorId);
|
||||
}
|
||||
}
|
||||
colorPickerOpen = false;
|
||||
$("#mycolorpicker").css('display', 'none');
|
||||
renderMyUserInfo();
|
||||
}
|
||||
|
||||
|
||||
function showColorPicker() {
|
||||
if (! colorPickerOpen) {
|
||||
var palette = pad.getColorPalette();
|
||||
for(var i=0;i<palette.length;i++) {
|
||||
$("#mycolorpicker .n"+(i+1)+" .pickerswatch").css(
|
||||
'background', palette[i]);
|
||||
}
|
||||
$("#mycolorpicker").css('display', 'block');
|
||||
colorPickerOpen = true;
|
||||
renderMyUserInfo();
|
||||
}
|
||||
// this part happens even if color picker is already open
|
||||
$("#mycolorpicker .pickerswatchouter").removeClass('picked');
|
||||
$("#mycolorpicker .pickerswatchouter:eq("+(myUserInfo.colorId||0)+")").
|
||||
addClass('picked');
|
||||
}
|
||||
|
||||
|
||||
var paduserlist = (function() {
|
||||
|
||||
|
@ -278,7 +314,6 @@ var paduserlist = (function() {
|
|||
var myUserInfo = {};
|
||||
var otherUsersInfo = [];
|
||||
var otherUsersData = [];
|
||||
var colorPickerOpen = false;
|
||||
|
||||
function rowManagerMakeNameEditor(jnode, userId) {
|
||||
setUpEditable(jnode, function() {
|
||||
|
@ -352,38 +387,6 @@ var paduserlist = (function() {
|
|||
jqueryNode.removeAttr('disabled').addClass('editable');
|
||||
}
|
||||
|
||||
function showColorPicker() {
|
||||
if (! colorPickerOpen) {
|
||||
var palette = pad.getColorPalette();
|
||||
for(var i=0;i<palette.length;i++) {
|
||||
$("#mycolorpicker .n"+(i+1)+" .pickerswatch").css(
|
||||
'background', palette[i]);
|
||||
}
|
||||
$("#mycolorpicker").css('display', 'block');
|
||||
colorPickerOpen = true;
|
||||
renderMyUserInfo();
|
||||
}
|
||||
// this part happens even if color picker is already open
|
||||
$("#mycolorpicker .pickerswatchouter").removeClass('picked');
|
||||
$("#mycolorpicker .pickerswatchouter:eq("+(myUserInfo.colorId||0)+")").
|
||||
addClass('picked');
|
||||
}
|
||||
function getColorPickerSwatchIndex(jnode) {
|
||||
return Number(jnode.get(0).className.match(/\bn([0-9]+)\b/)[1])-1;
|
||||
}
|
||||
function closeColorPicker(accept) {
|
||||
if (accept) {
|
||||
var newColorId = getColorPickerSwatchIndex($("#mycolorpicker .picked"));
|
||||
if (newColorId >= 0) { // fails on NaN
|
||||
myUserInfo.colorId = newColorId;
|
||||
pad.notifyChangeColor(newColorId);
|
||||
}
|
||||
}
|
||||
colorPickerOpen = false;
|
||||
$("#mycolorpicker").css('display', 'none');
|
||||
renderMyUserInfo();
|
||||
}
|
||||
|
||||
function updateInviteNotice() {
|
||||
if (otherUsersInfo.length == 0) {
|
||||
$("#otheruserstable").hide();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue