Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace relative paths "/wiki/" with $wgScriptPath #46

Open
4 of 5 tasks
simontaurus opened this issue Aug 21, 2023 · 0 comments
Open
4 of 5 tasks

replace relative paths "/wiki/" with $wgScriptPath #46

simontaurus opened this issue Aug 21, 2023 · 0 comments

Comments

@simontaurus
Copy link
Collaborator

simontaurus commented Aug 21, 2023

  • Option1: $wgArticlePath for direct page links. May or may not contain query params, e.g. /wiki/ vs /w/index.php?title=
  • Option2: $wgScript to build a query like $wgScript + ?title=<title>
  • Option3: $wgScriptPath for $wgScriptPath + /index.php or /api.php + query string

js mw.config see https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#mw.config or directly use mw.util.getUrl( 'MediaWiki:Foo.css', { action:'raw' } (see https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util)

Also needs replacement in schemas:

{
    "@context": [
        "/wiki/Category:Item?action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "/wiki/Category:Item?action=raw&slot=jsonschema"
        }
    ]
}

to

{
    "@context": [
        "./Category:Item?action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "./Category:Item?action=raw&slot=jsonschema"
        }
    ]
}

(requires pretty urls, "./" is required because ":" is not allowed in the first path segment)
or

{
    "@context": [
        "./index.php?title=Category:Item&action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "./index.php?title=Category:Item&action=raw&slot=jsonschema"
        }
    ]
}

see also: https://stackoverflow.com/questions/24028561/relative-path-in-html

ToDo:
replace all "/w/api..." with mw.config.get("wgScriptPath") + "/api..."

replace all "/wiki/title" with mw.util.getUrl("title")

  • fix extension MwJson
  • fix extension OpenSemanticLab
  • fix extension InteractiveSemanticGraph
  • fix editor extensions
  • fix OpenSemanticWorld-Schemas (minor, already handled by bundler in MwJson)
simontaurus added a commit to OpenSemanticWorld-Packages/world.opensemantic.core that referenced this issue Sep 10, 2023
simontaurus added a commit that referenced this issue Oct 7, 2023
simontaurus added a commit to OpenSemanticLab/mediawiki-extensions-MwJson that referenced this issue Oct 7, 2023
simontaurus added a commit to OpenSemanticLab/mediawiki-extensions-MwJson that referenced this issue Oct 8, 2023
simontaurus added a commit to OpenSemanticLab/mediawiki-extensions-SvgEditor that referenced this issue Oct 17, 2023
simontaurus added a commit to OpenSemanticLab/mediawiki-extensions-ChemEditor that referenced this issue Oct 17, 2023
simontaurus added a commit to simontaurus/WellplateEditor that referenced this issue Oct 17, 2023
simontaurus added a commit to OpenSemanticLab/mediawiki-extensions-SpreadsheetEditor that referenced this issue Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant