Skip to content

Commit

Permalink
merge: dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Sep 17, 2024
2 parents 558a2d0 + 7d723b9 commit 684b485
Show file tree
Hide file tree
Showing 142 changed files with 4,828 additions and 4,590 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## [Unreleased]

## [9.7.0] - 2024-09-17

### Added

- TypeScript typings for:
- config/settings
- URL parameters
- CQP queries
- CorpusListing
- `$rootScope`
- Auth module
- services (`backend`, `compare-searches`, `lexicons`, `searches`, `utils`)
- Map code from `korp-geo` has moved into this codebase [#359](https://github.com/spraakbanken/korp-frontend/issues/359)

### Changed

- Replaced Raphael library with Chart.js, used in the pie chart over corpus distribution in statistics
- Replaced jStorage library with native `localStorage`, and added TypeScript typings
- In the `ParallelCorpusListing` class, the methods `getLinked` and `getEnabledByLang` have new parameter signatures
- Replaced custom `popper` directive with `uib-popover` and `uib-dropdown` ([docs](https://angular-ui.github.io/bootstrap/))
- Removed the `mapper` template filter; change `x | mapper:f` to `f(x)`
- Removed the global `c` alias for `console`
- Removed global `lang`, use `$rootScope["lang"]` instead (outside Angular: `getService("$rootScope")["lang"]`)
- Removed global `loc_data`, use `$rootScope["loc_data"]` instead (outside Angular: `getService("$rootScope")["loc_data"]`)
- Removed globals `CSV` and `moment`, import the libraries instead
- Converted the "radioList" JQuery widget to a component
- Using Karp 7 backend instead of Karp 4 [#388](https://github.com/spraakbanken/korp-frontend/pull/388)
- For the `utils.setupHash()` function, the `config` argument is no longer an array. To sync multiple parameters, call it once for each.
- Dopped support for old map usage (`sb-old-map="true"`)

### Fixed

- News were sometimes not shown immediately after fetch
- In the time interval component in Extended search:
- Simple input fields were being ignored [#377](https://github.com/spraakbanken/korp-frontend/issues/377)
- Handle end seconds correctly [#378](https://github.com/spraakbanken/korp-frontend/issues/378)
- Parsing of the simple input had been incomplete since way back
- There was no word picture heading if lemgram
- Paging broken in word picture example search [#383](https://github.com/spraakbanken/korp-frontend/issues/383)
- Incoherent style change to corpus heading when switching between KWIC and context view [#389](https://github.com/spraakbanken/korp-frontend/issues/389)
- Context view broken in example search [#386](https://github.com/spraakbanken/korp-frontend/issues/386)
- Can't navigate between tokens in KWIC using arrow keys [#368](https://github.com/spraakbanken/korp-frontend/issues/368)

## [9.6.0] - 2024-05-27

### Added
Expand Down Expand Up @@ -212,6 +257,7 @@
- Lots of bug fixes for the sidebar

[unreleased]: https://github.com/spraakbanken/korp-frontend/compare/master...dev
[9.7.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.7.0
[9.6.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.6.0
[9.5.3]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.5.3
[9.5.2]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.5.2
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This repo contains the frontend for [Korp](https://spraakbanken.gu.se/korp),
a tool using the IMS Open Corpus Workbench (CWB). Korp is a great
tool for searching and visualising natural language corpus data.
This repo contains the frontend for [Korp](https://spraakbanken.gu.se/korp), Språkbanken's word research platform using the IMS Open Corpus Workbench (CWB).
Korp is a great tool for searching and visualising natural language corpus data.

Korp is mainly developed by [Språkbanken](https://spraakbanken.gu.se) at the
University of Gothenburg, Sweden. Contributions are also made from other
Expand Down Expand Up @@ -51,8 +50,7 @@ imgPath = require("img/image.png")
myTemplate = `<img src='${imgPath}'>`
```

Most dependencies are only specified in `app/index.js` and where needed
added to the `window`-object.
Some dependencies are only specified in `app/index.ts`.

About the current loaders in `webpack.config.js`:
- `pug` and `html` files: all `src`-attributes in `<img>` tags and all `href`s in `<link>` tags will be
Expand Down
53 changes: 24 additions & 29 deletions app/index.js → app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@
import $ from "jquery"
import currentMode from "@/mode"
import { locationSearchGet } from "@/util"
import { HashParams } from "@/urlparams"

declare global {
interface Window {
jQuery: JQueryStatic
$: JQueryStatic
/**
* TODO Remove, currently used in tests
* @deprecated
*/
locationSearch: <K extends keyof HashParams>(key: K) => HashParams[K]
}
}

window.jQuery = $
window.$ = $
window.locationSearch = locationSearchGet

require("slickgrid/slick.grid.css")
require("./styles/ui_mods.css")
Expand All @@ -13,7 +27,6 @@ require("rickshaw/rickshaw.css")

require("leaflet/dist/leaflet.css")
require("leaflet.markercluster/dist/MarkerCluster.css")
require("geokorp/dist/styles/geokorp.css")
require("components-jqueryui/themes/smoothness/jquery-ui.min.css")
require("./styles/_bootstrap-custom.scss")

Expand All @@ -22,14 +35,11 @@ require("./styles/tailwind.scss")
require("./styles/styles.scss")
require("./styles/textreader.css")

require("components-jqueryui/ui/widgets/dialog.js") // Needed for popover
require("components-jqueryui/ui/widget.js")

require("angular")

require("jquerylocalize")

window.c = console

try {
// modes-files are optional and have customizing code
require(`modes/${currentMode}_mode.js`)
Expand All @@ -46,42 +56,27 @@ require("slickgrid/slick.interactions.js")

require("./scripts/jq_extensions.js")

window.moment = require("moment")
window.CSV = require("comma-separated-values/csv")

require("leaflet")
require("leaflet.markercluster")
require("leaflet-providers")
require("angular-filter/index.js")

require("./lib/jquery.tooltip.pack.js")

require("./scripts/pie-widget.js")
require("./scripts/widgets.js")
require("./scripts/main.js")
require("./scripts/app.js")
require("./scripts/search_controllers.js")

require("./scripts/kwic_download.js")
require("./scripts/main")
require("./scripts/app")

require("./scripts/controllers/comparison_controller.js")
require("./scripts/controllers/kwic_controller.js")
require("./scripts/controllers/example_controller.js")
require("./scripts/controllers/statistics_controller.js")
require("./scripts/controllers/trend_diagram_controller.js")
require("./scripts/controllers/word_picture_controller.js")
require("./scripts/controllers/comparison_controller")
require("./scripts/controllers/kwic_controller")
require("./scripts/controllers/example_controller")
require("./scripts/controllers/statistics_controller")
require("./scripts/controllers/trend_diagram_controller")
require("./scripts/controllers/word_picture_controller")
require("./scripts/controllers/map_controller")

require("./scripts/map_controllers.js")
require("./scripts/text_reader_controller.js")
require("./scripts/video_controllers.js")
require("./scripts/services.js")
require("./scripts/extended.js")
require("./scripts/struct_services.js")
require("./scripts/directives.js")
require("./scripts/directives/scroll.js")
require("./scripts/filter_directives.js")
require("./scripts/matomo.js")

// TODO Remove, currently used in tests
/** @deprecated */
window.locationSearch = locationSearchGet
4 changes: 2 additions & 2 deletions app/lib/jquery.localize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { default: settings } = require("@/settings");
const { locationSearchGet } = require("@/util");
const { locationSearchGet, getService } = require("@/util");

(function($) {
dl_cache = {}
Expand Down Expand Up @@ -45,7 +45,7 @@ const { locationSearchGet } = require("@/util");
$.fn.localize = function() {
//TODO: make this less slow.
var lang = locationSearchGet("lang") || settings["default_language"];
var data = loc_data[lang];
var data = getService("$rootScope")["loc_data"][lang];
this.find("[rel^=localize]").each(function(i, elem) {
var elem = $(elem);
var key = elem.attr("rel").match(/localize\[(.*?)\]/)[1];
Expand Down
Loading

0 comments on commit 684b485

Please sign in to comment.