Commit d184fbb8 by Qiang Xue

new asset WIP [skip ci]

parent 35c3cbd0
{
"directory" : "web/assets"
}
\ No newline at end of file
......@@ -17,8 +17,11 @@ class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = ['css/site.css'];
public $js = [];
public $css = [
'css/site.css',
];
public $js = [
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
......
{
"name": "yii2-advanced-backend",
"version": "1.0.0",
"dependencies": {
},
"devDependencies": {
}
}
{
"directory" : "web/assets"
}
\ No newline at end of file
{
"name": "yii2-advanced-frontend",
"version": "1.0.0",
"dependencies": {
},
"devDependencies": {
}
}
{
"name": "yii2-basic",
"name": "yii2-basic-app",
"version": "1.0.0",
"dependencies": {
},
......
......@@ -10,3 +10,6 @@ To add a new extension named `xyz` (must be in lower case), take the following s
* `LICENSE.md`
3. ask Qiang to create a subsplit for `xyz` and a composer package named `yii2-xyz`;
4. modify `/composer.json` and add `xyz` to the `replace` section;
5. If an extension contains js/css files or depends on external bower packages:
* create `bower.json`
* ask Qiang to register a bower package with the name `yii2-xyz`
......@@ -17,12 +17,11 @@ use yii\web\AssetBundle;
*/
class AuthChoiceAsset extends AssetBundle
{
public $sourcePath = '@yii/authclient/assets';
public $js = [
'authchoice.js',
'yii2-authclient/assets/authchoice.js',
];
public $css = [
'authchoice.css',
'yii2-authclient/assets/authchoice.css',
];
public $depends = [
'yii\web\YiiAsset',
......
......@@ -18,8 +18,7 @@
}
],
"require": {
"yiisoft/yii2": "*",
"twbs/bootstrap": "3.2.* | 3.1.* | 3.0.*"
"yiisoft/yii2": "*"
},
"autoload": {
"psr-4": {
......
......@@ -19,12 +19,11 @@ class GiiAsset extends AssetBundle
{
public $css = [
'yii2-gii/assets/main.css',
// 'typeahead.js-bootstrap.css',
];
public $js = [
'yii2-gii/assets/gii.js',
'typeahead.js/dist/typeahead.jquery.js',
'typeahead.js/dist/typeahead.bundle.js',
];
public $depends = [
......
......@@ -125,7 +125,6 @@ body {
text-decoration: none;
}
.Differences {
width: 100%;
border-collapse: collapse;
......@@ -214,10 +213,47 @@ body {
content: attr(data-line-number);
}
/* additional styles for typeahead.js-bootstrap.css */
/* additional styles for typeahead.js, adapted from http://twitter.github.io/typeahead.js/examples/ */
.twitter-typeahead {
display: block !important;
}
.twitter-typeahead .tt-hint {
padding: 6px 12px !important;
.tt-query {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.tt-hint {
color: #999
}
.tt-dropdown-menu {
width: 422px;
margin-top: 2px;
padding: 8px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
}
.tt-suggestion {
padding: 3px 20px;
font-size: 18px;
line-height: 24px;
}
.tt-suggestion.tt-cursor {
color: #fff;
background-color: #0097cf;
}
.tt-suggestion p {
margin: 0;
}
/* always keep this link here when updating this file: https://github.com/jharding/typeahead.js-bootstrap.css */
.twitter-typeahead .tt-query,
.twitter-typeahead .tt-hint {
margin-bottom: 0;
}
.tt-dropdown-menu {
min-width: 160px;
margin-top: 2px;
padding: 5px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
-moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
box-shadow: 0 5px 10px rgba(0,0,0,.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.tt-suggestion {
display: block;
padding: 3px 20px;
}
.tt-suggestion.tt-is-under-cursor {
color: #fff;
background-color: #0081c2;
background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
background-image: -o-linear-gradient(top, #0088cc, #0077b3);
background-image: linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)
}
.tt-suggestion.tt-is-under-cursor a {
color: #fff;
}
.tt-suggestion p {
margin: 0;
}
......@@ -64,7 +64,7 @@ class ActiveField extends \yii\widgets\ActiveField
public function autoComplete($data)
{
static $counter = 0;
$this->inputOptions['class'] .= ' typeahead-' . (++$counter);
$this->inputOptions['class'] .= ' typeahead typeahead-' . (++$counter);
foreach ($data as &$item) {
$item = ['word' => $item];
}
......
......@@ -22,7 +22,7 @@ $asset = yii\gii\GiiAsset::register($this);
<?php $this->beginBody() ?>
<?php
NavBar::begin([
'brandLabel' => Html::img($asset->baseUrl . '/logo.png'),
'brandLabel' => Html::img('@web/assets/yii2-gii/assets/logo.png'),
'brandUrl' => ['default/index'],
'options' => ['class' => 'navbar-inverse navbar-fixed-top'],
]);
......
Copyright Mathias Bynens <http://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*! http://mths.be/punycode v1.2.1 by @mathias */
(function(o){function e(o){throw RangeError(L[o])}function n(o,e){for(var n=o.length;n--;)o[n]=e(o[n]);return o}function t(o,e){return n(o.split(S),e).join(".")}function r(o){for(var e,n,t=[],r=0,u=o.length;u>r;)e=o.charCodeAt(r++),55296==(63488&e)&&u>r?(n=o.charCodeAt(r++),56320==(64512&n)?t.push(((1023&e)<<10)+(1023&n)+65536):t.push(e,n)):t.push(e);return t}function u(o){return n(o,function(o){var e="";return o>65535&&(o-=65536,e+=R(55296|1023&o>>>10),o=56320|1023&o),e+=R(o)}).join("")}function i(o){return 10>o-48?o-22:26>o-65?o-65:26>o-97?o-97:x}function f(o,e){return o+22+75*(26>o)-((0!=e)<<5)}function c(o,e,n){var t=0;for(o=n?P(o/m):o>>1,o+=P(o/e);o>M*y>>1;t+=x)o=P(o/M);return P(t+(M+1)*o/(o+j))}function l(o){var n,t,r,f,l,d,s,a,p,h,v=[],g=o.length,w=0,j=I,m=A;for(t=o.lastIndexOf(F),0>t&&(t=0),r=0;t>r;++r)o.charCodeAt(r)>=128&&e("not-basic"),v.push(o.charCodeAt(r));for(f=t>0?t+1:0;g>f;){for(l=w,d=1,s=x;f>=g&&e("invalid-input"),a=i(o.charCodeAt(f++)),(a>=x||a>P((b-w)/d))&&e("overflow"),w+=a*d,p=m>=s?C:s>=m+y?y:s-m,!(p>a);s+=x)h=x-p,d>P(b/h)&&e("overflow"),d*=h;n=v.length+1,m=c(w-l,n,0==l),P(w/n)>b-j&&e("overflow"),j+=P(w/n),w%=n,v.splice(w++,0,j)}return u(v)}function d(o){var n,t,u,i,l,d,s,a,p,h,v,g,w,j,m,E=[];for(o=r(o),g=o.length,n=I,t=0,l=A,d=0;g>d;++d)v=o[d],128>v&&E.push(R(v));for(u=i=E.length,i&&E.push(F);g>u;){for(s=b,d=0;g>d;++d)v=o[d],v>=n&&s>v&&(s=v);for(w=u+1,s-n>P((b-t)/w)&&e("overflow"),t+=(s-n)*w,n=s,d=0;g>d;++d)if(v=o[d],n>v&&++t>b&&e("overflow"),v==n){for(a=t,p=x;h=l>=p?C:p>=l+y?y:p-l,!(h>a);p+=x)m=a-h,j=x-h,E.push(R(f(h+m%j,0))),a=P(m/j);E.push(R(f(a,0))),l=c(t,w,u==i),t=0,++u}++t,++n}return E.join("")}function s(o){return t(o,function(o){return E.test(o)?l(o.slice(4).toLowerCase()):o})}function a(o){return t(o,function(o){return O.test(o)?"xn--"+d(o):o})}var p="object"==typeof exports&&exports,h="object"==typeof module&&module&&module.exports==p&&module,v="object"==typeof global&&global;(v.global===v||v.window===v)&&(o=v);var g,w,b=2147483647,x=36,C=1,y=26,j=38,m=700,A=72,I=128,F="-",E=/^xn--/,O=/[^ -~]/,S=/\x2E|\u3002|\uFF0E|\uFF61/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=x-C,P=Math.floor,R=String.fromCharCode;if(g={version:"1.2.1",ucs2:{decode:r,encode:u},decode:l,encode:d,toASCII:a,toUnicode:s},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return g});else if(p&&!p.nodeType)if(h)h.exports=g;else for(w in g)g.hasOwnProperty(w)&&(p[w]=g[w]);else o.punycode=g})(this);
\ No newline at end of file
......@@ -53,8 +53,6 @@
"ext-mbstring": "*",
"lib-pcre": "*",
"yiisoft/yii2-composer": "*",
"yiisoft/jquery": "~2.0 | ~1.10",
"yiisoft/jquery-pjax": "*",
"ezyang/htmlpurifier": "4.6.*",
"cebe/markdown": "0.9.*"
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment