Skip to content

Commit

Permalink
Dev: Fix (partial : public part only) merging issue
Browse files Browse the repository at this point in the history
Dev: #11918 : remove jqueryui from template config.xml, add it to do_ranking
Dev: create config/packages.php for core packages
  • Loading branch information
Shnoulle committed Nov 16, 2016
1 parent 4ecf385 commit cd8244b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
15 changes: 1 addition & 14 deletions application/config/internal.php
Expand Up @@ -98,20 +98,7 @@
'clientScript'=>array(
'packages' => array_merge(
require('third_party.php'),
array(
'limesurvey-public'=>array(
'basePath' => 'core.limesurvey',
'css'=> array(
'survey.css',
),
'js'=>array(
'survey.js',
),
'depends' => array(
'bootstrap',
)
)
)
require('packages.php')
)
),

Expand Down
22 changes: 22 additions & 0 deletions application/config/packages.php
@@ -0,0 +1,22 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Core packages , no third_party
*
* @license GPL v3
*
*/
return array(
/* For public template functionnality */
'limesurvey-public'=>array(
'basePath' => 'core.limesurvey',
'css'=> array(
'survey.css',
),
'js'=>array(
'survey.js',
),
'depends' => array(
//'bootstrap',
)
)
);
6 changes: 3 additions & 3 deletions application/config/third_party.php
Expand Up @@ -5,7 +5,8 @@
* Defining them here allows for easy inclusion in views.
*/


/* Please : comment the reason, mantis bug link: ajax don't need any package if i don't make error */
/* Ajax must renderPartial (better : always return json) and never render and don't registerScript (IMHO) / Shnoulle on 2016-11-16 */
if (!isset($_GET['isAjax']))
{
$aJquery = array(
Expand Down Expand Up @@ -303,6 +304,7 @@
'css' => array(
'css/emoji.css',
'css/ss-emoji.css'
),
),
'jquery-datatable' => array(
'basePath' => 'third_party.jquery-datatable',
Expand All @@ -317,6 +319,4 @@
'bootstrap'
)
)


);
3 changes: 3 additions & 0 deletions application/helpers/qanda_helper.php
Expand Up @@ -2074,7 +2074,10 @@ function do_ranking($ia)
$inputnames[]=$myfname;
}

App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-touch-punch');
App()->getClientScript()->registerPackage('jquery-actual'); // Needed to with jq1.9 ?
Yii::app()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."ranking.js");
Yii::app()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . "ranking.css");

Expand Down
2 changes: 2 additions & 0 deletions templates/default/config.xml
Expand Up @@ -112,8 +112,10 @@
<!-- Here, you can publish packages set as third party extensions in application/config/third_party -->
<!-- If bootstrap is registered as a css framework, it will be loaded first -->
<packages>
<!--
<package>jqueryui</package>
<package>jquery-touch-punch</package>
-->
<package>fontawesome</package>
<package>limesurvey-public</package>
</packages>
Expand Down

0 comments on commit cd8244b

Please sign in to comment.