Changeset - 60536f91af5e
[Not reviewed]
default
0 1 0
Takumi IINO - 11 years ago 2014-07-21 17:46:26
trot.thunder@gmail.com
templates: replace YUI with jquery in kallithea/templates/summary/summary.html
1 file changed with 27 insertions and 30 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/summary/summary.html
Show inline comments
 
@@ -200,79 +200,80 @@ summary = lambda n:{False:'summary-short
 
        <div id="shortlog_data">
 
            <%include file='../changelog/changelog_summary_data.html'/>
 
        </div>
 
    </div>
 
</div>
 

	
 
%if c.readme_data:
 
<div id="readme" class="anchor">
 
<div class="box" style="background-color: #FAFAFA">
 
    <div class="title" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}">
 
        <div class="breadcrumbs">
 
            <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
 
        </div>
 
    </div>
 
    <div class="readme">
 
      <div class="readme_box">
 
        ${c.readme_data|n}
 
      </div>
 
    </div>
 
</div>
 
</div>
 
%endif
 

	
 
<script type="text/javascript">
 
var clone_url = 'clone_url';
 
YUE.on(clone_url,'click',function(e){
 
    if(YUD.hasClass(clone_url,'selected')){
 
        return
 
var $clone_url = $('#clone_url');
 
var $clone_url_id = $('#clone_url_id');
 
var $clone_by_name = $('#clone_by_name');
 
var $clone_by_id = $('#clone_by_id');
 
$clone_url.click(function(e){
 
    if($clone_url.hasClass('selected')){
 
        return ;
 
    }else{
 
        $clone_url.addClass('selected');
 
        $clone_url.select();
 
    }
 
    else{
 
        YUD.addClass(clone_url,'selected');
 
        YUD.get(clone_url).select();
 
    }
 
})
 
});
 

	
 
YUE.on('clone_by_name','click',function(e){
 
$clone_by_name.click(function(e){
 
    // show url by name and hide name button
 
    YUD.setStyle('clone_url','display','');
 
    YUD.setStyle('clone_by_name','display','none');
 
    $clone_url.show();
 
    $clone_by_name.hide();
 

	
 
    // hide url by id and show name button
 
    YUD.setStyle('clone_by_id','display','');
 
    YUD.setStyle('clone_url_id','display','none');
 
    $clone_by_id.show();
 
    $clone_url_id.hide();
 
});
 

	
 
})
 
YUE.on('clone_by_id','click',function(e){
 

	
 
$clone_by_id.click(function(e){
 
    // show url by id and hide id button
 
    YUD.setStyle('clone_by_id','display','none');
 
    YUD.setStyle('clone_url_id','display','');
 
    $clone_by_id.hide();
 
    $clone_url_id.show();
 

	
 
    // hide url by name and show id button
 
    YUD.setStyle('clone_by_name','display','');
 
    YUD.setStyle('clone_url','display','none');
 
})
 
    $clone_by_name.show();
 
    $clone_url.hide();
 
});
 

	
 
$(document).ready(function(){
 
    var cache = {}
 
    $("#download_options").select2({
 
        placeholder: _TM['Select changeset'],
 
        dropdownAutoWidth: true,
 
        query: function(query){
 
          var key = 'cache';
 
          var cached = cache[key] ;
 
          if(cached) {
 
            var data = {results: []};
 
            //filter results
 
            $.each(cached.results, function(){
 
                var section = this.text;
 
                var children = [];
 
                $.each(this.children, function(){
 
                    if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
 
                        children.push({'id': this.id, 'text': this.text})
 
                    }
 
                })
 
                data.results.push({'text': section, 'children': children})
 
            });
 
            query.callback(data);
 
          }else{
 
@@ -365,37 +366,33 @@ for (var i=0;i<data.length;i++){
 
    trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
 
    trending_language.style.width=percentage+"%";
 
    td2.appendChild(trending_language);
 

	
 
    tr.appendChild(td1);
 
    tr.appendChild(td2);
 
    tbl.appendChild(tr);
 
    if(cnt == 3){
 
        var show_more = document.createElement('tr');
 
        var td = document.createElement('td');
 
        lnk = document.createElement('a');
 

	
 
        lnk.href='#';
 
        lnk.innerHTML = "${_('Show more')}";
 
        lnk.id='code_stats_show_more';
 
        td.appendChild(lnk);
 

	
 
        show_more.appendChild(td);
 
        show_more.appendChild(document.createElement('td'));
 
        tbl.appendChild(show_more);
 
    }
 

	
 
}
 

	
 
YUD.get('lang_stats').appendChild(tbl);
 
YUE.on('code_stats_show_more','click',function(){
 
    l = YUD.getElementsByClassName('stats_hidden')
 
    for (e in l){
 
        YUD.setStyle(l[e],'display','');
 
    };
 
    YUD.setStyle(YUD.get('code_stats_show_more'),
 
            'display','none');
 
$('#lang_stats').appendChild(tbl);
 
$('#code_status_show_more').click(function(){
 
    $('.stats_hidden').show();
 
    $('#code_status_show_more').hide();
 
});
 
</script>
 
%endif
 

	
 
</%def>
0 comments (0 inline, 0 general)