Merge remote-tracking branch 'upstream/master' into feature/line-endings

This commit is contained in:
Thomas Deinhamer 2014-08-23 10:29:40 +02:00
commit f27354cbb7
4 changed files with 66 additions and 40 deletions

View File

@ -1,18 +1,18 @@
{ {
"title": "DAUX.IO", "title": "My Project",
"tagline": "The Easiest Way To Document Your Project", "tagline": "My Stylish Documentation",
"author": "Justin Walsh", "author": "I, Me & Myself",
"image": "", "image": "",
"theme": "daux-blue", "theme": "daux-blue",
"breadcrumbs": true, "breadcrumbs": false,
"template": "default", "template": "default",
"toggle_code": true, "toggle_code": false,
"date_modified": true, "date_modified": false,
"float": false, "float": false,
"file_editor": false, "file_editor": false,
"repo": "justinwalsh/daux.io", "repo": "",
"twitter": ["justin_walsh", "todaymade"], "twitter": [],
"google_analytics": "UA-12653604-10", "google_analytics": "",
"timezone": "America/Los_Angeles", "timezone": "America/Los_Angeles",
"piwik_analytics": false, "piwik_analytics": false,
"piwik_analytics_id": "0", "piwik_analytics_id": "0",
@ -22,9 +22,5 @@
"folders": [] "folders": []
}, },
"links": { "links": {
"Download": "https://github.com/justinwalsh/daux.io/archive/master.zip",
"GitHub Repo": "https://github.com/justinwalsh/daux.io",
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
"Made by Todaymade": "http://todaymade.com"
} }
} }

View File

@ -1,24 +1,27 @@
{ {
"title": "DAUX.IO", "title": "DAUX.IO",
"tagline": "The Easiest Way To Document Your Project", "tagline": "The Easiest Way To Document Your Project",
"image": "<base_url>img/app.png", "author": "Justin Walsh",
"theme": "daux-blue", "image": "<base_url>img/app.png",
"toggle_code": true, "theme": "daux-blue",
"breadcrumbs": true, "template": "default",
"breadcrumb_separator": "Chevrons", "toggle_code": true,
"date_modified": true, "breadcrumbs": true,
"file_editor": false, "breadcrumb_separator": "Chevrons",
"repo": "justinwalsh/daux.io", "date_modified": true,
"ignore": { "float": true,
"files": ["Work_In_Progress.md"], "file_editor": false,
"folders": ["99_Not_Ready"] "repo": "justinwalsh/daux.io",
"ignore": {
"files": ["Work_In_Progress.md"],
"folders": ["99_Not_Ready"]
}, },
"twitter": ["justin_walsh", "todaymade"], "twitter": ["justin_walsh", "todaymade"],
"google_analytics": "UA-12653604-10", "google_analytics": "UA-12653604-10",
"links": { "links": {
"Download": "https://github.com/justinwalsh/daux.io/archive/master.zip", "Download": "https://github.com/justinwalsh/daux.io/archive/master.zip",
"GitHub Repo": "https://github.com/justinwalsh/daux.io", "GitHub Repo": "https://github.com/justinwalsh/daux.io",
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues", "Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
"Made by Todaymade": "http://todaymade.com" "Made by Todaymade": "http://todaymade.com"
} }
} }

View File

@ -96,13 +96,33 @@
$name_a = explode('_', $a->name); $name_a = explode('_', $a->name);
$name_b = explode('_', $b->name); $name_b = explode('_', $b->name);
if (is_numeric($name_a[0])) { if (is_numeric($name_a[0])) {
if (is_numeric($name_b[0])) return (intval($name_a[0]) > intval($name_b[0])); $a = intval($name_a[0]);
return -1; if (is_numeric($name_b[0])) {
$b = intval($name_b[0]);
if (($a >= 0) == ($b >= 0)) {
$a = abs($a);
$b = abs($b);
if ($a == $b) return (strcasecmp($name_a[1], $name_b[1]));
return ($a > $b) ? 1 : -1;
}
return ($a >= 0) ? -1 : 1;
}
$t = $name_b[0];
if ($t && $t[0] === '-') return -1;
return ($a < 0) ? 1 : -1;
} else { } else {
if (is_numeric($name_b[0])) return 1; if (is_numeric($name_b[0])) {
return (strcasecmp($name_a[0], $name_b[0])); $b = intval($name_b[0]);
if ($b >= 0) return 1;
$t = $name_a[0];
if ($t && $t[0] === '-') return 1;
return ($b >= 0) ? 1 : -1;
}
$p = $name_a[0];
$q = $name_b[0];
if (($p && $p[0] === '-') == ($q && $q[0] === '-')) return strcasecmp($p, $q);
else return ($p[0] === '-') ? 1 : -1;
} }
} }
} }
?> ?>

View File

@ -31,8 +31,11 @@
public static function get_title_from_filename($filename) { public static function get_title_from_filename($filename) {
$filename = explode('_', $filename); $filename = explode('_', $filename);
if ($filename[0] == '' || is_numeric($filename[0])) unset($filename[0]); if ($filename[0] == '' || is_numeric($filename[0])) unset($filename[0]);
else {
$t = $filename[0];
if ($t[0] == '-') $filename[0] = substr($t, 1);
}
$filename = implode(' ', $filename); $filename = implode(' ', $filename);
return $filename; return $filename;
} }
@ -44,6 +47,10 @@
public static function get_url_from_filename($filename) { public static function get_url_from_filename($filename) {
$filename = explode('_', $filename); $filename = explode('_', $filename);
if ($filename[0] == '' || is_numeric($filename[0])) unset($filename[0]); if ($filename[0] == '' || is_numeric($filename[0])) unset($filename[0]);
else {
$t = $filename[0];
if ($t[0] == '-') $filename[0] = substr($t, 1);
}
$filename = implode('_', $filename); $filename = implode('_', $filename);
return $filename; return $filename;
} }