Merge branch 'master' into timeslider-realtimeupdate+readonly-pads

This commit is contained in:
Egil Moeller 2012-04-25 17:51:03 +02:00
commit c173ebe197
11 changed files with 408 additions and 394 deletions

View file

@ -167,7 +167,13 @@ require.setGlobalKeyPath("require");\n\
buffer.push(Ace2Editor.EMBEDED[KERNEL_SOURCE]);
buffer.push(KERNEL_BOOT);
buffer.push('<\/script>');
}
} else {
file = KERNEL_SOURCE;
buffer.push('<script type="application/javascript" src="' + KERNEL_SOURCE + '"><\/script>');
buffer.push('<script type="text/javascript">');
buffer.push(KERNEL_BOOT);
buffer.push('<\/script>');
}
}
function pushScriptsTo(buffer) {
/* Folling is for packaging regular expression. */

View file

@ -229,6 +229,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
result.node.innerHTML = curHTML;
}
if (lineClass !== null) result.node.className = lineClass;
hooks.callAll("acePostWriteDomLineHTML", {
node: result.node
});
}
result.prepareForAdd = writeHTML;
result.finishUpdate = writeHTML;

View file

@ -203,7 +203,8 @@ function handshake()
//create the url
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
//find out in which subfolder we are
var resource = loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "socket.io";
var resource = exports.baseURL + "socket.io";
//connect
socket = pad.socket = io.connect(url, {
resource: resource,
@ -1035,7 +1036,7 @@ var settings = {
};
pad.settings = settings;
exports.baseURL = '';
exports.settings = settings;
exports.createCookie = createCookie;
exports.readCookie = readCookie;

View file

@ -182,7 +182,7 @@ var padeditbar = (function()
//hide all modules
if(moduleName == "none")
{
$("#editbar ul#menu_right > li").removeClass("selected");
$(".toolbar ul.menu_right li").removeClass("selected");
for(var i=0;i<modules.length;i++)
{
//skip the userlist
@ -200,11 +200,11 @@ var padeditbar = (function()
else
{
var nth_child = indexOf(modules, moduleName) + 1;
if (nth_child > 0 && nth_child <= (modules.length-1)) {
$("#editbar ul#menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected");
$("#editbar ul#menu_right li:nth-child(" + nth_child + ")").toggleClass("selected");
}
if(modules[modules.length-1] === moduleName) $("#editbar ul#menu_right li").removeClass("selected");
if (nth_child > 0 && nth_child <= (modules.length-1)) {
$(".toolbar ul.menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected");
$(".toolbar ul.menu_right li:nth-child(" + nth_child + ")").toggleClass("selected");
}
if(modules[modules.length-1] === moduleName) $(".toolbar ul.menu_right li").removeClass("selected");
//hide all modules that are not selected and show the selected one
for(var i=0;i<modules.length;i++)
{

View file

@ -748,13 +748,14 @@ function closeColorPicker(accept)
var newColor = $("#mycolorpickerpreview").css("background-color");
var parts = newColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
// parts now should be ["rgb(0, 70, 255", "0", "70", "255"]
delete (parts[0]);
for (var i = 1; i <= 3; ++i) {
parts[i] = parseInt(parts[i]).toString(16);
if (parts[i].length == 1) parts[i] = '0' + parts[i];
if (parts) {
delete (parts[0]);
for (var i = 1; i <= 3; ++i) {
parts[i] = parseInt(parts[i]).toString(16);
if (parts[i].length == 1) parts[i] = '0' + parts[i];
}
var newColor = "#" +parts.join(''); // "0070ff"
}
var newColor = "#" +parts.join(''); // "0070ff"
myUserInfo.colorId = newColor;
pad.notifyChangeColor(newColor);
paduserlist.renderMyUserInfo();

View file

@ -24,6 +24,7 @@ exports.loaded = false;
exports.plugins = {};
exports.parts = [];
exports.hooks = {};
exports.baseURL = '';
exports.ensure = function (cb) {
if (!exports.loaded)
@ -103,7 +104,7 @@ if (exports.isClient) {
// which appears to fix the issue.
var callback = function () {setTimeout(cb, 0);};
jQuery.getJSON('/pluginfw/plugin-definitions.json', function(data) {
jQuery.getJSON(exports.baseURL + 'pluginfw/plugin-definitions.json', function(data) {
exports.plugins = data.plugins;
exports.parts = data.parts;
exports.hooks = exports.extractHooks(exports.parts, "client_hooks");

View file

@ -60,8 +60,8 @@ function init() {
//create the url
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
//find out in which subfolder we are
var resource = loc.pathname.substr(1,loc.pathname.indexOf("/p/")) + "socket.io";
var resource = exports.baseURL + 'socket.io';
//build up the socket io connection
socket = io.connect(url, {resource: resource});
@ -162,4 +162,5 @@ function handleClientVars(message)
}
}
exports.baseURL = '';
exports.init = init;