Skip to content

Commit

Permalink
Merge pull request #47 from SimplyEdit/feature/install-simplyedit
Browse files Browse the repository at this point in the history
install simplyedit
  • Loading branch information
ylebre authored Nov 8, 2024
2 parents 311bbfb + 9901347 commit a8c679e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
31 changes: 28 additions & 3 deletions npm_post_install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

npm_post_install() {
installCodeMirror() {
sSourceDir="${npm_config_local_prefix}/node_modules"
sTargetDir="${npm_config_local_prefix}/www/js"

Expand All @@ -21,4 +21,29 @@ npm_post_install() {
cp -f "${sSourceDir}/codemirror/theme/base16-dark.css" "${sTargetDir}/codemirror/theme/base16-dark.css"
}

npm_post_install
installSimplyEdit() {
local sSourceDir sTargetDir

readonly sSourceDir="${npm_config_local_prefix}/node_modules/simplyedit"
readonly sTargetDir="${npm_config_local_prefix}/www"

mkdir -p \
"${sTargetDir}/js/" \
"${sTargetDir}/hope/" \
"${sTargetDir}/simply/" \

cp -a "${sSourceDir}/js/"* "${sTargetDir}/js"
cp -a "${sSourceDir}/hope/"* "${sTargetDir}/hope"
cp -a "${sSourceDir}/simply/"* "${sTargetDir}/simply"
}

if [[ ${BASH_SOURCE[0]} != "${0}" ]]; then
export -f installSimplyEdit
export -f installCodeMirror
else
installSimplyEdit
installCodeMirror
exit $?
fi


6 changes: 5 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"author": "SimplyEdit",
"description": "Code editor in the SimplyEdit family",
"dependencies": {
"codemirror": "5.65.2"
"codemirror": "5.65.2",
"simplyedit": "github:simplyedit/simplyedit"
},
"keywords": [
"code",
Expand Down
1 change: 1 addition & 0 deletions www/simply/toolbar.simply-basepack.html
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ <h1>HTML Image Toolbar</h1>
editor.responsiveImages.initImage(hopeEditor.field);
editor.plugins.image.reselect();
editor.context.update();
editor.fireEvent("databinding:valuechanged", hopeEditor.field);
}
},
"simply-insert-image" : function() {
Expand Down
1 change: 1 addition & 0 deletions www/simply/toolbar.simply-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ <h1>HTML Image Toolbar</h1>
editor.responsiveImages.initImage(hopeEditor.field);
editor.plugins.image.reselect();
editor.context.update();
editor.fireEvent("databinding:valuechanged", hopeEditor.field);
}
},
"simply-insert-image" : function() {
Expand Down

0 comments on commit a8c679e

Please sign in to comment.