flaghunters / Extra-Flags-for-4chan

Extra Flags for 4chan boards, supports /int/, /sp/ and /pol/.
https://flaghunters.github.io/Extra-Flags-for-4chan/
Other
46 stars 65 forks source link

Show province flags if user have selected certain city #88

Closed annanimous closed 8 years ago

annanimous commented 8 years ago

Maybe add an option to show whole hierarchy: country - state/province/region - city? USA - Washington DC or Russia - Moscow is ok, because they are on the 1-st level of administrative division, but USA - San Francisco look not nice.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Thought about this too, would be a nice improvement.

Thsar999 commented 8 years ago

This would be fantastic, especially for the collectors because it's become much harder to get state flags because of city flags.

WhatIsThisImNotGoodWithComputers commented 8 years ago

I would first require a matrix of which city belongs to which region, it's quite a hassle to figure out.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Seems like noone is up for the task to figure out which city belongs to which province/state.

ghost commented 8 years ago

http://www.unece.org/cefact/locode/service/location.html

WhatIsThisImNotGoodWithComputers commented 8 years ago

It's something, but not enough it seems. http://www.unece.org/fileadmin/DAM/cefact/locode/nl.htm If you take Netherlands for example, it shows a lot of sublocations but not everything matches to a higher level region. Also the higher regions only show two letter codes, which isn't enough for me to run an automated script or something.

ghost commented 8 years ago

Well, could you use it for some of the countries, and figure something else out for others? For example, here is a Wikipedia page of cities and their provinces of The Netherlands. In the unece.org link, Canada for example is correct. Why won't two letter codes work? Some have 3 letters as well, and some have numbers. I don't know anything about programming, but couldn't you run a separate script for each country?

WhatIsThisImNotGoodWithComputers commented 8 years ago

I just don't have time for it if the solution isn't simple enough. I need to shitpost as well.

WhatIsThisImNotGoodWithComputers commented 8 years ago

First setup is made (beta folder). The file in here can be used to develop (the original script may not be touched yet).

TODO:

I don't have time yet, I will probably start on this next weekend.

@flagzzzz Any more ideas or interested in contributing?

WhatIsThisImNotGoodWithComputers commented 8 years ago
sdjklag commented 8 years ago

Why not use a different branch instead of a folder?

flagzzzz commented 8 years ago

I'd like to help out, although I have next to no experience with web development and server stuff. With recursion implemented in the region selection, how would the post flag data be stored? Would every region and subregion selected be stored on the backend, or would it just be the most sub subregion? I suppose you could set it up so that the backend stores an array like such:

[region, subregion1, subregion2, ...]

to each post number then just iterate through the array with the script and load each flag sequentially on page load

WhatIsThisImNotGoodWithComputers commented 8 years ago

@flagzzzz Exactly, it will store as an List or Array.

@sdjklag Using a different branch would be preferred but because it took a while to find someone who knows git I wanted to keep it as simple as possible for anyone to contribute may they want to. The 'regular' version is in production so I want to prevent updates to script, thought using different branches would allow merge mistakes. I have no way to lock a single file and I cannot lock the whole master branch. Using a separate file instead of a branch would also allow easier access for beta testers. If you have a better idea, let me know.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Made some progress, not as much as I hoped to. Need to think of some good solution to implement the recursion for dropdown selectors for the regions.

flagzzzz commented 8 years ago

Check out https://github.com/flagzzzz/Extra-Flags-for-4chan/blob/patch-1/beta/Extra%20Flags%20for%20int%20BETA.user.js

I've got it set up to recursively go through folders. The "Go into folder" button enters the folder, while the "Back a step" button goes up. The "save settings" button will store the "regions" array locally. I also included prototype method of displaying the extra flags by a loop.

In my repo in the "patch-1" branch, I went through and added Canadian flags so you can see what how the script is like with two countries. The script I linked you will automatically use that repo

WhatIsThisImNotGoodWithComputers commented 8 years ago

Looks good fam! Invited you, so if you would, please merge your changes to this repo.

Want to make some changes though. Need to rename some texts, country should be changed into region when setting up regions for example and go into folder should be something like select region. Other than that, going back up a level should remember the choices you made earlier. For example selecting USA > Alabama > Mobile > back up a lvl > save should save USA + Alabama.

Got not time atm, will probably be tomorrow.

flagzzzz commented 8 years ago

Updated once more and merged.

Took care of text changes, going back will remember your choices and will autoselect your last choice (i.e. you have USA > Alabama > Birmingham then go back, the selected choice in the select box will be Alabama). After you set your region, a pop up will come up confirming what you have. I put a method in place that will detect when the user has reached a dead end (no more folders in current directory) and will stop the user from going onward.

Also added a tooltip to the "Save Region" button, clarifying what happens when you press it.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Thanks lad, really, great job. Made some changes to the html part, mostly deduplications. Also modified some text values and added a string to make it easier and more intuitive. I'll start on the php part tomorrow.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Business idea: A checkbox which optionally shows only the first regional flag and no cities/municipalities. Maybe two for the UK.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Backend scripts are checked in and working. For now the userscript only contains two example calls -it does not work yet-, the submit and get calls should be updated to support the array in the proper format and some more cleanup could be done.

WhatIsThisImNotGoodWithComputers commented 8 years ago

I'll probably have time this weekend, if anyone else wants to do it, feel free :)

tiikeri commented 8 years ago

I'll work on some flags, I'm doing ones that are simple and easy to make first.
Pennsylvania flags done. Included: Abington, Bethel Park, Bristol Twp, Coatsville, East Lampeter Twp, Easton, Gettysburg, Harrisburg, Hopewell Twp, Huntingdon, Meadville, Nanticoke, Pottstown, Springfield Twp, York_

Alabama flags done. Included: Andalusia, Atmore, Auburn, Dauphin Island, Elba, Enterprise, Gadsden, Greensboro, Mobile, Montgomery, Tuscaloosa, Vestavia Hills

WhatIsThisImNotGoodWithComputers commented 8 years ago

@spurdo-sparde Have you checked the US flags folder? We have some cities already. Just making sure you aren't doing double work.

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers Yeah.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Had no time for this this weekend, will hopefully finalize next weekend.

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers Sounds good. I'll keep up going with flags, currently on Cali (Lots of stuff.)

tiikeri commented 8 years ago

Pushed Arizona, Arkansas, California, and Colorado.

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers Can you add me as a contributor so I can directly commit my flags?

WhatIsThisImNotGoodWithComputers commented 8 years ago

New beta script is ready, test here: https://github.com/flaghunters/Extra-Flags-for-4chan/blob/master/beta/Extra%20Flags%20for%20int.user.js Click Raw to install.

Please report any bugs you encounter.

TODO

If there's no bugs or additions I'll push the update somewhere next week.

@spurdo-sparde Invited.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Beta script works side by side with original, if you do not disable your original flag script now, be sure to remember to turn it off once we go live.

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers Looks like it's broken for me. screenshot from 2016-05-09 18 12 47

WhatIsThisImNotGoodWithComputers commented 8 years ago

Are you using the original as well? If yes, can you disable it and try again?

tiikeri commented 8 years ago

Yep, now it's working. screenshot from 2016-05-10 11 10 44

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers I've dropped the beta to a new branch.

tiikeri commented 8 years ago

@WhatIsThisImNotGoodWithComputers I'm being kind of lazy here and skipping flags with only circle charges, because I don't want to waste time doing them.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Don't think we really need a separate branch tbh. We need to start migrating now. I'll open up a new issue for migration of flags to the new style.

Script is pretty much done I think, as soon as we get most of the flags ready in new order we can switch.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Implemented filter to be restrict all flags to country + first region.

WhatIsThisImNotGoodWithComputers commented 8 years ago

v2 is live Updating your addons should include the script in the updates and you should be able to update. Please try it and report bugs asap.

In a couple of hours I will disable the api for v1 with a message to tell users to update to force them to update to v2.

WhatIsThisImNotGoodWithComputers commented 8 years ago

Fixed a bug which would only show first word of hover instead of full name. Updated from 0.20 to 0.21.