From a9dc069aab494de63cbedbd61759000e56e347b8 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 22 Apr 2015 14:07:37 +0000 Subject: [PATCH] # added Font Awesome 4.3.0 # changed some code views to use fonts from FA # fixed code/graph to use given revision in generating some graphs --- codepot/README | 1 + codepot/configure | 3 +- codepot/configure.ac | 1 + codepot/src/codepot/controllers/code.php | 42 +- .../src/codepot/helpers/codepot_helper.php | 89 +++ codepot/src/codepot/views/code_blame.php | 5 +- codepot/src/codepot/views/code_diff.php | 41 +- codepot/src/codepot/views/code_file.php | 5 +- codepot/src/codepot/views/code_folder.php | 13 +- codepot/src/codepot/views/code_history.php | 4 +- codepot/src/codepot/views/code_search.php | 6 +- codepot/src/css/Makefile.am | 3 +- codepot/src/css/Makefile.in | 3 +- codepot/src/css/code.css | 5 +- codepot/src/css/fonts/Makefile.am | 10 + codepot/src/css/fonts/Makefile.in | 419 +++++++++++++ codepot/src/css/fonts/fontawesome-webfont.eot | Bin 0 -> 60767 bytes codepot/src/css/fonts/fontawesome-webfont.svg | 565 ++++++++++++++++++ codepot/src/css/fonts/fontawesome-webfont.ttf | Bin 0 -> 122092 bytes .../src/css/fonts/fontawesome-webfont.woff | Bin 0 -> 71508 bytes .../src/css/fonts/fontawesome-webfont.woff2 | Bin 0 -> 56780 bytes 21 files changed, 1158 insertions(+), 57 deletions(-) create mode 100644 codepot/src/css/fonts/Makefile.am create mode 100644 codepot/src/css/fonts/Makefile.in create mode 100644 codepot/src/css/fonts/fontawesome-webfont.eot create mode 100644 codepot/src/css/fonts/fontawesome-webfont.svg create mode 100644 codepot/src/css/fonts/fontawesome-webfont.ttf create mode 100644 codepot/src/css/fonts/fontawesome-webfont.woff create mode 100644 codepot/src/css/fonts/fontawesome-webfont.woff2 diff --git a/codepot/README b/codepot/README index c0361ae9..651106bb 100644 --- a/codepot/README +++ b/codepot/README @@ -228,5 +228,6 @@ LICENSE PHPGraphLib MIT CLOC 1.62 GPL Flot https://github.com/flot/flot/blob/master/LICENSE.txt + Font Awesome 4.3.0 MIT & SIL OFL 1.1 ------------------------------------------------------------------------ diff --git a/codepot/configure b/codepot/configure index c89de088..b03ef60f 100755 --- a/codepot/configure +++ b/codepot/configure @@ -3267,7 +3267,7 @@ phpextinidir=$phpextinidir -ac_config_files="$ac_config_files Makefile codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap etc/codepot.httpd etc/pre-commit etc/start-commit etc/post-commit etc/pre-revprop-change etc/post-revprop-change sbin/Makefile sbin/codepot-user pecl-svn/Makefile DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/Makefile" +ac_config_files="$ac_config_files Makefile codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap etc/codepot.httpd etc/pre-commit etc/start-commit etc/post-commit etc/pre-revprop-change etc/post-revprop-change sbin/Makefile sbin/codepot-user pecl-svn/Makefile DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/fonts/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3996,6 +3996,7 @@ do "src/codepot/models/Makefile") CONFIG_FILES="$CONFIG_FILES src/codepot/models/Makefile" ;; "src/codepot/views/Makefile") CONFIG_FILES="$CONFIG_FILES src/codepot/views/Makefile" ;; "src/codepot/Makefile") CONFIG_FILES="$CONFIG_FILES src/codepot/Makefile" ;; + "src/css/fonts/Makefile") CONFIG_FILES="$CONFIG_FILES src/css/fonts/Makefile" ;; "src/css/images/Makefile") CONFIG_FILES="$CONFIG_FILES src/css/images/Makefile" ;; "src/css/Makefile") CONFIG_FILES="$CONFIG_FILES src/css/Makefile" ;; "src/js/prettify/Makefile") CONFIG_FILES="$CONFIG_FILES src/js/prettify/Makefile" ;; diff --git a/codepot/configure.ac b/codepot/configure.ac index a5790c95..8cd090b1 100644 --- a/codepot/configure.ac +++ b/codepot/configure.ac @@ -132,6 +132,7 @@ AC_CONFIG_FILES([ src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile + src/css/fonts/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index b984cc68..8979bc8b 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -962,7 +962,7 @@ class Code extends Controller $average_commits = 0; $total_months = 0; - $file = $this->subversion->getHistory ($projectid, $path, SVN_REVISION_HEAD); + $file = $this->subversion->getHistory ($projectid, $path, $rev); if ($file === FALSE) { //header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error'); @@ -971,7 +971,7 @@ class Code extends Controller } else { - + $history = $file['history']; $history_count = count($history); @@ -1006,7 +1006,7 @@ class Code extends Controller $max_month = substr($k, 5, 2); } - $idx++; + $idx++; $total_commits += $v; } @@ -1055,26 +1055,26 @@ class Code extends Controller $this->graph->setXValuesHorizontal(TRUE); if ($stats_count <= 1) { - $this->graph->setBarSpace(TRUE); - //$this->graph->setDataPoints(TRUE); - //$this->graph->setDataPointColor("red"); + $this->graph->setBarSpace(TRUE); + //$this->graph->setDataPoints(TRUE); + //$this->graph->setDataPointColor("red"); } else { - $this->graph->setBarSpace(FALSE); + $this->graph->setBarSpace(FALSE); - if ($stats_count <= 8) - { - $this->graph->setXValuesInterval(1); - } - else if ($stats_count <= 16) - { - $this->graph->setXValuesInterval(2); - } - else - { - $this->graph->setXValuesInterval(11); - } + if ($stats_count <= 8) + { + $this->graph->setXValuesInterval(1); + } + else if ($stats_count <= 16) + { + $this->graph->setXValuesInterval(2); + } + else + { + $this->graph->setXValuesInterval(11); + } } //$this->graph->setGrid(FALSE); $this->graph->setGridVertical(FALSE); @@ -1085,7 +1085,7 @@ class Code extends Controller else if ($type == 'commit-share-by-users') { // revision is ignored - $file = $this->subversion->getHistory ($projectid, $path, SVN_REVISION_HEAD); + $file = $this->subversion->getHistory ($projectid, $path, $rev); if ($file === FALSE) { header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error'); @@ -1117,7 +1117,7 @@ class Code extends Controller else /* if ($type == 'commits-by-users') */ { // revision is ignored - $file = $this->subversion->getHistory ($projectid, $path, SVN_REVISION_HEAD); + $file = $this->subversion->getHistory ($projectid, $path, $rev); if ($file === FALSE) { header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error'); diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index 62a7d8c3..9a98eaa6 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -332,3 +332,92 @@ if ( !function_exists ('codepot_find_matching_sequences')) return $result; } } + +if (!function_exists ('codepot_get_fa_file_type')) +{ + function codepot_get_fa_file_type ($path) + { + // return font awesome file types. + $ext = substr(strrchr($path, '.'), 1); + if (!empty($ext)) + { + $ext = strtolower($ext); + $types = array ( + 'aiff' => 'audio', + 'aac' => 'audio', + 'au' => 'audio', + 'flac' => 'audio', + 'm4a' => 'audio', + 'm4p' => 'audio', + 'mp3' => 'audio', + 'ogg' => 'audio', + 'ra' => 'audio', + 'vox' => 'audio', + 'wav' => 'audio', + 'wma' => 'audio', + + '3gp' => 'video', + 'asf' => 'video', + 'avi' => 'video', + 'flv' => 'video', + 'm4v' => 'video', + 'mp4' => 'video', + 'mkv' => 'video', + 'rm' => 'video', + + 'gif' => 'image', + 'jpg' => 'image', + 'png' => 'image', + + 'pdf' => 'pdf', + 'txt' => 'text', + 'wiki' => 'text', + 'htm' => 'html', + 'html' => 'html', + + 'doc' => 'word', + 'docx' => 'word', + 'xls' => 'excel', + 'xlsx' => 'excel', + 'ppt' => 'powerpoint', + 'pptx' => 'powerpoint', + + 'ada' => 'code', + 'adb' => 'code', + 'ads' => 'code', + 'bas' => 'code', + 'c' => 'code', + 'cc' => 'code', + 'cpp' => 'code', + 'cxx' => 'code', + 'h' => 'code', + 'hh' => 'code', + 'hpp' => 'code', + 'hxx' => 'code', + 'java' => 'code', + 'js' => 'code', + 'pas' => 'code', + 'php' => 'code', + 'pl' => 'code', + 'py' => 'code', + 'rb' => 'code', + 'st' => 'code', + 'vb' => 'code', + + 'alz' => 'archive', + 'arj' => 'archive', + 'bz2' => 'archive', + 'gz' => 'archive', + 'jar' => 'archive', + 'rar' => 'archive', + 'tar' => 'archive', + '7z' => 'archive', + 'zip' => 'archive' + ); + + if (array_key_exists($ext, $types)) return 'file-' . $types[$ext]; + } + + return 'file'; + } +} diff --git a/codepot/src/codepot/views/code_blame.php b/codepot/src/codepot/views/code_blame.php index 348d782e..cb6a2d69 100644 --- a/codepot/src/codepot/views/code_blame.php +++ b/codepot/src/codepot/views/code_blame.php @@ -6,6 +6,7 @@ + @@ -175,7 +176,7 @@ print anchor ("code/fetch/{$project->id}/${xpar}{$revreq}", $this->lang->line('D
id}/${xpar}/{$file['prev_rev']}", '<<'); + print anchor ("code/blame/{$project->id}/${xpar}/{$file['prev_rev']}", ''); print ' '; // anchor to the revision history at the root directory @@ -192,7 +193,7 @@ print anchor ("code/fetch/{$project->id}/${xpar}{$revreq}", $this->lang->line('D print (''); } print ' '; - print anchor ("code/blame/{$project->id}/${xpar}/{$file['next_rev']}", '>>'); + print anchor ("code/blame/{$project->id}/${xpar}/{$file['next_rev']}", ''); print ' | '; printf ('%s: %s', $this->lang->line('Size'), $file['size']); diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index 3087b1f2..f47fe881 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -6,6 +6,7 @@ + @@ -266,12 +267,13 @@ if (FALSE) // don't want to delete code for the original diff view. print ''; print ''; + print ' '; $currev = $file['created_rev']; $prevrev = $file['against']['prev_rev']; $prevanc = "code/diff/{$project->id}/{$xpar}/{$currev}/{$prevrev}"; - print anchor ($prevanc, '<<'); - print '   '; + print anchor ($prevanc, ''); + print ' '; print $this->lang->line('Revision'); print ' '; @@ -280,18 +282,19 @@ if (FALSE) // don't want to delete code for the original diff view. $currev = $file['created_rev']; $nextrev = $file['against']['next_rev']; $nextanc = "code/diff/{$project->id}/{$xpar}/{$currev}/{$nextrev}"; - print '   '; - print anchor ($nextanc, '>>'); + print ' '; + print anchor ($nextanc, ''); print ''; print ''; + print ' '; $currev = $file['against']['created_rev']; $prevrev = $file['prev_rev']; $prevanc = "code/diff/{$project->id}/{$xpar}/{$prevrev}/{$currev}"; - print anchor ($prevanc, '<<'); - print '   '; + print anchor ($prevanc, ''); + print ' '; print $this->lang->line('Revision'); print ' '; @@ -300,8 +303,8 @@ if (FALSE) // don't want to delete code for the original diff view. $currev = $file['against']['created_rev']; $nextrev = $file['next_rev']; $nextanc = "code/diff/{$project->id}/{$xpar}/{$nextrev}/{$currev}"; - print '   '; - print anchor ($nextanc, '>>'); + print ' '; + print anchor ($nextanc, ''); print ''; print ''; @@ -396,13 +399,14 @@ else // print ("
"); - print "