Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include fileEnding in Import handler for plugins #3

Merged
merged 6 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/locales/oc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"@metadata": {
"authors": [
"Cedric31"
"Cedric31",
"Quentí"
]
},
"index.newPad": "Pad novèl",
Expand Down Expand Up @@ -86,6 +87,8 @@
"pad.chat": "Chat",
"pad.chat.title": "Dobrir lo chat associat a aqueste pad.",
"pad.chat.loadmessages": "Cargar mai de messatges.",
"pad.chat.stick.title": "Ancorar la discussion a l’ecran",
"pad.chat.writeMessage.placeholder": "Escrivètz lo vòstre messatge aicí",
"timeslider.pageTitle": "Istoric dinamic de {{appTitle}}",
"timeslider.toolbar.returnbutton": "Retorn a aqueste Pad.",
"timeslider.toolbar.authors": "Autors :",
Expand Down
2 changes: 1 addition & 1 deletion src/node/handler/APIHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ exports.handle = async function(apiVersion, functionName, fields, req, res)

// say goodbye if this is an unknown function
if (!(functionName in version[apiVersion])) {
// no status code?!
res.statusCode = 404;
res.send({code: 3, message: "no such function", data: null});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/node/handler/ImportHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function doImport(req, res, padId)
let oldSrcFile = srcFile;

srcFile = path.join(path.dirname(srcFile), path.basename(srcFile, fileEnding) + ".txt");
await fs.rename(oldSrcFile, srcFile);
await fsp_rename(oldSrcFile, srcFile);
} else {
console.warn("Not allowing unknown file type to be imported", fileEnding);
throw "uploadFailed";
Expand Down
11 changes: 5 additions & 6 deletions src/static/css/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,6 @@ input[type=checkbox] {
right:100px;
}

.toolbar ul.menu_right {
right:0px;
}
.popup {
width:100%;
max-width:300px;
Expand All @@ -1074,7 +1071,7 @@ input[type=checkbox] {
}

/* Mobile devices */
@media only screen and (min-device-width: 320px) and (max-device-width: 720px) {
@media only screen and (max-width: 720px) {
#users {
top: auto;
right:0px !important;
Expand Down Expand Up @@ -1108,9 +1105,11 @@ input[type=checkbox] {
}
.toolbar ul.menu_left {
right:0px;
position: fixed;
position: relative;
display: flex;
top: 0;
padding-top: 4px;
overflow-x: auto;
padding: 4px 0 0 0;
border-bottom: 1px solid #ccc;
z-index: 10;
}
Expand Down
7 changes: 4 additions & 3 deletions src/static/js/contentcollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,13 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
cc: this,
state: state,
tname: tname,
node:node,
text:txt,
node: node,
text: txt,
styl: null,
cls: null
});
var txt = (typeof(txtFromHook)=='object'&&txtFromHook.length==0)?dom.nodeValue(node):txtFromHook[0];
var txt = (typeof(txtFromHook)=='object' && txtFromHook.length==0)
? dom.nodeValue(node).trim() : txtFromHook[0].trim();

var rest = '';
var x = 0; // offset into original text
Expand Down
14 changes: 6 additions & 8 deletions src/static/skins/colibris/src/components/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}

.toolbar ul.menu_left {
left: 8px;
padding-left: 8px;
}

.toolbar ul.menu_right {
Expand Down Expand Up @@ -97,23 +97,21 @@
}

@media (max-width: 720px) {
.toolbar ul {
.toolbar ul {
height: 39px;
background: none;
background-color: transparent;
border: none !important;
padding: 0 !important;
overflow-x: visible;
}
.toolbar ul.menu_left {
padding-top: 2px !important;
padding: 2px 0 0 0;
}
.toolbar ul.menu_right {
left: 0;
padding-left: 8px !important;
padding-top: 8px !important;
padding-left: 8px;
padding-top: 8px;
height: 35px !important;
border-top: 1px solid #d2d2d2 !important;
border-top: 1px solid #d2d2d2;
background-color: white;
}
.toolbar ul li a {
Expand Down
1 change: 1 addition & 0 deletions src/static/skins/colibris/src/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#outerdocbody.plugin-ep_author_neat { padding-left: 0; }
#options-linenoscheck { display:none; }
#options-linenoscheck ~ label { display:none; }
#outerdocbody { padding-left: 0; } /* side div is hidden now */
}

#outerdocbody.sidediv-hidden {
Expand Down
300 changes: 149 additions & 151 deletions tests/frontend/specs/importexport.js

Large diffs are not rendered by default.