This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
forked from ofri/Open-Knesset
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for ok help texts which can be edited from the admin
- Loading branch information
Showing
3 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
function placeHelptext(obj,left,top) { | ||
$('#helptextcontainer').empty(); | ||
obj.clone().appendTo($('#helptextcontainer')) | ||
|
||
if (left<500) { | ||
$('#helptextcontainer .helptext').removeClass('right') | ||
$('#helptextcontainer .helptext').addClass('left') | ||
} else { | ||
$('#helptextcontainer .helptext').removeClass('left') | ||
$('#helptextcontainer .helptext').addClass('right') | ||
} | ||
|
||
$('#helptextcontainer .helptext').css('z-index',1000); | ||
$('#helptextcontainer .helptext .x').bind('click',function(){ | ||
$('#helptextcontainer').empty();}); | ||
$('#helptextcontainer .helptext').css('display','inline-block'); | ||
$('#helptextcontainer .helptext').css('top',top-50).css('left',left); | ||
function showHelpText(elt) { | ||
var helptext = $(elt).data('helptext'); | ||
var moreinfo = $(elt).data('moreinfo'); | ||
if (moreinfo) { | ||
helptext += '<p><a href="'+moreinfo+'">למידע נוסף</a></p>' | ||
} | ||
$('#okhelptextscontainer .modal-body p').html(helptext); | ||
$('#okhelptextscontainer').modal(); | ||
} | ||
$('body').append('<div id="helptextcontainer"></div>'); | ||
$(document).ready(function() { | ||
$('.quest-mark').click(function(e) {placeHelptext($(e.currentTarget).find(".helptext"),e.pageX,e.pageY)}); | ||
}); | ||
$(function() { | ||
$('body').append('' + | ||
'<div id="okhelptextscontainer" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">' + | ||
// '<div class="modal-header">' + | ||
// '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' + | ||
// '<h3>Modal header</h3>' + | ||
// '</div>' + | ||
'<div class="modal-body">' + | ||
'<p></p>' + | ||
'</div>' + | ||
'<div class="modal-footer">' + | ||
'<button class="btn" data-dismiss="modal" aria-hidden="true">סגור</button>' + | ||
'</div>' + | ||
'</div>' + | ||
''); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{%load i18n%}{% if helptext %}<span class='quest-mark'><img src='/static/icons/help_16.png'><span class='triangle-border right helptext' style='display:none'><span class='x'>X</span>{{helptext}}{% if moreinfo %}<a href='{{moreinfo}}' target='_blank'>{%trans 'For More Info Click Here'%}</a>{%endif%}</span></span>{%endif%} | ||
{%load i18n%} | ||
{% if helptext %} | ||
<a class="btn btn-mini btn-question" href="javascript:;" onClick="showHelpText(this);" data-helptext="{{ helptext }}" data-moreinfo="{{ moreinfo }}">?</a> | ||
{%endif%} |