NATION

PASSWORD

NationStates++ | Browser Extension for NationStates

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.

Advertisement

Remove ads

User avatar
Port blood
Ambassador
 
Posts: 1946
Founded: Jan 06, 2009
Ex-Nation

Postby Port blood » Thu May 01, 2014 12:47 am

Shadow Afforess wrote:
Port blood wrote:
Problem being I don't have much scripting knowledge :P so i hoped afforess had some scripts so i can study them and base it from there

edit:I'm talking about fetching data,and ordering it properly in a good overview so any effects can be documented


Most of the code for the NationStates++ server (which is where I gather and store statistics on nations) would not be useful for you. NationStates++ isn't a script, it's a full-blown NationStates emulator engine. I described it a bit here: http://www.nationstates.net/page=dispatch/id=238290

I would try learning python or another high level language that will make the task easier. Programming can be self-taught.


Seeing as you code a lot on NS and in general,I hoped you had some code snippets laying around,I know a tad coding,not python though
No,I don't speak for TBR,TBH,your mom,moderation or any other person/organization,just saying before anyone thinks that
Sedgistan wrote:Discussion of UDL shirts belongs in the UDL thread.



Kelvaros Prime wrote:*Introduces head to wall repeatedly*
People are learning,join the revolution!

http://pastebin.com/JG8S5Txd

User avatar
Kazmr
Chargé d'Affaires
 
Posts: 460
Founded: Aug 23, 2013
Ex-Nation

Postby Kazmr » Thu May 01, 2014 1:17 am

More than half of the current navbar's height is due to the ad. I imagine they would have to change the ad size, of course, but there would still either be a large ad on the topbar which would then be always visilbe or it would have to be somewhere else and still taking up space for content. I imagine that getting rid of it isn't really an option.

If you're concerned about size the navbar as it is could be clipped a fair bit. Cut it down to just the width of the ad and you've shaved off a fair number of pixels there. The default font size is 13px, no? Cut it to 12 and you can save a bit of height as well.

If you want to pack in more menu options, for NS++ at least, how difficult would it be to play around with the CSS or js you're already running to create a rollout/horizontal dropdown? Perhaps some of the subpoints under nation name could be under one, your three news could be as could world assembly, and maybe put the news and FAQ into one? Perhaps even a collapsable latest forum topics?

As for bootstrap, I'm well aware its very customizable and easy to implement (I've used it myself for, say, hackathons and whatnot where maybe its more about what we're doing with the back end technology rather than just the look and feel of the site), I just see enough sites with it that I personally would be able to tell :P
Former Chairman of the Peoples Republic of Lazarus
Officer of the Lazarene Liberation Army
Also known as United Gordonopia

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 2:05 am

New release. Mostly bugfixes.

Version 2.4.3.3
  • Removed Security Notice from 2/23/2014 incident.
  • Fixed RMB posting bug where form would not be accessible after 1 post, when RMB searching was disabled
  • Footer appears correctly on region pages, with infinite scroll
  • Fixed bug causing Firefox not to load KiwiIRC frame correctly in rare occasions
  • Changed settings to show advertisments by default at admin request (can still be disabled in settings)
  • Flipped placement of regional/nationstates settings in menu.
  • Removed Survey Link
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 2:17 am

Port blood wrote:Seeing as you code a lot on NS and in general,I hoped you had some code snippets laying around,I know a tad coding,not python though


I don't use random scripts or bits of code. I build tools that can handle various tasks. Tools like NS-API and NS-DUMPS, which transform the NS Api into java objects, and data dumps into SQL database formats. I don't do things by half-measures.

I recommend you pick up an easy language like python to expore the API. It's a good way to learn.

Kazmr wrote:More than half of the current navbar's height is due to the ad. I imagine they would have to change the ad size, of course, but there would still either be a large ad on the topbar which would then be always visilbe or it would have to be somewhere else and still taking up space for content. I imagine that getting rid of it isn't really an option.


You must have a very tall vertical screen for the ads to be consuming 1/2 the vertical screen space. On 1920x1080 the "latest forum topics" extends all the way down near to the bottom. There is maybe 2 inches of free white space at the bottom. On a smaller screen I expect there would be none.

On that note, I hate the latest forum topics. Feels very spammy to me. I wish it would be removed.

Kazmr wrote:If you're concerned about size the navbar as it is could be clipped a fair bit. Cut it down to just the width of the ad and you've shaved off a fair number of pixels there. The default font size is 13px, no? Cut it to 12 and you can save a bit of height as well.


It's not just about the size. The sidebar looks and feels antiqued. It uses ALL-CAPS words and a sans-serif font that makes it seem very blocky.

Kazmr wrote:If you want to pack in more menu options, for NS++ at least, how difficult would it be to play around with the CSS or js you're already running to create a rollout/horizontal dropdown? Perhaps some of the subpoints under nation name could be under one, your three news could be as could world assembly, and maybe put the news and FAQ into one? Perhaps even a collapsable latest forum topics?


Maybe, but any time I change much with the sidebar I get complaints that I am killing people's pet dogs or something similar. If the admins change something it is divine and good, but if a player tweaks it, it is hell-spawn. At least that sort of reaction has been my experience.
Last edited by Shadow Afforess on Thu May 01, 2014 2:18 am, edited 1 time in total.
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Kazmr
Chargé d'Affaires
 
Posts: 460
Founded: Aug 23, 2013
Ex-Nation

Postby Kazmr » Thu May 01, 2014 2:39 am

I suppose I should have clarified that it takes up half of the total space on the sidebar when scrolling down, not at the very top of the page; the ad itself is within the <div id="panel> that contains the sidebar content. On chrome without NS++ installed at 1920x1080 resolution I'm seeing the calculated size at 194x1068 with the ad at 160x600.

What I'm saying is that the ad has to go somewhere. I imagine it'd look horrendeous in the top bar, but then you're still stuck with a large block somewhere else on the page that's already over half the height and only slightly thinner than what the current sidebar is unless you want to change ad sizes.
Former Chairman of the Peoples Republic of Lazarus
Officer of the Lazarene Liberation Army
Also known as United Gordonopia

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 2:41 am

Kazmr wrote:I suppose I should have clarified that it takes up half of the total space on the sidebar when scrolling down, not at the very top of the page; the ad itself is within the <div id="panel> that contains the sidebar content. On chrome without NS++ installed at 1920x1080 resolution I'm seeing the calculated size at 194x1068 with the ad at 160x600.

What I'm saying is that the ad has to go somewhere. I imagine it'd look horrendeous in the top bar, but then you're still stuck with a large block somewhere else on the page that's already over half the height and only slightly thinner than what the current sidebar is unless you want to change ad sizes.


Plenty of sites stick ads at the top of the page and look decent -> http://www.nytimes.com/

Although I am not a fan of ads, and if the admins hold out on improving the site look and feel simply out of concern for maximizing ad revenue, something is rather wrong.
Last edited by Shadow Afforess on Thu May 01, 2014 2:42 am, edited 1 time in total.
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Kazmr
Chargé d'Affaires
 
Posts: 460
Founded: Aug 23, 2013
Ex-Nation

Postby Kazmr » Thu May 01, 2014 3:00 am

Shadow Afforess wrote:
Kazmr wrote:I suppose I should have clarified that it takes up half of the total space on the sidebar when scrolling down, not at the very top of the page; the ad itself is within the <div id="panel> that contains the sidebar content. On chrome without NS++ installed at 1920x1080 resolution I'm seeing the calculated size at 194x1068 with the ad at 160x600.

What I'm saying is that the ad has to go somewhere. I imagine it'd look horrendeous in the top bar, but then you're still stuck with a large block somewhere else on the page that's already over half the height and only slightly thinner than what the current sidebar is unless you want to change ad sizes.


Plenty of sites stick ads at the top of the page and look decent -> http://www.nytimes.com/

Although I am not a fan of ads, and if the admins hold out on improving the site look and feel simply out of concern for maximizing ad revenue, something is rather wrong.

I personally don't like the NYT ads up there, tbh (though I suppose it didn't stop me from subscribing; dirt cheap student rate ftw). For them I've always seen their header as emulating the masthead on a newspaper, since visually thats what it seems to do, but the ads on the web version (which replaces their tagline and a small blurb with the edition and weather: see here have always seemed a bit out of place to me. I can see there being some ways to get it cleanly up top, but I was largely responding to your argument regarding the size and how much space the infobar took up.

As it is ad is mostly hidden until you scroll down, and it can be scrolled past on longer pages. With a header you would have a few options:

1. Include the ad in the fixed header, which would limit the space a lot and would then be with you on the whole page. Probably the worst option.
2. Include it in a header that isn't fixed, with either an additional fixed header that follows the user (kind of the nytimes style or no fixed header at all.
3. Work the ad in somewhere else. Problem with this one is you still then have a big block out and your space issue isn't really that solved, just spread out since you seemed to be coming at this at first from a pixels on the screen perspective.

I don't think its a matter of maximizing ad revenue; I think its an issue of getting enough ad revenue to pay for or take the load of of the server costs. If they cared about maximizing revenue we'd have a lot more than just one sidebar ad. I imagine that any sort of new design would have to incorporate it somewhere, but it'd need a lot of consideration exactly where so that it is both in a place where they don't get dinged for hiding it but also somewhere where the new design could actually cut down on clutter and not just spread it around a bit.
Former Chairman of the Peoples Republic of Lazarus
Officer of the Lazarene Liberation Army
Also known as United Gordonopia

User avatar
Inspired By The Novel
Secretary
 
Posts: 34
Founded: Apr 05, 2014
Ex-Nation

Postby Inspired By The Novel » Thu May 01, 2014 8:53 am

Shadow Afforess wrote:
Inspired By The Novel wrote:
If you change the UI I am going to murder my pet kangaroo.

:(

Now then, Affy:

Code: Select all
if (document.title=="NationStates | Change Region")
{
$(".info a").click();
}

Code: Select all
window.location=$(".info a").href;


I understand the code you have to get past the Change Region page on a move, but I was wondering why either one of my codes above doesn't work in an extension. Both work from the console but neither work in an extension.

I am editing your code to write my own custom extension for defending, and would prefer to do it this way but it isn't working. Any idea why?

Thanks, one love. ♡


Submitting the change region button causes your browser to execute a POST request. You can not do a post request from the address bar, only from a form or code. Jquery lets you post with $.post(URL, formdata, callback);


I understand your Jquery, I am asking why mine doesn't work instead. :P

I don't want to do a POST request or do an event.preventDefault() on the move button, I want to go to the Change Region page and simulate a click or navigate to the $(".info a").href that is in the <p class="info"> you get telling you "Success! Inspired By The Novel is now located in <a href="THE LINK TO ACT ON">Unity</a>.

Go to the change region page after moving (the one you land on by default) and type
Code: Select all
$(".info a").click();
or
Code: Select all
window.location=$(".info a").href;
into your console and it takes you to the region page, but do it in an extension and it does nothing.

Why? :(

Also I did not know about your NS-API that is very cool and interesting, thank you! :)

User avatar
The Blaatschapen
Technical Moderator
 
Posts: 62659
Founded: Antiquity
Anarchy

Postby The Blaatschapen » Thu May 01, 2014 9:14 am

Shadow Afforess wrote:
Inspired By The Novel wrote:
If you change the UI I am going to murder my pet kangaroo.

:(

Now then, Affy:

Code: Select all
if (document.title=="NationStates | Change Region")
{
$(".info a").click();
}

Code: Select all
window.location=$(".info a").href;


I understand the code you have to get past the Change Region page on a move, but I was wondering why either one of my codes above doesn't work in an extension. Both work from the console but neither work in an extension.

I am editing your code to write my own custom extension for defending, and would prefer to do it this way but it isn't working. Any idea why?

Thanks, one love. ♡


Submitting the change region button causes your browser to execute a POST request. You can not do a post request from the address bar, only from a form or code. Jquery lets you post with $.post(URL, formdata, callback);


You can also do POSTs with a RESTClient (eg. https://addons.mozilla.org/en-US/firefo ... estclient/ ), which you could argue is just a GUI for the $.post(url, formdata) thing (no callback, it just gives the response in a small window. But still, for the less tech literate ones, they can try stuff with that (as long as it stays within scripting rules here, I guess).
The Blaatschapen should resign

User avatar
Inspired By The Novel
Secretary
 
Posts: 34
Founded: Apr 05, 2014
Ex-Nation

Postby Inspired By The Novel » Thu May 01, 2014 9:21 am

Or you could just use Jquery's .click() which anyone can do from their console. :P

Easier to understand than http request methods which may be a bit unnecessary, and those of us used to the change region page might not mind seeing it for a second before the change.

User avatar
Mr Ryan
Civil Servant
 
Posts: 7
Founded: Sep 21, 2007
Ex-Nation

Postby Mr Ryan » Thu May 01, 2014 9:23 am

The footbar div hides the Submission/Preview buttons when infinite scroll is turned off.

http://i.imgur.com/8pVVTR9.png

You can see the buttons poking out just at the top on the left.

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 11:51 am

Thanks Mr Ryan for pointing that out. Fixed.

Version 2.4.3.4
  • Fixed bug where footer would hide submission form when infinite scroll was disabled.
  • Improved error handling for recruitment campaigns
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
[violet]
Site Admin
 
Posts: 16045
Founded: Antiquity

Postby [violet] » Thu May 01, 2014 1:42 pm

Shadow Afforess wrote:any time I change much with the sidebar I get complaints that I am killing people's pet dogs or something similar. If the admins change something it is divine and good, but if a player tweaks it, it is hell-spawn.

Ha, I wish. Last time I modified a few pixels in the sidebar there were many complaints.

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 2:29 pm

It's the day of bug fixes. New release, because violet renamed the hyperlink "Switch to Forum View", to the more minimalist "Forum View". I approve the change, just wish my code was less horrible.

Version 2.4.3.5
  • Fixed invisible RMB submission menu caused by change to NS code-change
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Fendon
Spokesperson
 
Posts: 114
Founded: Jun 04, 2013
Ex-Nation

Postby Fendon » Thu May 01, 2014 4:39 pm

Hi there,

I'm finding that when I have NS++ enabled, I can't post on any Regional RMB. I was just wondering if there is a quick fix on this that I can initiate, or if there is a bug with the extension?

Cheers,

Dan

User avatar
The Leningrad Union
Chargé d'Affaires
 
Posts: 471
Founded: Apr 23, 2014
Ex-Nation

Postby The Leningrad Union » Thu May 01, 2014 4:41 pm

There's no button to leave an RMB post or search for posts right now.
I founded Madrigal and Confederacy of Allied States. However, I have given up my power in both. I reside in Iraq currently. Come join me!

Parody of typical NSG sig:

NSG's resident Liberal Gay Atheist because there's totally no other liberals, gays or atheists here!
Impeach GP, Legalize RP, NSG 2016!
Mallorea and Riva should resign
*Insert some uneducated statement about how I support a stupid ideology that I heard about in my middle school social studies class*
*Insert some typical liberal and/or edgy statement about Gaza and/or Ukraine*

some popular TETer wrote:Leningrad iz kewl

some dude that agreed with me on a debate wrote:Just listen to Leningrad!

User avatar
Thafoo
Post Czar
 
Posts: 33492
Founded: Mar 19, 2011
Ex-Nation

Postby Thafoo » Thu May 01, 2014 4:46 pm

You can post if you switch to the forum view, but not if you're on the main region page.

On the main region page, though, you could quote someone and just delete their quote and post. That works, too.

User avatar
Enfaru
Minister
 
Posts: 2921
Founded: Apr 20, 2012
Ex-Nation

Postby Enfaru » Thu May 01, 2014 4:57 pm

In another thread it was mentioned at the side bar is supposed to have a Sans-serif font... according to the CSS it's supposed to be inherited from the body, so "Verdana, Tahoma, sans" however... may side bar font is displaying as Serif. Is NS++ doing something strange that I need to edit?
Sovereign Charter Quick Links
Factbook · Role-plays · RMB · Map (Origin | Quantum) · Chat · Members: 73
Myraxia: One does not learn to GM; One throws oneself in and prays they don't fuck up too badly.
Game Master
Founder of the Sovereign Charter,
4th President and,
Tutor of the College of Theatrics

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 5:09 pm

Fendon wrote:Hi there,

I'm finding that when I have NS++ enabled, I can't post on any Regional RMB. I was just wondering if there is a quick fix on this that I can initiate, or if there is a bug with the extension?

Cheers,

Dan


The Leningrad Union wrote:There's no button to leave an RMB post or search for posts right now.


Literally fixed in the post above. Check for updates to the extension.
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Enfaru
Minister
 
Posts: 2921
Founded: Apr 20, 2012
Ex-Nation

Postby Enfaru » Thu May 01, 2014 5:12 pm

The quick fix is to switch to forum view and scroll to the bottom.
Sovereign Charter Quick Links
Factbook · Role-plays · RMB · Map (Origin | Quantum) · Chat · Members: 73
Myraxia: One does not learn to GM; One throws oneself in and prays they don't fuck up too badly.
Game Master
Founder of the Sovereign Charter,
4th President and,
Tutor of the College of Theatrics

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 5:13 pm

Enfaru wrote:The quick fix is to switch to forum view and scroll to the bottom.


The quick fix is to go to the addon/extensions area of your browser and force update your extensions.
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

User avatar
Fendon
Spokesperson
 
Posts: 114
Founded: Jun 04, 2013
Ex-Nation

Postby Fendon » Thu May 01, 2014 5:27 pm

Shadow Afforess wrote:
Enfaru wrote:The quick fix is to switch to forum view and scroll to the bottom.


The quick fix is to go to the addon/extensions area of your browser and force update your extensions.


That's better. Thanks :)

User avatar
Enfaru
Minister
 
Posts: 2921
Founded: Apr 20, 2012
Ex-Nation

Postby Enfaru » Thu May 01, 2014 5:32 pm

Shadow Afforess wrote:
Enfaru wrote:The quick fix is to switch to forum view and scroll to the bottom.


The quick fix is to go to the addon/extensions area of your browser and force update your extensions.


No Updates found.

I'll stick to my method until an update is found.
Sovereign Charter Quick Links
Factbook · Role-plays · RMB · Map (Origin | Quantum) · Chat · Members: 73
Myraxia: One does not learn to GM; One throws oneself in and prays they don't fuck up too badly.
Game Master
Founder of the Sovereign Charter,
4th President and,
Tutor of the College of Theatrics

User avatar
Darwinish Brentsylvania
Senator
 
Posts: 4590
Founded: Aug 21, 2013
Ex-Nation

Postby Darwinish Brentsylvania » Thu May 01, 2014 5:35 pm

Can't post on RMB without quoting, newspapers aren't showing up, has NS++ broken down?

User avatar
Shadow Afforess
Ambassador
 
Posts: 1270
Founded: Nov 06, 2013
Ex-Nation

Postby Shadow Afforess » Thu May 01, 2014 5:51 pm

Darwinish Brentsylvania wrote:Can't post on RMB without quoting, newspapers aren't showing up, has NS++ broken down?

Nope. What newspapers are you having problems with? I see them fine. Make sure you are on the latest version.

Enfaru wrote:
Shadow Afforess wrote:
The quick fix is to go to the addon/extensions area of your browser and force update your extensions.


No Updates found.

I'll stick to my method until an update is found.


Latest is v2.4.3.5, I see the latest fine on all browsers. If you are on Firefox, you may need to clear your cache. Firefox loves caching addon updates for 24 hours.
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Belarusball, Big Boys Ville

Advertisement

Remove ads