Closed annanimous closed 8 years ago
Thought about this too, would be a nice improvement.
This would be fantastic, especially for the collectors because it's become much harder to get state flags because of city flags.
I would first require a matrix of which city belongs to which region, it's quite a hassle to figure out.
Seems like noone is up for the task to figure out which city belongs to which province/state.
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.
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?
I just don't have time for it if the solution isn't simple enough. I need to shitpost as well.
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?
Why not use a different branch instead of a folder?
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
@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.
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.
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
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.
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.
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.
Business idea: A checkbox which optionally shows only the first regional flag and no cities/municipalities. Maybe two for the UK.
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.
I'll probably have time this weekend, if anyone else wants to do it, feel free :)
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
@spurdo-sparde Have you checked the US flags folder? We have some cities already. Just making sure you aren't doing double work.
@WhatIsThisImNotGoodWithComputers Yeah.
Had no time for this this weekend, will hopefully finalize next weekend.
@WhatIsThisImNotGoodWithComputers Sounds good. I'll keep up going with flags, currently on Cali (Lots of stuff.)
Pushed Arizona, Arkansas, California, and Colorado.
@WhatIsThisImNotGoodWithComputers Can you add me as a contributor so I can directly commit my flags?
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.
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.
@WhatIsThisImNotGoodWithComputers Looks like it's broken for me.
Are you using the original as well? If yes, can you disable it and try again?
Yep, now it's working.
@WhatIsThisImNotGoodWithComputers I've dropped the beta to a new branch.
@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.
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.
Implemented filter to be restrict all flags to country + first region.
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.
Fixed a bug which would only show first word of hover instead of full name. Updated from 0.20 to 0.21.
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.