I installed a mediawiki and my version is 1.21.1, now I want to add some code when the page is onload using javascript. I have searched on the Internet and found we can put our scripts on the Common.js file, but I don't found Common.js in my wiki project. I have searched the whole directory and still did not find it.
Anyone could tell me how to achieve my goal?
brightbyte's answer, which worked: Enter MediaWiki:Common.js into the search box of your wiki. It will tell you the page doesn't exist - just create it. Any JS code you put in there will be executed on every page load. Of course, you have to be an administrator to create or edit that page.
This is documented at Manual:Interface/JavaScript; there are similar customisations at Manual:User group CSS and Javascript and Manual:Page customizations.
Related
I imported a web proxy from github known as rhodium on to replit, and, after some editing was satisfied with the results, but i cant seem to add HTML to a site that is proxied. Example: You use rhodium to navigate your way to www.discord.com, but you want HTML added to the page, "yourdomain.example/service/https://discord.com/". I looked at the files and online, but I wasn't able to find a way to edit the index.html of that specific page, but frankly I am extremely new to html. (and to a lot of things web-development).
https://github.com/LudicrousDevelopment/Rhodium
Any help available?
Based on what i know, you can't. Because of the security parameters. You can't attach or redirect a website which isn't on the same directory/server.
You can, however redirect to that site, inside or outside, freely.
It's my first time to add a python script into by blog, after some Googling i found that i easiest way is to use Gist, i posted my python script into Gist, i choose a python language and create public Gist, the result "Embed this gist" was a javascript
<script src="https://gist.github.com/anonymous/7842985.js"></script>
now when i paste this code into my blog and click on preview or publish, nothing appear but the same java script !
any idea please .
1.Sign in to blogger and create/edit a post
2.Click on "HTML" and not "compose" and then paste your script.The save without again clicking on compose.
(source: ctrlv.in)
Just change to “Interpret typed HTML” under Post Options -> Compose Settings in blogger
You need to switch to HTML mode instead of WYSIWYG editor. Then add the JavaScript code in place you need.
However if you switch back to Compose mode the snippet won't appear!
You have to click Preview to see it.
Also try solution mentioned here Issues adding github gist to my blog
I have this theme http://themes.two2twelve.com/site/fluidapp/light/ installed on my website running wordpress. I converted the template to a wordpress theme by following the steps here: http://thethemefoundry.com/blog/html-wordpress/ and its all working fine.
However, I have now been given the crazy task to integrate a "Back button" function in it.
What they want is to have some sort of Back button functionality (or the browser one) so when they open Team and they press Back - they go back to Home. The template is basically one-paged, you can see so in the source code.
One way I can see this happening is if I make every page a different .php file, upload them to my theme folder and then just hyperlink them. like www.yoursite.com/team.php
Another possible way (I think) would be to create a page.php template file and then post the pages using wordpress. Question: How do I tell wordpress to use page.php as the page template file?
Can you think of another way to integrate this functionality? Thanks a lot in advance.
If it always is going to return the user to the startpage you could just use the home_url(); function.
Back
If you got more advance structure and you want the button to just redirect the user back one page, you should use javascript.
Back
page.php is the default template for wordpress pages. So if no other is selected in admin, page.php will be used.
If you're using javascript to load the new content, you could use javascript pushState()and popState() to log the stuff to new url's, and it gets added to the browser history. Here's an example.
What I'm trying to do is to save the changes I make to CSS and HTML on different sites with Firebug.
Just to be clear, I don't expect Firebug to upload the changes to the server via FTP or anything. I just want to save the changes locally, so only I will be able to see them.
For example I've seen a few Firefox/Chrome extensions that add a download button under every video on Youtube, so I know it's possible to do that somehow.
If you have a different way to achieve what I'm trying to do, I'll be glad to hear about it.
(It doesn't have to be with Firebug.)
Thanks in advance!
If you don't mind using Web Developer Toolbar it's easy to save changes made to the DOM (and CSS).
When you install the toolbar, you'll get a "View Source" menu, click on that and choose "View generated source". Then just copy and paste that into a .html file.
You did not say if you alter your HTML or CSS, if CSS, FireFile is a very good addon for this.
Edit, with some Googling, i found FireDiff, which states that it can export changes made in Firebug, i have not tested it bit it's worth checking out.
You could try using Greasemonkey.
It has support for adding custom scripts that are run whenever you load a page (linked to which pages it should load on) and that can make changes to the page dynamically.
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
The http://chrispederick.com/work/web-developer/ web developer toolbar will let you add a user style sheet to a site which should achieve your goals.
This may or may not be exactly what you're asking for, but you can download the extension FireDiff in order to save changes made with FireBug. I made a little tutorial on how to do it here: https://www.youtube.com/watch?v=m4OmZLX2zd4
I have a somewhat simlar use-case that I solved differently. I'm not sure if it is what you are looking for or not. I'll describe the behavior and if that is helpful I'll explain exactly how I implemented it.
I changed the code that execute when you click "Run" (or Ctrl+Enter) to check to see if the first line of the code is a hard-coded string //LoadFromFile:<file path>. If it is, and the file exists then I pull the file off of the local file system and run it instead of executing the code in the console window. This way I can use an external text editor to write code.
My widget does not work once deployed even though it shows no errors in Dashcode. Apologies in advance for my inarticulartness with the terminology. I am a newbie.
To create the widget, I deleted the default .js file and pasted the JavaScript plus XHTML into the HTML page and created the accompanying CSS file.
The only code I can see that is generated is the plist.
I tried opening up all the permissions but nothing seems to change.
The OSX utilities console shows errors which are on lines beyond what there are numbers for in the code.
I don't think the JavaScript/XHTML/CSS is the problem as it works when in a web page and the widget does actually work within Dashcode.
Help appreciated,
Ruby
If you're using Dashcode, don't delete the default JS. file. This is important because it has the loaders necessary to render most of the parts in your widget. You can always add your custom javascript file. It also provides code that will allow it to work properly in Dashcode.