From: Ismaël Bouya Date: Sun, 3 May 2020 22:12:46 +0000 (+0200) Subject: Fix some etherpad-lite modules and packaging X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=4b0a82cc2f4597a11b9275cf156ae9cceffaf44f;p=perso%2FImmae%2FConfig%2FNix.git 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. --- diff --git a/modules/private/websites/tools/ether/default.nix b/modules/private/websites/tools/ether/default.nix index a0329ef..3350a4a 100644 --- a/modules/private/websites/tools/ether/default.nix +++ b/modules/private/websites/tools/ether/default.nix @@ -125,6 +125,10 @@ in { "defaultLang": "fr" } }, + "ep_comments_page": { + "displayCommentAsIcon": true, + "highlightSelectedText": true + }, "socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"], "loadTest": false, "indentationOnNewLine": false, @@ -152,7 +156,16 @@ in { ]; services.etherpad-lite = { enable = true; - modules = builtins.attrValues pkgs.webapps.etherpad-lite-modules; + package = pkgs.webapps.etherpad-lite.withModules (p: [ + p.ep_align p.ep_bookmark p.ep_colors p.ep_comments_page + p.ep_cursortrace p.ep_delete_empty_pads p.ep_embedmedia + p.ep_font_size p.ep_headings2 p.ep_immae_buttons p.ep_ldapauth + p.ep_line_height p.ep_markdown p.ep_mypads p.ep_page_view + p.ep_previewimages p.ep_ruler p.ep_scrollto + p.ep_set_title_on_pad p.ep_subscript_and_superscript + p.ep_timesliderdiff + ]); + modules = []; sessionKeyFile = "/var/secrets/webapps/tools-etherpad-sessionkey"; apiKeyFile = "/var/secrets/webapps/tools-etherpad-apikey"; configFile = "/var/secrets/webapps/tools-etherpad"; diff --git a/modules/webapps/etherpad-lite.nix b/modules/webapps/etherpad-lite.nix index 7f0e2ed..2e09952 100644 --- a/modules/webapps/etherpad-lite.nix +++ b/modules/webapps/etherpad-lite.nix @@ -57,18 +57,22 @@ in description = '' Etherpad lite package to use. ''; + example = lib.literalExample '' + pkgs.webapps.etherpad-lite.withModules (p: [ p.ep_align ]); + ''; }; modules = lib.mkOption { type = lib.types.listOf lib.types.package; default = []; description = '' Etherpad lite modules to use. + DEPRECATED: use package directly ''; }; # Output variables workdir = lib.mkOption { type = lib.types.package; - default = cfg.package.withModules cfg.modules; + default = cfg.package.withModules (_: cfg.modules); description = '' Adjusted Etherpad lite package with plugins ''; diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix index 05172a9..fdf2651 100644 --- a/pkgs/webapps/default.nix +++ b/pkgs/webapps/default.nix @@ -15,23 +15,6 @@ rec { (name: callPackage (./dokuwiki/plugins + "/${name}.nix") {}); etherpad-lite = callPackage ./etherpad-lite {}; - etherpad-lite-with-modules = etherpad-lite.withModules (builtins.attrValues etherpad-lite-modules); - etherpad-lite-modules = let - nodeEnv = callPackage mylibs.nodeEnv {}; - names = [ - "ep_aa_file_menu_toolbar" "ep_adminpads" "ep_align" "ep_bookmark" - "ep_clear_formatting" "ep_colors" "ep_copy_paste_select_all" - "ep_cursortrace" "ep_embedmedia" "ep_font_family" "ep_font_size" - "ep_headings2" "ep_ldapauth" "ep_line_height" "ep_markdown" - "ep_previewimages" "ep_ruler" "ep_scrollto" "ep_set_title_on_pad" - "ep_subscript_and_superscript" "ep_timesliderdiff" - "ep_delete_empty_pads" "ep_mypads" - ]; - in - # nix files are built using node2nix -i node-packages.json - lib.attrsets.genAttrs names - (name: (callPackage (./etherpad-lite/modules + "/${name}/node-packages.nix") { inherit nodeEnv; }) - .${name}.overrideAttrs(old: { passthru = (old.passthru or {}) // { moduleName = name; }; })); grocy = callPackage ./grocy { inherit mylibs composerEnv; }; diff --git a/pkgs/webapps/etherpad-lite/default.nix b/pkgs/webapps/etherpad-lite/default.nix index 5cd1cfb..4327384 100644 --- a/pkgs/webapps/etherpad-lite/default.nix +++ b/pkgs/webapps/etherpad-lite/default.nix @@ -1,31 +1,43 @@ { varDir ? "/var/lib/etherpad-lite" # if you override this change the StateDirectory in service file too! -, stdenv, callPackage, mylibs, fetchurl }: +, stdenv, callPackage, mylibs, lib }: let - jquery = fetchurl { - url = https://code.jquery.com/jquery-1.9.1.js; - sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v"; + nodeEnv = callPackage mylibs.nodeEnv {}; + moduleNames = [ + "ep_aa_file_menu_toolbar" "ep_adminpads" "ep_align" "ep_bookmark" + "ep_clear_formatting" "ep_colors" "ep_comments_page" + "ep_copy_paste_select_all" "ep_cursortrace" "ep_delete_empty_pads" + "ep_embedmedia" "ep_font_family" "ep_font_size" "ep_headings2" + "ep_immae_buttons" "ep_ldapauth" "ep_line_height" "ep_markdown" + "ep_mypads" "ep_page_view" "ep_previewimages" "ep_ruler" + "ep_scrollto" "ep_set_title_on_pad" "ep_subscript_and_superscript" + "ep_timesliderdiff" + ]; + # nix files are built using node2nix -i node-packages.json + allModules = lib.attrsets.genAttrs moduleNames + (name: (callPackage (./modules + "/${name}/node-packages.nix") { inherit nodeEnv; }).${name}); + toPassthru = pkg: { + inherit varDir allModules; + withModules = withModules pkg; }; - withModules = modules: package.overrideAttrs(old: { - installPhase = let - modInst = n: - let n' = n.override { - postInstall = '' - if [ ! -f $out/lib/node_modules/${n.moduleName}/.ep_initialized ]; then - ln -s ${varDir}/ep_initialized/${n.moduleName} $out/lib/node_modules/${n.moduleName}/.ep_initialized - fi - ''; - }; - in "cp -a ${n'}/lib/node_modules/${n.moduleName} $out/node_modules"; - in old.installPhase + builtins.concatStringsSep "\n" (map modInst modules); - passthru = old.passthru // { - inherit modules; - withModules = moreModules: old.withModules (moreModules ++ modules); - }; - }); + withModules = pkg: toModules: + let + modules = toModules allModules; + toInstallModule = n: '' + cp -a ${n}/lib/node_modules/${n.packageName} $out/node_modules + if [ ! -f $out/node_modules/${n.packageName}/.ep_initialized ]; then + chmod u+w $out/node_modules/${n.packageName}/ + ln -s ${varDir}/ep_initialized/${n.packageName} $out/node_modules/${n.packageName}/.ep_initialized + fi + ''; + newEtherpad = pkg.overrideAttrs(old: { + installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallModule modules); + passthru = toPassthru newEtherpad; + }); + in newEtherpad; # built using node2nix -l package-lock.json # and changing "./." to "src" node-environment = (callPackage ./node-packages.nix { - nodeEnv = callPackage mylibs.nodeEnv {}; + inherit nodeEnv; src = stdenv.mkDerivation (mylibs.fetchedGithub ./etherpad-lite.json // rec { patches = [ ./libreoffice_patch.diff ]; buildPhase = '' @@ -44,12 +56,8 @@ let mkdir $out/node_modules cp -a lib/node_modules/ep_etherpad-lite $out/src chmod u+w $out/src/static/js/ - #cp ${jquery} $out/src/static/js/jquery.js ln -s ../src $out/node_modules/ep_etherpad-lite ''; - passthru = { - modules = []; - inherit varDir withModules; - }; + passthru = toPassthru package; }; in package diff --git a/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.json b/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.json new file mode 100644 index 0000000..ae32884 --- /dev/null +++ b/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.json @@ -0,0 +1 @@ +["ep_comments_page"] diff --git a/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.nix b/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.nix new file mode 100644 index 0000000..8d7c85a --- /dev/null +++ b/pkgs/webapps/etherpad-lite/modules/ep_comments_page/node-packages.nix @@ -0,0 +1,342 @@ +# This file has been generated by node2nix 1.8.0. Do not edit! + +{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}: + +let + sources = { + "after-0.8.2" = { + name = "after"; + packageName = "after"; + version = "0.8.2"; + src = fetchurl { + url = "https://registry.npmjs.org/after/-/after-0.8.2.tgz"; + sha1 = "fedb394f9f0e02aa9768e702bda23b505fae7e1f"; + }; + }; + "arraybuffer.slice-0.0.7" = { + name = "arraybuffer.slice"; + packageName = "arraybuffer.slice"; + version = "0.0.7"; + src = fetchurl { + url = "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz"; + sha512 = "wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog=="; + }; + }; + "async-limiter-1.0.1" = { + name = "async-limiter"; + packageName = "async-limiter"; + version = "1.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz"; + sha512 = "csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="; + }; + }; + "backo2-1.0.2" = { + name = "backo2"; + packageName = "backo2"; + version = "1.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz"; + sha1 = "31ab1ac8b129363463e35b3ebb69f4dfcfba7947"; + }; + }; + "base64-arraybuffer-0.1.5" = { + name = "base64-arraybuffer"; + packageName = "base64-arraybuffer"; + version = "0.1.5"; + src = fetchurl { + url = "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz"; + sha1 = "73926771923b5a19747ad666aa5cd4bf9c6e9ce8"; + }; + }; + "better-assert-1.0.2" = { + name = "better-assert"; + packageName = "better-assert"; + version = "1.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz"; + sha1 = "40866b9e1b9e0b55b481894311e68faffaebc522"; + }; + }; + "blob-0.0.5" = { + name = "blob"; + packageName = "blob"; + version = "0.0.5"; + src = fetchurl { + url = "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz"; + sha512 = "gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig=="; + }; + }; + "callsite-1.0.0" = { + name = "callsite"; + packageName = "callsite"; + version = "1.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz"; + sha1 = "280398e5d664bd74038b6f0905153e6e8af1bc20"; + }; + }; + "component-bind-1.0.0" = { + name = "component-bind"; + packageName = "component-bind"; + version = "1.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz"; + sha1 = "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1"; + }; + }; + "component-emitter-1.2.1" = { + name = "component-emitter"; + packageName = "component-emitter"; + version = "1.2.1"; + src = fetchurl { + url = "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz"; + sha1 = "137918d6d78283f7df7a6b7c5a63e140e69425e6"; + }; + }; + "component-inherit-0.0.3" = { + name = "component-inherit"; + packageName = "component-inherit"; + version = "0.0.3"; + src = fetchurl { + url = "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz"; + sha1 = "645fc4adf58b72b649d5cae65135619db26ff143"; + }; + }; + "debug-3.1.0" = { + name = "debug"; + packageName = "debug"; + version = "3.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz"; + sha512 = "OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g=="; + }; + }; + "debug-4.1.1" = { + name = "debug"; + packageName = "debug"; + version = "4.1.1"; + src = fetchurl { + url = "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz"; + sha512 = "pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw=="; + }; + }; + "engine.io-client-3.4.1" = { + name = "engine.io-client"; + packageName = "engine.io-client"; + version = "3.4.1"; + src = fetchurl { + url = "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz"; + sha512 = "RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw=="; + }; + }; + "engine.io-parser-2.2.0" = { + name = "engine.io-parser"; + packageName = "engine.io-parser"; + version = "2.2.0"; + src = fetchurl { + url = "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz"; + sha512 = "6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w=="; + }; + }; + "formidable-1.2.2" = { + name = "formidable"; + packageName = "formidable"; + version = "1.2.2"; + src = fetchurl { + url = "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz"; + sha512 = "V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q=="; + }; + }; + "has-binary2-1.0.3" = { + name = "has-binary2"; + packageName = "has-binary2"; + version = "1.0.3"; + src = fetchurl { + url = "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz"; + sha512 = "G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw=="; + }; + }; + "has-cors-1.1.0" = { + name = "has-cors"; + packageName = "has-cors"; + version = "1.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz"; + sha1 = "5e474793f7ea9843d1bb99c23eef49ff126fff39"; + }; + }; + "indexof-0.0.1" = { + name = "indexof"; + packageName = "indexof"; + version = "0.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz"; + sha1 = "82dc336d232b9062179d05ab3293a66059fd435d"; + }; + }; + "isarray-2.0.1" = { + name = "isarray"; + packageName = "isarray"; + version = "2.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz"; + sha1 = "a37d94ed9cda2d59865c9f76fe596ee1f338741e"; + }; + }; + "ms-2.0.0" = { + name = "ms"; + packageName = "ms"; + version = "2.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"; + sha1 = "5608aeadfc00be6c2901df5f9861788de0d597c8"; + }; + }; + "ms-2.1.2" = { + name = "ms"; + packageName = "ms"; + version = "2.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"; + sha512 = "sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="; + }; + }; + "object-component-0.0.3" = { + name = "object-component"; + packageName = "object-component"; + version = "0.0.3"; + src = fetchurl { + url = "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz"; + sha1 = "f0c69aa50efc95b866c186f400a33769cb2f1291"; + }; + }; + "parseqs-0.0.5" = { + name = "parseqs"; + packageName = "parseqs"; + version = "0.0.5"; + src = fetchurl { + url = "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz"; + sha1 = "d5208a3738e46766e291ba2ea173684921a8b89d"; + }; + }; + "parseuri-0.0.5" = { + name = "parseuri"; + packageName = "parseuri"; + version = "0.0.5"; + src = fetchurl { + url = "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz"; + sha1 = "80204a50d4dbb779bfdc6ebe2778d90e4bce320a"; + }; + }; + "socket.io-client-2.3.0" = { + name = "socket.io-client"; + packageName = "socket.io-client"; + version = "2.3.0"; + src = fetchurl { + url = "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz"; + sha512 = "cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA=="; + }; + }; + "socket.io-parser-3.3.0" = { + name = "socket.io-parser"; + packageName = "socket.io-parser"; + version = "3.3.0"; + src = fetchurl { + url = "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz"; + sha512 = "hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng=="; + }; + }; + "to-array-0.1.4" = { + name = "to-array"; + packageName = "to-array"; + version = "0.1.4"; + src = fetchurl { + url = "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz"; + sha1 = "17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"; + }; + }; + "ws-6.1.4" = { + name = "ws"; + packageName = "ws"; + version = "6.1.4"; + src = fetchurl { + url = "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz"; + sha512 = "eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA=="; + }; + }; + "xmlhttprequest-ssl-1.5.5" = { + name = "xmlhttprequest-ssl"; + packageName = "xmlhttprequest-ssl"; + version = "1.5.5"; + src = fetchurl { + url = "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz"; + sha1 = "c2876b06168aadc40e57d97e81191ac8f4398b3e"; + }; + }; + "yeast-0.1.2" = { + name = "yeast"; + packageName = "yeast"; + version = "0.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz"; + sha1 = "008e06d8094320c372dbc2f8ed76a0ca6c8ac419"; + }; + }; + }; +in +{ + ep_comments_page = nodeEnv.buildNodePackage { + name = "ep_comments_page"; + packageName = "ep_comments_page"; + version = "0.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/ep_comments_page/-/ep_comments_page-0.1.0.tgz"; + sha512 = "aHUfyR3HZ677wgL1hJEeaa1yIabW3PjaFXHhWnlEXdIDXL3WmgkGQ4Y1ccHp057EmquCwNb595HADQO+QUK/lw=="; + }; + dependencies = [ + sources."after-0.8.2" + sources."arraybuffer.slice-0.0.7" + sources."async-limiter-1.0.1" + sources."backo2-1.0.2" + sources."base64-arraybuffer-0.1.5" + sources."better-assert-1.0.2" + sources."blob-0.0.5" + sources."callsite-1.0.0" + sources."component-bind-1.0.0" + sources."component-emitter-1.2.1" + sources."component-inherit-0.0.3" + sources."debug-4.1.1" + sources."engine.io-client-3.4.1" + sources."engine.io-parser-2.2.0" + sources."formidable-1.2.2" + sources."has-binary2-1.0.3" + sources."has-cors-1.1.0" + sources."indexof-0.0.1" + sources."isarray-2.0.1" + sources."ms-2.1.2" + sources."object-component-0.0.3" + sources."parseqs-0.0.5" + sources."parseuri-0.0.5" + sources."socket.io-client-2.3.0" + (sources."socket.io-parser-3.3.0" // { + dependencies = [ + sources."debug-3.1.0" + sources."ms-2.0.0" + ]; + }) + sources."to-array-0.1.4" + sources."ws-6.1.4" + sources."xmlhttprequest-ssl-1.5.5" + sources."yeast-0.1.2" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "Adds comments on sidebar and link it to the text. Support for Page View, requires ep_page_view"; + homepage = "https://github.com/ether/ep_comments#readme"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; +} \ No newline at end of file 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 @@ +diff --git a/ep.json b/ep.json +index 083d484..6803475 100644 +--- a/ep.json ++++ b/ep.json +@@ -5,6 +5,7 @@ + "hooks": { + "eejsBlock_editbarMenuLeft": "ep_embedmedia/hooks:eejsBlock_editbarMenuLeft", + "eejsBlock_scripts": "ep_embedmedia/hooks:eejsBlock_scripts", ++ "eejsBlock_timesliderBody": "ep_embedmedia/hooks:eejsBlock_scripts", + "eejsBlock_styles": "ep_embedmedia/hooks:eejsBlock_styles", + "eejsBlock_body": "ep_embedmedia/hooks:eejsBlock_body" + }, +diff --git a/static/css/main.css b/static/css/main.css +index 72a460f..3b66d8e 100644 +--- a/static/css/main.css ++++ b/static/css/main.css +@@ -6,10 +6,18 @@ + z-index:999999; + } + ++#embedMediaSrc { ++ max-width: 100%; ++} ++ + .embedMediaButton { + padding:10px; + } + ++#doEmbedMedia{ ++ color:blue; ++} ++ + #cancelEmbedMedia{ + color:red; + } +@@ -19,6 +27,6 @@ + } + + .buttonicon-embed-media:before{ +- content:"\e80b"; ++ content:"\e83b"; + top: 2px !important; + } +diff --git a/static/js/main.js b/static/js/main.js +index 8c94767..19415d5 100644 +--- a/static/js/main.js ++++ b/static/js/main.js +@@ -10,22 +10,25 @@ $(document).ready(function () { + } else { + module.slideDown("fast"); + } ++ module.toggleClass("popup-show"); + }); + + $("#doEmbedMedia").click(function () { + var padeditor = require('ep_etherpad-lite/static/js/pad_editor').padeditor; + + $("#embedMediaModal").slideUp("fast"); ++ $("#embedMediaModal").removeClass("popup-show"); + + return padeditor.ace.callWithAce(function (ace) { +- rep = ace.ace_getRep(); ++ var rep = ace.ace_getRep(); + ace.ace_replaceRange(rep.selStart, rep.selEnd, "E"); + ace.ace_performSelectionChange([rep.selStart[0],rep.selStart[1]-1], rep.selStart, false); +- ace.ace_performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, [["embedMedia", escape($("#embedMediaSrc")[0].value)]]); ++ ace.ace_performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, [["embedMedia", escape($("#embedMediaSrc")[0].value)]]); + }, "embedMedia"); + }); + + $("#cancelEmbedMedia").click(function () { + $("#embedMediaModal").slideUp("fast"); ++ $("#embedMediaModal").removeClass("popup-show"); + }); + }); +diff --git a/templates/modals.ejs b/templates/modals.ejs +index 9340698..8915a3b 100644 +--- a/templates/modals.ejs ++++ b/templates/modals.ejs +@@ -1,4 +1,4 @@ +-