ASCIIMath and TiddlyWiki - javascript

I use TiddlyWiki for work-notes. I already have pretty large wiki, but now I want to add math-support. As far as I understand what is written here, all I would have to do to use ASCIIMathML in my wiki would be including the script ASCIIMathML.js. Doesn't work (no effect at all). Then I found this plugin for TiddlyWiki, but when I import it to my wiki, it gives me an error in one of the regexp strings. When I download that wiki directly, ASCIIMath does not work anymore, even though I have the script in the same directory.
Does anyone have a solution available, how I can add ASCIIMath to my existing TiddlyWiki?
Edit: I know this not strictly a programming question, but questions about tools (such as SVN or VisualStudio) get asked here all the time, and I see no-one complaining there.

Ok, I've got it now. The plugin I linked in the question works, but one has to import by creating the tiddler manually and then copy/paste the script, otherwise what comes in is messed up. Then, one has to import the ASCIIMathML.js in the header-section of the wiki-file.

ASciencePad sounds like exactly what you need: TiddlyWiki + WISYWIG + AsciiMathML + AsciiSVG.
I'm not sure how to translate your existing wiki to it, but I guess you could cut-and-paste the wiki source?

You ought to be able to migrate all the tiddlers from one TiddlyWiki variant to another easily. At the worst you could just copy the block of tiddlers at the bottom of the html file in a text editor and paste them into the new file. (Since the "wiki source" is that html file, I'm not saying anything different than Beni Cherniavsky-Paskin did.)
Roger_S

Related

Translating minicart and other javascript related strings in magento 2.1.3

I am learning magento 2, i have started with basics like creating module, then a theme.
Since magento does not come with slovak language i want to do some translation on frontend and later on backend.
I have succeed translating frontend where no javascript / knockout template is used, by placing sk_SK.csv into company/themename/i18n.
I have read about issue on github that in magento 2.0 translation of javascript strings does not work using this method, so i have upgraded to latest version (2.1.3), and its still not working.
I have checked vendor/magento-checkout/i18n/ where the ex. string "Go to Checkout" is defined. So I have tried the override method used also for overriding templates (created company/themename/Magento_Checkout/i18n/sk_SK.csv) and placed the translation here. it does not worked also.
Note: After each change i delete the static folder and run the command to generate static content for sk_SK then i clean the cache and flush the cache, in browser i do hard reload with cleaning cache.
Yes there are lot of topics on github, stackoverflow, docs... but i do not understand them, these answers are written i thing for super professionals.
Note 2: Theoretically i can hard-code slovak language into web/minicart/content.html (not sure if path is right) by overriding this file. But this is not solution for possible multi-language website.
Note 3:
I have did also an export using i18n, but the output is messed up. like "Hello "World"!","something" same quotes in quotes without escape.its pain to open in any excel kind of app (partly succeed with libreoffice calc) because it has long string and too much strings not friendly for developers or people who will do the translation.
What kind of answer i want to receive is like this:
1. Copy this file here, because..[explanation]
2. Edit/Add/Whatever here, because....
3. etc...
Why? I want to learn and not just copy paste.
Thank you

After save (ctrl+s) Javascript file change all format

I am having a problem with intellij IDE community edition 14.03 version that i hope you can help me,
when i modify a javascript file (an small change like a space) looks like intellij is changing the format or something behind scenes because when i check with svn tortoise in show differences as unified diff option looks like i was changing all my file, removing all the lines and the adding them again with the new change(the space that i added).
note: i was modifying the same file with webstorm IDE and when i select the same option(show differences as unified diff), this is just modifying the line that i change. i dont know if is something in my setting or a bug.
after checking this problenm with intellij team, in the bug
https://youtrack.jetbrains.com/issue/WEB-15304
We realize that the problem was due to .editorconfig file, we can work with .editconfig file to standarize the format of our files, doesn't matter what IDE are you working on, but in my case this file was getting my a headache, in my case the only thing that i need to do to solve my problem was remove does files in my project and everything is working fine now.
but i just wanna to mention that this file could solve a lot of our problems if our team work with differents IDEs
I am leaving the link about this if you are interested on it.
http://editorconfig.org/

How to find an issue when using foreign JavaScript?

My problem is quite generic: I know that I have a JavaScript issue somewhere. Now I don't know how to start searching where the problem could be. Usually I use the Firefox built-in or the Firebug Debugger. I know how to use it in general. But what I don't know is where to start. Where should I set breakpoints? I often have this kind of problem.
As an example which is my current problem: I have a page with an unordered list. Every second list item is empty for some reason. I can see that the page gets loaded with proper list items. But then some JavaScript seems to add those empty items. It's a Yii application that inserts some JavaScript directly into the HTML but let the browser also load jquery.js, bootstrap.js and yii.js. I haven't added any own JavaScript.
Now, as I said, I don't know where to start to find the problem. It might be that I have done something wrong with some configuration. But it could also be bug. I just want to figure it out somehow.
With my current issue, the best would be to have a breakpoint on a function like onInsertEmptyListItemToCounfuseDeveloper() ...
I don't want a solution to my current issue. I'd like to know in general, where and how to start finding JavaScript related problems. Especially, with third-party JS. With some applications (CMS, shops,...) there are sometimes a lot of JS files. This makes it more worser.
I hope this question is answerable and you can provide some experiences.
Not speaking 'bout the CMS right now, but in general my method is
1) If you did not add any of your onw scripts, just 3rd party, delete them all of your project e.g.
You've added jquery.js, bootstrap.js, yii.js so you remove them and then you test if all works fine, if so, add first one, for me it would've been jquery.js, test again, if no bug visible add second and so on. In this case you'll see in which file is some bug or sort of unexpected behaviour.
2) Here is the worst part, in the found file you should find the problem part. So, download the full version, not production, open it in editor, and start searching... The good news are that you don't have to look through all file, just find the event listeners in your devtolls or firebug and follow them.
All of this is just my experience , so if someone know better methods, I would like to hear 'em too.
It would depend on the code. Generally, if I have a function that is suspicious, I put breakpoints or console.log() at the beginning and end of the function and see if both are executed. Then I follow the logic down to figure out which piece is broken. It really depends on the code though.

Themes not importing remote JS files correctly in XPages

I'm having a lot of trouble with JavaScript elements in themes. All of my CSS is loading correctly, but my JavaScript doesn't seem to be.
I'm working with a combination of resource JS files uploaded as resources to the Database, JavaScript script libraries, server-stored JavaScript files, and Javascript files at http locations.
I've tried setting content-type to application/x-javascript, but that doesn't seem to work. Anything uploaded as a file resource I'm able to include by omitting the content-type, but if I add the content-type, it becomes invalid.
Example:
<resource>
<href>anytime.js</href>
</resource>
Will show up as /anytime.js"> when the page renders, but
<resource>
<content-type>application/x-javascript</content-type>
<href>anytime.js</href>
</resource>
doesn't render anything.
Additionally, trying to access something remote, like http://code.jquery.com/jquery-1.7.1.js doesn't work either way. Both omitting the content type and setting it to application/x-javascript result in nothing rendering to the browser. I'm hoping someone will be able to help me out with this one.
This is an attempt you answer your question on auto-formatting that you ask in your own answer. So this is not an attempt to answer the original question.
Yes, you can control what auto-formatting does.
For instance, you can control the XML editor auto formatting in Domino Designer Preferences under XML - XML Files - Editor. This controls XPages, custom control, themes and faces-config editing. Here you can control line width and whether to split multiple attributes each on a new line.
You can also control Java formatting in Domino Designer Preferences under Java - Code Style - Formatter. Here you can edit the existing profile or create your own profile and edit that.
I am sure there are several other places in Preferences that could be useful. Lessons learned is that whenever auto-formatting does something, you can change its behaviour.
Have a look at Nathan Freemans "Making Domino Designer work like you want" for more useful stuff that you can change in Preferences.
Okay, so, after some more testing and frustration, I figured out what's going on here. After I'd enter the code, I was doing ctrl+alt+F to auto-format the code so that the indentation would be consistent. This was causing the closing tag for to appear on the second line, like so:
<resource>
<href>URL
</href>
</resource>
If I try to render it like this, it doesn't work. So, it wasn't an issue of css vs js, but rather file length. Though that does make me wonder if there's any way to change the line length threshhold settings on the auto-format?

breakpoints in single-lined js-scripts with firebug

i want to analyze an external js-file. but the file is single-lined and obfuscated. so i cannot set meaningful breakpoints. (though automatical unobfuscation, code-indentation is assumed to be possible).
first of all, what would your suggestion be to overcome that impairement?
i wonder if it is possible to replace an external js-file with an unobfuscated nice-looking (maybe altered one) and have this one executed instead. any ideas?
i found a way. i am not accepting my answer as the answer b/c its not as comfortable as i would like it to be. so i am interested in further ideas.
you install foxyproxy and configure a new proxy for '*filename.js' (mind the asterisk!). as you host you use a local server, so '192.168.?.?' or 'localhost'.
thing is if the URL of the js-file to be replaced is 'http://www.abc.net/dir1/dir2/filename.js' then you have to make your new js-file accessible at 'http://[host]/dir1/dir2/filename.js'.
that setup is somewhat complicated. it should be possible to have the js-file replaced by another file anywhere on your disk. but it does the job.
Take some tool which has reformat code option. JetBrains WebStorm for example. It should break the lines so they will be suitable for setting breakpoints.
This should take 5-10 minutes. I doubt you will be able to do anything more without spending much time.

Categories

Resources