How can I correctly use Imacros in JS file? I added a macros script to bookmarks and took location and put inside the JS file,but it seems that its not working. What is the cause why its not working?
I used this command.
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros:/\/run/?m=%23Current.iim;
Refer the URL http://wiki.imacros.net/iimPlay() , you need to specify like this
iimPlay ("c:\MyMacros\macro1.iim")
Figured out how to run Imacros from HTML file.
Add imacros to bookmarks.
Click property, copy location link.
In Html file between <script>tag put: window.location.href='imacros://run/?m=%23Current.iim';
Related
For my jekyll blog, I'm knitting Rmd to Md for the posts. At somewhere (preferably top), I want to programmatically add a link to view the source page (Rmd) hosted under _sources folder in top level directory.
Similar implementation can be found at https://yihui.org/en/about/ (at the left sidebar- Edit this page option)
Can this be done by some modification in custom knit command?
OR
Some html-include with liquid syntax should be used?
What about this? This has the Github icon, and links to the repo on the github page. Without any reprex, or an example from you, this is the best I can do unless you give more details. Does Jekyll use YAML?
I got this working, so answering my own question
Well in Rmarkdown, we can access the current source file as knitr::current_input().
This can be combined with the url of repository to get the full link to the source file. The best way is to create a new YAML entry as
RmdSource: '_source/`r knitr::current_input()`'
Now to programmatically add the link, either we can use R code with some liquid syntex at the top of the source file OR we can use html-include file inside the current layout file.
I prefer the latter.
I'm making a "this day in history" sort of site in gh-pages, using javascript to pull the day's entry for the front page and a collection to store all the other entries indexed by date.
The entries are text files.
I've made markdown files as stubs to pull in the text files. I don't want to replicate the text files if possible, because then any typos I would have to remember to fix in two places.
As far as I can see, there are two ways to include the text files in the template:
{% include date.txt %} which requires the txt files to be in the _includes directory, thus not generated into the site and not available to the javascript on the front page
{% include_relative date.txt %} which requires the txt file to be in the collection folder, which is also not generated unless it has a yaml header, in which case it would be difficult to extract the text from the generated html.
Is there another way I'm missing for jekyll to include plain text files without them having to be in special _folders?
I'm using github pages, so plugins are out.
I think there is no other way to include text files through liquid. It is part of the way it separates published files from the pieces that go together to make the files.
The way forward is to adapt the javascript to read the text from a raw blob from the github repository.
But using an http request to raw.githubusercontent.com gives a Cross Origin Resource Sharing error.
So next way is to make a new collection with a new layout to output the input files as they are.
I am busy with making a macro in iMacros, but the script won't work.
The function of the script is to add autoplay=1 on a youtube video. I would need this macro to play youtube videos which don't automatically play on particular sites!
Here's my code:
SET !VAR1 (\"var test = document.getElementsByTagName('object')[0].getAttribute('data');
var test2 = test.replace(autoplay=0, autoplay=1)
document.getElementById(myytplayer).data=test2
")
Help is really appreciated!
This cannot work. In order to execute JavaScript in iMacros you have to use URL command
URL GOTO=javascript:javascriptcode;
And even this is not 100% sure way of executing JS on the web page.
I am not able to understand what actually parsing the html means ?
As i understand -
- it means that suppose we have any html file by parsing we can have the contents of the html file and we can edit them using parsing. Am i right ?? (parsing simply gives the idea about the contents and structure inside the file.)
I have one more question-
- I also want to know that suppose i have html file contents stored in a stream suppose (inside IStream *HTMLContents - No matter for now that how i got these contents). Is there any process exist that using these file contents may i create the preview on any window/Dialog Box/Preview pane with the same way exactly as i get the view of that html file in the browser.(for now you can imagine that i have downloded the HTML File contents from any web page(or from any where-No matter- But i have contents of html file in my stream i am sure about it) and i want to render that html file view in my own created window/Dialog Box/Preview pane(i mean it should view exactly as it appears in browser-Yes i know it won't be avle to display some pictures in html file but thats not a problem for me). How to do that ?? (I am using Visual c++ for my accomplishing my task)
Parsing basically means analyzing any data. When you parse HTML, it could be that you are figuring out where all the various elements are located and what do they do.
As for displaying HTML, it depends on what do you want to do:
If you want to open the file in your browser, use something like this.
As for displaying HTML directly in your form, I don't really know of any other way than parsing the HTML and creating your own web rendering engine. Good luck and have fun with that I guess.
Parse HTML means build object model such as DOM: https://en.wikipedia.org/wiki/Document_Object_Model in your program
I saw this guy approach into organizing PHP projects http://net.tutsplus.com/tutorials/php/organize-your-next-php-project-the-right-way/comment-page-1/#comments and i liked it, but since the head.php will be the same to all pages how can i put JS scripts only in the pages that need them?
Well, first off, putting JavaScript in the bottom of a page tends to yield the best results, but, to answer your question: if you have scripts that are only relevant to one page, you could save that script with the same name as that PHP page (obviously with a .js extension instead), and then inject the file name into the script reference. I'd also maybe add a flag so that you only look for a JS file when the flag is true:
<?php
$usesJS = true;
$filename = "somerandomname";
if($usesJS){
echo( '<script src="/js/' . $filename . '.js"></script>' );
}
?>
This would print out something like <script src="/js/somerandomname.js"></script>
Another option is to create an include file for each page and code your script tags as normal inside the include, and then reference the include. I did something like that for a simple site I did where each page had a different jQuery setup and only one needed a plugin.