Пример #1
0
$current_branch = $repo->getCurrentBranchName();
$branch_list = array();
foreach ($branches as $branch) {
    if (strpos($branch, 'HEAD') !== false) {
        continue;
    }
    if (strpos($branch, 'remotes/') !== false) {
        $arr = explode("/", $branch);
        $branch_type = array_shift($arr);
        $origin = array_shift($arr);
        $branch_name = implode("/", $arr);
        $branch_list[] = array('value' => $branch_name, 'text' => $branch_name, 'type' => 'remote', 'origin' => $origin, 'selected' => $branch_name == $current_branch);
    }
}
if (sizeof($branch_list) == 0) {
    $branches = $repo->getLocalBranches();
    $branch_list = array();
    foreach ($branches as $branch) {
        $branch_list[] = array('value' => $branch, 'text' => $branch, 'type' => 'local', 'selected' => $branch == $current_branch);
    }
}
?>
<script type="text/javascript">
$(function() {


	var ExternalItemTemplate = window.ExternalItemTemplate = '<span title="drag me for ordering" class="handle" draggable="true"><i class="icon-dashboardlist"></i></span><input type="text" placeholder="//myhost.com/my.js" class="input" /><a class="btn small"><i class="icon-exit"></i></a>';

	var baseCode = window.baseCode = CodeMirror.fromTextArea($("#base_code")[0], {
	  lineNumbers : true
	});