mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-15 17:37:30 +01:00
gardening: remove trailing whitespace in spacedeck_sections.js
This commit is contained in:
@@ -123,7 +123,7 @@ var SpacedeckSections = {
|
|||||||
{id:12, hex:"#bbbbbb"},
|
{id:12, hex:"#bbbbbb"},
|
||||||
{id:13, hex:"#dddddd"},
|
{id:13, hex:"#dddddd"},
|
||||||
{id:14, hex:"#ffffff"},
|
{id:14, hex:"#ffffff"},
|
||||||
|
|
||||||
{id:20, hex:"#4a2f7e"},
|
{id:20, hex:"#4a2f7e"},
|
||||||
{id:21, hex:"#9b59b6"},
|
{id:21, hex:"#9b59b6"},
|
||||||
{id:22, hex:"#3498db"},
|
{id:22, hex:"#3498db"},
|
||||||
@@ -135,7 +135,7 @@ var SpacedeckSections = {
|
|||||||
{id:29, hex:"#95a5a6"},
|
{id:29, hex:"#95a5a6"},
|
||||||
{id:30, hex:"rgba(0,0,0,0)"},
|
{id:30, hex:"rgba(0,0,0,0)"},
|
||||||
],
|
],
|
||||||
|
|
||||||
swatches_text: [
|
swatches_text: [
|
||||||
{id:1, hex:"#9b59b6"},
|
{id:1, hex:"#9b59b6"},
|
||||||
{id:2, hex:"#3498db"},
|
{id:2, hex:"#3498db"},
|
||||||
@@ -216,7 +216,7 @@ var SpacedeckSections = {
|
|||||||
Mousetrap.bind('shift+left', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(-10,0,evt);}) }.bind(this));
|
Mousetrap.bind('shift+left', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(-10,0,evt);}) }.bind(this));
|
||||||
Mousetrap.bind('shift+right', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(10,0,evt);}) }.bind(this));
|
Mousetrap.bind('shift+right', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(10,0,evt);}) }.bind(this));
|
||||||
Mousetrap.bind('space', function(evt) { this.activate_pan_tool(evt); }.bind(this));
|
Mousetrap.bind('space', function(evt) { this.activate_pan_tool(evt); }.bind(this));
|
||||||
|
|
||||||
$(document).bind("beforecopy", this.handle_onbeforecopy.bind(this));
|
$(document).bind("beforecopy", this.handle_onbeforecopy.bind(this));
|
||||||
$(window).bind("beforeunload", this.handle_onunload.bind(this));
|
$(window).bind("beforeunload", this.handle_onunload.bind(this));
|
||||||
$(window).bind("resize", this.handle_window_resize.bind(this));
|
$(window).bind("resize", this.handle_window_resize.bind(this));
|
||||||
@@ -434,7 +434,7 @@ var SpacedeckSections = {
|
|||||||
extract_properties_from_selection: function() {
|
extract_properties_from_selection: function() {
|
||||||
// stop extract->apply feedback loop
|
// stop extract->apply feedback loop
|
||||||
this.skip_formatting = true;
|
this.skip_formatting = true;
|
||||||
|
|
||||||
var arts = this.selected_artifacts();
|
var arts = this.selected_artifacts();
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
this.skip_formatting = false;
|
this.skip_formatting = false;
|
||||||
@@ -601,7 +601,7 @@ var SpacedeckSections = {
|
|||||||
if (_.contains(["mobile","shapes","zones"],id)) {
|
if (_.contains(["mobile","shapes","zones"],id)) {
|
||||||
this.deselect();
|
this.deselect();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.opened_dialog=id;
|
this.opened_dialog=id;
|
||||||
|
|
||||||
if (id.match("color") || id.match("background")) {
|
if (id.match("color") || id.match("background")) {
|
||||||
@@ -719,7 +719,7 @@ var SpacedeckSections = {
|
|||||||
|
|
||||||
presenter_send_viewport: function() {
|
presenter_send_viewport: function() {
|
||||||
name = this.user.nickname || this.user.email;
|
name = this.user.nickname || this.user.email;
|
||||||
|
|
||||||
var msg = {
|
var msg = {
|
||||||
action: "viewport",
|
action: "viewport",
|
||||||
x: this.scroll_left,
|
x: this.scroll_left,
|
||||||
@@ -734,14 +734,14 @@ var SpacedeckSections = {
|
|||||||
var packed = JSON.stringify(msg);
|
var packed = JSON.stringify(msg);
|
||||||
if (packed==this._old_viewport_msg) return;
|
if (packed==this._old_viewport_msg) return;
|
||||||
this._old_viewport_msg = packed;
|
this._old_viewport_msg = packed;
|
||||||
|
|
||||||
if (this.present_mode && this.active_space_role!="viewer")
|
if (this.present_mode && this.active_space_role!="viewer")
|
||||||
this.websocket_send(msg);
|
this.websocket_send(msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
presenter_send_media_action: function(artifact_id,type,cmd,time) {
|
presenter_send_media_action: function(artifact_id,type,cmd,time) {
|
||||||
name = this.user.nickname || this.user.email;
|
name = this.user.nickname || this.user.email;
|
||||||
|
|
||||||
var msg = {
|
var msg = {
|
||||||
action: "media",
|
action: "media",
|
||||||
artifact_id: artifact_id,
|
artifact_id: artifact_id,
|
||||||
@@ -820,7 +820,7 @@ var SpacedeckSections = {
|
|||||||
y2: msg.y+msg.h
|
y2: msg.y+msg.h
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handle_presenter_media_update: function(msg) {
|
handle_presenter_media_update: function(msg) {
|
||||||
if(this.follow_mode) {
|
if(this.follow_mode) {
|
||||||
if (msg.type=="audio") {
|
if (msg.type=="audio") {
|
||||||
@@ -847,7 +847,7 @@ var SpacedeckSections = {
|
|||||||
may_select: function(a) {
|
may_select: function(a) {
|
||||||
if (!a) return false;
|
if (!a) return false;
|
||||||
if (!this.active_space) return false;
|
if (!this.active_space) return false;
|
||||||
|
|
||||||
if (this.active_space_role=="viewer" || (a.locked && this.active_space_role!="admin")) {
|
if (this.active_space_role=="viewer" || (a.locked && this.active_space_role!="admin")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1024,7 +1024,7 @@ var SpacedeckSections = {
|
|||||||
this.selection_metrics.count = 1;
|
this.selection_metrics.count = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sr = this.selection_rect() || {x:0,y:0,w:0,h:0,style:"display:none"};
|
var sr = this.selection_rect() || {x:0,y:0,w:0,h:0,style:"display:none"};
|
||||||
|
|
||||||
if (sr.x1 || sr.x2) {
|
if (sr.x1 || sr.x2) {
|
||||||
@@ -1052,7 +1052,7 @@ var SpacedeckSections = {
|
|||||||
// FIXME make sure that menus fit in window
|
// FIXME make sure that menus fit in window
|
||||||
this.toolbar_props_x = pp.x+"px";
|
this.toolbar_props_x = pp.x+"px";
|
||||||
this.toolbar_props_y = pp.y+"px";
|
this.toolbar_props_y = pp.y+"px";
|
||||||
|
|
||||||
//this.hide_toolbar_artifacts();
|
//this.hide_toolbar_artifacts();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1341,7 +1341,7 @@ var SpacedeckSections = {
|
|||||||
|
|
||||||
this.update_selected_artifacts(function(a) {
|
this.update_selected_artifacts(function(a) {
|
||||||
var c = {};
|
var c = {};
|
||||||
|
|
||||||
if (a[prop] != val) {
|
if (a[prop] != val) {
|
||||||
//console.log("set_artifact_style_prop: ",c,val);
|
//console.log("set_artifact_style_prop: ",c,val);
|
||||||
c[prop]=val;
|
c[prop]=val;
|
||||||
@@ -1496,7 +1496,7 @@ var SpacedeckSections = {
|
|||||||
var tw = window.innerWidth;
|
var tw = window.innerWidth;
|
||||||
var th = window.innerHeight;
|
var th = window.innerHeight;
|
||||||
var el = $("#space")[0];
|
var el = $("#space")[0];
|
||||||
|
|
||||||
if (!el) return {x:0,y:0,z:1}; // FIXME
|
if (!el) return {x:0,y:0,z:1}; // FIXME
|
||||||
|
|
||||||
var wrap = $(".wrapper");
|
var wrap = $(".wrapper");
|
||||||
@@ -1542,7 +1542,7 @@ var SpacedeckSections = {
|
|||||||
this.active_tool = "pointer";
|
this.active_tool = "pointer";
|
||||||
this.mouse_state = "idle";
|
this.mouse_state = "idle";
|
||||||
//this.hide_toolbar_artifacts();
|
//this.hide_toolbar_artifacts();
|
||||||
|
|
||||||
if (!url && (item_type == 'image' || item_type == 'video' || item_type == 'embed')) {
|
if (!url && (item_type == 'image' || item_type == 'video' || item_type == 'embed')) {
|
||||||
url = prompt("URL?");
|
url = prompt("URL?");
|
||||||
if (!url || !url.length) return;
|
if (!url || !url.length) return;
|
||||||
@@ -1717,7 +1717,7 @@ var SpacedeckSections = {
|
|||||||
|
|
||||||
var point = this.cursor_point_to_space(evt);
|
var point = this.cursor_point_to_space(evt);
|
||||||
point.z = this.highest_z()+1;
|
point.z = this.highest_z()+1;
|
||||||
|
|
||||||
var a = {
|
var a = {
|
||||||
space_id: this.active_space._id,
|
space_id: this.active_space._id,
|
||||||
mime: "x-spacedeck/shape",
|
mime: "x-spacedeck/shape",
|
||||||
@@ -1773,7 +1773,7 @@ var SpacedeckSections = {
|
|||||||
space_point_to_window: function(x,y) {
|
space_point_to_window: function(x,y) {
|
||||||
var rx = 0;
|
var rx = 0;
|
||||||
var ry = 0;
|
var ry = 0;
|
||||||
|
|
||||||
var el = $("#space")[0];
|
var el = $("#space")[0];
|
||||||
rx = x*this.viewport_zoom-el.scrollLeft+this.bounds_margin_horiz;
|
rx = x*this.viewport_zoom-el.scrollLeft+this.bounds_margin_horiz;
|
||||||
ry = y*this.viewport_zoom-el.scrollTop+this.bounds_margin_vert;
|
ry = y*this.viewport_zoom-el.scrollTop+this.bounds_margin_vert;
|
||||||
@@ -1785,7 +1785,7 @@ var SpacedeckSections = {
|
|||||||
if (this.active_space_role=="viewer") {
|
if (this.active_space_role=="viewer") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. create placeholder artifact
|
// 1. create placeholder artifact
|
||||||
var w=300,h=150;
|
var w=300,h=150;
|
||||||
var fill="transparent";
|
var fill="transparent";
|
||||||
@@ -2091,7 +2091,7 @@ var SpacedeckSections = {
|
|||||||
a.description = dom.innerHTML;
|
a.description = dom.innerHTML;
|
||||||
|
|
||||||
console.log("new DOM:",dom.innerHTML);
|
console.log("new DOM:",dom.innerHTML);
|
||||||
|
|
||||||
this.update_board_artifact_viewmodel(a);
|
this.update_board_artifact_viewmodel(a);
|
||||||
this.queue_artifact_for_save(a);
|
this.queue_artifact_for_save(a);
|
||||||
|
|
||||||
@@ -2109,12 +2109,12 @@ var SpacedeckSections = {
|
|||||||
// text level selection
|
// text level selection
|
||||||
var a = this.find_artifact_by_id(this.editing_artifact_id);
|
var a = this.find_artifact_by_id(this.editing_artifact_id);
|
||||||
var medium = this.medium_for_object[a._id];
|
var medium = this.medium_for_object[a._id];
|
||||||
|
|
||||||
if (medium && a) {
|
if (medium && a) {
|
||||||
medium.focus();
|
medium.focus();
|
||||||
medium.element.focus();
|
medium.element.focus();
|
||||||
medium.invokeElement(cmd);
|
medium.invokeElement(cmd);
|
||||||
|
|
||||||
a.description = medium.value();
|
a.description = medium.value();
|
||||||
this.queue_artifact_for_save(a);
|
this.queue_artifact_for_save(a);
|
||||||
}
|
}
|
||||||
@@ -2152,7 +2152,7 @@ var SpacedeckSections = {
|
|||||||
update.payload_thumbnail_medium_uri = thumb_uri;
|
update.payload_thumbnail_medium_uri = thumb_uri;
|
||||||
update.payload_thumbnail_big_uri = thumb_uri;
|
update.payload_thumbnail_big_uri = thumb_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
return update;
|
return update;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2287,7 +2287,7 @@ var SpacedeckSections = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pastedText) return;
|
if (!pastedText) return;
|
||||||
|
|
||||||
this.insert_embedded_artifact(pastedText);
|
this.insert_embedded_artifact(pastedText);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2300,7 +2300,7 @@ var SpacedeckSections = {
|
|||||||
try {
|
try {
|
||||||
parsed = JSON.parse(text);
|
parsed = JSON.parse(text);
|
||||||
if (text[0]=='{') parsed = [parsed];
|
if (text[0]=='{') parsed = [parsed];
|
||||||
|
|
||||||
this.deselect();
|
this.deselect();
|
||||||
|
|
||||||
for (var i=0; i<parsed.length; i++) {
|
for (var i=0; i<parsed.length; i++) {
|
||||||
@@ -2338,7 +2338,7 @@ var SpacedeckSections = {
|
|||||||
|
|
||||||
create_artifact_via_embed_url: function(url) {
|
create_artifact_via_embed_url: function(url) {
|
||||||
this.close_modal();
|
this.close_modal();
|
||||||
|
|
||||||
var point = this.find_place_for_item(200,200);
|
var point = this.find_place_for_item(200,200);
|
||||||
var z = this.highest_z()+1;
|
var z = this.highest_z()+1;
|
||||||
|
|
||||||
@@ -2356,7 +2356,7 @@ var SpacedeckSections = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var metadata = parse_link(url)
|
var metadata = parse_link(url)
|
||||||
|
|
||||||
if (!metadata) {
|
if (!metadata) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2531,16 +2531,16 @@ var SpacedeckSections = {
|
|||||||
}
|
}
|
||||||
this.toolbar_props_in = true;
|
this.toolbar_props_in = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
hide_toolbar_props: function() {
|
hide_toolbar_props: function() {
|
||||||
// FIXME test
|
// FIXME test
|
||||||
//this.toolbar_props_in = false;
|
//this.toolbar_props_in = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
show_toolbar_artifacts: function(x,y) {
|
show_toolbar_artifacts: function(x,y) {
|
||||||
this.toolbar_artifacts_in = true;
|
this.toolbar_artifacts_in = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
hide_toolbar_artifacts: function() {
|
hide_toolbar_artifacts: function() {
|
||||||
this.toolbar_artifacts_in = false;
|
this.toolbar_artifacts_in = false;
|
||||||
},
|
},
|
||||||
@@ -2642,7 +2642,7 @@ var SpacedeckSections = {
|
|||||||
x2: (el.scrollLeft+window.innerWidth)/this.viewport_zoom,
|
x2: (el.scrollLeft+window.innerWidth)/this.viewport_zoom,
|
||||||
y2: (el.scrollTop+window.innerHeight)/this.viewport_zoom
|
y2: (el.scrollTop+window.innerHeight)/this.viewport_zoom
|
||||||
};
|
};
|
||||||
|
|
||||||
var pad = 10;
|
var pad = 10;
|
||||||
er.x1-=pad;
|
er.x1-=pad;
|
||||||
er.y1-=pad;
|
er.y1-=pad;
|
||||||
@@ -2708,7 +2708,7 @@ var SpacedeckSections = {
|
|||||||
var el = $("#space")[0];
|
var el = $("#space")[0];
|
||||||
var anim_res = 20;
|
var anim_res = 20;
|
||||||
if (!elapsed) elapsed = 0;
|
if (!elapsed) elapsed = 0;
|
||||||
|
|
||||||
if (duration>elapsed) {
|
if (duration>elapsed) {
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
this.animate_zoom_to_rect(target_r, duration, cur_r, elapsed+anim_res);
|
this.animate_zoom_to_rect(target_r, duration, cur_r, elapsed+anim_res);
|
||||||
@@ -2747,7 +2747,7 @@ var SpacedeckSections = {
|
|||||||
|
|
||||||
zoom_to_point: function(p,amount) {
|
zoom_to_point: function(p,amount) {
|
||||||
var el = $("#space")[0];
|
var el = $("#space")[0];
|
||||||
|
|
||||||
var sx = el.scrollLeft/this.viewport_zoom;
|
var sx = el.scrollLeft/this.viewport_zoom;
|
||||||
var sy = el.scrollTop/this.viewport_zoom;
|
var sy = el.scrollTop/this.viewport_zoom;
|
||||||
var ww = window.innerWidth/(this.viewport_zoom);
|
var ww = window.innerWidth/(this.viewport_zoom);
|
||||||
@@ -2757,7 +2757,7 @@ var SpacedeckSections = {
|
|||||||
var oyy = (p.y-(sy+wh/2))*amount;
|
var oyy = (p.y-(sy+wh/2))*amount;
|
||||||
var ox = -oxx;
|
var ox = -oxx;
|
||||||
var oy = -oyy;
|
var oy = -oyy;
|
||||||
|
|
||||||
var r = {
|
var r = {
|
||||||
x1: p.x-(ww/2)*amount + ox,
|
x1: p.x-(ww/2)*amount + ox,
|
||||||
y1: p.y-(wh/2)*amount + oy,
|
y1: p.y-(wh/2)*amount + oy,
|
||||||
@@ -2781,12 +2781,12 @@ var SpacedeckSections = {
|
|||||||
var adjust_scroll = function() {
|
var adjust_scroll = function() {
|
||||||
if (!$("#space").length) return;
|
if (!$("#space").length) return;
|
||||||
if (!this.active_space || !this.active_space_loaded) return;
|
if (!this.active_space || !this.active_space_loaded) return;
|
||||||
|
|
||||||
var el = $("#space")[0];
|
var el = $("#space")[0];
|
||||||
|
|
||||||
var eff_w = this.active_space.width*this.viewport_zoom;
|
var eff_w = this.active_space.width*this.viewport_zoom;
|
||||||
var eff_h = this.active_space.height*this.viewport_zoom;
|
var eff_h = this.active_space.height*this.viewport_zoom;
|
||||||
|
|
||||||
var sx = el.scrollLeft;
|
var sx = el.scrollLeft;
|
||||||
var sy = el.scrollTop;
|
var sy = el.scrollTop;
|
||||||
|
|
||||||
@@ -2912,7 +2912,7 @@ var SpacedeckSections = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var html = evt.dataTransfer.getData('text/html');
|
var html = evt.dataTransfer.getData('text/html');
|
||||||
|
|
||||||
if (html) {
|
if (html) {
|
||||||
var rx = /src="([^"]+)"/g;
|
var rx = /src="([^"]+)"/g;
|
||||||
var m = rx.exec(html);
|
var m = rx.exec(html);
|
||||||
|
|||||||
Reference in New Issue
Block a user