yii 1.1 select2 jquery conflict with yii jquery - netbeans

I am working on a project in yii, in which i am using jquery select2 extension, I have created a searchable dropdown list using select2 extension in localhost/business/package/create page, now when i want to create a package the drop down list just becomes drop down, not searchable, unless i remove this line from my layout <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>. After that i can create the package,with my seachable drop down list, but my rest of the pages are not scrolling. If i open the view source of package/create these files are already added
<script type="text/javascript" src="/businessadvisor/assets/f81f8ab/jquery.js"></script>
<script type="text/javascript" src="/businessadvisor/assets/1075462/select2.js"></script>
so the crux is a because of a single file, my rest of the pages are not scrolling, nor clicking etc. so what is the solution to deal with this conflict.

You are including jQuery multiple times, so the second inclusion will overwrite all the already included plugins.
You can use the scriptMap option to specify the location of jQuery for the whole site.
'components'=>array(
...
'clientScript'=>array (
'scriptMap'=>array(
'jquery.js'=>'//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js',
),
...
),
...
),

Ok here is the answer. The problem was, when i commented out <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script> from my admin.php (my layout), drop down in package/createstart working, while the rest of the pages becomes stuck, not scrolling nor clicking. so one file was creating a whole problem, to solve this, you need to go into your custom.jsand replace $ with jQuery and save it. Now I had below files under my footer widget.
<!-- <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>-->
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/slimmenu.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap-datepicker.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/bootstrap-timepicker.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/nicescroll.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/dropit.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/ionrangeslider.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/icheck.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/fotorama.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/typeahead.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/card-payment.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/magnific.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/owl-carousel.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/fitvids.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/tweet.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/countdown.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/gridrotator.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/custom.js"></script>
I commented out <!-- <script src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.js"></script>-->jquery and in header of my layout having these files
<head>
<title>Business Advisor,Where you give ratings and reviews</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="keywords" content="Template, html, premium, themeforest" />
<meta name="description" content="Traveler - Premium template for travel companies">
<meta name="author" content="Tsoy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
<!-- /GOOGLE FONTS -->
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/font-awesome.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/icomoon.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/styles.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/mystyles.css">
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/modernizr.js"></script>
</head>
so what i did, i copied this code
<?php
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');?> <!-- put these files in admin.php so that conflcit will resolve from select2 extension select2.php-->
from my select2.php and paste in my header like this.
<head>
<title>Business Advisor,Where you give ratings and reviews</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="keywords" content="Template, html, premium, themeforest" />
<meta name="description" content="Traveler - Premium template for travel companies">
<meta name="author" content="Tsoy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
<!-- /GOOGLE FONTS -->
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/font-awesome.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/icomoon.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/styles.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;?>/css/mystyles.css">
<script src="<?php echo Yii::app()->request->baseUrl;?>/js/modernizr.js"></script>
<?php
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');?> <!-- put these files in admin.php so that conflcit will resolve from select2 extension select2.php-->
</head>
Now the jquery has been registered. and now my every page, even package/create
is working, every thing is scrolling, no conflict at all. Cheers :)

Related

idtabs not working with ads script on same page

Im using idtabs jquery library and when i put ads on the page, the script stops working. I tried plain script with only idtabs and google adsense code. If I run the script on my localhost, it runs ok (because adsense doesnt show), but once i upload it on server, the ads shows and the script id tabs wont work. Anyone know how to solve this?
<!DOCTYPE html>
<body>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery.idTabs.js"></script>
~~google adsense code here
</head>
<body>
<div class="usual">
<ul class="idTabs" >
<li><a class="selected" href="#tab1">Tab 1</a></li>
<li>Tab 2</li>
<li>Tab 3</li>
</ul>
<div style="display:block;" id="tab1">This is tab 1.</div>
<div style="display:none;" id="tab2">More content in tab 2.</div>
<div style="display:none;" id="tab3">Tab 3 is always last!</div>
</div>
</body>
</html>

Github Pages not loading my project

I am trying to create a GitHub Pages for one of my existing repositories. When I click on "Your site is published at ..." I just get a blank screen. Here is the link to the site: https://mrcj101111.github.io/Clipboard/
The page is correct. Your Body is empty, in the below example I added an h1 header with the a value of "geckos-23".
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<title>geckos-23</title>
</head>
<body>
<h1>geckos-23</h1>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

Change order of Title tag in moodle login page

Currently Moodle add Content-Type meta Tag
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
after Title tag
<title>Mount Orange School: Log in to the site</title>
within Head tag.
<head>
<title>Mount Orange School: Log in to the site</title>
<link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...
...
</head>
How can we change this order with minimum change in moodle3.1 core(https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374). Putting Content Type meta tag on top within Head tag. Something like this.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mount Orange School: Log in to the site</title>
<link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
...
...
</head>
We are using http://nutch.apache.org/ and it is not reading title if Content type Meta is not defined as first tag in Head.
Ref1: view-source:https://school.demo.moodle.net/login/index.php
Ref2: https://school.demo.moodle.net/login/index.php
Ref3: https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374
There are two ways of doing it.
Change the core code here https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/theme/bootstrapbase/layout/columns1.php#L30
Create Custom theme and import base theme and make changes there.
https://edwiser.org/blog/create-child-theme-moodle/
https://docs.moodle.org/dev/Themes
Change which require is
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
.....
to
<head>
<?php echo $OUTPUT->standard_head_html() ?>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
....

How can I create and manage playlist in phonegap? (audio/Video files)

I am trying to create a playlist in phonegap application for iPhone. I don't have any idea regarding this, I am totally new to this issue, I am not getting any thing, can any one help me out to solve this issue?
This may help you
Use PhoneGap Media API & jQuery Mobile UI Framework
Here is the code:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=screen.width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Audio Player</title>
<!-- NOTE: The following 4 lines are inserted by the project wizard -->
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.0.css" type="text/css">
<script type="text/javascript" src="jquery.mobile/jquery-1.6.4.min"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.0.js"></script>
<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
</head>
<body>
<div data-role="page" data-theme="a" id="page-home">
<div data-role="header" data-nobackbtn="true" data-theme="e">
<h1>Audio Player</h1>
</div> <!-- /header -->
<div data-role="content" id="content-manual" data-theme="a">
<div data-role="button" id="playaudio" data-theme="e">Play</div>
<div data-role="button" id="pauseaudio" data-theme="e">Pause</div>
<div data-role="button" id="stopaudio" data-theme="e">Stop</div>
<div class="ui-grid-a">
<div class="ui-block-a"> Current: <span id="audio_position">0 sec</span></div>
<div class="ui-block-b">Total: <span id=media_dur>0</span> sec</div>
</div><!-- /grid-a -->
</div> <!-- /content-manual -->
</div> <!-- /page -->
</body>
</html>

Extjs4 what's the best way to add a plugin in extjs?

I want to add a plugin(http://www.sencha.com/forum/showthread.php?150918-Grid-Header-Filters) to my application.
What's the best way to install it, considering I use sencha SDK-tools ...
The class name of plugin is: Ext.ux.grid.plugin.HeaderFilters
Any suggests?
Check basic setup here:
http://www.sencha.com/learn/html-page-setup/
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Velociraptor Owners</title>
<!--Ext JS-->
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<!-- script type="text/javascript" src="extjs/bootstrap.js"></script-->
<script src="extjs/ext-all-debug.js"></script>
<script src="extjs/GridHeaderFilters.js"></script>
<!--Application JS-->
<script src="grid.js"></script>
<!-- script src="php/api.php"></script -->
<!--Application Aesthetics-->
<link rel="stylesheet" href="style.css" type="text/css">
</head>