diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-04 00:12:46 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-04 00:12:46 +0200 |
commit | 4b0a82cc2f4597a11b9275cf156ae9cceffaf44f (patch) | |
tree | a384ea0b7a610387f9a9cb8b6de4de58e8dd76b0 /pkgs/webapps/etherpad-lite/modules/ep_embedmedia | |
parent | e9c91c19475ed679676829bfd716e41009b560c8 (diff) | |
download | Nix-4b0a82cc2f4597a11b9275cf156ae9cceffaf44f.tar.gz Nix-4b0a82cc2f4597a11b9275cf156ae9cceffaf44f.tar.zst Nix-4b0a82cc2f4597a11b9275cf156ae9cceffaf44f.zip |
Fix some etherpad-lite modules and packaging
The upgrade to 1.8.3 broke many modules, which were patched to continue
working correctly.
This commit also reworks the module system, making it similar to
python’s withPackages.
Diffstat (limited to 'pkgs/webapps/etherpad-lite/modules/ep_embedmedia')
-rw-r--r-- | pkgs/webapps/etherpad-lite/modules/ep_embedmedia/fix.patch | 85 | ||||
-rw-r--r-- | pkgs/webapps/etherpad-lite/modules/ep_embedmedia/node-packages.nix | 5 |
2 files changed, 89 insertions, 1 deletions
diff --git a/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/fix.patch b/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/fix.patch new file mode 100644 index 0000000..162f1b0 --- /dev/null +++ b/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/fix.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | diff --git a/ep.json b/ep.json | ||
2 | index 083d484..6803475 100644 | ||
3 | --- a/ep.json | ||
4 | +++ b/ep.json | ||
5 | @@ -5,6 +5,7 @@ | ||
6 | "hooks": { | ||
7 | "eejsBlock_editbarMenuLeft": "ep_embedmedia/hooks:eejsBlock_editbarMenuLeft", | ||
8 | "eejsBlock_scripts": "ep_embedmedia/hooks:eejsBlock_scripts", | ||
9 | + "eejsBlock_timesliderBody": "ep_embedmedia/hooks:eejsBlock_scripts", | ||
10 | "eejsBlock_styles": "ep_embedmedia/hooks:eejsBlock_styles", | ||
11 | "eejsBlock_body": "ep_embedmedia/hooks:eejsBlock_body" | ||
12 | }, | ||
13 | diff --git a/static/css/main.css b/static/css/main.css | ||
14 | index 72a460f..3b66d8e 100644 | ||
15 | --- a/static/css/main.css | ||
16 | +++ b/static/css/main.css | ||
17 | @@ -6,10 +6,18 @@ | ||
18 | z-index:999999; | ||
19 | } | ||
20 | |||
21 | +#embedMediaSrc { | ||
22 | + max-width: 100%; | ||
23 | +} | ||
24 | + | ||
25 | .embedMediaButton { | ||
26 | padding:10px; | ||
27 | } | ||
28 | |||
29 | +#doEmbedMedia{ | ||
30 | + color:blue; | ||
31 | +} | ||
32 | + | ||
33 | #cancelEmbedMedia{ | ||
34 | color:red; | ||
35 | } | ||
36 | @@ -19,6 +27,6 @@ | ||
37 | } | ||
38 | |||
39 | .buttonicon-embed-media:before{ | ||
40 | - content:"\e80b"; | ||
41 | + content:"\e83b"; | ||
42 | top: 2px !important; | ||
43 | } | ||
44 | diff --git a/static/js/main.js b/static/js/main.js | ||
45 | index 8c94767..19415d5 100644 | ||
46 | --- a/static/js/main.js | ||
47 | +++ b/static/js/main.js | ||
48 | @@ -10,22 +10,25 @@ $(document).ready(function () { | ||
49 | } else { | ||
50 | module.slideDown("fast"); | ||
51 | } | ||
52 | + module.toggleClass("popup-show"); | ||
53 | }); | ||
54 | |||
55 | $("#doEmbedMedia").click(function () { | ||
56 | var padeditor = require('ep_etherpad-lite/static/js/pad_editor').padeditor; | ||
57 | |||
58 | $("#embedMediaModal").slideUp("fast"); | ||
59 | + $("#embedMediaModal").removeClass("popup-show"); | ||
60 | |||
61 | return padeditor.ace.callWithAce(function (ace) { | ||
62 | - rep = ace.ace_getRep(); | ||
63 | + var rep = ace.ace_getRep(); | ||
64 | ace.ace_replaceRange(rep.selStart, rep.selEnd, "E"); | ||
65 | ace.ace_performSelectionChange([rep.selStart[0],rep.selStart[1]-1], rep.selStart, false); | ||
66 | - ace.ace_performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, [["embedMedia", escape($("#embedMediaSrc")[0].value)]]); | ||
67 | + ace.ace_performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, [["embedMedia", escape($("#embedMediaSrc")[0].value)]]); | ||
68 | }, "embedMedia"); | ||
69 | }); | ||
70 | |||
71 | $("#cancelEmbedMedia").click(function () { | ||
72 | $("#embedMediaModal").slideUp("fast"); | ||
73 | + $("#embedMediaModal").removeClass("popup-show"); | ||
74 | }); | ||
75 | }); | ||
76 | diff --git a/templates/modals.ejs b/templates/modals.ejs | ||
77 | index 9340698..8915a3b 100644 | ||
78 | --- a/templates/modals.ejs | ||
79 | +++ b/templates/modals.ejs | ||
80 | @@ -1,4 +1,4 @@ | ||
81 | -<div id="embedMediaModal" class="popup"> | ||
82 | +<div id="embedMediaModal" class="popup popup-content"> | ||
83 | <% e.begin_block("embedMediaPopup"); %> | ||
84 | <h1>Embed media into this pad</h1> | ||
85 | <p>Paste a link or "embed code" here:</p> | ||
diff --git a/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/node-packages.nix b/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/node-packages.nix index 9ded27d..80ba484 100644 --- a/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/node-packages.nix +++ b/pkgs/webapps/etherpad-lite/modules/ep_embedmedia/node-packages.nix | |||
@@ -15,6 +15,9 @@ in | |||
15 | sha1 = "b24bf0fe9702d21aa73079890e93183efc6a0975"; | 15 | sha1 = "b24bf0fe9702d21aa73079890e93183efc6a0975"; |
16 | }; | 16 | }; |
17 | buildInputs = globalBuildInputs; | 17 | buildInputs = globalBuildInputs; |
18 | preRebuild = '' | ||
19 | patch -p1 < ${./fix.patch} | ||
20 | ''; | ||
18 | meta = { | 21 | meta = { |
19 | description = "Embed media (youtube, vimeo etc)"; | 22 | description = "Embed media (youtube, vimeo etc)"; |
20 | homepage = https://github.com/JohnMcLear/ep_embedmedia; | 23 | homepage = https://github.com/JohnMcLear/ep_embedmedia; |
@@ -23,4 +26,4 @@ in | |||
23 | bypassCache = true; | 26 | bypassCache = true; |
24 | reconstructLock = true; | 27 | reconstructLock = true; |
25 | }; | 28 | }; |
26 | } \ No newline at end of file | 29 | } |