Ikariam Shortcuts v1.2

By Hasan USLU Last update Feb 7, 2009 — Installed 4,744 times.

Suggestions

in
Subscribe to Suggestions 3 posts, 2 voices



oliezekat Scriptwright

Hi,

Nice idea, you may continue...

I submit
- attach shortkeys to current selected city (in header)
- allow shorkeys from any pages
- add shortkey for branch-office

Study my script to detect current city and view page. And kChen script success define links to select another city with new view ;o)

 
Hasan USLU Script's Author

Thank you very much

 
oliezekat Scriptwright

First, not use document.URL to detect current "view" because some pages use form with POST method

But body "id" equal current building name or page "view".

try
	{
	var body_id = document.getElementsByTagName("body")[0].id;
	window.status = 'body.id=' + body_id;
	}
catch (e)
	{
	var body_id = '';
	var url_view = /[\?&]view=([a-zA-Z0-9\-_]+)/.exec(document.URL);
	if (url_view != null) body_id = RegExp.$1;
	window.status = 'body.id not found, view=' + body_id;
	if (body_id == '') { window.status = 'body.id and view not found'; }
	}

In kChen script, study table.js file which have function to change current city ; we may send http request (with POST method) to change current city before to open building URL ;o)

In my script, study how I get city_id (id of current city in header) and how I obtain city's ID (and island ID) of city's name you fetch in "mainview" tag.

Good luck ^^

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel