FIX: conflicting class declaration with core (#4)
* DEV: Remove `fade-in` and use `jsuites.basic.css` instead * FIX: Linting issues with jspreadsheet-theme * WIP: Add bash script to handle vendor assets * FIX: Ember Linting fixes * DEV: Cleanup comments and commented code
This commit is contained in:
parent
12e09ebad6
commit
52710496ed
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "eslint-config-discourse",
|
||||
"ignorePatterns": ["javascripts/vendor/*"],
|
||||
"ignorePatterns": ["javascripts/vendor/*", "assets/vendor/*"],
|
||||
"globals": {
|
||||
"settings": "readonly",
|
||||
"themePrefix": "readonly"
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
"minimum_discourse_version": null,
|
||||
"maximum_discourse_version": null,
|
||||
"assets": {
|
||||
"jsuites": "assets/jsuites.js",
|
||||
"jspreadsheet": "assets/jspreadsheet.js"
|
||||
"jsuites": "assets/vendor/jsuites.js",
|
||||
"jspreadsheet": "assets/vendor/jspreadsheet.js"
|
||||
},
|
||||
"modifiers": {
|
||||
"svg_icons": [
|
||||
|
|
16861
assets/jspreadsheet.js
16861
assets/jspreadsheet.js
File diff suppressed because it is too large
Load Diff
13312
assets/jsuites.js
13312
assets/jsuites.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,88 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Global Variables:
|
||||
SCSS_VENDOR=scss/vendor/
|
||||
JS_VENDOR=assets/vendor/
|
||||
|
||||
JSUITES_JS_URL="https://jsuites.net/v4/jsuites.js"
|
||||
JSPREADSHEET_JS_URL="https://bossanova.uk/jspreadsheet/v4/jexcel.js"
|
||||
|
||||
JSUITES_CSS_URL="https://raw.githubusercontent.com/jsuites/jsuites/master/dist/jsuites.basic.css"
|
||||
JSPREADSHEET_CSS_URL="https://bossanova.uk/jspreadsheet/v4/jexcel.css"
|
||||
|
||||
JSUITES_CSS_FILE=jsuites.basic.css
|
||||
JSUITES_SCSS_FILE=jsuites.scss
|
||||
JSUITES_SCSS_FILE_LOCATION=$SCSS_VENDOR$JSUITES_SCSS_FILE
|
||||
|
||||
JSUITES_JS_FILE=jsuites.js
|
||||
JSUITES_NEW_JS_FILE=jsuites.js
|
||||
JSUITES_JS_FILE_LOCATION=$JS_VENDOR$JSUITES_NEW_JS_FILE
|
||||
|
||||
JSPREADSHEET_CSS_FILE=jexcel.css
|
||||
JSPREADSHEET_SCSS_FILE=jspreadsheet.scss
|
||||
JSPREADSHEET_SCSS_FILE_LOCATION=$SCSS_VENDOR$JSPREADSHEET_SCSS_FILE
|
||||
|
||||
JSPREADSHEET_JS_FILE=jexcel.js
|
||||
JSPREADSHEET_NEW_JS_FILE=jspreadsheet.js
|
||||
JSPREADSHEET_JS_FILE_LOCATION=$JS_VENDOR$JSPREADSHEET_NEW_JS_FILE
|
||||
|
||||
|
||||
|
||||
|
||||
# Remove all vendor related files:
|
||||
rm -r ${SCSS_VENDOR}*
|
||||
rm -r ${JS_VENDOR}
|
||||
|
||||
# Recreate vendor directory
|
||||
mkdir $JS_VENDOR
|
||||
echo "Old vendor assets have been removed."
|
||||
|
||||
|
||||
# STYLESHEETS:
|
||||
# Add JSuite vendor file
|
||||
if test -f "$JSUITES_CSS_FILE"; then
|
||||
echo "$JSUITES_CSS_FILE already exists."
|
||||
else
|
||||
# Fetch jsuite stylesheet
|
||||
wget $JSUITES_CSS_URL
|
||||
echo "$JSUITES_CSS_FILE has been created in $(pwd)"
|
||||
# Move jsuite stylesheet to vendor as a scss file
|
||||
mv $JSUITES_CSS_FILE $JSUITES_SCSS_FILE_LOCATION
|
||||
echo "$JSUITES_SCSS_FILE has been placed in the scss vendor directory"
|
||||
# Scope styles to jexcel_container class
|
||||
sed -i '' '1s/^/.jexcel_container {\n/' $JSUITES_SCSS_FILE_LOCATION
|
||||
sed -i '' '$a\
|
||||
}' $JSUITES_SCSS_FILE_LOCATION
|
||||
|
||||
# Remove conflicting animation classes
|
||||
# TODO: Improve below code to handle nested code blocks
|
||||
fi
|
||||
|
||||
# Add JSpreadsheet vendor file
|
||||
if test -f "$JSPREADSHEET_CSS_FILE"; then
|
||||
echo "$JSPREADSHEET_CSS_FILE already exists."
|
||||
else
|
||||
# Fetch jspreadsheet stylesheet
|
||||
wget $JSPREADSHEET_CSS_URL
|
||||
echo "$JSPREADSHEET_CSS_FILE has been created in $(pwd)"
|
||||
# Move jspreadsheet stylesheet to vendor as a scss file
|
||||
mv $JSPREADSHEET_CSS_FILE $JSPREADSHEET_SCSS_FILE_LOCATION
|
||||
fi
|
||||
|
||||
# Apply prettier to vendor files
|
||||
yarn prettier --write $SCSS_VENDOR
|
||||
|
||||
# JAVASCRIPTS:
|
||||
if test -f "$JSUITES_JS_FILE"; then
|
||||
echo "$JSUITES_JS_FILE already exists."
|
||||
else
|
||||
wget $JSUITES_JS_URL
|
||||
mv $JSUITES_JS_FILE $JSUITES_JS_FILE_LOCATION
|
||||
fi
|
||||
|
||||
if test -f "$JSPREADSHEET_JS_FILE"; then
|
||||
echo "$JSPREADSHEET_JS_FILE already exists."
|
||||
else
|
||||
wget $JSPREADSHEET_JS_URL
|
||||
mv $JSPREADSHEET_JS_FILE $JSPREADSHEET_JS_FILE_LOCATION
|
||||
fi
|
|
@ -1,6 +1,5 @@
|
|||
@import "vendor/jspreadsheet";
|
||||
@import "vendor/jspreadsheet-datatables";
|
||||
@import "vendor/jspreadsheet-theme";
|
||||
@import "vendor/jsuites";
|
||||
@import "theme/jspreadsheet-theme";
|
||||
@import "post/table-edit-decorator";
|
||||
@import "modal/insert-table-modal";
|
||||
|
|
|
@ -6,6 +6,7 @@ import { iconNode } from "discourse-common/lib/icon-library";
|
|||
import { create } from "virtual-dom";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default apiInitializer("0.11.1", (api) => {
|
||||
const site = api.container.lookup("site:main");
|
||||
const currentUser = api.getCurrentUser();
|
||||
|
|
|
@ -7,6 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
|
|||
import I18n from "I18n";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
|
||||
export default class SpreadsheetEditor extends GlimmerComponent {
|
||||
@tracked showEditReason = false;
|
||||
spreadsheet = null;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,13 @@
|
|||
{
|
||||
"name": "discourse-table-builder",
|
||||
"description": "Create and edit markdown tables using a spreadsheet editor.",
|
||||
"version": "0.0.1",
|
||||
"repository": "https://github.com/keegangeorge/discourse-table-builder",
|
||||
"author": "Keegan George",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"scripts": {
|
||||
"build": "bash ./build.bash"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-discourse": "latest"
|
||||
}
|
||||
|
|
|
@ -27,6 +27,21 @@
|
|||
background-color: transparent;
|
||||
}
|
||||
|
||||
table.jexcel > thead > tr > td {
|
||||
border-top: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid #000;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
table.jexcel > tbody > tr > td {
|
||||
padding: 8px;
|
||||
border-right: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
}
|
||||
|
||||
table.jexcel {
|
||||
border-bottom: 1px solid var(--jexcel_border_color);
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
table.jexcel {
|
||||
border-right: 1px solid transparent;
|
||||
}
|
||||
|
||||
table.jexcel > thead {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
table.jexcel > thead > tr > td {
|
||||
border-top: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid #000;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.jexcel > thead > tr > td.selected {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
table.jexcel > tbody > tr > td {
|
||||
padding: 8px;
|
||||
border-right: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
}
|
||||
|
||||
table.jexcel > tbody > tr > td:first-child {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
table.jexcel > tbody > tr.selected > td:first-child {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.jexcel_toolbar {
|
||||
background-color: transparent;
|
||||
border: 0px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-top: 1px solid #ccc;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.jexcel_pagination > div > div {
|
||||
border: 1px solid transparent;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.jexcel_page_selected {
|
||||
background: linear-gradient(to bottom, #fff 0%, #dcdcdc 100%);
|
||||
border: 1px solid #979797 !important;
|
||||
font-weight: normal;
|
||||
color: #333 !important;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/*.jexcel > div > table > tbody > tr,
|
||||
.jexcel > div > table > thead
|
||||
{
|
||||
border-left:1px solid transparent;
|
||||
}
|
||||
.jexcel > div > table > tbody > tr > td
|
||||
{
|
||||
padding:10px;
|
||||
border-right:1px solid transparent;
|
||||
}
|
||||
.jexcel > div > table > tbody > td.edition
|
||||
{
|
||||
padding:0px;
|
||||
padding-left:4px;
|
||||
}
|
||||
.jexcel > div > table > tbody > tr > td:first-child
|
||||
{
|
||||
background-color:#fff;
|
||||
font-weight:bold;
|
||||
}
|
||||
.jexcel > div > table > tbody > tr.selected > td:first-child
|
||||
{
|
||||
background-color:#eee;
|
||||
}
|
||||
.jexcel > div > table > thead > tr > td.selected
|
||||
{
|
||||
background-color:#eee;
|
||||
}*/
|
|
@ -410,6 +410,7 @@
|
|||
-khtml-user-drag: none;
|
||||
-moz-user-drag: none;
|
||||
-o-user-drag: none;
|
||||
user-drag: none;
|
||||
}
|
||||
|
||||
.jexcel_textarea {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue