Skip to content

Commit

Permalink
Fixed issue #07694: When clicking on showing last 50 answers first 50…
Browse files Browse the repository at this point in the history
… are shown

Dev: Add tooltip on menu bar too
Dev: Move tooltip dunctionnality to specific admin function
  • Loading branch information
Shnoulle committed Mar 27, 2013
1 parent 0c74c6f commit b173975
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 183 deletions.
58 changes: 24 additions & 34 deletions application/views/admin/responses/browsemenubar_view.php
Expand Up @@ -17,42 +17,32 @@
</div>
<?php if (Permission::model()->hasSurveyPermission($surveyid, 'responses', 'read'))
{ ?>
<ul class='sf-menu'>
<?php if (count(Survey::model()->findByPk($surveyid)->additionalLanguages) == 0) { ?>
<ul class='sf-menu'>
<li><a href='<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL; ?>document.png' title='' alt='<?php $clang->eT("Display Responses"); ?>' /></a></li>
<?php } else { ?>
<li><a href='#' accesskey='b'>
<img src='<?php echo $sImageURL;?>document.png' alt='<?php $clang->eT("Display Responses"); ?>' />
</a><ul>
<li><a accesskey='b' target='_blank' href='<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php $clang->eT("Display Responses"); ?> </a><ul>
<?php foreach ($tmp_survlangs as $tmp_lang) { ?>
<li>
<a href="<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/start/0/limit/50/order/asc/browselang/$tmp_lang"); ?>" accesskey='b'><img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang, false); ?></a>
</li>
<?php } ?>
</ul></li>
</ul></li>
<img src='<?php echo $sImageURL; ?>document.png' title='' alt='<?php $clang->eT("Display Responses"); ?>' /></a>
<?php if (count($tmp_survlangs)) { ?>
<ul>
<?php foreach ($tmp_survlangs as $tmp_lang) { ?>
<li>
<a href="<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/browselang/$tmp_lang"); ?>" accesskey='b'><img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang, false); ?></a>
</li>
<?php } ?>
</ul>
<?php } ?>
</li>
<li><a href='<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/start/0/limit/50/order/desc"); ?>'>
<img src='<?php echo $sImageURL; ?>viewlast.png' title='' alt='<?php $clang->eT("Display Last 50 Responses"); ?>' /></a>
<?php if (count($tmp_survlangs)) { ?>
<ul>
<?php foreach ($tmp_survlangs as $tmp_lang) { ?>
<li>
<a href="<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/start/0/limit/50/order/desc/browselang/$tmp_lang"); ?>" accesskey='b'><img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang, false); ?></a>
</li>
<?php } ?>
</ul>
<?php } ?>
<?php if (count(Survey::model()->findByPk($surveyid)->additionalLanguages) == 0) { ?>
<li><a href='<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid"); ?>'>
<img src='<?php echo $sImageURL; ?>viewlast.png' title='' alt='<?php $clang->eT("Display Last 50 Responses"); ?>' /></a></li>
<?php } else { ?>
<li><a href='#' accesskey='b'>
<img src='<?php echo $sImageURL;?>viewlast.png' alt='<?php $clang->eT("Display Last 50 Responses"); ?>' />
</a><ul>
<li><a accesskey='b' target='_blank' href='<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/start/0/limit/50/order/desc"); ?>'>
<img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php $clang->eT("Display Last 50 Responses"); ?> </a><ul>
<?php foreach ($tmp_survlangs as $tmp_lang) { ?>
<li>
<a href="<?php echo $this->createUrl("admin/responses/sa/browse/surveyid/$surveyid/start/0/limit/50/order/desc/browselang/$tmp_lang"); ?>" accesskey='b'><img src='<?php echo $sImageURL;?>document_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang, false); ?></a>
</li>
<?php } ?>
</ul></li>
</ul></li>
<?php } ?>
</ul>
</li>
</ul>
<?php } ?>
<div class='menubar-left'>
<?php
Expand Down
6 changes: 3 additions & 3 deletions application/views/admin/super/header.php
Expand Up @@ -9,14 +9,14 @@
App()->getClientScript()->registerPackage('qTip2');
//App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('third_party') . 'jquery-qtip/jquery.qtip-1.0.0-rc3.min.js');
//App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . "admin_core.js");
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('styleurl') . "adminstyle.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "jquery-ui/jquery-ui.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "printablestyle.css", 'print');
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "adminstyle.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "superfish.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'jquery.multiselect.css');
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'jquery.multiselect.filter.css');
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "displayParticipants.css");
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('styleurl') . "adminstyle.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "adminstyle.css" );
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "printablestyle.css", 'print');
?>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

Expand Down
16 changes: 7 additions & 9 deletions application/views/admin/survey/surveybar_view.php
Expand Up @@ -38,17 +38,15 @@
<img src='<?php echo $sImageURL;?>do.png' alt='<?php echo $icontext;?>' />
</a></li>
<?php } else { ?>
<li><a href='#' accesskey='d'>
<li><a accesskey='d' target='_blank' href="<?php echo $this->createUrl("survey/index/sid/$surveyid/newtest/Y/lang/$baselang"); ?>" >
<img src='<?php echo $sImageURL;?>do.png' alt='<?php echo $icontext;?>' />
</a><ul>
<li><a accesskey='d' target='_blank' href='<?php echo $this->createUrl("survey/index/sid/$surveyid/newtest/Y"); ?>'>
<img src='<?php echo $sImageURL;?>do_30.png' alt=''/> <?php echo $icontext;?> </a><ul>
<?php foreach ($languagelist as $tmp_lang) { ?>
<li><a accesskey='d' target='_blank' href='<?php echo $this->createUrl("survey/index/sid/$surveyid/newtest/Y/lang/$tmp_lang");?>'>
<img src='<?php echo $sImageURL;?>do_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang,false);?></a></li>
<?php } ?>
</ul></li>
</ul></li>
<?php foreach ($languagelist as $tmp_lang) { ?>
<li><a accesskey='d' target='_blank' href='<?php echo $this->createUrl("survey/index/sid/$surveyid/newtest/Y/lang/$tmp_lang");?>'>
<img src='<?php echo $sImageURL;?>do_30.png' alt=''/> <?php echo getLanguageNameFromCode($tmp_lang,false);?></a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php } ?>
<li><a href='#'>
Expand Down
227 changes: 129 additions & 98 deletions scripts/admin/admin_core.js
Expand Up @@ -35,66 +35,10 @@ $(document).ready(function(){
duration: 'fast'
}, $.datepicker.regional[userlanguage]);
}
$(".sf-menu").superfish({});
$(".sf-menu").find("img").removeAttr("alt");;
$('button,input[type=submit],input[type=button],input[type=reset]').addClass("limebutton ui-state-default ui-corner-all");
$('button,input[type=submit],input[type=button],input[type=reset]').hover(
function(){
$(this).addClass("ui-state-hover");
},
function(){
$(this).removeClass("ui-state-hover");
}
)

// Call the popuptip hover rel attribute
$('.popuptip').each(function(){
if($(this).attr('rel')){
htmlcontent=$(this).html();
tiptarget=$("#"+$(this).attr('rel'));
//if($("#"+$(this).attr('rel')).find('img').length==1){ tiptarget=$("#"+$(this).attr('rel')).find('img');}
tiptarget.qtip({
content: {
text: htmlcontent
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
at: "bottom center",
my: "top center"
},
hide: {
fixed: true,
delay: 500,
event: "mouseout"
}
});
$("#"+$(this).attr('rel')).find("img").removeAttr("alt"); // Remove children img attr alt, the default tooltip can apply.
}
});


// Loads the tooltips for the toolbars except the surveybar
$('img[alt],input[src]').each(function() {
if($(this).attr('alt') != ''){
$(this).qtip({
content: {
attr: "alt"
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
viewport: $(window),
at: "bottom right"
},
hide: {
event: "mouseout"
}
});
}
});
$(".sf-menu").superfish({speed: 'fast'});
doToolTip();
$('button,input[type=submit],input[type=button],input[type=reset]').button();
$('button,input[type=submit],input[type=button],input[type=reset]').addClass("limebutton");

$(".progressbar").each(function(){
var pValue = parseInt($(this).attr('name'));
Expand All @@ -111,44 +55,6 @@ $(document).ready(function(){
});



$('label[title]').each(function() {
if($(this).attr('title') != '')
{
$(this).qtip({
style: {
classes: "qtip-cream qtip-rounded"
},
position: {
viewport: $(window),
at: "bottom right"
}
});
}
});

//Still used ?
$('.tipme').each(function() {
if($(this).attr('alt') != '')
{
$(this).qtip(
{
content: {
attr: 'alt'
},
style: {
classes: "qtip-cream qtip-rounded"
},
position: {
viewport: $(window),
at: 'top right',
tooltip: 'bottom left'
}
});
}
});


if ($('#showadvancedattributes').length>0) updatequestionattributes();

$('#showadvancedattributes').click(function(){
Expand Down Expand Up @@ -305,6 +211,131 @@ function validatefilename (form, strmessage )
return true ;
}

function doToolTip()
{
// ToolTip on menu
$(".sf-menu li").each(function() {
tipcontent=$(this).children("a").children("img").attr('alt');
if(tipcontent && tipcontent!=""){
$(this).qtip({
content: {
text: tipcontent
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
my: 'bottom left',
at: "top right"
}
});
}
});
$(".sf-menu a > img[alt]").removeAttr("alt");
$("a").each(function() {
tipcontent=$(this).children("img").attr('alt');
if(!tipcontent){tipcontent=$(this).attr('title');}
if(tipcontent && tipcontent!=""){
$(this).qtip({
content: {
text: tipcontent
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
viewport: $(window),
at: 'bottom right',
}
});
}
});
$("a > img[alt]").removeAttr("alt");

// Call the popuptip hover rel attribute
$('.popuptip').each(function(){
if($(this).attr('rel')){
htmlcontent=$(this).html();
tiptarget=$("#"+$(this).attr('rel'));
//if($("#"+$(this).attr('rel')).find('img').length==1){ tiptarget=$("#"+$(this).attr('rel')).find('img');}
tiptarget.qtip({
content: {
text: htmlcontent
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
at: "bottom center",
my: "top center"
},
hide: {
fixed: true,
delay: 500,
event: "mouseout"
}
});
$("#"+$(this).attr('rel')).find("img").removeAttr("alt"); // Remove children img attr alt, the default tooltip can apply.
}
});
// On label
$('label[title]').each(function() {
if($(this).attr('title') != '')
{
$(this).qtip({
style: {
classes: "qtip-cream qtip-rounded"
},
position: {
viewport: $(window),
at: "bottom right"
}
});
}
});
// Loads the tooltips on image
$('img[alt],input[src]').each(function() {
if($(this).attr('alt') != ''){
$(this).qtip({
content: {
attr: "alt"
},
style: {
classes: "qtip-light qtip-rounded"
},
position: {
viewport: $(window),
at: "bottom right"
},
hide: {
event: "mouseout"
}
});
}
});

//Still used ?
$('.tipme').each(function() {
if($(this).attr('alt') != '')
{
$(this).qtip(
{
content: {
attr: 'alt'
},
style: {
classes: "qtip-cream qtip-rounded"
},
position: {
viewport: $(window),
at: 'top right',
tooltip: 'bottom left'
}
});
}
});

}

// If the length of the element's string is 0 then display helper message
function isEmpty(elem, helperMsg)
Expand Down

0 comments on commit b173975

Please sign in to comment.