Skip to content

Commit

Permalink
Tag search fixed
Browse files Browse the repository at this point in the history
Another fix of the fix
  • Loading branch information
LabunskyA committed Jan 21, 2015
1 parent a745a32 commit f47fe38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Sources/Dialogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ public void itemStateChanged(ItemEvent e) {
prevNya.addActionListener(getPrevNya);

tag.setPreferredSize(new Dimension(100, 20));
tag.setBackground(Color.WHITE);
heightScan.setPreferredSize(new Dimension(50, 20));
heightScan.setBackground(Color.WHITE);
widthScan.setPreferredSize(new Dimension(50, 20));
widthScan.setBackground(Color.WHITE);

hdCheckBox.setBackground(Color.WHITE);
hdCheckBoxPanel.setLayout(new FlowLayout());
Expand Down Expand Up @@ -215,7 +218,7 @@ void ShowAbout(){

JPanel southPanel = new JPanel();
JTextField madeBy = new JTextField("Made by Labunsky Artem");
JTextArea aboutNya = new JTextArea("Simple Zerochan.net image downloader.\nUse '+' to search for multiple words tag.\nUse ' ' (space) as logical and in the text field.\nUse 'or' as logical or in text field.\nUse '>' and '<' before size in height and width fields to specify nya size.");
JTextArea aboutNya = new JTextArea("Simple Zerochan.net image downloader.\nClose settings to save fields state\nUse '+' to search for multiple words tag.\nUse ' ' (space) as logical and in the text field.\nUse 'or' as logical or in text field.\nUse '>' and '<' before size in height and width fields to specify nya size.");
SimpleButton closeAbout = new SimpleButton("resources/closeNya.png");
ActionListener closeDialog = new ActionListener() {
@Override
Expand Down
5 changes: 2 additions & 3 deletions Sources/Zerochan.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,13 @@ class Checker {
public boolean CheckTag(LittleParser littleParser, Boolean check) throws MalformedURLException {
if (Window.useTag) {
String[] or = Window.tag.split("or ");
System.out.println(or);

for (String tags : or) {
Integer tagNumContains = 0;
String[] splitedTags = tags.split(" "); //for more than one tag
for (String tag : splitedTags) {
System.out.println(tag);
if (tag.length() > 0 && littleParser.parse("http://www.zerochan.net/" + Zerochan.numberNya, LittleParser.TAG).contains(tag + " "))
String parseResult = littleParser.parse("http://www.zerochan.net/" + Zerochan.numberNya, LittleParser.TAG);
if (tag.length() > 0 && (parseResult.contains(">" + tag) || parseResult.contains(tag + " ") || parseResult.contains(tag + "<"))) //fixed?
tagNumContains++;
}
if (tagNumContains == splitedTags.length)
Expand Down

0 comments on commit f47fe38

Please sign in to comment.