⌈⌋ ⎇ branch:  freshcode


Check-in [0bdc1f7dbd]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Introduced Trove-tags select box.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0bdc1f7dbd8b8ad15774871b9330d1949545d879
User & Date: mario 2014-07-25 20:50:47
Context
2014-07-27
04:02
Utilize new :* expression placeholder for search query (binding though does not work for count()=? for some reason) check-in: 86b7fdab70 user: mario tags: trunk
2014-07-25
20:50
Introduced Trove-tags select box. check-in: 0bdc1f7dbd user: mario tags: trunk
2014-07-24
21:51
Added sourceforge project import, and allow PKG_INFO to understand LSM, Debian control files, and RPM spec check-in: 057e47927c user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to .htaccess.

1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# encoding: UTF-8
# api: apache
# title: RewriteRules
# description: Map paths onto dispatcher script
# version: 1.0
# depends: mod_rewrite



RewriteEngine On

#-- Simulate [END] flag
RewriteCond  %{ENV:REDIRECT_STATUS}  =200
RewriteRule  ^                  -                       [L,NS]

#-- Strip www. prefix
RewriteCond  %{REQUEST_METHOD}  ^GET$
RewriteCond  %{HTTP_HOST}       ^ww+\.(\w+\.\w+)\.?$
RewriteRule  ^(.*)$             http://%1/$1            [R,QSA,L]

#-- RSS/Atom aliases
RewriteCond  %{QUERY_STRING}    ^format=(atom|rss)$
RewriteRule  ^$ /feed/xfer.%1
RewriteRule ^(?:projects)\.(atom|rss|json)$  /feed/xfer.$1

#-- Page dispatching
RewriteRule  ^$                 index.php?page=index    [L,NS,QSA]
RewriteRule  ^(projects|submit|search|flag|tags|feed|login|links|forum|admin)\b/?(\w+(?:[-_]\w+)*)?(?:\.(json|atom|rss))?/?$   index.php?page=$1&name=$2&ext=$3   [L,NS,QSA]

#-- Deny direct invocations
RewriteRule  ^freshcode\.db.*$  -                       [F]
RewriteRule  ^\.                -                       [F]
RewriteCond  %{ENV:REDIRECT_STATUS}  !200
RewriteRule  ^\w+\.php(|/.*)$   -                       [F,L,NS]










>


















|








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# encoding: UTF-8
# api: apache
# title: RewriteRules
# description: Map paths onto dispatcher script
# version: 1.0
# depends: mod_rewrite


Options -MultiViews
RewriteEngine On

#-- Simulate [END] flag
RewriteCond  %{ENV:REDIRECT_STATUS}  =200
RewriteRule  ^                  -                       [L,NS]

#-- Strip www. prefix
RewriteCond  %{REQUEST_METHOD}  ^GET$
RewriteCond  %{HTTP_HOST}       ^ww+\.(\w+\.\w+)\.?$
RewriteRule  ^(.*)$             http://%1/$1            [R,QSA,L]

#-- RSS/Atom aliases
RewriteCond  %{QUERY_STRING}    ^format=(atom|rss)$
RewriteRule  ^$ /feed/xfer.%1
RewriteRule ^(?:projects)\.(atom|rss|json)$  /feed/xfer.$1

#-- Page dispatching
RewriteRule  ^$                 index.php?page=index    [L,NS,QSA]
RewriteRule  ^(projects|submit|search|flag|tags?|feed|login|links|forum|admin)\b/?(\w+(?:[-_]\w+)*)?(?:\.(json|atom|rss))?/?$   index.php?page=$1&name=$2&ext=$3   [L,NS,QSA]

#-- Deny direct invocations
RewriteRule  ^freshcode\.db.*$  -                       [F]
RewriteRule  ^\.                -                       [F]
RewriteCond  %{ENV:REDIRECT_STATUS}  !200
RewriteRule  ^\w+\.php(|/.*)$   -                       [F,L,NS]


Added doc/mktrove.php.









































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/php -qC
<?php
/**
 * api: cli
 * title: convert trove.csv
 * description: generates PHP array of trove categories and tag leaves
 *
 *  `soffice --headleass --convert-to csv trove.ods`
 *  does not work, so we need it preconverted in trove.csv
 *
 *  only first 4 columns contain the tree and leaves
 *
 */


#-- read in
$csv = array_map("str_getcsv", file(__DIR__."/trove.csv"));
unset($csv[0]);  // remove head


// target
$TREE = array();
$TMAP = array();

// last tree
$last_path = array();

# loop over lines
foreach ($csv as $row) {

    // Cut out only 5 columns (rest of spreadsheet is documentation)
    $py_trove = $row[5];
    $row = array_map("trim", array_slice($row, 0, 5));


    // merge current leave parts with last path
    if ($row = array_filter($row)) {
        $row = array_slice($last_path, 0, key($row)) + $row;
        $last_path = $row;
    }
    // skip empty
    else {
        continue;
    }
    $TMAP[] = array($py_trove, implode(" :: ", $row));

    
    // append to what we have
    $path = array_filter($row);
    $leaf = array_pop($path);
    $var = enclose("['", $path, "']");
    eval("
        \$TREE{$var}[] = '$leaf';
    ");
#            if ($up_var) unset(\$TREE{$up_var}[array_search('$up_leaf', \$TREE{$up_var})]);

}

// reorder, strip Status and License, then output
print var_export54(array(
    "Topic" => $TREE["Topic"],
    "Programming Language" => $TREE["Programming Language"],
    "Environment" => $TREE["Environment"],
    "Framework" => $TREE["Framework"],
    "Operating System" => $TREE["Operating System"],
    "Audience" => $TREE["Audience"],
    "Natural" => $TREE["Natural"],
));

// save mapping onto py-trove
file_put_contents(__DIR__."/trove.pypi-map.csv", json_encode($TMAP, JSON_PRETTY_PRINT));


#-- le functions

function enclose($pre, $values, $post) {
    return $values ? $pre . implode("$post$pre", $values) . $post : "";
}


function var_export54($var, $indent="") {
    switch (gettype($var)) {
        case "string":
            return '"' . addcslashes($var, "\\\$\"\r\n\t\v\f") . '"';
        case "array":
          //  $indexed = array_keys($var) === range(0, count($var) - 1);
            $r = [];
            foreach ($var as $key => $value) {
                $indexed = is_numeric($key);
                $r[] = "$indent    "
                     . ($indexed ? "" : var_export54($key) . " => ")
                     . var_export54($value, "$indent    ");
            }
            return "[\n" . implode(",\n", $r) . "\n" . $indent . "]";
        case "boolean":
            return $var ? "TRUE" : "FALSE";
        default:
            return var_export($var, TRUE);
    }
}

Changes to doc/trove.ods.

cannot compute difference between binary files

Changes to freshcode.css.

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * api: css
 * type: stylesheet
 * title: freshcode.club layout+style
 * description: Simulates the late freecode.com layout and looks; well mostly.
 * version: 0.5.9
 *
 * Centered two-pane layout. The #main section is usually 33% of the screen width,
 * while the #sidebar floats at the right. They're repositioned only using padding:
 * to the outer html,body{}.
 *
 */






|







1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * api: css
 * type: stylesheet
 * title: freshcode.club layout+style
 * description: Simulates the late freecode.com layout and looks; well mostly.
 * version: 0.6.0
 *
 * Centered two-pane layout. The #main section is usually 33% of the screen width,
 * while the #sidebar floats at the right. They're repositioned only using padding:
 * to the outer html,body{}.
 *
 */

471
472
473
474
475
476
477





































478
479
480
481
482
483
484
    color: #333;
    font-size: 80%;
}
.pagination-links a.current {
    background: #999;
}







































/**
 * Page footer
 *
 */
#spotlight {
    margin-top: 50pt;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
    color: #333;
    font-size: 80%;
}
.pagination-links a.current {
    background: #999;
}



/**
 * Submit form: trove select list (<ul> instead of <select>
 *
 */
#trove_tags {
    margin: 0; padding: 0;
    display: inline-block;
    position: relative;
    top: -60px;
    width: 175px;
    height: 170px;
    overflow-y: scroll;
    overflow-x: hidden;
    border: 1px solid #ccc;
    font-size: 85%;
}
#trove_tags span {
    display: block;
    margin: 0; padding: 0;
    padding-left: 10px;
    font-weight: 200;
}
#trove_tags > span {
    padding: 0;
}
#trove_tags span > span {
    background: url("img/dotleader.png") no-repeat;
}
#trove_tags span.optgroup {
    font-weight: 900;
}
#trove_tags span > span.option:hover, #trove_tags span.optgroup > b:hover {
    background: #ccf;
}


/**
 * Page footer
 *
 */
#spotlight {
    margin-top: 50pt;

Changes to gimmicks.js.

23
24
25
26
27
28
29








30
31
32
        $(this).toggleClass("trimmed");
    });

    // Likewise for compacted news feeds in #sidebar
    $(".forum .entry").one("click", function(){
        $(this).find(".excerpt, .content, .funcs").toggleClass("trimmed");
    });









});








>
>
>
>
>
>
>
>



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
        $(this).toggleClass("trimmed");
    });

    // Likewise for compacted news feeds in #sidebar
    $(".forum .entry").one("click", function(){
        $(this).find(".excerpt, .content, .funcs").toggleClass("trimmed");
    });
    
    
    // Trove tags select box
    $("#trove_tags .option").click(function(){
        var $tags = $("#tags");
        var tags = $tags.val();
        $tags.val(tags + (tags.length ? ", " : "") + $(this).data("tag"));
    });

});

lib/htmlpurifier.phar became a regular file.

cannot compute difference between binary files

Changes to tags.php.

125
126
127
128
129
130
131
132















































































































































































































































































































































































































































































































































































































133
134
135
136
137
138
139
    ];


    /**
     * Tag tree.
     *
     */
    static public $tree = [















































































































































































































































































































































































































































































































































































































    ];


    /**
     * Try to map SPDX.org names onto our license tags,
     * or find entry in long description;
     *







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
    ];


    /**
     * Tag tree.
     *
     */
    static public $tree =
    [
        "Topic" => [
            "Adaptive Technologies",
            "Artistic Software",
            "Communication",
            "Communication" => [
                "BBS",
                "Chat",
                "Chat" => [
                    "AOL Instant Messenger",
                    "ICQ",
                    "Internet Relay Chat",
                    "Unix Talk"
                ],
                "Conferencing",
                "Email",
                "Email" => [
                    "Address Book",
                    "Email Client",
                    "Filters",
                    "Mailing List Server",
                    "Mail Transport Agent",
                    "IMAP",
                    "POP3"
                ],
                "Fax",
                "FIDO",
                "File Sharing",
                "Ham Radio",
                "Internet Phone",
                "Telephony",
                "Usenet"
            ],
            "Database",
            "Database" => [
                "Database-server",
                "Front-End"
            ],
            "Desktop",
            "Desktop" => [
                "File Manager",
                "Gnome",
                "GNUstep",
                "KDE",
                "PicoGUI",
                "Screen Savers",
                "Window Manager",
                "Window Manager" => [
                    "Afterstep",
                    "Applets",
                    "Blackbox",
                    "CTWM",
                    "Enlightenment",
                    "Fluxbox",
                    "FVWM",
                    "IceWM",
                    "MetaCity",
                    "Openbox",
                    "Oroborus",
                    "Sawfish",
                    "Waimea",
                    "Window Maker",
                    "XFCE"
                ]
            ],
            "Documentation",
            "Education",
            "Education" => [
                "Computer Aided Instruction",
                "Testing"
            ],
            "Game",
            "Game" => [
                "Arcade",
                "Board Game",
                "First Person Shooter",
                "Fortune Cookies",
                "Multi-User Dungeons",
                "Puzzle",
                "Real Time Strategy",
                "Role-Playing",
                "Side-Scrolling",
                "Simulation",
                "Turn Based Strategy"
            ],
            "Home Automation",
            "Internet",
            "Internet" => [
                "FTP",
                "Finger",
                "Log Analysis",
                "DNS",
                "Proxy Server",
                "WAP",
                "WWW",
                "WWW" => [
                    "Browsers",
                    "Dynamic Content",
                    "Dynamic Content" => [
                        "CGI Tools/Libraries",
                        "Message Boards",
                        "News/Diary",
                        "Page Counters"
                    ],
                    "HTTP Servers",
                    "Indexing/Search",
                    "Session",
                    "Site Management",
                    "Site Management" => [
                        "Link Checking"
                    ],
                    "WSGI"
                ]
            ],
            "Multimedia",
            "Multimedia" => [
                "Graphics",
                "Graphics" => [
                    "3D Modeling",
                    "3D Rendering",
                    "Capture",
                    "Capture" => [
                        "Digital Camera",
                        "Scanners",
                        "Screen Capture"
                    ],
                    "Editor",
                    "Editor" => [
                        "Raster-Based",
                        "Vector-Based"
                    ],
                    "Graphics Conversion",
                    "Presentation",
                    "Viewer"
                ],
                "Audio",
                "Audio" => [
                    "Analysis",
                    "Recording",
                    "CD Audio",
                    "CD Audio" => [
                        "CD Playing",
                        "CD Ripping",
                        "CD Writing"
                    ],
                    "Conversion",
                    "Editors",
                    "MIDI",
                    "Mixers",
                    "Player",
                    "Player" => [
                        "MP3"
                    ],
                    "Sound Synthesis",
                    "Speech"
                ],
                "Video",
                "Video" => [
                    "Capture",
                    "Conversion",
                    "Display",
                    "Non-Linear Editor"
                ]
            ],
            "Office",
            "Office" => [
                "Financial",
                "Financial" => [
                    "Accounting",
                    "Investment",
                    "Point-Of-Sale",
                    "Spreadsheet"
                ],
                "Groupware",
                "News/Diary",
                "Office Suite",
                "Scheduling"
            ],
            "Printing",
            "Religion",
            "Scientific",
            "Scientific" => [
                "Artificial Intelligence",
                "Artificial Life",
                "Astronomy",
                "Atmospheric Science",
                "Bio-Informatics",
                "Chemistry",
                "Electronic Design Automation",
                "GIS",
                "Human Machine Interfaces",
                "Image Recognition",
                "Information Analysis",
                "Interface Engine",
                "Mathematics",
                "Medical Science",
                "Physics",
                "Visualization"
            ],
            "Security",
            "Security" => [
                "Cryptography"
            ],
            "Sociology",
            "Sociology" => [
                "Genealogy",
                "History"
            ],
            "Software Development",
            "Software Development" => [
                "Assemblers",
                "Bug Tracking",
                "Build Tool",
                "Code Generator",
                "Compiler",
                "Debugger",
                "Disassembler",
                "Documentation",
                "Embedded Systems",
                "Internationalization",
                "Interpreter",
                "Library",
                "Library" => [
                    "Application Framework",
                    "Java Library",
                    "Perl Module",
                    "PHP Class",
                    "Pike Module",
                    "pygame",
                    "Python Module",
                    "Ruby Modules",
                    "Tcl Extension"
                ],
                "Localization",
                "Object Brokering",
                "Object Brokering" => [
                    "CORBA"
                ],
                "Pre-processor",
                "Quality Assurance",
                "Testing",
                "Testing" => [
                    "Traffic Generation"
                ],
                "User Interfaces",
                "Version Control",
                "Widget Set"
            ],
            "System",
            "System" => [
                "Archiving",
                "Archiving" => [
                    "Backup",
                    "Compression",
                    "Mirroring",
                    "Packaging"
                ],
                "Benchmark",
                "Boot",
                "Boot" => [
                    "Init"
                ],
                "Clustering",
                "Console Font",
                "Distributed Computing",
                "Emulator",
                "Filesystems",
                "Hardware",
                "Hardware" => [
                    "Hardware Driver",
                    "Mainframes",
                    "Symmetric Multi-processing"
                ],
                "Installation",
                "Logging",
                "Monitoring",
                "Networking",
                "Networking" => [
                    "Firewalls",
                    "Monitoring",
                    "Monitoring" => [
                        "Hardware Watchdog"
                    ],
                    "Time Synchronization"
                ],
                "Operating System",
                "Kernel",
                "Power (UPS)",
                "Recovery Tool",
                "Shells",
                "Software Distribution",
                "Systems Administration",
                "Systems Administration" => [
                    "Authentication/Directory",
                    "Authentication/Directory" => [
                        "LDAP",
                        "NIS"
                    ]
                ]
            ],
            "Shell",
            "Terminal",
            "Terminal" => [
                "Serial",
                "Telnet",
                "Terminal Emulator"
            ],
            "Text Editor",
            "Text Editor" => [
                "Documentation",
                "Emacs",
                "IDE",
                "Text Processing",
                "Word Processor"
            ],
            "Text Processing",
            "Text Processing" => [
                "Filter",
                "Font",
                "General",
                "Indexing",
                "Linguistic",
                "Markup",
                "Markup" => [
                    "DocBook",
                    "HTML",
                    "LaTeX",
                    "Markdown",
                    "ReStructuredText",
                    "SGML",
                    "VRML",
                    "Wiki",
                    "XML"
                ]
            ],
            "Utilities"
        ],
        "Programming Language" => [
            "Ada",
            "APL",
            "ASP",
            "Assembly",
            "Awk",
            "Basic",
            "C",
            "C#",
            "C++",
            "Cold Fusion",
            "Cython",
            "Delphi",
            "Dylan",
            "Eiffel",
            "Emacs-Lisp",
            "Erlang",
            "Euler",
            "Euphoria",
            "Forth",
            "Fortran",
            "Go",
            "Groovy",
            "Haskell",
            "Java",
            "JavaScript",
            "Lisp",
            "Logo",
            "ML",
            "Modula",
            "Objective C",
            "Object Pascal",
            "OCaml",
            "Pascal",
            "Perl",
            "PHP",
            "Pike",
            "Pliant",
            "PL/SQL",
            "PROGRESS",
            "Prolog",
            "Python",
            "Python" => [
                "CPython",
                "IronPython",
                "Jython",
                "PyPy",
                "Stackless"
            ],
            "REBOL",
            "Regex",
            "Rexx",
            "Ruby",
            "Scala",
            "Scheme",
            "Simula",
            "Smalltalk",
            "SQL",
            "Tcl",
            "Unix Shell",
            "YACC",
            "Zope"
        ],
        "Environment" => [
            "Console",
            "Console" => [
                "Curses",
                "Framebuffer",
                "Newt",
                "svgalib"
            ],
            "Mobile",
            "MacOS X",
            "MacOS X" => [
                "Aqua",
                "Carbon",
                "Cocoa"
            ],
            "Daemon",
            "OpenStack",
            "Plugin",
            "Web Environment",
            "Web Environment" => [
                "Buffet",
                "Mozilla",
                "ToscaWidgets"
            ],
            "Win32",
            "X11",
            "X11" => [
                "Gnome",
                "GTK",
                "KDE",
                "Qt",
                "Tk"
            ],
            "Wayland"
        ],
        "Framework" => [
            "C++" => [
                "Boost"
            ],
            "Groovy" => [
                "Grails"
            ],
            "Java" => [
                "Spring",
                "Sinatra",
                "Struts",
                "OpenXava"
            ],
            "JavaScript" => [
                "AngularJS",
                "extJS",
                "jQuery",
                "MooTools",
                "Prototype",
                "qooxdoo"
            ],
            "Perl" => [
                "Mason",
                "Catalyst"
            ],
            "Python" => [
                "BFG",
                "Bob",
                "Bottle",
                "Buildout",
                "Chandler",
                "CherryPy",
                "CubicWeb",
                "Django",
                "Flask",
                "IDLE",
                "IPython",
                "Opps",
                "Paste",
                "Plone",
                "py2web",
                "Pylons",
                "Pyramid",
                "Review Board",
                "Setuptools Plugin",
                "Trac",
                "Tryton",
                "TurboGears",
                "Twisted",
                "ZODB",
                "Zope2",
                "Zope3"
            ],
            "PHP" => [
                "CakePHP",
                "Laravel",
                "Symfony",
                "Yii",
                "Zend Framework"
            ],
            "Ruby" => [
                "Rails"
            ]
        ],
        "Operating System" => [
            "BeOS",
            "MacOS",
            "MS-DOS",
            "Windows",
            "OS2",
            "Cross-plattform",
            "PalmOS",
            "PDA Systems",
            "POSIX",
            "AIX",
            "FreeBSD",
            "NetBSD",
            "OpenBSD",
            "Hurd",
            "HP-UX",
            "IRIX",
            "Linux",
            "SCO",
            "Solaris",
            "Unix"
        ],
        "Audience" => [
            "Customer Service",
            "Developers",
            "Education",
            "End Users",
            "Financial and Insurance Industry",
            "Healthcare Industry",
            "Information Technology",
            "Legal Industry",
            "Manufacturing",
            "Religion",
            "Science/Research",
            "System Administrators",
            "Telecommunications Industry"
        ],
        "Natural" => [
            "Afrikaans",
            "Arabic",
            "Bengali",
            "Bosnian",
            "Bulgarian",
            "Catalan",
            "Chinese",
            "Traditional-Chinese",
            "Croatian",
            "Czech",
            "Danish",
            "Dutch",
            "English",
            "Esperanto",
            "Finnish",
            "French",
            "Galician",
            "German",
            "Greek",
            "Hebrew",
            "Hindi",
            "Hungarian",
            "Icelandic",
            "Indonesian",
            "Italian",
            "Japanese",
            "Javanese",
            "Korean",
            "Latin",
            "Latvian",
            "Macedonian",
            "Malay",
            "Marathi",
            "Norwegian",
            "Panjabi",
            "Persian",
            "Polish",
            "Portuguese",
            "Brazilian-Portuguese",
            "Romanian",
            "Russian",
            "Serbian",
            "Slovak",
            "Slovenian",
            "Spanish",
            "Swedish",
            "Tamil",
            "Telugu",
            "Thai",
            "Turkish",
            "Ukranian",
            "Urdu",
            "Vietnamese"
        ]
    ];


    /**
     * Try to map SPDX.org names onto our license tags,
     * or find entry in long description;
     *
161
162
163
164
165
166
167
168


169
170

171
172
173
174
175
176
177
178
179
180
181
182











































183
184
185
186
187
188
189
            if ($match = preg_grep("/{$name}[Lv-]*{$ver[0]}/i", array_keys(tags::$licenses))
            or  $match = preg_grep("/$name/i", array_keys(tags::$licenses)))
            {
                return reset($match);
            }
        }
    }



    /**
     * Get leaves from Trove categories

     *
     */
    function trove_to_tags($array, $tags=array()) {
        preg_match_all("~^Topic :: .+ :: (\w[\w\s/-]+)$~m", implode("\n", (array)$array), $uu);
        foreach ($uu[1] as $trove) {
            $tags[] =
                strtolower(
                    strtr($trove, " /.", "--_")
                );
        }
        return implode(", ", $tags);
    }












































}




?>








>
>

|
>












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
            if ($match = preg_grep("/{$name}[Lv-]*{$ver[0]}/i", array_keys(tags::$licenses))
            or  $match = preg_grep("/$name/i", array_keys(tags::$licenses)))
            {
                return reset($match);
            }
        }
    }



    /**
     * Guess leaves from standard Trove categories
     * (Does not utilize self::$tree yet!)
     *
     */
    function trove_to_tags($array, $tags=array()) {
        preg_match_all("~^Topic :: .+ :: (\w[\w\s/-]+)$~m", implode("\n", (array)$array), $uu);
        foreach ($uu[1] as $trove) {
            $tags[] =
                strtolower(
                    strtr($trove, " /.", "--_")
                );
        }
        return implode(", ", $tags);
    }



    /**
     * HTML output list of Trove tags.
     *
     * Is used in page_submit within the <div class=select id=trove_tags>
     *
     * Here everything just wrapped in <span>s, because <select> optgroups
     * can't be nested, and <ul> breaks out of inline flow text DOM
     * structure.
     *
     */
    function trove_select($trove, $level=0, $html="") {

        // loop through one level
        foreach ($trove as $key=>$value) {
        
            // normalize title into tag-key
            $tag = is_numeric($key) ? $value : $key;
            $tag = strtr(strtolower($tag), " /.:-", "-----");
            $style = "style='margin-left: {$level}px;'";
        
            // descend into groups
            if (is_array($value)) {
                $html .= "<span class=optgroup><b class=option data-tag=$tag>$key</b>";
                $html .= self::trove_select($value, $level + 10);
                $html .= "</span>";
            }
            // skip if entry repeated as subgroup
            elseif (isset($trove[$value])) {
                #..
            }
            // single tag entry
            else {
                $html .= "<span data-tag=$tag class=option>$value</span>";
            }
        }
        
        return $html;
    }



}




?>

Changes to template/header.php.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 *
 */
?>
<!DOCTYPE html>
<html>
<head> 
    <title><?= isset($title) ? $title : "freshcode.club" ?></title>
    <meta name=version content=0.5.0>
    <meta charset=UTF-8>
    <link rel=stylesheet href="/freshcode.css?0.5.9">
    <link rel="shortcut icon" href="/img/changes.png">
    <base href="//<?= HTTP_HOST ?>/">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="/gimmicks.js"></script>
    <?php if (isset($header_add)) { print $header_add . "\n"; } ?>
</head>
<body>

<nav id=topbar>
Open source community software release tracking.
<?= is_int(strpos(HTTP_HOST, ".")) ? '<small style="color:#9c7">[0.4.8 alpha]</small>' : '<b style="color:#c54">[local dev]</b>'; ?>
<span style=float:right>
<a href="//freshmeat.club/">freshmeat.club</a> |
<a href="//freecode.club/">freecode.club</a> |
<b><a href="//freshcode.club/">freshcode.club</a></b>
</span>
</nav>








|

|










|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 *
 */
?>
<!DOCTYPE html>
<html>
<head> 
    <title><?= isset($title) ? $title : "freshcode.club" ?></title>
    <meta name=version content=0.5.1>
    <meta charset=UTF-8>
    <link rel=stylesheet href="/freshcode.css?0.6.0">
    <link rel="shortcut icon" href="/img/changes.png">
    <base href="//<?= HTTP_HOST ?>/">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="/gimmicks.js"></script>
    <?php if (isset($header_add)) { print $header_add . "\n"; } ?>
</head>
<body>

<nav id=topbar>
Open source community software release tracking.
<?= is_int(strpos(HTTP_HOST, ".")) ? '<small style="color:#9c7">[0.5.1 alpha]</small>' : '<b style="color:#c54">[local dev]</b>'; ?>
<span style=float:right>
<a href="//freshmeat.club/">freshmeat.club</a> |
<a href="//freecode.club/">freecode.club</a> |
<b><a href="//freshcode.club/">freshcode.club</a></b>
</span>
</nav>

Changes to template/submit_form.php.

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78





79
80
81
82
83
84
85
86
               Homepage
               <input name=homepage size=50 type=url placeholder="http://project.example.org/" value="$data[homepage]"
                      maxlength=250>
           </label>

           <label>
               Description
               <textarea cols=60 rows=9 name=description
                         maxlength=1500 required>$data[description]</textarea>
               <small>Please give a concise roundup of what this software does, what specific features
               it provides, the intended target audience, or how it compares to similar apps.</small>
           </label>

           <label>
               License
               <select name=license>
                  {$select(tags::$licenses, $data["license"])}
               </select>
               <small>Again note that FLOSS is preferred.</small>
           </label>

           <label>
               Tags
               <input name=tags size=50 placeholder="game, desktop, gtk, python" value="$data[tags]"
                      maxlength=150 pattern="^\s*((c\+\+|\w+([-.]\w+)*(\[,;\s]+)?){0,10}\s*$">





               <small>Categorize your project. Tags can be made up of letters, numbers and dashes. 
               This can include usage context, application type, programming languages, related projects,
               etc.</small>
           </label>

           <label>
               Image
               <input type=url name=image size=50 placeholder="http://i.imgur.com/xyzbar.png" value="$data[image]" maxlength=250>







|














|
|
|
>
>
>
>
>
|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
               Homepage
               <input name=homepage size=50 type=url placeholder="http://project.example.org/" value="$data[homepage]"
                      maxlength=250>
           </label>

           <label>
               Description
               <textarea cols=55 rows=9 name=description
                         maxlength=1500 required>$data[description]</textarea>
               <small>Please give a concise roundup of what this software does, what specific features
               it provides, the intended target audience, or how it compares to similar apps.</small>
           </label>

           <label>
               License
               <select name=license>
                  {$select(tags::$licenses, $data["license"])}
               </select>
               <small>Again note that FLOSS is preferred.</small>
           </label>

           <label>
               Tags<br>
                  <input id=tags name=tags size=50 placeholder="game, desktop, gtk, python" value="$data[tags]"
                         maxlength=150 pattern="^\s*((c\+\+|\w+([-.]\w+)*(\[,;\s]+)?){0,10}\s*$"
                         style="display:inline-block">
                  <span style="inline-block; height: 0px; overflow: visible; position: absolute;">
                      <img src=img/addtrove.png with=100 height=150 style="position:relative;top:-140px;">
                      <span id=trove_tags>{$_(tags::trove_select(tags::$tree))}</span>
                  </span>
               <small style="width:60%">Categorize your project. Tags can be made up of letters, numbers and dashes. 
               This can include usage context, application type, programming languages, related projects,
               etc.</small>
           </label>

           <label>
               Image
               <input type=url name=image size=50 placeholder="http://i.imgur.com/xyzbar.png" value="$data[image]" maxlength=250>
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
           or a regex for your project homepage.
           See the <a href="http://fossil.include-once.org/freshcode/wiki/Autoupdate">Autoupdate Howto</a>.
        </p>
        <p>
           <label>
               Via
               <select name=autoupdate_module>
                   {$select("none,release.json,changelog,regex,github,sourceforge", $data["autoupdate_module"])}
               </select>
           </label>

           <label>
               Autoupdate URL
               <input name=autoupdate_url type=url size=50 value="$data[autoupdate_url]" placeholder="https://github.com/user/repo/tags.atom" maxlength=250>
               <small>This is the primary source for <b>releases.json</b> and the <b>regex</b> method.







|







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
           or a regex for your project homepage.
           See the <a href="http://fossil.include-once.org/freshcode/wiki/Autoupdate">Autoupdate Howto</a>.
        </p>
        <p>
           <label>
               Via
               <select name=autoupdate_module>
                   {$select(array("none"=>"none", "method"=>array("release.json"=>"release.json","changelog"=>"changelog","regex"=>"regex"), "service"=>array("github"=>"github","sourceforge"=>"sourceforge")), $data["autoupdate_module"])}
               </select>
           </label>

           <label>
               Autoupdate URL
               <input name=autoupdate_url type=url size=50 value="$data[autoupdate_url]" placeholder="https://github.com/user/repo/tags.atom" maxlength=250>
               <small>This is the primary source for <b>releases.json</b> and the <b>regex</b> method.