⌈⌋ ⎇ branch:  freshcode


Check-in [8e7583d6c6]

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

Overview
Comment:New revisions with version number will now hide previous entries without.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | 0.5.5
Files: files | file ages | folders
SHA1: 8e7583d6c6245e733942d80e53574a85b66bd23f
User & Date: mario 2014-07-30 03:15:00
Context
2014-07-30
03:18
Remove debugging output. check-in: 36e9116ab7 user: mario tags: trunk
03:15
New revisions with version number will now hide previous entries without. check-in: 8e7583d6c6 user: mario tags: trunk, 0.5.5
2014-07-29
23:54
URL updating verified for function, also updates separate homepage and download fields now check-in: cf7b3c257a user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/trove.ods.

cannot compute difference between binary files

Changes to gimmicks.js.

1
2
3
4
5
6
7
8

9

10
11
12

13
14
15
16


17
18
19
20
21
22
23
/**
 * api: jquery
 * title: UI behaviour
 * description: Well, just client-side interface features
 * version: 0.3
 * depends: jquery, jquery-ui
 *
 * Collects a few event callbacks to toggle and trigger all the things.

 *  → Compacted entries (.trimmed class)

 *  → Trove tags
 *      → Injection to submit_form input box
 *      → Or appending to links on page_tags cloud

 *  → Action links (green dotted underline)
 *      → Lock entry in submit_form
 *      → Injecting $version placeholder in URLs
 *      → Sidebar box for submit_imports


 *
 */


// DOM ready
$(document).ready(function(){





|



>

>



>
|



>
>







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
/**
 * api: jquery
 * title: UI behaviour
 * description: Well, just client-side interface features
 * version: 0.4
 * depends: jquery, jquery-ui
 *
 * Collects a few event callbacks to toggle and trigger all the things.
 *
 *  → Compacted entries (.trimmed class)
 *
 *  → Trove tags
 *      → Injection to submit_form input box
 *      → Or appending to links on page_tags cloud
 *
 *  → Action links (green dashed underline)
 *      → Lock entry in submit_form
 *      → Injecting $version placeholder in URLs
 *      → Sidebar box for submit_imports
 *
 *  → Forum action links
 *
 */


// DOM ready
$(document).ready(function(){

32
33
34
35
36
37
38





39
40
41
42
43
44
45
    });

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





    
    // Trove tags add to input#tags field
    $("#trove_tags.add-tags .option").click(function(){
        var $tags = $("#tags");
        var prev = $tags.val();
        $tags.val(prev + (prev.length ? ", " : "") + $(this).data("tag"));
    });







>
>
>
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    });

    // Likewise for compacted news feeds in #sidebar
    $(".forum .entry").one("click", function(){
        $(this).find(".excerpt, .content, .funcs").toggleClass("trimmed");
    });
    
    
    /**
     * Trove map and tag cloud.
     *
     */
    
    // Trove tags add to input#tags field
    $("#trove_tags.add-tags .option").click(function(){
        var $tags = $("#tags");
        var prev = $tags.val();
        $tags.val(prev + (prev.length ? ", " : "") + $(this).data("tag"));
    });
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
101
102
        }).get();
        
        // append to current link
        if (tags.length) {
            this.href += "&trove[]=" + tags.join("&trove[]=");
        }
    });
    





    
    // submit_form: lock entry
    $(".action.lock-entry").click(function(){
        var $lock = $("input[name='lock']");
        if (!$lock.val().length) {
            $lock.val($lock.val("placeholder"));
        }
    });

    // submit_form: apply $version placeholder in URLs
    $(".action.version-placeholder").click(function(){
        var $input = $(this).parent().parent().find("input, textarea").eq(0);
        var version = $("input[name='version']").val();
        if (version.length) {
            $input.val($input.val().replace(version, "$version"));
        }
    });

    // submit_form: apply $version placeholder in URLs
    $(".action.submit-import").click(function(){
        $("#sidebar section").eq(0).hide();
        $("#sidebar .submit-import").fadeToggle("trimmed");
    });








































});













|
>
>
>
>
>




















|
|

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








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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
        }).get();
        
        // append to current link
        if (tags.length) {
            this.href += "&trove[]=" + tags.join("&trove[]=");
        }
    });
 
    
    /**
     * Action links are marked up using <a class="action func-name">
     *
     */
    
    // submit_form: lock entry
    $(".action.lock-entry").click(function(){
        var $lock = $("input[name='lock']");
        if (!$lock.val().length) {
            $lock.val($lock.val("placeholder"));
        }
    });

    // submit_form: apply $version placeholder in URLs
    $(".action.version-placeholder").click(function(){
        var $input = $(this).parent().parent().find("input, textarea").eq(0);
        var version = $("input[name='version']").val();
        if (version.length) {
            $input.val($input.val().replace(version, "$version"));
        }
    });

    // submit_form: apply $version placeholder in URLs
    $(".action.submit-import").click(function(){
        $("#sidebar section").eq(0).toggle("medium");
        $("#sidebar .submit-import").fadeToggle("slow");
    });



    /**
     * Forum actions.
     *
     */
     
    // Post submit button
    $(".forum").delegate(".action", "click", function(){

        // entry/post id
        var id = $(this).data("id");
        var func = this.classList[1];
        var $target = $(this).closest(".entry");

        // new
        if (func == "forum-new") {
            $target.load("/forum/post", { "pid": id }).fadeIn();
        }
        // reply
        if (func == "forum-reply") {
            $target.append("<ul><li></li></ul>");
            $target.find("ul li").load("/forum/post", { "pid": id }).fadeIn();
        }
        // editing
        if (func == "forum-edit") {
            $target.load("/forum/edit", { "id": id });
        }
        // submit
        if (func == "forum-submit"){
            $target = $target.parent();
            $.post("/forum/submit", $target.serialize(), function(html){
                $target.html(html);
            });
        }
        event.preventDefault();
    });


});






Changes to img/nopreview.png.

cannot compute difference between binary files

Changes to index.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
/**
 * api: php
 * title: Freshcode.club
 * description: FLOSS software release tracking website
 * version: 0.5.3
 * author: mario
 * license: AGPL
 * 
 * Implements a freshmeat/freecode-like directory for open source
 * release publishing / tracking.
 *
 */





|







1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
/**
 * api: php
 * title: Freshcode.club
 * description: FLOSS software release tracking website
 * version: 0.5.5
 * author: mario
 * license: AGPL
 * 
 * Implements a freshmeat/freecode-like directory for open source
 * release publishing / tracking.
 *
 */

lib/htmlpurifier.phar became a regular file.

cannot compute difference between binary files

Changes to release.php.

130
131
132
133
134
135
136


137
138
139
140
141
142

143
144
145
146
147
148
149
        return $this;
    }

    
    /**
     * Store current data bag into `release` table.
     * Is to be invoked after ->update().


     *
     */
    function store($INSERT="INSERT") {
#db()->test = 1;
        $data = $this->getArrayCopy();
        return db("$INSERT INTO release (:?) VALUES (::)", $data, $data);

    }


    /**
     * Retrieve latest published release version.
     *
     * @return array







>
>



<

|
>







130
131
132
133
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149
150
151
        return $this;
    }

    
    /**
     * Store current data bag into `release` table.
     * Is to be invoked after ->update().
     * 
     * Automatically hides previous version-less entries.
     *
     */
    function store($INSERT="INSERT") {

        $data = $this->getArrayCopy();
        return db("$INSERT INTO release (:?) VALUES (::)", $data, $data)
           and db("UPDATE release SET hidden=1 WHERE name=? AND version=? AND t_published < ?", $data["name"], "", time()-5);
    }


    /**
     * Retrieve latest published release version.
     *
     * @return array

Changes to shared.phar.

cannot compute difference between binary files

Changes to template/header.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
<?php
/**
 * api: freshcode
 * type: template
 * title: HTML page header
 * description: Starts <html> and <head>, outputs top bar / menus etc.
 * version: 0.5.2
 *
 * Optionally injects a `$header_add` list, or allows to override the
 * page $title.
 *
 */
?>
<!DOCTYPE html>
<html>
<head> 
    <title><?= isset($title) ? $title : "freshcode.club" ?></title>
    <meta name=version content=0.5.2>
    <meta charset=UTF-8>
    <link rel=stylesheet href="/freshcode.css?0.6.1">
    <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>
    <!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><![endif]-->
    <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>







|










|

|











|







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
<?php
/**
 * api: freshcode
 * type: template
 * title: HTML page header
 * description: Starts <html> and <head>, outputs top bar / menus etc.
 * version: 0.5.5
 *
 * Optionally injects a `$header_add` list, or allows to override the
 * page $title.
 *
 */
?>
<!DOCTYPE html>
<html>
<head> 
    <title><?= isset($title) ? $title : "freshcode.club" ?></title>
    <meta name=version content=0.5.5>
    <meta charset=UTF-8>
    <link rel=stylesheet href="/freshcode.css?0.6.2">
    <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>
    <!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><![endif]-->
    <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" class=version>[0.5.5 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>