Commit b85aa245 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

Merge branch 'mnt' into 'master'

Mnt

See merge request !2
parents 2fc14e1e fff0340f
Showing with 1197 additions and 1077 deletions
+1197 -1077
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module.exports = { module.exports = {
up: function(migration, DataTypes) { up: function(migration, DataTypes) {
return [ return Promise.all([
migration.changeColumn('memberships', 'space_id', migration.changeColumn('memberships', 'space_id',
{ {
type: DataTypes.STRING, type: DataTypes.STRING,
...@@ -36,11 +36,11 @@ module.exports = { ...@@ -36,11 +36,11 @@ module.exports = {
onUpdate: 'CASCADE' onUpdate: 'CASCADE'
} }
) )
] ])
}, },
down: function(migration, DataTypes) { down: function(migration, DataTypes) {
return [ return Promise.all([
migration.changeColumn('memberships', 'space_id', migration.changeColumn('memberships', 'space_id',
{ {
type: DataTypes.STRING, type: DataTypes.STRING,
...@@ -52,7 +52,6 @@ module.exports = { ...@@ -52,7 +52,6 @@ module.exports = {
onUpdate: 'NO ACTION' onUpdate: 'NO ACTION'
} }
), ),
,
migration.changeColumn('artifacts', 'space_id', migration.changeColumn('artifacts', 'space_id',
{ {
type: DataTypes.STRING, type: DataTypes.STRING,
...@@ -75,6 +74,6 @@ module.exports = { ...@@ -75,6 +74,6 @@ module.exports = {
onUpdate: 'NO ACTION' onUpdate: 'NO ACTION'
} }
) )
] ])
} }
}; }
'use strict';
module.exports = {
up: function(migration, DataTypes) {
return Promise.all([
migration.changeColumn('users', 'api_token',
{
type: DataTypes.STRING
}
)
])
},
down: function(migration, DataTypes) {
return Promise.all([
migration.changeColumn('users', 'api_token',
{
type: Sequelize.STRING
}
)
])
}
}
...@@ -3,49 +3,54 @@ ...@@ -3,49 +3,54 @@
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "electron ." "start": "node spacedeck.js"
}, },
"engines": { "engines": {
"node": ">=7.8.0" "node": ">=10.0.0"
}, },
"dependencies": { "dependencies": {
"archiver": "1.3.0", "archiver": "1.3.0",
"async": "2.3.0", "async": "2.3.0",
"basic-auth": "1.1.0",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"body-parser": "~1.17.1", "body-parser": "^1.19.0",
"cheerio": "0.22.0", "cheerio": "0.22.0",
"config": "1.25.1", "config": "1.25.1",
"cookie-parser": "~1.4.3", "cookie-parser": "~1.4.3",
"electron": "^1.8.4", "ejs": "3.1.5",
"execSync": "latest", "execSync": "latest",
"express": "~4.13.0", "express": "^4.16.4",
"file-type": "^7.6.0", "file-type": "^7.6.0",
"glob": "7.1.1", "glob": "7.1.1",
"gm": "1.23.0", "gm": "^1.23.1",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-sass": "^4.0.2",
"helmet": "^3.5.0", "helmet": "^3.5.0",
"i18n-2": "0.6.3", "i18n-2": "0.6.3",
"log-timestamp": "latest", "log-timestamp": "latest",
"mock-aws-s3": "^2.6.0", "mock-aws-s3": "^2.6.0",
"moment": "^2.19.3", "moment": "^2.19.3",
"morgan": "1.8.1", "morgan": "^1.9.1",
"node-phantom-simple": "2.2.4", "node-phantom-simple": "2.2.4",
"node-server-screenshot": "^0.2.1",
"nodemailer": "^4.6.7", "nodemailer": "^4.6.7",
"phantomjs-prebuilt": "2.1.14", "passport": "^0.4.1",
"passport-saml": "^1.3.5",
"phantomjs-prebuilt": "^2.1.16",
"read-chunk": "^2.1.0", "read-chunk": "^2.1.0",
"request": "2.81.0", "request": "^2.88.0",
"saml2js": "^0.1.2",
"sanitize-html": "^1.11.1", "sanitize-html": "^1.11.1",
"sequelize": "^4.37.6", "sequelize": "^4.37.6",
"serve-favicon": "~2.4.2", "serve-favicon": "~2.4.2",
"serve-static": "^1.13.1", "serve-static": "^1.13.1",
"slug": "0.9.1", "slug": "^1.1.0",
"sqlite3": "^4.0.0", "sqlite3": "^4.0.0",
"swig": "1.4.2",
"umzug": "^2.1.0", "umzug": "^2.1.0",
"underscore": "1.8.3", "underscore": "1.8.3",
"uuid": "^3.2.1", "uuid": "^3.2.1",
"validator": "7.0.0", "validator": "7.0.0",
"ws": "2.2.3" "ws": "3.3.1"
}, },
"main": "app.js", "main": "app.js",
"description": "", "description": "",
......
public/images/favicon.png

1.83 KB | W: 0px | H: 0px

public/images/favicon.png

1.39 KB | W: 0px | H: 0px

public/images/favicon.png
public/images/favicon.png
public/images/favicon.png
public/images/favicon.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="17.370329mm"
height="17.370247mm"
viewBox="0 0 17.370329 17.370247"
version="1.1"
id="svg3417"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="sd6-icon-white.svg"
inkscape:export-filename="/home/mntmn/code/spacedeck-open/public/images/favicon.png"
inkscape:export-xdpi="93.585312"
inkscape:export-ydpi="93.585312">
<defs
id="defs3411" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="68.901329"
inkscape:cy="26.613846"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata3414">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-61.618407,-79.672019)">
<path
inkscape:connector-curvature="0"
id="path1681-6-5-3-7-4-9-2-0-2-9-7"
d="m 69.103371,79.69206 c -0.792105,0.07526 -1.553632,0.368078 -2.179688,0.99414 -0.967242,0.967233 -1.023215,2.24006 -0.822265,3.46875 -1.228429,-0.200703 -2.499819,-0.144769 -3.466797,0.822266 -1.252082,1.252133 -1.178244,3.043412 -0.677734,4.544922 0.500509,1.50151 1.477937,2.995513 2.832031,4.349611 1.354102,1.3541 2.848091,2.33152 4.349609,2.83203 1.501518,0.50051 3.292795,0.57437 4.544922,-0.67773 0.9673,-0.96727 1.023249,-2.24001 0.822266,-3.468755 1.228416,0.200714 2.499803,0.146691 3.466796,-0.820313 1.252124,-1.252112 1.17824,-3.045353 0.677735,-4.546874 -0.500505,-1.501522 -1.477926,-2.995502 -2.832031,-4.34961 -1.354109,-1.354105 -2.848087,-2.329573 -4.34961,-2.830078 -0.750761,-0.250253 -1.57313,-0.393617 -2.365234,-0.318359 z m 0.251953,3.427734 c -0.06232,0.06232 0.187775,-0.12686 1.025391,0.152344 0.837615,0.279204 1.980359,0.976455 3.005859,2.001953 1.025498,1.0255 1.720796,2.16629 2,3.003906 0.279204,0.837616 0.09198,1.087707 0.154297,1.025391 0.06232,-0.06232 -0.187775,0.124907 -1.025391,-0.154297 -0.817005,-0.272334 -1.926016,-0.966798 -2.93164,-1.951172 -0.02107,-0.02133 -0.03343,-0.04515 -0.05469,-0.06641 -0.02194,-0.02194 -0.04635,-0.0349 -0.06836,-0.05664 -0.984356,-1.005615 -1.678841,-2.112692 -1.951172,-2.929687 -0.279204,-0.837616 -0.09198,-1.087708 -0.154297,-1.025391 z m -4.289063,4.289063 c -0.06231,0.06232 0.187774,-0.124903 1.025391,0.154296 0.81575,0.271911 1.923337,0.965368 2.927735,1.947266 0.02276,0.02306 0.03561,0.04929 0.05859,0.07227 0.023,0.023 0.04918,0.03581 0.07227,0.05859 0.981898,1.004395 1.67535,2.111982 1.947265,2.927735 0.279205,0.837619 0.09198,1.087705 0.154297,1.025385 0.06232,-0.0623 -0.187772,0.12492 -1.02539,-0.154291 -0.837619,-0.27921 -1.980364,-0.974504 -3.00586,-2 -1.025488,-1.025491 -1.720791,-2.168245 -2,-3.00586 -0.279208,-0.837615 -0.09198,-1.087708 -0.154297,-1.02539 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.4395833;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:37.79527664;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="17.370329mm"
height="17.370247mm"
viewBox="0 0 17.370329 17.370247"
version="1.1"
id="svg3417"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="sd6-icon.svg">
<defs
id="defs3411" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="68.901329"
inkscape:cy="26.613846"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata3414">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-61.618407,-79.672019)">
<path
inkscape:connector-curvature="0"
id="path1681-6-5-3-7-4-9-2-0-2-9-7"
d="m 69.103371,79.69206 c -0.792105,0.07526 -1.553632,0.368078 -2.179688,0.99414 -0.967242,0.967233 -1.023215,2.24006 -0.822265,3.46875 -1.228429,-0.200703 -2.499819,-0.144769 -3.466797,0.822266 -1.252082,1.252133 -1.178244,3.043412 -0.677734,4.544922 0.500509,1.50151 1.477937,2.995513 2.832031,4.349611 1.354102,1.3541 2.848091,2.33152 4.349609,2.83203 1.501518,0.50051 3.292795,0.57437 4.544922,-0.67773 0.9673,-0.96727 1.023249,-2.24001 0.822266,-3.468755 1.228416,0.200714 2.499803,0.146691 3.466796,-0.820313 1.252124,-1.252112 1.17824,-3.045353 0.677735,-4.546874 -0.500505,-1.501522 -1.477926,-2.995502 -2.832031,-4.34961 -1.354109,-1.354105 -2.848087,-2.329573 -4.34961,-2.830078 -0.750761,-0.250253 -1.57313,-0.393617 -2.365234,-0.318359 z m 0.251953,3.427734 c -0.06232,0.06232 0.187775,-0.12686 1.025391,0.152344 0.837615,0.279204 1.980359,0.976455 3.005859,2.001953 1.025498,1.0255 1.720796,2.16629 2,3.003906 0.279204,0.837616 0.09198,1.087707 0.154297,1.025391 0.06232,-0.06232 -0.187775,0.124907 -1.025391,-0.154297 -0.817005,-0.272334 -1.926016,-0.966798 -2.93164,-1.951172 -0.02107,-0.02133 -0.03343,-0.04515 -0.05469,-0.06641 -0.02194,-0.02194 -0.04635,-0.0349 -0.06836,-0.05664 -0.984356,-1.005615 -1.678841,-2.112692 -1.951172,-2.929687 -0.279204,-0.837616 -0.09198,-1.087708 -0.154297,-1.025391 z m -4.289063,4.289063 c -0.06231,0.06232 0.187774,-0.124903 1.025391,0.154296 0.81575,0.271911 1.923337,0.965368 2.927735,1.947266 0.02276,0.02306 0.03561,0.04929 0.05859,0.07227 0.023,0.023 0.04918,0.03581 0.07227,0.05859 0.981898,1.004395 1.67535,2.111982 1.947265,2.927735 0.279205,0.837619 0.09198,1.087705 0.154297,1.025385 0.06232,-0.0623 -0.187772,0.12492 -1.02539,-0.154291 -0.837619,-0.27921 -1.980364,-0.974504 -3.00586,-2 -1.025488,-1.025491 -1.720791,-2.168245 -2,-3.00586 -0.279208,-0.837615 -0.09198,-1.087708 -0.154297,-1.02539 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.4395833;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:37.79527664;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="81.731232mm"
height="17.370247mm"
viewBox="0 0 81.731232 17.370247"
version="1.1"
id="svg2651"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="sd6-logo-black.svg">
<defs
id="defs2645" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="80.852573"
inkscape:cy="-16.110417"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata2648">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-29.059958,-86.19285)">
<g
id="g3248">
<path
inkscape:connector-curvature="0"
id="path1681-6-5-3-7-4-9-2-0-2-9-7"
d="m 36.544922,86.212891 c -0.792105,0.07526 -1.553632,0.368078 -2.179688,0.99414 -0.967242,0.967233 -1.023215,2.24006 -0.822265,3.46875 -1.228429,-0.200703 -2.499819,-0.144769 -3.466797,0.822266 -1.252082,1.252133 -1.178244,3.043412 -0.677734,4.544922 0.500509,1.50151 1.477937,2.995513 2.832031,4.349611 1.354102,1.3541 2.848091,2.33152 4.349609,2.83203 1.501518,0.50051 3.292795,0.57437 4.544922,-0.67773 0.9673,-0.96727 1.023249,-2.24001 0.822266,-3.468755 1.228416,0.200714 2.499803,0.146691 3.466796,-0.820313 1.252124,-1.252112 1.17824,-3.045353 0.677735,-4.546874 -0.500505,-1.501522 -1.477926,-2.995502 -2.832031,-4.34961 -1.354109,-1.354105 -2.848087,-2.329573 -4.34961,-2.830078 -0.750761,-0.250253 -1.57313,-0.393617 -2.365234,-0.318359 z m 0.251953,3.427734 c -0.06232,0.06232 0.187775,-0.12686 1.025391,0.152344 0.837615,0.279204 1.980359,0.976455 3.005859,2.001953 1.025498,1.0255 1.720796,2.16629 2,3.003906 0.279204,0.837616 0.09198,1.087707 0.154297,1.025391 0.06232,-0.06232 -0.187775,0.124907 -1.025391,-0.154297 -0.817005,-0.272334 -1.926016,-0.966798 -2.93164,-1.951172 -0.02107,-0.02133 -0.03343,-0.04515 -0.05469,-0.06641 -0.02194,-0.02194 -0.04635,-0.0349 -0.06836,-0.05664 -0.984356,-1.005615 -1.678841,-2.112692 -1.951172,-2.929687 -0.279204,-0.837616 -0.09198,-1.087708 -0.154297,-1.025391 z m -4.289063,4.289063 c -0.06231,0.06232 0.187774,-0.124903 1.025391,0.154296 0.81575,0.271911 1.923337,0.965368 2.927735,1.947266 0.02276,0.02306 0.03561,0.04929 0.05859,0.07227 0.023,0.023 0.04918,0.03581 0.07227,0.05859 0.981898,1.004395 1.67535,2.111982 1.947265,2.927735 0.279205,0.837619 0.09198,1.087705 0.154297,1.025385 0.06232,-0.0623 -0.187772,0.12492 -1.02539,-0.154291 -0.837619,-0.27921 -1.980364,-0.974504 -3.00586,-2 -1.025488,-1.025491 -1.720791,-2.168245 -2,-3.00586 -0.279208,-0.837615 -0.09198,-1.087708 -0.154297,-1.02539 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.4395833;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:37.79527664;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
id="g2614"
transform="matrix(0.26458333,0,0,0.26458333,-523.78744,61.714265)">
<g
id="flowRoot1610-0-6-8-1-1"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;line-height:1.25;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.37800002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:37.79527664;stroke-opacity:1"
transform="matrix(2.6369365,0,0,2.6369365,2045.0224,86.079903)"
aria-label="Spacedeck">
<path
id="path3214"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 52.795627,11.002199 h 2.693247 C 55.466146,8.82601 53.73315,7.3543837 51.028539,7.3543837 c -2.659155,0 -4.573974,1.4488985 -4.556928,3.6137233 -0.0057,1.767088 1.232985,2.76143 3.244397,3.221669 l 1.215938,0.284097 c 1.27844,0.295462 1.852317,0.642061 1.863681,1.295486 -0.01136,0.710244 -0.676152,1.204575 -1.806861,1.204575 -1.244349,0 -2.06255,-0.57956 -2.125052,-1.698905 h -2.693246 c 0.03409,2.721656 1.926182,4.022824 4.852389,4.022824 2.897797,0 4.613748,-1.312532 4.625112,-3.522812 -0.01136,-1.857999 -1.267076,-2.99439 -3.562586,-3.500084 l -1.000024,-0.227278 c -1.056844,-0.227279 -1.727315,-0.57956 -1.704587,-1.272758 0.0057,-0.636379 0.55115,-1.0966177 1.642085,-1.0966177 1.096618,0 1.698905,0.4943297 1.77277,1.3238957 z"
inkscape:connector-curvature="0" />
<path
id="path3216"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 57.068458,22.422928 h 2.778476 v -4.687613 h 0.05682 c 0.352281,0.806838 1.136391,1.53981 2.454605,1.53981 1.931864,0 3.48872,-1.5114 3.48872,-4.483062 0,-3.07962 -1.647767,-4.483063 -3.471674,-4.483063 -1.380715,0 -2.136415,0.806838 -2.471651,1.607994 h -0.08523 v -1.494355 h -2.750066 z m 2.721656,-7.636547 c 0,-1.426171 0.590923,-2.306874 1.607993,-2.306874 1.028434,0 1.59663,0.903431 1.59663,2.306874 0,1.409125 -0.568196,2.323919 -1.59663,2.323919 -1.01707,0 -1.607993,-0.909112 -1.607993,-2.323919 z"
inkscape:connector-curvature="0" />
<path
id="path3218"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 69.778991,19.297853 c 1.215939,0 2.056868,-0.471602 2.534152,-1.363669 h 0.06818 v 1.215938 h 2.613699 v -5.931961 c 0,-1.846635 -1.642085,-2.909161 -3.86373,-2.909161 -2.346647,0 -3.676224,1.181847 -3.897821,2.772794 l 2.562562,0.09091 c 0.119321,-0.556832 0.579559,-0.897749 1.312532,-0.897749 0.681834,0 1.113663,0.329553 1.113663,0.914794 v 0.02841 c 0,0.534104 -0.57956,0.647743 -2.068232,0.778428 -1.767088,0.147731 -3.244396,0.801156 -3.244396,2.73302 0,1.727315 1.198892,2.568244 2.869387,2.568244 z m 0.857975,-1.818226 c -0.642061,0 -1.096617,-0.306825 -1.096617,-0.886384 0,-0.562514 0.443193,-0.903431 1.232984,-1.022752 0.517058,-0.07387 1.153437,-0.187505 1.465945,-0.352282 v 0.829566 c 0,0.852293 -0.715927,1.431852 -1.602312,1.431852 z"
inkscape:connector-curvature="0" />
<path
id="path3220"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 80.767893,19.314899 c 2.454605,0 3.977369,-1.426171 4.051234,-3.585314 h -2.596653 c -0.102275,0.926159 -0.659107,1.431853 -1.420489,1.431853 -0.977296,0 -1.613675,-0.823883 -1.613675,-2.375057 0,-1.53981 0.642061,-2.363693 1.613675,-2.363693 0.795474,0 1.312532,0.539785 1.420489,1.431852 h 2.596653 c -0.0625,-2.147779 -1.630721,-3.54554 -4.056916,-3.54554 -2.744384,0 -4.403515,1.82959 -4.403515,4.505791 0,2.664836 1.647767,4.500108 4.409197,4.500108 z"
inkscape:connector-curvature="0" />
<path
id="path3222"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 90.336304,19.314899 c 2.289828,0 3.795546,-1.107981 4.113736,-2.823932 l -2.551198,-0.07387 c -0.215914,0.579559 -0.78411,0.892067 -1.5114,0.892067 -1.068208,0 -1.727315,-0.710245 -1.727315,-1.778452 v -0.07386 h 5.818322 v -0.693199 c 0,-2.875069 -1.750042,-4.454653 -4.227374,-4.454653 -2.636427,0 -4.32965,1.806862 -4.32965,4.511473 0,2.795521 1.670495,4.494426 4.414879,4.494426 z m -1.676177,-5.471723 c 0.03977,-0.869339 0.727291,-1.528446 1.647767,-1.528446 0.914795,0 1.573902,0.636379 1.585266,1.528446 z"
inkscape:connector-curvature="0" />
<path
id="path3224"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 99.10072,19.275125 c 1.31821,0 2.10232,-0.732972 2.4546,-1.53981 h 0.0852 v 1.414807 h 2.75007 V 7.5134784 h -2.77848 v 4.4035156 h -0.0568 C 101.22577,11.115838 100.46439,10.309 99.089356,10.309 c -1.823907,0 -3.477356,1.403443 -3.477356,4.483063 0,2.971662 1.562537,4.483062 3.48872,4.483062 z m 0.96593,-2.164825 c -1.028432,0 -1.602309,-0.914794 -1.602309,-2.323919 0,-1.403443 0.568196,-2.306874 1.602309,-2.306874 1.01707,0 1.608,0.880703 1.608,2.306874 0,1.414807 -0.59661,2.323919 -1.608,2.323919 z"
inkscape:connector-curvature="0" />
<path
id="path3226"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 110.24303,19.314899 c 2.28983,0 3.79555,-1.107981 4.11374,-2.823932 l -2.5512,-0.07387 c -0.21591,0.579559 -0.78411,0.892067 -1.5114,0.892067 -1.06821,0 -1.72731,-0.710245 -1.72731,-1.778452 v -0.07386 h 5.81832 v -0.693199 c 0,-2.875069 -1.75004,-4.454653 -4.22737,-4.454653 -2.63643,0 -4.32965,1.806862 -4.32965,4.511473 0,2.795521 1.67049,4.494426 4.41487,4.494426 z m -1.67617,-5.471723 c 0.0398,-0.869339 0.72729,-1.528446 1.64777,-1.528446 0.91479,0 1.5739,0.636379 1.58526,1.528446 z"
inkscape:connector-curvature="0" />
<path
id="path3228"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 119.89384,19.314899 c 2.4546,0 3.97736,-1.426171 4.05123,-3.585314 h -2.59665 c -0.10228,0.926159 -0.65911,1.431853 -1.42049,1.431853 -0.9773,0 -1.61368,-0.823883 -1.61368,-2.375057 0,-1.53981 0.64206,-2.363693 1.61368,-2.363693 0.79547,0 1.31253,0.539785 1.42049,1.431852 h 2.59665 c -0.0625,-2.147779 -1.63072,-3.54554 -4.05692,-3.54554 -2.74438,0 -4.40351,1.82959 -4.40351,4.505791 0,2.664836 1.64777,4.500108 4.4092,4.500108 z"
inkscape:connector-curvature="0" />
<path
id="path3230"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:16.00038528px;font-family:Inter;-inkscape-font-specification:'Inter, Ultra-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
d="m 125.3826,19.150122 h 2.77848 v -2.619381 l 0.56251,-0.681835 2.0796,3.301216 h 3.2103 l -3.22167,-4.926255 3.09667,-3.801228 h -3.1478 l -2.45461,3.125076 h -0.125 V 7.5134784 h -2.77848 z"
inkscape:connector-curvature="0" />
</g>
<path
d="m 2146.72,133.51812 a 23.030019,11.514995 45 0 1 -24.427,-8.1423 23.030019,11.514995 45 0 1 -8.1423,-24.427 23.030019,11.514995 45 0 1 24.427,8.1423 23.030019,11.514995 45 0 1 8.1423,24.427 z m -16.2137,16.2138 a 23.030019,11.514995 45 0 1 -24.427,-8.1424 23.030019,11.514995 45 0 1 -8.1424,-24.4269 23.030019,11.514995 45 0 1 24.4271,8.1422 23.030019,11.514995 45 0 1 8.1423,24.4271 z"
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:37.79527664;stroke-opacity:1"
id="path1681-6-5-3-7-4-9-2-0-2-7-6"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</svg>
public/images/sd6-screenshot.png

158 KB

...@@ -6,6 +6,10 @@ var websocket = null; ...@@ -6,6 +6,10 @@ var websocket = null;
var channel_id = null; var channel_id = null;
var space_auth = null; var space_auth = null;
function set_space_auth(hash) {
space_auth = hash;
}
function load_resource(method, path, data, on_success, on_error, on_progress) { function load_resource(method, path, data, on_success, on_error, on_progress) {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.onload = function(evt,b,c) { req.onload = function(evt,b,c) {
...@@ -44,24 +48,17 @@ function load_resource(method, path, data, on_success, on_error, on_progress) { ...@@ -44,24 +48,17 @@ function load_resource(method, path, data, on_success, on_error, on_progress) {
} }
req.withCredentials = true; req.withCredentials = true;
req.open(method, api_endpoint+"/api"+path, true); req.open(method, api_endpoint+"/api"+path, true);
if (api_token) { if (api_token) {
req.setRequestHeader("X-Spacedeck-Auth", api_token); req.setRequestHeader("X-Spacedeck-Auth", api_token);
} }
if (space_auth) { if (space_auth) {
console.log("set space auth", space_auth);
req.setRequestHeader("X-Spacedeck-Space-Auth", space_auth); req.setRequestHeader("X-Spacedeck-Space-Auth", space_auth);
} }
if (channel_id) { if (channel_id) {
req.setRequestHeader("X-Spacedeck-Channel", channel_id); req.setRequestHeader("X-Spacedeck-Channel", channel_id);
} }
if (csrf_token) {
req.setRequestHeader("X-csrf-token", csrf_token);
}
try { try {
if (data) { if (data) {
...@@ -133,18 +130,6 @@ function load_spaces(id, is_home, on_success, on_error) { ...@@ -133,18 +130,6 @@ function load_spaces(id, is_home, on_success, on_error) {
}, on_error); }, on_error);
} }
function load_importables(user, on_success, on_error) {
load_resource("get", "/users/"+user._id+"/importables", null, on_success, on_error);
}
function import_zip(user, filename, on_success, on_error) {
load_resource("get", "/users/"+user._id+"/import?zip="+filename, null, on_success, on_error);
}
function load_writable_folders(on_success, on_error) {
load_resource("get", "/spaces?writablefolders=true", null, on_success, on_error);
}
function load_history(s, on_success, on_error) { function load_history(s, on_success, on_error) {
load_resource("get", "/spaces/"+ s._id +"/digest", null, on_success, on_error); load_resource("get", "/spaces/"+ s._id +"/digest", null, on_success, on_error);
} }
...@@ -190,12 +175,10 @@ function delete_space(s, on_success, on_error) { ...@@ -190,12 +175,10 @@ function delete_space(s, on_success, on_error) {
load_resource("delete", "/spaces/"+s._id, null, on_success, on_error); load_resource("delete", "/spaces/"+s._id, null, on_success, on_error);
} }
function delete_artifact(a, on_success, on_error) { function delete_artifact(a, on_success, on_error) {
load_resource("delete", "/spaces/"+a.space_id+"/artifacts/"+a._id); load_resource("delete", "/spaces/"+a.space_id+"/artifacts/"+a._id);
} }
function duplicate_space(s, to_space_id, on_success, on_error) { function duplicate_space(s, to_space_id, on_success, on_error) {
var path = "/spaces/"+s._id+"/duplicate"; var path = "/spaces/"+s._id+"/duplicate";
if(to_space_id) { if(to_space_id) {
...@@ -274,8 +257,8 @@ function delete_user(u, password, on_success, on_error) { ...@@ -274,8 +257,8 @@ function delete_user(u, password, on_success, on_error) {
load_resource("delete", "/users/"+u._id +"?password="+password,null,on_success,on_error); load_resource("delete", "/users/"+u._id +"?password="+password,null,on_success,on_error);
} }
function create_user(name, email, password, password_confirmation, on_success, on_error) { function create_user(name, email, password, password_confirmation, invite_code, on_success, on_error) {
load_resource("post", "/users", {email:email, nickname:name, password:password, password_confirmation: password_confirmation}, on_success, on_error); load_resource("post", "/users", {email:email, nickname:name, password:password, password_confirmation: password_confirmation, invite_code: invite_code}, on_success, on_error);
} }
function create_session(email, password, on_success, on_error) { function create_session(email, password, on_success, on_error) {
......
...@@ -2,6 +2,7 @@ window.locales = {}; ...@@ -2,6 +2,7 @@ window.locales = {};
window.locales.en = {}; window.locales.en = {};
window.locales.de = {}; window.locales.de = {};
window.locales.fr = {}; window.locales.fr = {};
window.locales.oc = {};
window.locales.en.translation = window.locales.en.translation =
{ {
"ok": "OK", "ok": "OK",
...@@ -943,4 +944,328 @@ window.locales.fr.translation = ...@@ -943,4 +944,328 @@ window.locales.fr.translation =
"promote": "promouvoir", "promote": "promouvoir",
"demote": "rétrograder" "demote": "rétrograder"
} }
window.locales.oc.translation =
{
"ok": "D'acòrdi",
"cancel": "Anullar",
"close": "Tampar",
"open": "Dobrir",
"folder": "Repertòri",
"save": "Enregistrar",
"saved": "Enregistrat",
"created": "creat",
"duplicate": "Duplicar",
"delete": "Suprimir",
"remove": "Suprimir",
"set": "definir",
"reset": "reïnicializar",
"thanks": "Mercés",
"share": "Partejar",
"signup": "S’inscriure",
"login": "Connexion",
"logout": "Se desconnectar",
"email": "Adreça electronica",
"password": "Senhal",
"width": "Largor",
"height": "Nautor",
"nick": "Escais",
"role": "Ròtle",
"members": "Membres",
"actions": "Accions",
"or": "o",
"you": "vos",
"via": "via",
"by": "per",
"zero": "Zéro",
"page": "Pagina",
"new": "Nòu",
"copy": "Copiar",
"home": "Acuèlh",
"owner": "Proprietari",
"space": "Espaci",
"second": "Segond",
"not_found": "Pas trobat.",
"untitled_space": "Espaci sens nom",
"untitled_folder": "Repertòri sens nom",
"untitled": "sens títol",
"sure": "O volètz vertadièrament ?",
"specify": "Mercés d’especificar",
"confirm": "Mercés de confirmar",
"error_unknown_email": "Aquesta combinason d’adreça electronica/senhal es desconeguda.",
"error_password_confirmation": "Los senhals picats correspondon pas.",
"error_domain_blocked": "Lo domeni es blocat.",
"error_user_email_already_used": "Aquesta adreça es ja utilizada.",
"support": "Assisténcia Spacedeck",
"offline": "Fòra linha. Clicatz per mai d’opcions.",
"error": "O planhèm, quicòm a trucat. Mercés de contactar support@spacedeck.com",
"welcome": "La benvenguda",
"claim": "Vòstre tablèu numeric.",
"trynow": "Ensajatz ara.",
"about": "A prepaus de nosautre",
"terms": "Tèrmes",
"contact": "Contacte",
"privacy": "Confidencialitat",
"business_adress": "Adreça professionala",
"post_adress": "Adreça postala",
"phone": "Telefòn",
"ceo": "Gestionari",
"name": "Nom",
"confirm_subject": "Corrièl de confirmacion de Spacedeck",
"confirm_body": "Mercés de vòstra inscripcion a Spacedeck.\nMercés de clicar lo ligam seguent per confirmar vòstra adreça electronica.\n",
"confirm_action": "Confirmar",
"team_invite_membership_subject": "Invitacion d’equipa per %s",
"team_invite_membership_body": "Qualqu’un vos a convidat a %s sus Spacedeck. Mercés de clicar sul ligam seguent per acceptar l’invitacion.",
"team_invite_user_body": "Qualqu’un vos a convidat a %s sus Spacedeck.\nVòstre senhal temporari es « %s ».\nMercés de clicar sul ligam seguent per acceptar l’invitacion.",
"team_invite_admin_body": "%s es estat convidat a vòstra equipa : %s. Lo senhal temporari es « %s ».",
"team_invite_membership_acction": "Acceptar",
"team_new_member_subject": "Membre novèl",
"team_new_member_body": "%s a rejonch l’equipa %s sus Spacedeck",
"space_invite_membership_subject": "Invitacion Espaci per %s : %s",
"space_invite_membership_body": "%s vos a convit a l’Espaci « %s »",
"space_invite_membership_action": "Acceptar l’invitacion",
"folder_invite_membership_subject": "Espaci",
"folder_invite_membership_body": "Qualqu’un vos a convidat a Team sus Spacedeck. Clicatz lo ligam seguent per acceptar l’invitacion.",
"folder_invite_membership_acction": "Acceptar",
"login_google": "S’identificar amb Google",
"save_changes": "Enregistrar las modificacions",
"upgrade": "Metre a jorn",
"upgrade_now": "Metre a nivèl ara",
"create_space": "Crear un espaci",
"create_folder": "Crear un repertòri",
"email_unconfirmed": "Adreça pas confirmada",
"confirmation_sent": "Messatge enviat",
"folder_filter": "Filtre",
"sort_by": "Triar per",
"last_modified": "Darrièra modificacion",
"last_opened": "Darrièra dobertura",
"title": "Títol",
"edit_team": "Modificar equipa",
"edit_account": "Modificar compte",
"log_out": "Se desconnectar",
"no_spaces_yet": "Avètz pas encara creat cap d’espacis.",
"new_folder_title": "Novèl títol pel repertòri",
"folder_settings": "Paramètres repertòri",
"upload_cover_image": "Enviar imatge cobèrta",
"spacedeck_pro_ad_folders": "Avec Spacedeck Pro, vous pouvez organiser un nombre illimité de espaces dans les dossiers et gérer les contrôles d'accès pour chaque dossier. Voulez-vous en savoir plus sur les fonctionnalités Pro ?",
"spacedeck_pro_ad_versions": "Avec Spacedeck Pro, vous pouvez enregistrer des versions illimitées de chaque espace pour suivre vos progrès ou de conserver des instantanés sécurité. Voulez-vous en savoir plus sur les fonctionnalités Pro ?",
"spacedeck_pro_ad_pdf": "Avec Spacedeck Pro, vous pouvez exporter vos espaces et même des dossiers entiers belles PDF pour l'archivage, de diffusion, ou autour de l'impression. Voulez-vous en savoir plus sur les fonctionnalités Pro ?",
"spacedeck_pro_ad_zip": "Avec Spacedeck Pro, vous pouvez exporter le contenu d'un espace comme un paquet ZIP. Voulez-vous en savoir plus sur les fonctionnalités Pro ?",
"spacedeck_pro_ad_colors": "Avec Spacedeck Pro, vous pouvez mélanger vos propres couleurs en utilisant un sélecteur de couleur professionnelle.",
"profile_caption": "Perfil",
"upload_avatar": "Enviar avatar",
"uploading_avatar": "Mandadís avatar…",
"avatar_dimensions": "Dimensions recomandadas : 200x200 pixèls.",
"profile_name": "Nom",
"profile_email": "Adreça electronica",
"send_again": "Tornar enviar",
"confirmation_sent_long": "Ligam de confirmacion enviat. Mercés de verificar vòstres corrièrs.",
"confirmation_sent_another": "Un autre ligam de confirmacion enviat.",
"confirmation_sent_dialog_text": "Avèm enviat un corrièl qu’explica cossí confirmar vòstra adreça electronica.",
"payment_caption": "Pagament",
"language_caption": "Lenga",
"notifications_caption": "Notificacions",
"notifications_option_chat": "Enviatz-me de comentaris novèls per corrièl",
"notifications_option_spaces": "Enviatz-me un resumit jornadièr de las modificacions dels espacis",
"password_caption": "Senhal",
"current_password": "Senhal actual",
"new_password": "Senhal novèl",
"verify_password": "Verificar lo senhal novèl",
"change_password": "Modificar senhal",
"reset_password": "Reïnicializar senhal",
"terminate_caption": "Suprimir lo compte",
"terminate_warning": "En escafant vòstre compte, vòstres messatges, espacis, repertòris e lor contengut seràn suprimits. Aquesta accion pòt pas èsser anullada.",
"terminate_warning2": "Aquò pòt pas èsser anullat.",
"terminate_reason": "Messatge",
"terminate_reason_caption": "Ajudatz-nos a melhorar lo logicial en nos diguent las rasons de la supression de vòstre compte",
"terminate_terminate": "Suprimir vòstre compte per totjorn ?",
"space_blank1": "Aquò es vòstre novèl espaci",
"space_blank2": "Lisatz de fichièrs, pegatz de ligams",
"space_blank3": "o utilizatz las aisinas",
"space_blank4": "Siatz creatius !",
"draft": "Borrolhon",
"publish": "Publicar",
"published": "Publicat",
"save_version": "Enregistrar version",
"version_saved": "Version enregistrada",
"post": "Publicar messatge",
"chat_invite_cta1": "Collaboratz amb amusament !",
"chat_invite_cta2": "Perqué pas ",
"chat_invite_cta3": "convidar de monde",
"chat_invite_cta4": "per trabalhar amb vos ?",
"chat_message_placeholder": "Escrivètz vòstre messatge…",
"view": "Afichatge",
"edit": "Edicion",
"present": "Present",
"chat": "Messatjariá",
"meta": "Mèta",
"tool_search": "Recercar",
"tool_upload": "Enviar",
"tool_text": "Tèxte",
"tool_shape": "Forma",
"tool_zones": "Zònas",
"tool_canvas": "Canvas",
"search_media": "Cercar de mèdias…",
"type_here": "Picatz aquí",
"text_formats": "Formats",
"format_p": "Paragraph",
"format_bullets": "Lista a piuses",
"format_numbers": "Lista numeratada",
"format_h1": "Títol 1",
"format_h2": "Títol 2",
"format_h3": "Títol 3",
"font_size": "Font Size",
"line_height": "Nnautor de linha",
"tool_align": "Alinhar",
"tool_styles": "Estils",
"tool_bullets": "Bullets",
"tool_numbers": "Nombres",
"color_fill": "Fill",
"color_stroke": "Traçat",
"color_text": "Tèxte",
"tool_type": "Tipe",
"tool_box": "Bóstia",
"tool_link": "Ligam",
"tool_layout": "Agençament",
"tool_options": "Opcions",
"tool_stroke": "Traçat",
"tool_delete": "Suprimir",
"tool_lock": "Verrolhar",
"tool_copy": "Copiar",
"stack": "Pila",
"tool_circle": "Cercle",
"tool_hexagon": "Exagòn",
"tool_square": "Carrat",
"tool_diamond": "Diamond",
"tool_bubble": "Bulla",
"tool_cloud": "Nívol",
"tool_burst": "Burst",
"tool_star": "Star",
"tool_heart": "Còr",
"tool_scribble": "Barbolhatge",
"tool_line": "Linha",
"tool_arrow": "Sageta",
"search_media_placeholder": "Cercar de mèdias web…",
"add_zone": "Zòna novèla",
"palette": "Paleta",
"picker": "Pipeta",
"background_image_caption": "Imatge",
"background_color_caption": "Color",
"upload_background_caption": "Clicar per enviar un imatge de rèireplan",
"upload_background": "Enviar rèireplan",
"access_caption": "Accès",
"versions_caption": "Versions",
"info_caption": "Info",
"mode_private": "Privat : sonque los membres pòdon veire o modificar",
"mode_public": "Public : qual que siá amb lo ligam pòt veire",
"invite_collaborators": "Convidar collaborators",
"revoke_access": "Revocar l’accès",
"invite": "Enviar invitacions",
"invitee_email_address": "Adreça electronica del novèl membre",
"optional_message": "Messatge opcional",
"role_viewer": "Visualizaira",
"role_editor": "Editor",
"role_admin": "Admin",
"new_space_title": "Títol novèl per l’Espaci",
"team": "Equipa",
"search": "Recercar",
"search_no_results": "search_no_results",
"search_clear": "search_clear",
"rename": "Renomenar",
"mobile": "mobil",
"image": "imatge",
"tool_filter": "filtre",
"canel": "canel",
"invite_membership_action": "invite_membership_action",
"viewer": "visualizaira",
"editor": "editor",
"admin": "admin",
"logging_in": "connexion",
"password_confirmation": "Confirmacion del senhla",
"confirm_again": "Mercés de consultar vòstra bóstia de recepcion per confirmar vòstra adreça.",
"confirmed": "Vòstre compte es estat corrèctament confirmat. Mercés.",
"signing_up": "Inscripcion",
"password_check_inbox": "Verificatz vòstra bóstia de recepcion",
"new_space": "Espaci novèl",
"tool_more": "Mai",
"what_is_your_name": "La benvenguda a %s ! Mercés de causir un escais-nom.",
"lang": "en",
"landing_title": "Vòstre tablèu blanc sul Web.",
"landing_claim": "Spacedeck vos permet de facilament combinar quin que siá tipe de mèdias sus un tablèu virtual : tèxte, nòtas, ligams web, amai vidèos e enregistraments àudio. ",
"landing_example": "Lo monde utiliza Spacedeck per organizar lors idèas, en equipa per veire totes los projèctes en una ulhada, a l’escòla e a l’universitat pels mai rics, experiéncia d’aprendissatge connectat.",
"spaces": "Mos espacis",
"access_editor_link": "Ligam de modificacion dirècta",
"access_editor_link_desc": "Donatz aqueste ligam a qualqu’un que deu poder modificar dirèctament aqueste Espaci, cap de compte pas requerit : ",
"access_editor_link_desc_slug": "Aqueste ligam conten lo nom de l’espaci, tanben. ",
"access_anonymous_edit_blocking": "Los convidats pòdon pas modificar los elements qu’an creats.",
"access_current_members": "Membres actuals",
"access_new_members": "Convidar de novèls membres",
"access_no_members": "Los membres d’aqueste Espacii apreissaràn aquí.",
"comments": "comentaris",
"landing_customers": "La fisança de milièr de personas.",
"landing_features_title": "Un jòc d'enfants d’utilizar.",
"landing_features_text": "Le tout nouveau Spacedeck 5 vous permet de travailler bien plus facilement grâce à sa magnifique interface simplifiée.",
"landing_features_1": "Glissez & déposez images, vidéos et audios de votre ordinateur ou du web",
"landing_features_2": "Ecrivez directement sur l'espace et choisissez les polices de caractère, couleurs et styles",
"landing_features_3": "Dessinez, annotez et surlignez grâce aux formes graphiques intégrées",
"landing_features_4": "Transformez votre espace en une présentation dynamique",
"landing_features_5": "Collaborez et discutez en temps réel avec vos collègues, élèves et amis",
"landing_features_6": "Partagez vos espaces sur le web ou par email",
"landing_features_7": "Exportez votre espace en PDF pour l'imprimer",
"landing_pricing": "Incroyablement abordable.",
"landing_pricing_lite": "Usage personnel",
"landing_pricing_lite_text": "La version de base, bien arrondi pour recueillir des images et de garder des notes.",
"landing_pricing_pro_features_list": "<ul><li>Unlimited Spaces</li><li>Exporter PDF, ZIP</li><li>No Watermarks</li><li>Image de fonds</li><li>Activity History</li><li>20 Go de stockage</li><ul>",
"landing_pricing_pro": "€4,90/User/Mo. <br><small> €49,90/User/Year</small>",
"landing_pricing_pro_text": "Avec toute la puissance que vous attendez.",
"landing_pricing_pro_features": "€4,90/User/Mo. <br><small> €49,90/User/Year</small>",
"welcome_subject": "La benvenguda a Spacedeck",
"welcome_body": "Mercés per vòstra inscripcion a Spacedeck.\nEsperam qu’auretz plaser a trabalhar dins los Espacis. <br> Oblidetz pas que vòstre compte conten un nombre illimitat de collaborators. <br> Esitetz pas a partejar vòstres espacis amb los amics e collègas del monde entièr.",
"invite_emails": "Picatz las adreças mails (separadas per de vergulas)",
"history_recently_updated": "Novèlas",
"history_recently_empty": "Pas res",
"parent_folder": "Repertòri parent",
"created_by": "Creat per",
"last_updated": "Darrièra mesa a jorn",
"feedback_sent": "Comentari enviat",
"role_member": "Membre",
"team_invite_membership_action": "Acceptar",
"space_message_subject": "A publicat sus %s",
"space_message_body": "%s a comentat dins %s :\n",
"pro_ad_history_headline": "Aprèp una mesa a nivèl podètz obténer un apercebut de totas las activitats actualas dels espacis aquí.",
"password_reset_subject": "Reïnicializar lo senhal per Spacedeck",
"password_reset_body": "Òu !<br><br>Avètz demandat la reïnicializacion del senhal.<br>Mercés de clicar sul ligam seguent per ne causir un novèl.<br>",
"password_reset_action": "Reïnicializar ara",
"was_offline": "La connexion a Spacedeck es estada copada. S’avètz de trabalh pas enregistratz, gardatz aqueste onglet de navigador dobèrt fins que la connexion siá restablida puèi tocatz de nòu los elements pas enregistrats.",
"subscription_failed_user_subject": "Problèma amb lo pagament Spacedeck",
"subscription_failed_user_body": "Unfortunately, we could not process your Payment-method. You can easly create a new payment method including PayPal in your account settings.",
"subscription_failed_team_subject": "Problem with your Spacedeck Payment",
"subscription_failed_team_body": "Unfortunately, we could not process your Payment-method for your Team-Account. Please fix your payment method asap.",
"team_name": "Nom de l’equipa",
"subdomain": "jos-domeni",
"team_adresses": "Adreças equipa",
"add": "Ajustar",
"invited": "convidat",
"duplicate_destination": "Seleccionatz lo repertòri de destinacion",
"duplicate_confirm": "Duplicar %s dins %s ?",
"duplicate_success": "%s es estat duplicat dins %s.",
"goto_space": "anar a l’espaci",
"goto_folder": "anar al repertòri",
"stay_here": "Demorar aquí",
"sharing": "partatge",
"list": "lista",
"link": "Ligam",
"download_space": "Telecargar espaci",
"type": "Tipe",
"download": "Telecargar",
"Previous Zone": "Zòna precedenta",
"Next Zone": "Zòna seguenta",
"promote": "Promòure",
"demote": "Retrogradar",
"more": "Mai",
"lock": "Verrolhar",
"unlock": "Desverrolhar",
"follow_present": "Seguir",
"mute_present": "Quitar de seguir",
"follow_present_help": "follow_present_help",
"export": "exportar"
}
...@@ -9,19 +9,12 @@ SpacedeckAccount = { ...@@ -9,19 +9,12 @@ SpacedeckAccount = {
account_tab: 'invoices', account_tab: 'invoices',
password_change_error: null, password_change_error: null,
feedback_text: "", feedback_text: "",
importables: [], // spacedeck.com zip import files
}, },
methods: { methods: {
show_account: function() { show_account: function() {
this.activate_dropdown('account'); this.activate_dropdown('account');
}, },
start_zip_import: function(f) {
if (confirm("Your archive will be imported in the background. This can take a few minutes. You can continue using Spacedeck in the meantime.")) {
import_zip(this.user, f);
}
},
account_save_user_digest: function(val) { account_save_user_digest: function(val) {
this.user.prefs_email_digest = val; this.user.prefs_email_digest = val;
this.save_user(function() { this.save_user(function() {
......
...@@ -17,6 +17,21 @@ var SpacedeckRoutes = { ...@@ -17,6 +17,21 @@ var SpacedeckRoutes = {
}.bind(this) }.bind(this)
} }
]); ]);
this.router.add([
{
path: "/s/:hash",
handler: function(params, on_success) {
var parts = params.hash.split("-");
if (path.length > 0) {
this.load_space(parts.slice(1).join("-"), on_success, null, parts[0]);
} else {
// FIXME error handling
on_success();
}
}.bind(this)
}
]);
this.router.add([ this.router.add([
{ {
......
...@@ -63,8 +63,8 @@ var SpacedeckSections = { ...@@ -63,8 +63,8 @@ var SpacedeckSections = {
active_style: { active_style: {
border_radius: 0, border_radius: 0,
stroke: 0, stroke: 0,
font_family: "Avenir W01", font_family: "Inter",
font_size: 18, font_size: 36,
line_height: 1.5, line_height: 1.5,
letter_spacing: 0, letter_spacing: 0,
...@@ -110,18 +110,30 @@ var SpacedeckSections = { ...@@ -110,18 +110,30 @@ var SpacedeckSections = {
color_picker_opacity: 255, color_picker_opacity: 255,
swatches: [ swatches: [
{id:0, hex:"#4a2f7e"}, {id:1, hex:"#ff00ff"},
{id:1, hex:"#9b59b6"}, {id:2, hex:"#ffff00"},
{id:2, hex:"#3498db"}, {id:3, hex:"#00ffff"},
{id:3, hex:"#2ecc71"}, {id:5, hex:"#ff0000"},
{id:4, hex:"#f1c40f"}, {id:6, hex:"#00ff00"},
{id:5, hex:"#e67e22"}, {id:7, hex:"#0000ff"},
{id:6, hex:"#d55c4b"}, {id:8, hex:"#000000"},
{id:7, hex:"#6f4021"}, {id:9, hex:"#222222"},
{id:8, hex:"#ffffff"}, {id:10, hex:"#444444"},
{id:9, hex:"#95a5a6"}, {id:11, hex:"#888888"},
{id:10, hex:"#252525"}, {id:12, hex:"#bbbbbb"},
{id:11, hex:"rgba(0,0,0,0)"}, {id:13, hex:"#dddddd"},
{id:14, hex:"#ffffff"},
{id:20, hex:"#4a2f7e"},
{id:21, hex:"#9b59b6"},
{id:22, hex:"#3498db"},
{id:23, hex:"#2ecc71"},
{id:24, hex:"#f1c40f"},
{id:25, hex:"#e67e22"},
{id:26, hex:"#d55c4b"},
{id:27, hex:"#6f4021"},
{id:29, hex:"#95a5a6"},
{id:30, hex:"rgba(0,0,0,0)"},
], ],
swatches_text: [ swatches_text: [
...@@ -136,18 +148,8 @@ var SpacedeckSections = { ...@@ -136,18 +148,8 @@ var SpacedeckSections = {
], ],
fonts: [ fonts: [
"Arial", "Inter",
"Courier", "Courier"
"Georgia",
"Verdana",
"Comic Sans MS",
"Montserrat",
"Lato",
"Roboto",
"Crimson Text",
"EB Garamond",
"Vollkorn",
"Avenir W01"
], ],
detected_text_formats: {}, detected_text_formats: {},
...@@ -180,7 +182,7 @@ var SpacedeckSections = { ...@@ -180,7 +182,7 @@ var SpacedeckSections = {
toolbar_props_in: false, toolbar_props_in: false,
toolbar_artifacts_x: "-1000px", toolbar_artifacts_x: "-1000px",
toolbar_artifacts_y: "-1000px", toolbar_artifacts_y: "-1000px",
toolbar_artifacts_in: false toolbar_artifacts_in: true
}, },
methods: { methods: {
...@@ -403,7 +405,12 @@ var SpacedeckSections = { ...@@ -403,7 +405,12 @@ var SpacedeckSections = {
} }
if (space.space_type == "folder") return ""; if (space.space_type == "folder") return "";
return "background-image:url('/api/spaces/"+space._id+"/png')"; var query_string = "";
if (space_auth) {
query_string+="?spaceAuth="+space.edit_hash;
}
return "background-image:url('/api/spaces/"+space._id+"/png"+query_string+"')";
}, },
reset_artifact_filters: function() { reset_artifact_filters: function() {
...@@ -790,7 +797,6 @@ var SpacedeckSections = { ...@@ -790,7 +797,6 @@ var SpacedeckSections = {
}, },
handle_user_cursor_update: function(msg) { handle_user_cursor_update: function(msg) {
// console.log("handle cursor", msg);
var now = new Date().getTime(); var now = new Date().getTime();
msg.t = now; msg.t = now;
var existing = false; var existing = false;
...@@ -802,7 +808,6 @@ var SpacedeckSections = { ...@@ -802,7 +808,6 @@ var SpacedeckSections = {
u.y = msg.y; u.y = msg.y;
u.t = now; u.t = now;
u.name = msg.name; u.name = msg.name;
// console.log("updated cursor "+i);
existing = true; existing = true;
} else { } else {
// hide if no updates since 2sec // hide if no updates since 2sec
...@@ -1057,7 +1062,7 @@ var SpacedeckSections = { ...@@ -1057,7 +1062,7 @@ var SpacedeckSections = {
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();
} }
this.selection_metrics.x1 = sr.x1; this.selection_metrics.x1 = sr.x1;
...@@ -1125,9 +1130,12 @@ var SpacedeckSections = { ...@@ -1125,9 +1130,12 @@ var SpacedeckSections = {
var er = this.enclosing_rect(this.active_space_artifacts); var er = this.enclosing_rect(this.active_space_artifacts);
if (!er) return; if (!er) return;
this.active_space.width =Math.max(er.x2+100, window.innerWidth); // resize space
this.active_space.height=Math.max(er.y2+100, window.innerHeight); this.active_space.width =Math.max((parseInt(er.x2/window.innerWidth)+2)*window.innerWidth, window.innerWidth);
this.active_space.height=Math.max((parseInt(er.y2/window.innerHeight)+2)*window.innerHeight, window.innerHeight);
console.log("bounds: ",this.active_space.width,this.active_space.height);
if (this._last_bounds_width != this.active_space.width || if (this._last_bounds_width != this.active_space.width ||
this._last_bounds_height != this.active_space.height) { this._last_bounds_height != this.active_space.height) {
this._last_bounds_width = this.active_space.width; this._last_bounds_width = this.active_space.width;
...@@ -1544,7 +1552,7 @@ var SpacedeckSections = { ...@@ -1544,7 +1552,7 @@ var SpacedeckSections = {
add_artifact: function (space, item_type, url, evt) { add_artifact: function (space, item_type, url, evt) {
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?");
...@@ -1724,7 +1732,7 @@ var SpacedeckSections = { ...@@ -1724,7 +1732,7 @@ var SpacedeckSections = {
var a = { var a = {
space_id: this.active_space._id, space_id: this.active_space._id,
mime: "x-spacedeck/shape", mime: "x-spacedeck/shape",
description: "Text", description: "",
x: point.x, x: point.x,
y: point.y, y: point.y,
z: point.z, z: point.z,
...@@ -1736,7 +1744,7 @@ var SpacedeckSections = { ...@@ -1736,7 +1744,7 @@ var SpacedeckSections = {
fill_color: "#000000", fill_color: "#000000",
shape: shape_type, shape: shape_type,
valign: "middle", valign: "middle",
align: "center" align: "center",
}; };
if (this.guest_nickname) { if (this.guest_nickname) {
...@@ -1788,9 +1796,7 @@ var SpacedeckSections = { ...@@ -1788,9 +1796,7 @@ var SpacedeckSections = {
if (this.active_space_role=="viewer") { if (this.active_space_role=="viewer") {
return false; return false;
} }
this.hide_toolbar_artifacts();
// 1. create placeholder artifact // 1. create placeholder artifact
var w=300,h=150; var w=300,h=150;
var fill="transparent"; var fill="transparent";
...@@ -2293,11 +2299,6 @@ var SpacedeckSections = { ...@@ -2293,11 +2299,6 @@ var SpacedeckSections = {
if (!pastedText) return; if (!pastedText) return;
if (!pastedText.match(/<[a-zA-Z]+>/g)) {
// crappy heuristic if this is actually HTML
pastedText = pastedText.replace(/\n/g,"<br>");
}
this.insert_embedded_artifact(pastedText); this.insert_embedded_artifact(pastedText);
}, },
...@@ -2344,32 +2345,6 @@ var SpacedeckSections = { ...@@ -2344,32 +2345,6 @@ var SpacedeckSections = {
this.create_artifact_via_embed_url(text); this.create_artifact_via_embed_url(text);
return; return;
} }
var new_item = {
mime: "text/html",
description: text.replace("\n", "<br />"),
title: "",
space_id: space._id
};
var w = 400;
var h = 300;
var point = this.find_place_for_item(w,h);
new_item.x = point.x;
new_item.y = point.y;
new_item.w = w;
new_item.h = h;
new_item.z = point.z;
if (this.guest_nickname) {
new_item.editor_name = this.guest_nickname;
}
save_artifact(new_item, function(saved_item) {
this.update_board_artifact_viewmodel(saved_item);
this.active_space_artifacts.push(saved_item);
}.bind(this));
}, },
create_artifact_via_embed_url: function(url) { create_artifact_via_embed_url: function(url) {
...@@ -2528,18 +2503,9 @@ var SpacedeckSections = { ...@@ -2528,18 +2503,9 @@ var SpacedeckSections = {
this.opened_dialog = "none"; this.opened_dialog = "none";
if (files && files.length) { if (files && files.length) {
console.log("file: ",files[0]);
for (var i=0; i<files.length; i++) { for (var i=0; i<files.length; i++) {
var file = files[i]; var file = files[i];
if (file.type === "application/pdf") { this.create_artifact_via_upload(null, file, true);
var point = {x: 100, y: 100}; //fixme, center upload?
this.dropped_point = point;
this.pending_pdf_file = file;
this.activate_modal('pdfoptions');
} else {
this.create_artifact_via_upload(null, file, true);
}
} }
} }
}, },
...@@ -2578,12 +2544,11 @@ var SpacedeckSections = { ...@@ -2578,12 +2544,11 @@ var SpacedeckSections = {
}, },
hide_toolbar_props: function() { hide_toolbar_props: function() {
this.toolbar_props_in = false; // FIXME test
//this.toolbar_props_in = false;
}, },
show_toolbar_artifacts: function(x,y) { show_toolbar_artifacts: function(x,y) {
this.toolbar_artifacts_x = (x-175)+"px";
this.toolbar_artifacts_y = y+"px";
this.toolbar_artifacts_in = true; this.toolbar_artifacts_in = true;
}, },
...@@ -2593,29 +2558,23 @@ var SpacedeckSections = { ...@@ -2593,29 +2558,23 @@ var SpacedeckSections = {
start_adding_artifact: function(evt) { start_adding_artifact: function(evt) {
evt = fixup_touches(evt); evt = fixup_touches(evt);
// toggle
if (this.toolbar_artifacts_in) {
this.hide_toolbar_artifacts();
return;
}
this.show_toolbar_artifacts(evt.pageX,evt.pageY);
}, },
start_drawing_scribble: function(evt) { start_drawing_scribble: function(evt) {
this.hide_toolbar_artifacts(); if (this.active_tool == "scribble") {
this.active_tool = "scribble"; this.active_tool = "pointer";
} else {
this.active_tool = "scribble";
}
this.opened_dialog = "none"; this.opened_dialog = "none";
}, },
start_drawing_arrow: function(evt) { start_drawing_arrow: function(evt) {
this.hide_toolbar_artifacts();
this.active_tool = "arrow"; this.active_tool = "arrow";
this.opened_dialog = "none"; this.opened_dialog = "none";
}, },
start_drawing_line: function(evt) { start_drawing_line: function(evt) {
this.hide_toolbar_artifacts();
this.active_tool = "line"; this.active_tool = "line";
this.opened_dialog = "none"; this.opened_dialog = "none";
}, },
...@@ -2894,32 +2853,6 @@ var SpacedeckSections = { ...@@ -2894,32 +2853,6 @@ var SpacedeckSections = {
}.bind(this),500); }.bind(this),500);
}, },
approve_pdf_upload: function(evt,approve_pdf_upload, mode){
this.close_modal();
if(mode == "classic"){
this.create_artifact_via_upload(evt, this.pending_pdf_file, false);
}
if(mode == "grid") {
this.global_spinner = true;
save_pdf_file(this.active_space, this.dropped_point, this.pending_pdf_file, approve_pdf_upload, function(createdArtifacts){
this.global_spinner = false;
_.each(createdArtifacts, function(new_artifact){
this.update_board_artifact_viewmodel(new_artifact);
this.active_space_artifacts.push(new_artifact)
}.bind(this));
}.bind(this), function(xhr) {
this.global_spinner = false;
alert("Error PDF ("+xhr.status+")");
}.bind(this));
}
},
handle_data_drop: function(evt) { handle_data_drop: function(evt) {
if (this.active_space_role=="viewer") { if (this.active_space_role=="viewer") {
return false; return false;
...@@ -2932,17 +2865,8 @@ var SpacedeckSections = { ...@@ -2932,17 +2865,8 @@ var SpacedeckSections = {
if (files && files.length) { if (files && files.length) {
for (var i=0; i<files.length; i++) { for (var i=0; i<files.length; i++) {
var file = files[i]; var file = files[i];
if (file.type === "application/pdf") { this.create_artifact_via_upload(evt, file, (files.length>1));
var point = this.cursor_point_to_space(evt);
this.dropped_point = point;
this.pending_pdf_file = file;
this.activate_modal('pdfoptions');
} else {
this.create_artifact_via_upload(evt, file, (files.length>1));
}
} }
} else { } else {
var json = evt.dataTransfer.getData('application/json'); var json = evt.dataTransfer.getData('application/json');
......
...@@ -18,8 +18,6 @@ var SpacedeckSpaces = { ...@@ -18,8 +18,6 @@ var SpacedeckSpaces = {
active_space_path: [], active_space_path: [],
access_settings_space: null, access_settings_space: null,
access_settings_memberships: [], access_settings_memberships: [],
duplicate_folders: [],
duplicate_folder_id: "",
pending_pdf_files: [], pending_pdf_files: [],
meta_visible: false, meta_visible: false,
...@@ -101,36 +99,19 @@ var SpacedeckSpaces = { ...@@ -101,36 +99,19 @@ var SpacedeckSpaces = {
}.bind(this), {value: dft || "Guest "+parseInt(10000*Math.random()), ok: __("ok"), cancel: __("cancel")}); }.bind(this), {value: dft || "Guest "+parseInt(10000*Math.random()), ok: __("ok"), cancel: __("cancel")});
}, },
load_space: function(space_id, on_success, on_error) { load_space: function(space_id, on_success, on_error, space_auth) {
console.log("load space: ", space_id);
this.folder_spaces_filter=""; this.folder_spaces_filter="";
this.folder_spaces_search=""; this.folder_spaces_search="";
space_auth = get_query_param("spaceAuth"); if (space_auth) {
set_space_auth(space_auth);
} else {
set_space_auth(get_query_param("spaceAuth"));
}
this.embedded = !!(get_query_param("embedded"));
var userReady = function() { var userReady = function() {
if (get_query_param("embedded")) {
this.embedded = true;
this.guest_signup_enabled = true;
if (get_query_param("publish_cta")) {
this.publish_cta = get_query_param("publish_cta");
}
if (get_query_param("nosocial")) {
this.social_bar = false;
}
}
if (get_query_param("confirm") && this.logged_in) {
var token = get_query_param("confirm");
confirm_user(this.user, token, function() {
this.redirect_to("/spaces/"+space_id+"?show_access=1");
}.bind(this), function() {
alert("An error occured confirming your email with the given token.");
});
return;
}
this.close_dropdown(); this.close_dropdown();
this.active_space_loaded = false; this.active_space_loaded = false;
...@@ -158,9 +139,7 @@ var SpacedeckSpaces = { ...@@ -158,9 +139,7 @@ var SpacedeckSpaces = {
load_space(space_id, function(space, role) { load_space(space_id, function(space, role) {
document.title = space.name; document.title = space.name;
this.active_space_role = role || "viewer"; //via req header from backend this.active_space_role = role || "viewer"; // via req header from backend
this.space_embed_html = "<iframe width=\"1024\" height=\"768\" seamless src=\""+ENV.webEndpoint+"/spaces/"+space._id+"?embedded=1\"></iframe>";
if (!is_home) { if (!is_home) {
load_members(space, function(members) { load_members(space, function(members) {
...@@ -273,9 +252,9 @@ var SpacedeckSpaces = { ...@@ -273,9 +252,9 @@ var SpacedeckSpaces = {
this.discover_zones(); this.discover_zones();
//window.setTimeout(function() { window.setTimeout(function() {
// this.zoom_to_fit(); this.zoom_to_fit();
//}.bind(this),10); }.bind(this),10);
if (on_success) { if (on_success) {
on_success(); on_success();
...@@ -301,15 +280,6 @@ var SpacedeckSpaces = { ...@@ -301,15 +280,6 @@ var SpacedeckSpaces = {
// FIXME // FIXME
this.active_join_link = ""; this.active_join_link = "";
this.join_link_role = "viewer"; this.join_link_role = "viewer";
// FIXME
if (this.active_space_role == "admin") {
this.space_info_section="access";
} else if (this.active_space_role == "editor") {
//this.space_info_section="versions";
} else {
this.space_info_section="info";
}
} }
}.bind(this), function(xhr) { }.bind(this), function(xhr) {
...@@ -338,7 +308,7 @@ var SpacedeckSpaces = { ...@@ -338,7 +308,7 @@ var SpacedeckSpaces = {
userReady(); userReady();
} }
if (space_auth) { if (!this.user && space_auth) {
if (this.guest_nickname) { if (this.guest_nickname) {
userReady(); userReady();
} else { } else {
...@@ -673,47 +643,6 @@ var SpacedeckSpaces = { ...@@ -673,47 +643,6 @@ var SpacedeckSpaces = {
location.href = "/api/spaces/" + space._id + "/list"; location.href = "/api/spaces/" + space._id + "/list";
}, },
duplicate_space_into_folder: function() {
load_writable_folders( function(folders){
this.duplicate_folders = _.sortBy(folders, function (folder) { return folder.name; });
}.bind(this), function(xhr) {
console.error(xhr);
});
},
duplicate_folder_confirm: function() {
var folderId = this.duplicate_folder_id;
var idx = _.findIndex(this.duplicate_folders, function(s) { return s._id == folderId;});
if (idx<0) idx = 0;
var folder = this.duplicate_folders[idx];
console.log("df f",folder);
if (!folder) return;
duplicate_space(this.active_space, folder._id, function(new_space) {
this.duplicate_folders = [];
this.duplicate_folder = null;
smoke.quiz(__("duplicate_success", this.active_space.name, folder.name), function(e, test){
if (e == __("goto_space", new_space.name)){
this.redirect_to("/spaces/" + new_space._id);
}else if (e == __("goto_folder", folder.name)){
this.redirect_to("/folders/" + folder._id);
}
}.bind(this), {
button_1: __("goto_space", new_space.name),
button_2: __("goto_folder", folder.name),
button_cancel:__("stay_here")
});
}.bind(this), function(xhr){
console.error(xhr);
smoke.prompt("error: " + xhr.statusText);
}.bind(this));
},
toggle_follow_mode: function() { toggle_follow_mode: function() {
this.deselect(); this.deselect();
this.follow_mode = !this.follow_mode; this.follow_mode = !this.follow_mode;
...@@ -724,6 +653,13 @@ var SpacedeckSpaces = { ...@@ -724,6 +653,13 @@ var SpacedeckSpaces = {
this.present_mode = !this.present_mode; this.present_mode = !this.present_mode;
if (this.present_mode) { if (this.present_mode) {
//this.go_to_first_zone(); //this.go_to_first_zone();
if (this.embedded) {
document.documentElement.requestFullscreen();
}
} else {
if (this.embedded) {
document.exitFullscreen();
}
} }
}, },
...@@ -819,9 +755,12 @@ var SpacedeckSpaces = { ...@@ -819,9 +755,12 @@ var SpacedeckSpaces = {
this.invite_message = ""; this.invite_message = "";
} }
}.bind(this), function(xhr){ }.bind(this), function(xhr){
try {
text = JSON.stringify(xhr.responseText); var res = JSON.parse(xhr.response);
smoke.alert("Error: "+text); alert("Error: "+res.error);
} catch (e) {
console.error(e, xhr);
}
}.bind(this)); }.bind(this));
}.bind(this)); }.bind(this));
}, },
...@@ -829,9 +768,13 @@ var SpacedeckSpaces = { ...@@ -829,9 +768,13 @@ var SpacedeckSpaces = {
update_member: function(space, m, role) { update_member: function(space, m, role) {
m.role = role; m.role = role;
save_membership(space, m, function() { save_membership(space, m, function() {
console.log("saved")
}.bind(this), function(xhr) { }.bind(this), function(xhr) {
console.error(xhr); try {
var res = JSON.parse(xhr.response);
alert("Error: "+res.error);
} catch (e) {
console.error(e, xhr);
}
}.bind(this)); }.bind(this));
}, },
...@@ -840,7 +783,12 @@ var SpacedeckSpaces = { ...@@ -840,7 +783,12 @@ var SpacedeckSpaces = {
delete_membership(space, m, function() { delete_membership(space, m, function() {
this.access_settings_memberships.splice(this.access_settings_memberships.indexOf(m), 1); this.access_settings_memberships.splice(this.access_settings_memberships.indexOf(m), 1);
}.bind(this), function(xhr) { }.bind(this), function(xhr) {
console.error(xhr); try {
var res = JSON.parse(xhr.response);
alert("Error: "+res.error);
} catch (e) {
console.error(e, xhr);
}
}.bind(this)); }.bind(this));
}, },
...@@ -876,10 +824,6 @@ var SpacedeckSpaces = { ...@@ -876,10 +824,6 @@ var SpacedeckSpaces = {
}.bind(this)); }.bind(this));
}, },
emojified_comment: function(comment) {
return twemoji.parse(comment);
},
set_folder_sorting: function(key,reverse) { set_folder_sorting: function(key,reverse) {
this.folder_sorting = key; this.folder_sorting = key;
this.folder_reverse = reverse?-1:1; this.folder_reverse = reverse?-1:1;
......
...@@ -11,12 +11,12 @@ SpacedeckUsers = { ...@@ -11,12 +11,12 @@ SpacedeckUsers = {
login_email: "", login_email: "",
login_password: "", login_password: "",
signup_password: "", signup_password: "",
signup_invite_code: "",
signup_password_confirmation: "", signup_password_confirmation: "",
account_remove_error: null, account_remove_error: null,
loading_user: false, loading_user: false,
password_reset_confirm_error: "", password_reset_confirm_error: "",
password_reset_error: "", password_reset_error: "",
}, },
methods:{ methods:{
load_user: function(on_success, on_error) { load_user: function(on_success, on_error) {
...@@ -30,12 +30,6 @@ SpacedeckUsers = { ...@@ -30,12 +30,6 @@ SpacedeckUsers = {
if (on_success) { if (on_success) {
on_success(user); on_success(user);
} }
// see spacedeck_account.js
load_importables(this.user, function(files) {
this.importables = files;
}.bind(this));
}.bind(this), function() { }.bind(this), function() {
// error // error
this.loading_user = false; this.loading_user = false;
...@@ -122,7 +116,7 @@ SpacedeckUsers = { ...@@ -122,7 +116,7 @@ SpacedeckUsers = {
signup_guest: function(on_success) { signup_guest: function(on_success) {
}, },
signup_submit: function($event, name, email, password, password_confirmation, on_success) { signup_submit: function($event, name, email, password, password_confirmation, invite_code, on_success) {
this.creating_user = true; this.creating_user = true;
this.signup_error = null; this.signup_error = null;
...@@ -136,7 +130,7 @@ SpacedeckUsers = { ...@@ -136,7 +130,7 @@ SpacedeckUsers = {
$event.stopPropagation(); $event.stopPropagation();
} }
create_user(name, email, password, password_confirmation, function(session) { create_user(name, email, password, password_confirmation, invite_code, function(session) {
this.creating_user = false; this.creating_user = false;
this.login_submit(email, password, null, on_success); this.login_submit(email, password, null, on_success);
}.bind(this), function(req) { }.bind(this), function(req) {
...@@ -152,8 +146,8 @@ SpacedeckUsers = { ...@@ -152,8 +146,8 @@ SpacedeckUsers = {
}.bind(this)); }.bind(this));
}, },
signup_submit_modal: function($event, name, email, password, password_confirmation) { signup_submit_modal: function($event, name, email, password, password_confirmation, invite_code) {
this.signup_submit($event, name, email, password, password_confirmation, function() { this.signup_submit($event, name, email, password, password_confirmation, invite_code, function() {
alert("Success."); alert("Success.");
location.reload(); location.reload();
}); });
...@@ -201,27 +195,29 @@ SpacedeckUsers = { ...@@ -201,27 +195,29 @@ SpacedeckUsers = {
this.password_reset_confirm_error = null; this.password_reset_confirm_error = null;
this.password_reset_send = false; this.password_reset_send = false;
if(password != password_confirmation) { if (password != password_confirmation) {
this.password_reset_confirm_error = "Passwords do not match."; this.password_reset_confirm_error = "Passwords do not match.";
return; return;
} }
if(password.length < 5) { if (password.length < 5) {
this.password_reset_confirm_error = "Password too short (must have at least 5 characters)."; this.password_reset_confirm_error = "Password too short (must have at least 5 characters).";
return; return;
} }
confirm_password_reset(password, this.reset_token, function(parsed,req) { confirm_password_reset(password, this.reset_token, function(parsed,req) {
if(req.status==201){ if (req.status==201) {
alert("New password set successfully.");
this.active_view = "login"; this.active_view = "login";
} else {
alert("An unknown error occured.");
} }
}.bind(this), function(req) { }.bind(this), function(req) {
if (req.status==404) { if (req.status==404) {
var msg = "user not found"; alert("Error: Unknown user.");
} else { } else {
var msg = "error: " + req.statusText; alert("Error: "+req.statusText);
} }
this.password_reset_confirm_error = msg;
}.bind(this)); }.bind(this));
}, },
......
...@@ -14,6 +14,7 @@ function boot_spacedeck() { ...@@ -14,6 +14,7 @@ function boot_spacedeck() {
account: "profile", account: "profile",
logged_in: false, logged_in: false,
guest_nickname: null, guest_nickname: null,
embedded: false,
user: {}, user: {},
active_profile: null, active_profile: null,
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
*/ */
function setup_whiteboard_directives() { function setup_whiteboard_directives() {
var mode_touch = false;
if ('ontouchstart' in window) { if ('ontouchstart' in window) {
mode_touch = true;
var edown = "touchstart"; var edown = "touchstart";
var emove = "touchmove"; var emove = "touchmove";
var eup = "touchend"; var eup = "touchend";
...@@ -15,6 +18,12 @@ function setup_whiteboard_directives() { ...@@ -15,6 +18,12 @@ function setup_whiteboard_directives() {
var eup = "mouseup"; var eup = "mouseup";
} }
// detect first touch event
window.addEventListener('touchstart', function on_first_touch() {
mode_touch = true;
window.removeEventListener('touchstart', on_first_touch, false);
}, false);
Vue.directive('sd-whiteboard', { Vue.directive('sd-whiteboard', {
bind: function () { bind: function () {
var el = this.el; var el = this.el;
...@@ -23,9 +32,12 @@ function setup_whiteboard_directives() { ...@@ -23,9 +32,12 @@ function setup_whiteboard_directives() {
$(el).on("dblclick", ".artifact", this.handle_double_click_artifact.bind(this)); $(el).on("dblclick", ".artifact", this.handle_double_click_artifact.bind(this));
$(el).on("keyup", ".artifact", this.handle_key_up_artifact.bind(this)); $(el).on("keyup", ".artifact", this.handle_key_up_artifact.bind(this));
$(el).on("keydown", ".artifact", this.handle_key_down_artifact.bind(this)); $(el).on("keydown", ".artifact", this.handle_key_down_artifact.bind(this));
$(el).bind(edown, this.handle_mouse_down_space.bind(this)); $(el).bind("touchstart", this.handle_mouse_down_space.bind(this));
$(el).bind(emove, this.handle_mouse_move.bind(this)); $(el).bind("touchmove", this.handle_mouse_move.bind(this));
$(el).bind(eup, this.handle_mouse_up_space.bind(this)); $(el).bind("touchend", this.handle_mouse_up_space.bind(this));
$(el).bind("mousedown", this.handle_mouse_down_space.bind(this));
$(el).bind("mousemove", this.handle_mouse_move.bind(this));
$(el).bind("mouseup", this.handle_mouse_up_space.bind(this));
$(el).bind("wheel", this.handle_wheel_space.bind(this)); $(el).bind("wheel", this.handle_wheel_space.bind(this));
...@@ -80,10 +92,16 @@ function setup_whiteboard_directives() { ...@@ -80,10 +92,16 @@ function setup_whiteboard_directives() {
evt.stopPropagation(); evt.stopPropagation();
} }
var a = $scope.find_artifact_by_id(evt.currentTarget.id.replace("artifact-",""));
if ($scope.active_tool == "zoom") return; if ($scope.active_tool == "zoom") return;
if (evt.which == 2) {
// middle mouse button
this.handle_mouse_down_space(evt);
return;
}
var a = $scope.find_artifact_by_id(evt.currentTarget.id.replace("artifact-",""));
if ($scope.active_tool == "eyedrop") { if ($scope.active_tool == "eyedrop") {
var arts = $scope.selected_artifacts(); var arts = $scope.selected_artifacts();
if (!$scope.is_selected(a) && arts.length > 0) { if (!$scope.is_selected(a) && arts.length > 0) {
...@@ -196,8 +214,10 @@ function setup_whiteboard_directives() { ...@@ -196,8 +214,10 @@ function setup_whiteboard_directives() {
}, },
handle_mouse_down_space: function(evt) { handle_mouse_down_space: function(evt) {
if (evt.target != evt.currentTarget && !_.include(["wrapper"],evt.target.className)) return; if (evt.which != 2) {
if (evt.target != evt.currentTarget && !_.include(["wrapper"],evt.target.className)) return;
}
var $scope = this.vm.$root; var $scope = this.vm.$root;
$scope.opened_dialog="none"; $scope.opened_dialog="none";
...@@ -206,7 +226,7 @@ function setup_whiteboard_directives() { ...@@ -206,7 +226,7 @@ function setup_whiteboard_directives() {
$scope.mouse_ox = cursor.x; $scope.mouse_ox = cursor.x;
$scope.mouse_oy = cursor.y; $scope.mouse_oy = cursor.y;
if (evt.which == 2 || evt.buttons == 4) { if ((mode_touch && $scope.active_tool=="pointer") || evt.which == 2 || evt.buttons == 4) {
$scope.active_tool = "pan"; $scope.active_tool = "pan";
} }
...@@ -214,7 +234,7 @@ function setup_whiteboard_directives() { ...@@ -214,7 +234,7 @@ function setup_whiteboard_directives() {
this.deselect(); this.deselect();
this.mouse_state = "transform"; this.mouse_state = "transform";
$scope.mouse_state = this.mouse_state; $scope.mouse_state = this.mouse_state;
this.start_adding_note(evt); this.start_drawing_note(evt);
return; return;
} else if ($scope.active_tool=="arrow") { } else if ($scope.active_tool=="arrow") {
...@@ -354,12 +374,10 @@ function setup_whiteboard_directives() { ...@@ -354,12 +374,10 @@ function setup_whiteboard_directives() {
var lasso_scaled = { var lasso_scaled = {
x:this.lasso.x, x:this.lasso.x,
y:this.lasso.y, y:this.lasso.y,
w:this.lasso.w*$scope.viewport_zoom, w:this.lasso.w,
h:this.lasso.h*$scope.viewport_zoom h:this.lasso.h
} }
lasso_scaled = this.abs_rect(lasso_scaled); lasso_scaled = this.abs_rect(lasso_scaled);
lasso_scaled.x += $scope.bounds_margin_horiz;
lasso_scaled.y += $scope.bounds_margin_vert;
var s = "left:" +lasso_scaled.x+"px;"; var s = "left:" +lasso_scaled.x+"px;";
s += "top:" +lasso_scaled.y+"px;"; s += "top:" +lasso_scaled.y+"px;";
...@@ -379,15 +397,15 @@ function setup_whiteboard_directives() { ...@@ -379,15 +397,15 @@ function setup_whiteboard_directives() {
$("#lasso").show(); $("#lasso").show();
}, },
// Translate the mouse cursor location from device window coordinates to virtual space coordinates
cursor_point_to_space: function(evt) { cursor_point_to_space: function(evt) {
var $scope = this.vm.$root; var $scope = this.vm.$root;
var offset = {left: 0, top: 0};
evt = fixup_touches(evt); evt = fixup_touches(evt);
return { return {
x: (parseInt(evt.pageX) - parseInt(offset.left) - $scope.bounds_margin_horiz) / this.space_zoom, x: $scope.scroll_left + (parseInt(evt.pageX) - $scope.bounds_margin_horiz) / $scope.viewport_zoom,
y: (parseInt(evt.pageY) - parseInt(offset.top) - $scope.bounds_margin_vert) / this.space_zoom y: $scope.scroll_top + (parseInt(evt.pageY) - $scope.bounds_margin_vert) / $scope.viewport_zoom
}; };
}, },
...@@ -492,6 +510,7 @@ function setup_whiteboard_directives() { ...@@ -492,6 +510,7 @@ function setup_whiteboard_directives() {
if (!xdists[0] || xdists[0][0]>TOL) { if (!xdists[0] || xdists[0][0]>TOL) {
results.snapx = [0,x]; // distance, coordinate results.snapx = [0,x]; // distance, coordinate
} else { } else {
// FIXME snap rulers are broken
//$scope.snap_ruler_x = xdists[0][1]; //$scope.snap_ruler_x = xdists[0][1];
} }
if (!ydists[0] || ydists[0][0]>TOL) { if (!ydists[0] || ydists[0][0]>TOL) {
...@@ -503,17 +522,38 @@ function setup_whiteboard_directives() { ...@@ -503,17 +522,38 @@ function setup_whiteboard_directives() {
return results; return results;
}, },
offset_point_in_wrapper: function(point) { start_drawing_note: function(evt) {
var $scope = this.vm.$root; evt.preventDefault();
var section_el = $(this.el)[0]; evt.stopPropagation();
var z = $scope.viewport_zoom;
var pt = parseInt($("#space").css("padding-top")); var $scope = this.vm.$root;
var point = this.cursor_point_to_space(evt);
var z = $scope.highest_z()+1;
point.y=(point.y+section_el.scrollTop-pt)/z; var a = {
point.x=(point.x+section_el.scrollLeft)/z; space_id: $scope.active_space._id,
mime: "text/html",
description: "<p>Text</p>",
x: point.x,
y: point.y,
z: z,
w: 64,
h: 64,
align: "center",
valign: "middle",
stroke_color: "#000000",
fill_color: "rgb(241, 196, 15)",
stroke: 0
};
return point; $scope.save_artifact(a, function(saved_a) {
$scope.update_board_artifact_viewmodel(saved_a);
$scope.active_space_artifacts.push(saved_a);
$scope.select(evt,a);
$scope.transform_ox = 0;
$scope.transform_oy = 0;
$scope.begin_transaction();
}.bind(this));
}, },
start_drawing_scribble: function(evt) { start_drawing_scribble: function(evt) {
...@@ -521,7 +561,7 @@ function setup_whiteboard_directives() { ...@@ -521,7 +561,7 @@ function setup_whiteboard_directives() {
evt.stopPropagation(); evt.stopPropagation();
var $scope = this.vm.$root; var $scope = this.vm.$root;
var point = this.offset_point_in_wrapper(this.cursor_point_to_space(evt)); var point = this.cursor_point_to_space(evt);
var z = $scope.highest_z()+1; var z = $scope.highest_z()+1;
$scope.deselect(); $scope.deselect();
...@@ -536,7 +576,8 @@ function setup_whiteboard_directives() { ...@@ -536,7 +576,8 @@ function setup_whiteboard_directives() {
z: z, z: z,
w: 64, w: 64,
h: 64, h: 64,
stroke_color: "#000000", // Set the color to the last selected color, fallback to black if no color was selected
stroke_color: "#" + $scope.color_picker_rgb || "#000000",
stroke: 2, stroke: 2,
shape: "scribble" shape: "scribble"
}; };
...@@ -560,7 +601,6 @@ function setup_whiteboard_directives() { ...@@ -560,7 +601,6 @@ function setup_whiteboard_directives() {
var $scope = this.vm.$root; var $scope = this.vm.$root;
var point = this.cursor_point_to_space(evt); var point = this.cursor_point_to_space(evt);
this.offset_point_in_wrapper(point);
var z = $scope.highest_z()+1; var z = $scope.highest_z()+1;
var a = { var a = {
...@@ -573,7 +613,8 @@ function setup_whiteboard_directives() { ...@@ -573,7 +613,8 @@ function setup_whiteboard_directives() {
z: z, z: z,
w: 64, w: 64,
h: 64, h: 64,
stroke_color: "#000000", // Set the color to the last selected color, fallback to black if no color was selected
stroke_color: "#" + $scope.color_picker_rgb || "#000000",
stroke: 2, stroke: 2,
shape: "arrow" shape: "arrow"
}; };
...@@ -596,7 +637,6 @@ function setup_whiteboard_directives() { ...@@ -596,7 +637,6 @@ function setup_whiteboard_directives() {
var $scope = this.vm.$root; var $scope = this.vm.$root;
var point = this.cursor_point_to_space(evt); var point = this.cursor_point_to_space(evt);
this.offset_point_in_wrapper(point);
var z = $scope.highest_z()+1; var z = $scope.highest_z()+1;
var a = { var a = {
...@@ -639,8 +679,7 @@ function setup_whiteboard_directives() { ...@@ -639,8 +679,7 @@ function setup_whiteboard_directives() {
evt.preventDefault(); evt.preventDefault();
if (this.mouse_state == "lasso") { if (this.mouse_state == "lasso") {
var lasso_rect = this.abs_rect(this.offset_point_in_wrapper(this.lasso)); var lasso_rect = this.abs_rect(this.lasso);
// convert to space coordinates
if (lasso_rect.w>0 && lasso_rect.h>0) { if (lasso_rect.w>0 && lasso_rect.h>0) {
var arts = this.artifacts_in_rect(lasso_rect); var arts = this.artifacts_in_rect(lasso_rect);
...@@ -679,7 +718,7 @@ function setup_whiteboard_directives() { ...@@ -679,7 +718,7 @@ function setup_whiteboard_directives() {
return; return;
} }
if (_.include(["zoom"], $scope.active_tool)) { if (_.include(["zoom", "scribble"], $scope.active_tool)) {
// tools that stay active after use // tools that stay active after use
this.mouse_state = "idle"; this.mouse_state = "idle";
$scope.mouse_state = this.mouse_state; $scope.mouse_state = this.mouse_state;
...@@ -719,18 +758,12 @@ function setup_whiteboard_directives() { ...@@ -719,18 +758,12 @@ function setup_whiteboard_directives() {
$scope.handle_scroll(); $scope.handle_scroll();
var cursor = this.cursor_point_to_space(evt); var cursor = this.cursor_point_to_space(evt); // takes the raw event data and finds the mouse location in virtual space
var dx = cursor.x - $scope.mouse_ox; var dx = cursor.x - $scope.mouse_ox;
var dy = cursor.y - $scope.mouse_oy; var dy = cursor.y - $scope.mouse_oy;
var dt = (new Date()).getTime() - this.last_mouse_move_time; var dt = (new Date()).getTime() - this.last_mouse_move_time;
this.last_mouse_move_time = (new Date()).getTime(); this.last_mouse_move_time = (new Date()).getTime();
var zoom = $scope.viewport_zoom||1;
if (zoom) {
dx/=zoom;
dy/=zoom;
}
// send cursor // send cursor
if (dx>10 || dy>10 || dt>100) { if (dx>10 || dy>10 || dt>100) {
var name = "anonymous"; var name = "anonymous";
...@@ -742,8 +775,8 @@ function setup_whiteboard_directives() { ...@@ -742,8 +775,8 @@ function setup_whiteboard_directives() {
var cursor_msg = { var cursor_msg = {
action: "cursor", action: "cursor",
x: cursor.x/zoom, x: cursor.x,
y: cursor.y/zoom, y: cursor.y,
name: name, name: name,
id: $scope.user._id||name id: $scope.user._id||name
}; };
...@@ -851,7 +884,7 @@ function setup_whiteboard_directives() { ...@@ -851,7 +884,7 @@ function setup_whiteboard_directives() {
var scale_x = lead_x ? (moved_x)/lead_x : 1; var scale_x = lead_x ? (moved_x)/lead_x : 1;
var scale_y = lead_y ? (moved_y)/lead_y : 1; var scale_y = lead_y ? (moved_y)/lead_y : 1;
if (!$scope.transform_lock) scale_y = scale_x; if ($scope.transform_lock) scale_y = scale_x;
$scope.update_selected_artifacts(function(a) { $scope.update_selected_artifacts(function(a) {
var old_a = $scope.find_artifact_before_transaction(a); var old_a = $scope.find_artifact_before_transaction(a);
...@@ -913,7 +946,7 @@ function setup_whiteboard_directives() { ...@@ -913,7 +946,7 @@ function setup_whiteboard_directives() {
var old_a = a; var old_a = a;
var control_points = _.cloneDeep(old_a.control_points); var control_points = _.cloneDeep(old_a.control_points);
var offset = this.offset_point_in_wrapper({x:cursor.x,y:cursor.y}); var offset = {x:cursor.x,y:cursor.y};
control_points.push({ control_points.push({
dx: offset.x-old_a.x, dx: offset.x-old_a.x,
...@@ -933,8 +966,8 @@ function setup_whiteboard_directives() { ...@@ -933,8 +966,8 @@ function setup_whiteboard_directives() {
if (!$("#space").length) return; if (!$("#space").length) return;
el = $("#space")[0]; el = $("#space")[0];
el.scrollLeft = this.old_panx - dx*$scope.viewport_zoom; el.scrollLeft -= dx*$scope.viewport_zoom;
el.scrollTop = this.old_pany - dy*$scope.viewport_zoom; el.scrollTop -= dy*$scope.viewport_zoom;
$scope.handle_scroll(); $scope.handle_scroll();
} }
......
...@@ -121,33 +121,100 @@ function render_vector_drawing(a, padding) { ...@@ -121,33 +121,100 @@ function render_vector_drawing(a, padding) {
} }
function render_vector_star(edges,xradius,yradius,offset) { function render_vector_star(tips,width,height,stroke) {
//A 5-pointed (5 tips) regular star of radius from center to tip of 1 has a box around it of width = 2 cos(pi/10) and height = 1 + cos(pi/5)
// assuming the star is oriented with one point directly above the center.
// So the center of the star is at width * 1/2 and height * 0.552786 which is 1 / (1 + cos(pi/5)) (also assuming the y-axis is inverted).
// The inner points are at radius 0.381966 = sin(pi/10)/cos(pi/5).
// Fortunately with simple transformations with matrices, we can do rotations and scales easily.
// See https://en.wikipedia.org/wiki/Rotation_matrix for details.
// But because the stroke is done after scaling (it's not scaled), we have to adjust the points after the rotation and scaling happens.
//A 10-pointed regular star is simpler because it is vertically symmetrical.
//NOTE: for very thick stroke widths, and small stars, the star might render very strangely!
var xcenter = width/2;
var ycenter = 0;
var inner_radius = 0;
if (tips == 5) {
ycenter = height * 0.552786;
inner_radius = 0.381966; //scale compared to outer_radius of 1.0
} else {
//tips == 10
ycenter = height/2;
inner_radius = 0.7; //scale compared to outer_radius of 1.0
}
edges *= 2; // Coordinates of the first tip, and the first inner corner
var xtip = 1; // radius 1
var ytip = 0;
var xinner = inner_radius * Math.cos(Math.PI/(tips==5?5:10));
var yinner = inner_radius * Math.sin(Math.PI/(tips==5?5:10));
var points = []; var points = [];
var degrees = 360 / edges;
for (var i=0; i < edges; i++) {
var a = i * degrees - 90;
var xr = xradius;
var yr = yradius;
if (i%2) { // var tmp_outside_points = []; // uncomment to see the calculated edge of the star (outside the stroke width)
if (edges==20) {
xr/=1.5; var angle = 2*Math.PI / tips;
yr/=1.5; // generate points without offset from stroke width first
} else { for (var i=0; i < tips; i++) {
xr/=2.8; var a = i * angle - Math.PI/2;
yr/=2.8;
} // Tip first...
} // Rotate the outer tip around the origin:
var x = xtip * Math.cos(a); // because ytip = 0 we don't include: - ytip * Math.sin(a);
var y = xtip * Math.sin(a); // because ytip = 0 we don't include: + ytip * Math.cos(a);
// Scale for the bounding box:
x = x * width / (2 * Math.cos(Math.PI/10));
y = y * height / (tips==5?(1 + Math.cos(Math.PI/5)):2);
points.push([x,y]);
// tmp_outside_points.push(x+" "+y); // uncomment to see the calculated edge of the star (outside the stroke width)
// Now the inner corner...
// Rotate the inner corner around the origin:
x = xinner * Math.cos(a) - yinner * Math.sin(a);
y = xinner * Math.sin(a) + yinner * Math.cos(a);
// Scale for the bounding box:
x = x * width / (2 * Math.cos(Math.PI/10));
y = y * height / (tips==5?(1 + Math.cos(Math.PI/5)):2);
points.push([x,y]);
// tmp_outside_points.push(x+" "+y); // uncomment to see the calculated edge of the star (outside the stroke width)
}
var x = offset + xradius + xr * Math.cos(a * Math.PI / 180); var inset_points = [];
var y = offset + yradius + yr * Math.sin(a * Math.PI / 180); for (var i=0; i < points.length; i++) {
points.push(x+","+y); var pA = points[(((i-1)%points.length)+points.length)%points.length]; // Javascript modulus "bug"
var p0 = points[i];
var pB = points[(i+1)%points.length];
var dAx = p0[0] - pA[0];
var dAy = p0[1] - pA[1];
var dBx = p0[0] - pB[0];
var dBy = p0[1] - pB[1];
var dBLength = Math.sqrt(dBx**2 + dBy**2);
// The trig here is a bit hairy. Basically, finding the inset points is done by finding the angle (theta)
// between the tips and the neighboring inner corners (or vice versa). Then, that angle is used to
// calculate vector scaling factors for half the thickness of the stroked path. Which then is used to find
// the actual inset points for the tips and inner corners.
var theta = Math.atan2(dAx*dBy-dAy*dBx, dAx*dBx + dAy*dBy); // angle between the vectors
var theta = (i%2? Math.PI * 2 - theta : theta);
var stroke_prime = dBLength * Math.tan(theta/2); // this is really a scaling factor
var xprime = p0[0] + (i%2?-1:1)*((stroke/2)/stroke_prime)*dBx + dBy*(stroke/2)/dBLength;
var yprime = p0[1] + (i%2?-1:1)*((stroke/2)/stroke_prime)*dBy + -1 * dBx*(stroke/2)/dBLength;;
inset_points.push(xprime+","+yprime);
} }
return "<polygon points='"+points.join(" ")+"'/>"; // NOTE: use svg transformations to center the thing
return "<polygon stroke-miterlimit='64' points='"+inset_points.join(" ")+"' transform='translate(" + xcenter + " " + ycenter + ")'/>";
// Append these if you want to see what is being calculated.
// The cyan dashed line is the outside of the star including the stroke width.
// The red dashed line is just the star polygon points themselves.
// "<polygon stroke-width='4' stroke='red' stroke-dasharray='16 12' fill-opacity='0' points='"+inset_points.join(" ")+"' transform='translate(" + xcenter + " " + ycenter + ")'/>" +
// "<polygon stroke-width='4' stroke='cyan' stroke-dasharray='16 12' fill-opacity='0' points='"+tmp_outside_points.join(" ")+"' transform='translate(" + xcenter + " " + ycenter + ")'/>";
} }
function transform_vector_template(cmds, xr, yr, offset) { function transform_vector_template(cmds, xr, yr, offset) {
...@@ -251,8 +318,8 @@ function render_vector_shape(a) { ...@@ -251,8 +318,8 @@ function render_vector_shape(a) {
diamond: function() { return render_vector_ngon(4, xr, yr, offset); }, diamond: function() { return render_vector_ngon(4, xr, yr, offset); },
square: function() { return "" }, square: function() { return "" },
triangle: function() { return render_vector_ngon(3, xr, yr, offset); }, triangle: function() { return render_vector_ngon(3, xr, yr, offset); },
star: function() { return render_vector_star(5, xr, yr, offset); }, star: function() { return render_vector_star(5, a.w, a.h, a.stroke); },
burst: function() { return render_vector_star(10, xr, yr, offset); }, burst: function() { return render_vector_star(10, a.w, a.h, a.stroke); },
speechbubble: function() { return render_vector_speechbubble(xr, yr, offset); }, speechbubble: function() { return render_vector_speechbubble(xr, yr, offset); },
heart: function() { return render_vector_heart(xr, yr, offset); }, heart: function() { return render_vector_heart(xr, yr, offset); },
cloud: function() { return render_vector_cloud(xr, yr, offset); }, cloud: function() { return render_vector_cloud(xr, yr, offset); },
......
This diff is collapsed.
...@@ -57,6 +57,7 @@ router.post('/', function(req, res) { ...@@ -57,6 +57,7 @@ router.post('/', function(req, res) {
}); });
}); });
router.delete('/current', function(req, res, next) { router.delete('/current', function(req, res, next) {
if (req.user) { if (req.user) {
var token = req.cookies['sdsession']; var token = req.cookies['sdsession'];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment