Show More
@@ -108,7 +108,7 b' def _ignorews_url(GET, fileid=None):' | |||
|
108 | 108 | |
|
109 | 109 | params['anchor'] = fileid |
|
110 | 110 | icon = h.literal('<i class="icon-strike"></i>') |
|
111 |
return h.link_to(icon, h.url.current(**params), title=lbl, |
|
|
111 | return h.link_to(icon, h.url.current(**params), title=lbl, **{'data-toggle': 'tooltip'}) | |
|
112 | 112 | |
|
113 | 113 | |
|
114 | 114 | def get_line_ctx(fid, GET): |
@@ -168,7 +168,7 b' def _context_url(GET, fileid=None):' | |||
|
168 | 168 | |
|
169 | 169 | params['anchor'] = fileid |
|
170 | 170 | icon = h.literal('<i class="icon-sort"></i>') |
|
171 |
return h.link_to(icon, h.url.current(**params), title=lbl, |
|
|
171 | return h.link_to(icon, h.url.current(**params), title=lbl, **{'data-toggle': 'tooltip'}) | |
|
172 | 172 | |
|
173 | 173 | |
|
174 | 174 | # Could perhaps be nice to have in the model but is too high level ... |
@@ -311,9 +311,9 b' def pygmentize_annotation(repo_name, fil' | |||
|
311 | 311 | author = escape(changeset.author) |
|
312 | 312 | date = changeset.date |
|
313 | 313 | message = escape(changeset.message) |
|
314 |
tooltip_html = (" |
|
|
315 |
" %s |
|
|
316 |
"</b> %s |
|
|
314 | tooltip_html = ("<b>Author:</b> %s<br/>" | |
|
315 | "<b>Date:</b> %s</b><br/>" | |
|
316 | "<b>Message:</b> %s") % (author, date, message) | |
|
317 | 317 | |
|
318 | 318 | lnk_format = show_id(changeset) |
|
319 | 319 | uri = link_to( |
@@ -321,9 +321,8 b' def pygmentize_annotation(repo_name, fil' | |||
|
321 | 321 | url('changeset_home', repo_name=repo_name, |
|
322 | 322 | revision=changeset.raw_id), |
|
323 | 323 | style=get_color_string(changeset.raw_id), |
|
324 |
|
|
|
325 |
|
|
|
326 | **{'data-toggle': 'tooltip'} | |
|
324 | **{'data-toggle': 'popover', | |
|
325 | 'data-content': tooltip_html} | |
|
327 | 326 | ) |
|
328 | 327 | |
|
329 | 328 | uri += '\n' |
@@ -568,7 +567,7 b' def action_parser(user_log, feed=False, ' | |||
|
568 | 567 | lbl = rev[:12] |
|
569 | 568 | title_ = _('Changeset %s not found') % lbl |
|
570 | 569 | if parse_cs: |
|
571 |
return link_to(lbl, url_, title=title_, |
|
|
570 | return link_to(lbl, url_, title=title_, **{'data-toggle': 'tooltip'}) | |
|
572 | 571 | return link_to(lbl, url_, class_='lazy-cs' if lazy_cs else '', |
|
573 | 572 | **{'data-raw_id':rev.raw_id, 'data-repo_name':repo_name}) |
|
574 | 573 |
@@ -2624,37 +2624,6 b" table.code-browser i[class^='icon-'] {" | |||
|
2624 | 2624 | z-index: 2; |
|
2625 | 2625 | } |
|
2626 | 2626 | |
|
2627 | #tip-box { | |
|
2628 | position: absolute; | |
|
2629 | ||
|
2630 | background-color: #FFF; | |
|
2631 | border: 2px solid #577632; | |
|
2632 | font: 100% sans-serif; | |
|
2633 | width: auto; | |
|
2634 | opacity: 1; | |
|
2635 | padding: 8px; | |
|
2636 | ||
|
2637 | white-space: pre-wrap; | |
|
2638 | border-radius: 8px 8px 8px 8px; | |
|
2639 | box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6); | |
|
2640 | z-index: 100000; | |
|
2641 | } | |
|
2642 | ||
|
2643 | .hl-tip-box { | |
|
2644 | z-index: 1; | |
|
2645 | position: absolute; | |
|
2646 | color: #666; | |
|
2647 | background-color: #FFF; | |
|
2648 | border: 2px solid #577632; | |
|
2649 | font: 100% sans-serif; | |
|
2650 | width: auto; | |
|
2651 | opacity: 1; | |
|
2652 | padding: 8px; | |
|
2653 | white-space: pre-wrap; | |
|
2654 | border-radius: 8px 8px 8px 8px; | |
|
2655 | box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6); | |
|
2656 | } | |
|
2657 | ||
|
2658 | 2627 | |
|
2659 | 2628 | .mentions-container { |
|
2660 | 2629 | width: 90% !important; |
@@ -2983,7 +2952,7 b' input.btn {' | |||
|
2983 | 2952 | |
|
2984 | 2953 | input[disabled].btn, |
|
2985 | 2954 | .btn.disabled { |
|
2986 | color: #999; | |
|
2955 | opacity: 0.5; | |
|
2987 | 2956 | } |
|
2988 | 2957 | |
|
2989 | 2958 | .label, |
@@ -4434,3 +4403,144 b' div.codeblock div.code-header div.author' | |||
|
4434 | 4403 | ul.user_group_member li { |
|
4435 | 4404 | clear: both; |
|
4436 | 4405 | } |
|
4406 | ||
|
4407 | .tooltip { | |
|
4408 | position: absolute; | |
|
4409 | z-index: 1070; | |
|
4410 | display: block; | |
|
4411 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; | |
|
4412 | font-size: 12px; | |
|
4413 | font-style: normal; | |
|
4414 | font-weight: 400; | |
|
4415 | line-height: 1.42857143; | |
|
4416 | text-align: left; | |
|
4417 | text-align: start; | |
|
4418 | text-decoration: none; | |
|
4419 | text-shadow: none; | |
|
4420 | text-transform: none; | |
|
4421 | letter-spacing: normal; | |
|
4422 | word-break: normal; | |
|
4423 | word-spacing: normal; | |
|
4424 | word-wrap: normal; | |
|
4425 | white-space: normal; | |
|
4426 | } | |
|
4427 | .tooltip-arrow { | |
|
4428 | position: absolute; | |
|
4429 | width: 0; | |
|
4430 | height: 0; | |
|
4431 | border-color: transparent; | |
|
4432 | border-style: solid; | |
|
4433 | } | |
|
4434 | .tooltip-inner { | |
|
4435 | max-width: 200px; | |
|
4436 | padding: 3px 8px; | |
|
4437 | color: #fff; | |
|
4438 | text-align: center; | |
|
4439 | background-color: #000; | |
|
4440 | border-radius: 4px; | |
|
4441 | } | |
|
4442 | ||
|
4443 | .tooltip.top { | |
|
4444 | padding: 5px 0; | |
|
4445 | margin-top: -3px; | |
|
4446 | } | |
|
4447 | .tooltip.top .tooltip-arrow { | |
|
4448 | bottom: 0; | |
|
4449 | left: 50%; | |
|
4450 | margin-left: -5px; | |
|
4451 | border-width: 5px 5px 0; | |
|
4452 | border-top-color: #000; | |
|
4453 | } | |
|
4454 | ||
|
4455 | .tooltip.bottom { | |
|
4456 | padding: 5px 0; | |
|
4457 | margin-top: 3px; | |
|
4458 | } | |
|
4459 | .tooltip.bottom .tooltip-arrow { | |
|
4460 | top: 0; | |
|
4461 | left: 50%; | |
|
4462 | margin-left: -5px; | |
|
4463 | border-width: 0 5px 5px; | |
|
4464 | border-bottom-color: #000; | |
|
4465 | } | |
|
4466 | ||
|
4467 | ||
|
4468 | .popover { | |
|
4469 | position: absolute; | |
|
4470 | top: 0; | |
|
4471 | left: 0; | |
|
4472 | z-index: 1060; | |
|
4473 | max-width: 276px; | |
|
4474 | padding: 1px; | |
|
4475 | background-color: #fff; | |
|
4476 | background-clip: padding-box; | |
|
4477 | border: 1px solid #ccc; | |
|
4478 | border: 1px solid rgba(0,0,0,.2); | |
|
4479 | border-radius: 6px; | |
|
4480 | box-shadow: 0 5px 10px rgba(0,0,0,.2); | |
|
4481 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; | |
|
4482 | font-size: 12px; | |
|
4483 | font-style: normal; | |
|
4484 | font-weight: 400; | |
|
4485 | line-height: 1.42857143; | |
|
4486 | text-align: left; | |
|
4487 | text-align: start; | |
|
4488 | text-decoration: none; | |
|
4489 | text-shadow: none; | |
|
4490 | text-transform: none; | |
|
4491 | letter-spacing: normal; | |
|
4492 | word-break: normal; | |
|
4493 | word-spacing: normal; | |
|
4494 | word-wrap: normal; | |
|
4495 | white-space: normal; | |
|
4496 | } | |
|
4497 | ||
|
4498 | .popover > .arrow { | |
|
4499 | border-width: 11px; | |
|
4500 | } | |
|
4501 | .popover > .arrow, | |
|
4502 | .popover > .arrow::after { | |
|
4503 | position: absolute; | |
|
4504 | display: block; | |
|
4505 | width: 0; | |
|
4506 | height: 0; | |
|
4507 | border-color: transparent; | |
|
4508 | border-style: solid; | |
|
4509 | } | |
|
4510 | ||
|
4511 | .popover-title { | |
|
4512 | padding: 8px 14px; | |
|
4513 | margin: 0; | |
|
4514 | font-size: 14px; | |
|
4515 | background-color: #f7f7f7; | |
|
4516 | border-bottom: 1px solid #ebebeb; | |
|
4517 | border-radius: 5px 5px 0 0; | |
|
4518 | } | |
|
4519 | ||
|
4520 | .popover-content { | |
|
4521 | padding: 9px 14px; | |
|
4522 | } | |
|
4523 | ||
|
4524 | .popover.top { | |
|
4525 | margin-top: -10px; | |
|
4526 | } | |
|
4527 | .popover.top > .arrow { | |
|
4528 | bottom: -11px; | |
|
4529 | left: 50%; | |
|
4530 | margin-left: -11px; | |
|
4531 | border-top-color: #999; | |
|
4532 | border-top-color: rgba(0,0,0,.25); | |
|
4533 | border-bottom-width: 0; | |
|
4534 | } | |
|
4535 | ||
|
4536 | .popover.bottom { | |
|
4537 | margin-top: 10px; | |
|
4538 | } | |
|
4539 | .popover.bottom > .arrow { | |
|
4540 | top: -11px; | |
|
4541 | left: 50%; | |
|
4542 | margin-left: -11px; | |
|
4543 | border-top-width: 0; | |
|
4544 | border-bottom-color: #999; | |
|
4545 | border-bottom-color: rgba(0,0,0,.25); | |
|
4546 | } |
@@ -411,25 +411,6 b' var show_more_event = function(){' | |||
|
411 | 411 | }); |
|
412 | 412 | }; |
|
413 | 413 | |
|
414 | /** | |
|
415 | * activate .lazy-cs mouseover for showing changeset tooltip | |
|
416 | */ | |
|
417 | var show_changeset_tooltip = function(){ | |
|
418 | $('.lazy-cs').mouseover(function(e){ | |
|
419 | var $target = $(e.currentTarget); | |
|
420 | var rid = $target.data('raw_id'); | |
|
421 | var repo_name = $target.data('repo_name'); | |
|
422 | if(rid && !$target.hasClass('tooltip')){ | |
|
423 | _show_tooltip(e, _TM['loading ...']); | |
|
424 | var url = pyroutes.url('changeset_info', {"repo_name": repo_name, "revision": rid}); | |
|
425 | ajaxGET(url, function(json){ | |
|
426 | $target.addClass('tooltip'); | |
|
427 | _show_tooltip(e, json['message']); | |
|
428 | _activate_tooltip($target); | |
|
429 | }); | |
|
430 | } | |
|
431 | }); | |
|
432 | }; | |
|
433 | 414 | |
|
434 | 415 | var _onSuccessFollow = function(target){ |
|
435 | 416 | var $target = $(target); |
@@ -475,76 +456,56 b' var showRepoSize = function(target, repo' | |||
|
475 | 456 | }; |
|
476 | 457 | |
|
477 | 458 | /** |
|
478 | * tooltips | |
|
459 | * load tooltips dynamically based on data attributes, used for .lazy-cs changeset links | |
|
479 | 460 | */ |
|
480 | ||
|
481 | var tooltip_activate = function(){ | |
|
482 | $(document).ready(_init_tooltip); | |
|
483 | }; | |
|
484 | ||
|
485 | var _activate_tooltip = function($tt){ | |
|
486 | $tt.mouseover(_show_tooltip); | |
|
487 | $tt.mousemove(_move_tooltip); | |
|
488 | $tt.mouseout(_close_tooltip); | |
|
489 | }; | |
|
461 | var get_changeset_tooltip = function() { | |
|
462 | var $target = $(this); | |
|
463 | var tooltip = $target.data('tooltip'); | |
|
464 | if (!tooltip) { | |
|
465 | var raw_id = $target.data('raw_id'); | |
|
466 | var repo_name = $target.data('repo_name'); | |
|
467 | var url = pyroutes.url('changeset_info', {"repo_name": repo_name, "revision": raw_id}); | |
|
490 | 468 | |
|
491 | var _init_tooltip = function(){ | |
|
492 | var $tipBox = $('#tip-box'); | |
|
493 | if(!$tipBox.length){ | |
|
494 | $tipBox = $('<div id="tip-box"></div>'); | |
|
495 | $(document.body).append($tipBox); | |
|
469 | $.ajax(url, { | |
|
470 | async: false, | |
|
471 | success: function(data) { | |
|
472 | tooltip = data["message"]; | |
|
473 | } | |
|
474 | }); | |
|
475 | $target.data('tooltip', tooltip); | |
|
496 | 476 | } |
|
497 | ||
|
498 | $tipBox.hide(); | |
|
499 | $tipBox.css('position', 'absolute'); | |
|
500 | $tipBox.css('max-width', '600px'); | |
|
501 | ||
|
502 | _activate_tooltip($('[data-toggle="tooltip"]')); | |
|
477 | return tooltip; | |
|
503 | 478 | }; |
|
504 | 479 | |
|
505 | var _show_tooltip = function(e, tipText, safe){ | |
|
506 | e.stopImmediatePropagation(); | |
|
507 | var el = e.currentTarget; | |
|
508 | var $el = $(el); | |
|
509 | if(tipText){ | |
|
510 | // just use it | |
|
511 | } else if(el.tagName.toLowerCase() === 'img'){ | |
|
512 | tipText = el.alt ? el.alt : ''; | |
|
513 | } else { | |
|
514 | tipText = el.title ? el.title : ''; | |
|
515 | safe = safe || $el.hasClass("safe-html-title"); | |
|
480 | /** | |
|
481 | * activate tooltips and popups | |
|
482 | */ | |
|
483 | var tooltip_activate = function(){ | |
|
484 | function placement(p, e){ | |
|
485 | if(e.getBoundingClientRect().top > 2*$(window).height()/3){ | |
|
486 | return 'top'; | |
|
487 | }else{ | |
|
488 | return 'bottom'; | |
|
489 | } | |
|
516 | 490 | } |
|
517 | ||
|
518 | if(tipText !== ''){ | |
|
519 | // save org title | |
|
520 | $el.attr('tt_title', tipText); | |
|
521 | // reset title to not show org tooltips | |
|
522 | $el.prop('title', ''); | |
|
523 | ||
|
524 | var $tipBox = $('#tip-box'); | |
|
525 | if (safe) { | |
|
526 | $tipBox.html(tipText); | |
|
527 |
} |
|
|
528 | $tipBox.text(tipText); | |
|
529 | } | |
|
530 | $tipBox.css('display', 'block'); | |
|
531 | } | |
|
491 | $(document).ready(function(){ | |
|
492 | $('[data-toggle="tooltip"]').tooltip({ | |
|
493 | placement: placement | |
|
494 | }); | |
|
495 | $('[data-toggle="popover"]').popover({ | |
|
496 | html: true, | |
|
497 | container: 'body', | |
|
498 | placement: placement, | |
|
499 | trigger: 'hover', | |
|
500 | template: '<div class="popover cs-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' | |
|
501 | }); | |
|
502 | $('.lazy-cs').tooltip({ | |
|
503 | title: get_changeset_tooltip, | |
|
504 | placement: placement | |
|
505 | }); | |
|
506 | }); | |
|
532 | 507 | }; |
|
533 | 508 | |
|
534 | var _move_tooltip = function(e){ | |
|
535 | e.stopImmediatePropagation(); | |
|
536 | var $tipBox = $('#tip-box'); | |
|
537 | $tipBox.css('top', (e.pageY + 15) + 'px'); | |
|
538 | $tipBox.css('left', (e.pageX + 15) + 'px'); | |
|
539 | }; | |
|
540 | ||
|
541 | var _close_tooltip = function(e){ | |
|
542 | e.stopImmediatePropagation(); | |
|
543 | var $tipBox = $('#tip-box'); | |
|
544 | $tipBox.hide(); | |
|
545 | var el = e.currentTarget; | |
|
546 | $(el).prop('title', $(el).attr('tt_title')); | |
|
547 | }; | |
|
548 | 509 | |
|
549 | 510 | /** |
|
550 | 511 | * Quick filter widget |
@@ -44,7 +44,6 b'' | |||
|
44 | 44 | asynchtml(e.target.href, $user_log, function(){ |
|
45 | 45 | show_more_event(); |
|
46 | 46 | tooltip_activate(); |
|
47 | show_changeset_tooltip(); | |
|
48 | 47 | }); |
|
49 | 48 | e.preventDefault(); |
|
50 | 49 | }); |
@@ -81,7 +81,6 b'' | |||
|
81 | 81 | $(document).ready(function(){ |
|
82 | 82 | tooltip_activate(); |
|
83 | 83 | show_more_event(); |
|
84 | show_changeset_tooltip(); | |
|
85 | 84 | // routes registration |
|
86 | 85 | pyroutes.register('home', "${h.url('home')}", []); |
|
87 | 86 | pyroutes.register('new_gist', "${h.url('new_gist')}", []); |
@@ -45,7 +45,7 b'' | |||
|
45 | 45 | <%def name="revision(name,rev,tip,author,last_msg)"> |
|
46 | 46 | <div> |
|
47 | 47 | %if rev >= 0: |
|
48 | <a data-toggle="tooltip" title="${'%s:\n\n%s' % (h.escape(author), h.escape(last_msg))}" class="revision-link safe-html-title" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a> | |
|
48 | <a data-toggle="popover" title="${author | entity}" data-content="${last_msg | entity}" class="hash" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a> | |
|
49 | 49 | %else: |
|
50 | 50 | ${_('No changesets yet')} |
|
51 | 51 | %endif |
@@ -20,13 +20,13 b'' | |||
|
20 | 20 | <div id="body" class="codeblock"> |
|
21 | 21 | <div class="code-header"> |
|
22 | 22 | <div class="stats"> |
|
23 | <div class="pull-left"> | |
|
23 | <div class="pull-left"> | |
|
24 | 24 | <div class="left img"><i class="icon-doc-inv"></i></div> |
|
25 | 25 | <div class="left item"><pre data-toggle="tooltip" title="${h.fmt_date(c.changeset.date)}">${h.link_to(h.show_id(c.changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</pre></div> |
|
26 | 26 | <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div> |
|
27 | 27 | <div class="left item last"><pre>${c.file.mimetype}</pre></div> |
|
28 | </div> | |
|
29 | <div class="pull-right buttons"> | |
|
28 | </div> | |
|
29 | <div class="pull-right buttons"> | |
|
30 | 30 | %if c.annotate: |
|
31 | 31 | ${h.link_to(_('Show Source'), h.url('files_home', repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="btn btn-default btn-xs")} |
|
32 | 32 | %else: |
@@ -39,14 +39,14 b'' | |||
|
39 | 39 | ${h.link_to(_('Edit on Branch: %s') % c.changeset.branch, h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-default btn-xs")} |
|
40 | 40 | ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-danger btn-xs")} |
|
41 | 41 | %elif c.on_branch_head and c.file.is_binary: |
|
42 |
${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled |
|
|
42 | ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled", title=_('Editing binary files not allowed'),**{'data-toggle':'tooltip'})} | |
|
43 | 43 | ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-danger btn-xs")} |
|
44 | 44 | %else: |
|
45 |
${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled |
|
|
46 |
${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-xs disabled |
|
|
45 | ${h.link_to(_('Edit'), '#', class_="btn btn-default btn-xs disabled", title=_('Editing files allowed only when on branch head revision'),**{'data-toggle':'tooltip'})} | |
|
46 | ${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-xs disabled", title=_('Deleting files allowed only when on branch head revision'),**{'data-toggle':'tooltip'})} | |
|
47 | 47 | %endif |
|
48 | 48 | %endif |
|
49 | </div> | |
|
49 | </div> | |
|
50 | 50 | </div> |
|
51 | 51 | <div class="author"> |
|
52 | 52 | ${h.gravatar_div(h.email_or_none(c.changeset.author), size=16)} |
@@ -32,7 +32,6 b'' | |||
|
32 | 32 | asynchtml(e.target.href, $followers, function(){ |
|
33 | 33 | show_more_event(); |
|
34 | 34 | tooltip_activate(); |
|
35 | show_changeset_tooltip(); | |
|
36 | 35 | }); |
|
37 | 36 | e.preventDefault(); |
|
38 | 37 | }); |
@@ -32,7 +32,6 b'' | |||
|
32 | 32 | asynchtml(e.target.href, $forks, function(){ |
|
33 | 33 | show_more_event(); |
|
34 | 34 | tooltip_activate(); |
|
35 | show_changeset_tooltip(); | |
|
36 | 35 | }); |
|
37 | 36 | e.preventDefault(); |
|
38 | 37 | }); |
@@ -62,7 +62,6 b'' | |||
|
62 | 62 | asynchtml("${h.url.current(filter=c.search_term)}", $("#journal"), function(){ |
|
63 | 63 | show_more_event(); |
|
64 | 64 | tooltip_activate(); |
|
65 | show_changeset_tooltip(); | |
|
66 | 65 | }); |
|
67 | 66 | e.preventDefault(); |
|
68 | 67 | }); |
@@ -76,7 +75,6 b'' | |||
|
76 | 75 | asynchtml(e.target.href, $journal, function(){ |
|
77 | 76 | show_more_event(); |
|
78 | 77 | tooltip_activate(); |
|
79 | show_changeset_tooltip(); | |
|
80 | 78 | }); |
|
81 | 79 | e.preventDefault(); |
|
82 | 80 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now