diff --git a/app/Components/EndaPage.php b/app/Components/EndaPage.php new file mode 100644 index 00000000..537780a1 --- /dev/null +++ b/app/Components/EndaPage.php @@ -0,0 +1,135 @@ + + * Time: 2015.11.12 下午6:16 + */ +namespace App\Components; + +use Illuminate\Contracts\Pagination\Presenter; +use Illuminate\Contracts\Pagination\Paginator as PaginatorContract; +use Illuminate\Pagination\BootstrapThreePresenter; +class EndaPage extends BootstrapThreePresenter implements Presenter +{ + public $paginator; + + public function __construct(PaginatorContract $paginator) + { + $this->paginator = $paginator; + } + + /** + * Determine if the underlying paginator being presented has pages to show. + * + * @return bool + */ + public function hasPages() + { + return $this->paginator->hasPages() && count($this->paginator->items()) > 0; + } + + /** + * Convert the URL window into Bootstrap HTML. + * + * @return string + */ + public function render() + { + if ($this->hasPages()) { + return sprintf( + '', + $this->getPreviousButton('上一页'), + $this->getNextButton('下一页') + ); + } + + return ''; + } + + /** + * 获取上一页按钮 + * + * @param string $text + * @return string + */ + public function getPreviousButton($text = '«') + { + if ($this->paginator->currentPage() <= 1) { + return $this->getPreviousDisabledTextWrapper($text); + } + + $url = $this->paginator->url( + $this->paginator->currentPage() - 1 + ); + + return $this->getPreviousPageWrapper($url, $text, 'prev'); + } + + + /** + * 获取上一页li + * @param $url + * @param $page + * @param null $rel + * @return string + */ + protected function getPreviousPageWrapper($url, $page, $rel = null) + { + $rel = is_null($rel) ? '' : ' rel="'.$rel.'"'; + + return ''; + } + + /** + * 获取下一页按钮 + * + * @param string $text + * @return string + */ + public function getNextButton($text = '»') + { + if (! $this->paginator->hasMorePages()) { + return $this->getDisabledTextWrapper($text); + } + + $url = $this->paginator->url($this->paginator->currentPage() + 1); + + return $this->getNextPageWrapper($url, $text, 'next'); + } + + /** + * 获取上一页li + * @param $url + * @param $page + * @param null $rel + * @return string + */ + protected function getNextPageWrapper($url, $page, $rel = null) + { + $rel = is_null($rel) ? '' : ' rel="'.$rel.'"'; + + return ''; + } + + + /** + * 获取上一页选择状态下的li + * + * @param string $text + * @return string + */ + protected function getPreviousDisabledTextWrapper($text) + { + return ''; + } + + /** + * 获取下一页选择状态下的li + * + * @param string $text + * @return string + */ + protected function getNextDisabledTextWrapper($text) + { + return ''; + } +} diff --git a/app/Http/Controllers/AboutController.php b/app/Http/Controllers/AboutController.php index 60183e84..405def1c 100644 --- a/app/Http/Controllers/AboutController.php +++ b/app/Http/Controllers/AboutController.php @@ -9,35 +9,6 @@ class AboutController extends Controller { - /** - * Display a listing of the resource. - * - * @return Response - */ - public function index() - { - // - } - - /** - * Show the form for creating a new resource. - * - * @return Response - */ - public function create() - { - // - } - - /** - * Store a newly created resource in storage. - * - * @return Response - */ - public function store() - { - // - } /** * Display the specified resource. @@ -61,37 +32,4 @@ public function show($id) ]); } - /** - * Show the form for editing the specified resource. - * - * @param int $id - * @return Response - */ - public function edit($id) - { - // - } - - /** - * Update the specified resource in storage. - * - * @param int $id - * @return Response - */ - public function update($id) - { - // - } - - /** - * Remove the specified resource from storage. - * - * @param int $id - * @return Response - */ - public function destroy($id) - { - // - } - } diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index f7d6d074..7607e7ac 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -1,5 +1,6 @@ $article, - 'hotArticle'=>$hotArticle + $page = new EndaPage($article['page']); + return homeView('index', array( + 'articleList' => $article, + 'page' => $page )); - } - - - /** - * Display the specified resource. - * - * @param int $id - * @return Response - */ - public function show($id) - { - // + } + + + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) + { $article = Article::getArticleModelByArticleId($id); - $tags = Tag::getTagModelByTagIds($article->tags); - $authorArticle = Article::getArticleModelByUserId($article->user_id); ArticleStatus::updateViewNumber($id); $data = array( - 'article'=>$article, - 'tags'=>$tags, - 'authorArticle'=>$authorArticle, + 'article' => $article, ); viewInit(); - return homeView('article',$data); - } + return homeView('article', $data); + } } diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index fc84757c..555b446f 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -6,92 +6,31 @@ use App\Model\Article; use App\Model\Category; use Illuminate\Http\Request; - -class CategoryController extends Controller { - - /** - * Display a listing of the resource. - * - * @return Response - */ - public function index() - { - // - } - - /** - * Show the form for creating a new resource. - * - * @return Response - */ - public function create() - { - // - } - - /** - * Store a newly created resource in storage. - * - * @return Response - */ - public function store() - { - // - } - - /** - * Display the specified resource. - * - * @param int $id - * @return Response - */ - public function show($id) - { - // +use App\Components\EndaPage; +class CategoryController extends Controller +{ + + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) + { + // viewInit(); $category = Category::getCatInfoModelByAsName($id); - if(empty($category)){ + if (empty($category)) { return redirect(url(route('article.index'))); } - $article = Article::getArticleListByCatId($category->id,10); - - return homeView('category',[ - 'category'=>$category, - 'article'=>$article + $article = Article::getArticleListByCatId($category->id, 10); + $page = new EndaPage($article['page']); + return homeView('category', [ + 'category' => $category, + 'articleList' => $article, + 'page' => $page ]); - } - - /** - * Show the form for editing the specified resource. - * - * @param int $id - * @return Response - */ - public function edit($id) - { - // - } - - /** - * Update the specified resource in storage. - * - * @param int $id - * @return Response - */ - public function update($id) - { - // - } - - /** - * Remove the specified resource from storage. - * - * @param int $id - * @return Response - */ - public function destroy($id) - { - // - } + } } diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index f0d6bf64..c5e7cbb6 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -1,5 +1,6 @@ input('keyword'); - if(empty($keyword)){ + if (empty($keyword)) { return redirect()->route('article.index'); } $article = Article::getArticleListByKeyword($keyword); - + $page = new EndaPage($article['page']); viewInit(); return homeView('search', [ - 'article' => $article, - 'keyword' => $keyword + 'articleList' => $article, + 'keyword' => $keyword, + 'page' => $page ]); } @@ -32,11 +34,12 @@ public function getTag($id) { $article = Article::getArticleListByTagId($id); - + $page = new EndaPage($article['page']); viewInit(); return homeView('searchTag', [ - 'article' => $article, - 'tagName'=> Tag::getTagNameByTagId($id) + 'articleList' => $article, + 'tagName' => Tag::getTagNameByTagId($id), + 'page' => $page ]); } diff --git a/app/Http/Controllers/backend/LinksController.php b/app/Http/Controllers/backend/LinksController.php new file mode 100644 index 00000000..21fb3ba9 --- /dev/null +++ b/app/Http/Controllers/backend/LinksController.php @@ -0,0 +1,125 @@ + Links::all(), + ]); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + // + return backendView('create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(LinksRequest $request) + { + // + try { + if (Links::create($request->all())) { + Notification::success('添加成功'); + return redirect()->route('backend.links.index'); + } + } catch (\Exception $e) { + return redirect()->back()->withErrors(array('error' => $e->getMessage()))->withInput(); + } + } + + /** + * Display the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function show($id) + { + // + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + // + return backendView('edit', [ + 'link' => Links::find($id), + ]); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(LinksRequest $request, $id) + { + // + try { + if (Links::find($id)->update($request->all())) { + Notification::success('修改成功'); + } + return redirect()->route('backend.links.index'); + } catch (\Exception $e) { + return redirect()->back()->withErrors(array('error' => $e->getMessage()))->withInput(); + } + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + try { + Links::destroy($id); + Notification::success('删除成功'); + } catch (\Exception $e) { + Notification::error($e->getMessage()); + } + + + return redirect()->route('backend.links.index'); + } +} diff --git a/app/Http/Controllers/backend/NavigationController.php b/app/Http/Controllers/backend/NavigationController.php index 93e30f21..af30a483 100644 --- a/app/Http/Controllers/backend/NavigationController.php +++ b/app/Http/Controllers/backend/NavigationController.php @@ -23,9 +23,9 @@ public function __construct() */ public function index() { - // + return backendView('index', [ - 'list' => Navigation::getTreeNavigationAll(), + 'list' => Navigation::getNavigationAll(), ]); } @@ -34,14 +34,10 @@ public function index() * * @return Response */ - public function create(Request $request) + public function create() { // - $parentId = $request->input('parentId', 0); - - return backendView('create', [ - 'parent_id' => $parentId - ]); + return backendView('create'); } /** @@ -52,14 +48,13 @@ public function create(Request $request) public function store(NavigationForm $request) { - // try { if (Navigation::create($request->all())) { Notification::success('添加成功'); return redirect()->route('backend.nav.index'); } } catch (\Exception $e) { - return redirect()->back()->withInput(); + return redirect()->back()->withErrors(array('error' => $e->getMessage()))->withInput(); } } @@ -97,16 +92,12 @@ public function edit($id) */ public function update(NavigationForm $request, $id) { - // try { - $data = $request->all(); - unset($data['_method']); - unset($data['_token']); - if (Navigation::where('id', $id)->update($data)) { + if (Navigation::find($id)->update($request->all())) { Notification::success('修改成功'); - return redirect()->route('backend.nav.index'); } + return redirect()->route('backend.nav.index'); } catch (\Exception $e) { return redirect()->back()->withErrors(array('error' => $e->getMessage()))->withInput(); } @@ -121,18 +112,15 @@ public function update(NavigationForm $request, $id) */ public function destroy($id) { - // - if (Navigation::isChildNav($id)) { - Notification::error('该导航包含子导航,请先删除'); - } else { - try { - Navigation::destroy($id); - Notification::success('删除成功'); - } catch (\Exception $e) { - Notification::error($e->getMessage()); - } + + try { + Navigation::destroy($id); + Notification::success('删除成功'); + } catch (\Exception $e) { + Notification::error($e->getMessage()); } + return redirect()->route('backend.nav.index'); } diff --git a/app/Http/Requests/LinksRequest.php b/app/Http/Requests/LinksRequest.php new file mode 100644 index 00000000..bad3ae7a --- /dev/null +++ b/app/Http/Requests/LinksRequest.php @@ -0,0 +1,23 @@ + 'required|integer', + 'name' => 'required', + 'url' => 'required|url', + ]; + } +} diff --git a/app/Http/Requests/NavigationForm.php b/app/Http/Requests/NavigationForm.php index a001af59..f3054d5d 100644 --- a/app/Http/Requests/NavigationForm.php +++ b/app/Http/Requests/NavigationForm.php @@ -14,7 +14,6 @@ public function rules() { return [ - 'parent_id' => 'required|integer', 'sequence' => 'required|integer', 'name' => 'required', 'url' => 'required|url', diff --git a/app/Http/routes.php b/app/Http/routes.php index a3600423..8f96eeb1 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -36,6 +36,7 @@ Route::resource('user','backend\UserController'); Route::resource('comment','backend\CommentController'); Route::resource('nav','backend\NavigationController'); + Route::resource('links','backend\LinksController'); Route::controllers([ 'system'=>'backend\SystemController', 'upload'=>'backend\UploadFileController' diff --git a/app/Model/Article.php b/app/Model/Article.php index d1726975..39b744c7 100644 --- a/app/Model/Article.php +++ b/app/Model/Article.php @@ -204,7 +204,7 @@ public static function getArticleListByKeyword($keyword) $page = Input::get('page', 1); $cacheName = $page . '_' . md5($keyword); - if ($model = empty(Cache::tags(self::REDIS_ARTICLE_PAGE_TAG)->get(self::REDIS_SEARCH_ARTICLE_CACHE . $cacheName))) { + if (empty($model = Cache::tags(self::REDIS_ARTICLE_PAGE_TAG)->get(self::REDIS_SEARCH_ARTICLE_CACHE . $cacheName))) { $model = self::select('id')->where('title', 'like', "%$keyword%")->orderBy('id', 'desc')->simplePaginate(10); Cache::tags(self::REDIS_ARTICLE_PAGE_TAG)->put(self::REDIS_SEARCH_ARTICLE_CACHE . $cacheName, $model, self::$cacheMinutes); } diff --git a/app/Model/Links.php b/app/Model/Links.php new file mode 100644 index 00000000..408121bc --- /dev/null +++ b/app/Model/Links.php @@ -0,0 +1,30 @@ + + */ +namespace App\Model; + +use Illuminate\Database\Eloquent\Model; + +class Links extends Model +{ + // + protected $table; + protected $fillable = [ + 'sequence', + 'name', + 'url' + ]; + + /** + * 获取链接列表 + * @param int $limit + * @return mixed + */ + public static function getLinkList($limit = 5) + { + return self::orderBy('sequence', 'asc')->limit($limit)->get(); + } + + +} diff --git a/app/Model/Navigation.php b/app/Model/Navigation.php index 0a4a8701..05bfb73d 100644 --- a/app/Model/Navigation.php +++ b/app/Model/Navigation.php @@ -11,47 +11,19 @@ class Navigation extends Model public $child; protected $fillable = [ - 'parent_id', 'sequence', 'name', 'url' ]; - static $navigation = [ - 0 => '顶级导航' - ]; - - public static function getNavigationAll() - { - return self::orderBy('sequence', 'asc')->get(); - } + static $navigation = []; - /** - * 方便以后扩展 - * @return \Illuminate\Database\Eloquent\Collection|static[] - */ - public static function getTreeNavigationAll() + public static function getNavigationAll($limit = 5) { - return tree(self::getNavigationAll()); + return self::orderBy('sequence', 'asc')->limit($limit)->get(); } - /** - * 获取所有导航 - * @return array - */ - public static function getNavigationArray() - { - if (empty(self::$navigation)) { - $model = self::getTreeNavigationAll(); - if (!empty($model)) { - foreach ($model as $nav) { - self::$navigation[$nav->id] = $nav->html . $nav->name; - } - } - } - return self::$navigation; - } /** * 获得导航名称 @@ -68,45 +40,4 @@ public static function getNavNameByNavId($id) } return isset(self::$navigation[$id]) ? self::$navigation[$id] : ''; } - - /** - * 获取子导航 - * @param $id - * @return mixed - */ - public static function getChildNav($id) - { - return self::where('parent_id', $id)->get(); - } - - - /** - * 是否包含子级 - * @param $id - * @return bool - */ - public static function isChildNav($id) - { - $child = self::where('parent_id', '=', $id)->first(); - return !empty($child) ? true : false; - } - - public static function getNavList() - { - $model = self::getNavigationAll(); - $data = []; - if (!empty($model)) { - foreach ($model as $key => $nav) { - if($nav->parent_id == 0){ - $data[$key] = $nav; - foreach ($model as $navigation) { - if ($navigation->parent_id == $nav->id) { - $data[$key]->child[] = $navigation; - } - } - } - } - } - return $data; - } } diff --git a/composer.json b/composer.json index 2ee44150..7b22587e 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "App\\": "app/" }, "files": [ - "app/helpers/functions.php" + "helpers/functions.php" ] }, "autoload-dev": { diff --git a/config/app.php b/config/app.php index 68e346e0..072ef223 100644 --- a/config/app.php +++ b/config/app.php @@ -81,7 +81,7 @@ 'key' => env('APP_KEY', 'SomeRandomString'), 'cipher' => MCRYPT_RIJNDAEL_128, - 'themes' => 'keylime', + 'themes' => 'default', /* |-------------------------------------------------------------------------- diff --git a/config/path.php b/config/path.php index 7cc7488a..e2fbeead 100644 --- a/config/path.php +++ b/config/path.php @@ -15,6 +15,7 @@ 'tags'=>CONTENT.'tags.', 'system'=>SYSTEM.'system.', 'navigation'=>SYSTEM.'navigation.', + 'links'=>SYSTEM.'links.', 'user'=>USER, 'comment'=>CONTENT.'comment.' ], diff --git a/database/migrations/2015_11_12_145600_edit_navigation_table.php b/database/migrations/2015_11_12_145600_edit_navigation_table.php new file mode 100644 index 00000000..71152c92 --- /dev/null +++ b/database/migrations/2015_11_12_145600_edit_navigation_table.php @@ -0,0 +1,33 @@ +dropColumn('parent_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('navigation', function (Blueprint $table) { + // + $table->integer('parent_id'); + }); + } +} diff --git a/database/migrations/2015_11_13_023030_create_links_table.php b/database/migrations/2015_11_13_023030_create_links_table.php new file mode 100644 index 00000000..b2fd6987 --- /dev/null +++ b/database/migrations/2015_11_13_023030_create_links_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->integer('sequence'); + $table->string('name'); + $table->string('url'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + Schema::drop('links'); + } +} diff --git a/app/helpers/functions.php b/helpers/functions.php similarity index 93% rename from app/helpers/functions.php rename to helpers/functions.php index 5a9b29eb..c102e1d1 100644 --- a/app/helpers/functions.php +++ b/helpers/functions.php @@ -124,18 +124,16 @@ function strCut($string, $length, $suffix = '...') function viewInit() { $article = app('App\Model\Article'); - $articleStatus = app('App\Model\ArticleStatus'); $tags = app('App\Model\Tag'); $view = app('view'); + $nav = app('App\Model\Navigation'); + $links = app('App\Model\Links'); - $count = array( - 'article' => $article->count(), - 'visit' => $articleStatus->sum('view_number'), - ); - $view->share('recentArticle', $article::getNewsArticle(3)['data']); - $view->share('hotTags', $tags::getHotTags(12)); - $view->share('dataCount', $count); + $view->share('hotArticleList', $article::getHotArticle(3)); + $view->share('tagList', $tags::getHotTags(12)); + $view->share('navList', $nav::getNavigationAll()); + $view->share('linkList', $links::getLinkList()); } } @@ -224,8 +222,8 @@ function systemConfig($field, $default = '') function getArticleImg($image = '') { $imageUrl = 'images/01.jpg'; - if(!empty($image)){ - $imageUrl = 'uploads'.'/'.$image; + if (!empty($image)) { + $imageUrl = 'uploads' . '/' . $image; } return asset($imageUrl); } diff --git a/node_modules/.bin/gulp b/node_modules/.bin/gulp new file mode 120000 index 00000000..5de73328 --- /dev/null +++ b/node_modules/.bin/gulp @@ -0,0 +1 @@ +../gulp/bin/gulp.js \ No newline at end of file diff --git a/node_modules/gulp/CHANGELOG.md b/node_modules/gulp/CHANGELOG.md new file mode 100644 index 00000000..d9846eab --- /dev/null +++ b/node_modules/gulp/CHANGELOG.md @@ -0,0 +1,233 @@ +# gulp changelog + +## 3.9.0 + +- add babel support +- add transpiler fallback support +- add support for some renamed transpilers (livescript, etc) +- add JSCS +- update dependecies (liftoff, interpret) +- documentation tweaks + +## 3.8.11 + +- fix node 0.12/iojs problems +- add node 0.12 and iojs to travis +- update dependencies (liftoff, v8flags) +- documentation tweaks + +## 3.8.10 + +- add link to spanish docs +- update dependencies (archy, semver, mocha, etc) +- documentation tweaks + +## 3.8.9 + +- fix local version undefined output +- add completion for fish shell +- fix powershell completion line splitting +- add support for arbitrary node flags (oops, should have been a minor bump) +- add v8flags dependency +- update dependencies (liftoff) +- documentation tweaks + +## 3.8.8 + +- update dependencies (minimist, tildify) +- documentation tweaks + +## 3.8.7 + +- handle errors a bit better +- update dependencies (gulp-util, semver, etc) +- documentation tweaks + +## 3.8.6 + +- remove executable flag from LICENSE +- update dependencies (chalk, minimist, liftoff, etc) +- documentation tweaks + +## 3.8.5 + +- simplify --silent and --tasks-simple +- fix bug in autocomplete where errors would come out + +## 3.8.4 + +- CLI will use exit code 1 on exit when any task fails during the lifetime of the process + + +## 3.8.3 + +- Tweak error formatting to work better with PluginErrors and strings + +## 3.8.2 + +- add manpage generation + +## 3.8.1 + +- the CLI now adds process.env.INIT_CWD which is the original cwd it was launched from + +## 3.8.0 + +- update vinyl-fs + - gulp.src is now a writable passthrough, this means you can use it to add files to your pipeline at any point + - gulp.dest can now take a function to determine the folder + +This is now possible! + +```js +gulp.src('lib/*.js') + .pipe(uglify()) + .pipe(gulp.src('styles/*.css')) + .pipe(gulp.dest(function(file){ + // I don't know, you can do something cool here + return 'build/whatever'; + })); +``` + +## 3.7.0 + +- update vinyl-fs to remove BOM from UTF8 files +- add --tasks-simple flag for plaintext task listings +- updated autocomplete scripts to be simpler and use new --tasks-simple flag +- added support for transpilers via liftoff 0.11 and interpret + - just npm install your compiler (coffee-script for example) and it will work out of the box + +## 3.5.5 + +- update deps +- gulp.dest now support mode option, uses source file mode by default (file.stat.mode) +- use chalk for colors in bin +- update gulp.env deprecation msg to be more helpful + + +## 3.5.2 + +- add -V for version on CLI (unix standard) +- -v is deprecated, use -V +- add -T as an alias for --tasks +- documentation + +## 3.5 + +- added `gulp.watch(globs, tasksArray)` sugar +- remove gulp.taskQueue +- deprecate gulp.run +- deprecate gulp.env +- add engineStrict to prevent people with node < 0.9 from installing + +## 3.4 + +- added `--tasks` that prints out the tree of tasks + deps +- global cli + local install mismatch is no longer fatal +- remove tests for fs stuff +- switch core src, dest, and watch to vinyl-fs +- internal cleaning + +## 3.3.4 + +- `--base` is now `--cwd` + +## 3.3.3 + +- support for `--base` CLI arg to change where the search for gulpfile/`--require`s starts +- support for `--gulpfile` CLI arg to point to a gulpfile specifically + +## 3.3.0 + +- file.contents streams are no longer paused coming out of src +- dest now passes files through before they are empty to fix passing to multiple dests + +## 3.2.4 + +- Bug fix - we didn't have any CLI tests + +## 3.2.3 + +- Update dependencies for bug fixes +- autocomplete stuff in the completion folder + +## 3.2 + +- File object is now [vinyl](https://github.com/wearefractal/vinyl) +- .watch() is now [glob-watcher](https://github.com/wearefractal/glob-watcher) +- Fix CLI -v when no gulpfile found +- gulp-util updated +- Logging moved to CLI bin file + - Will cause double logging if you update global CLI to 3.2 but not local + - Will cause no logging if you update local to 3.1 but not global CLI +- Drop support for < 0.9 + +## 3.1.3 + +- Move isStream and isBuffer to gulp-util + +## 3.1 + +- Move file class to gulp-util + +## 3.0 + +- Ability to pass multiple globs and glob negations to glob-stream +- Breaking change to the way glob-stream works +- File object is now a class +- file.shortened changed to file.relative +- file.cwd added +- Break out getStats to avoid nesting +- Major code reorganization + +## 2.7 + +- Breaking change to the way options are passed to glob-stream +- Introduce new File object to ease pain of computing shortened names (now a getter) + +## 2.4 - 2.6 + +- Moved stuff to gulp-util +- Quit exposing createGlobStream (just use the glob-stream module) +- More logging +- Prettier time durations +- Tons of documentation changes +- gulp.trigger(tasks...) as a through stream + +## 1.2-2.4 (11/12/13) + +- src buffer=false fixed for 0.8 and 0.9 (remember to .resume() on these versions before consuming) +- CLI completely rewritten + - Colorful logging + - Uses local version of gulp to run tasks + - Uses findup to locate gulpfile (so you can run it anywhere in your project) + - chdir to gulpfile directory before loading it + - Correct exit codes on errors +- silent flag added to gulp to disable logging +- Fixes to task orchestration (3rd party) +- Better support for globbed directories (thanks @robrich) + +## 1.2 (10/28/13) + +- Can specify buffer=false on src streams to make file.content a stream +- Can specify read=false on src streams to disable file.content + +## 1.1 (10/21/13) + +- Can specify run callback +- Can specify task dependencies +- Tasks can accept callback or return promise +- `gulp.verbose` exposes run-time internals + +## 1.0 (9/26/13) + +- Specify dependency versions +- Updated docs + +## 0.2 (8/6/13) + +- Rename .files() to .src() and .folder() to .dest() + +## 0.1 (7/18/13) + +- Initial Release diff --git a/node_modules/gulp/LICENSE b/node_modules/gulp/LICENSE new file mode 100644 index 00000000..a64cd85d --- /dev/null +++ b/node_modules/gulp/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2013-2015 Fractal + +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. diff --git a/node_modules/gulp/README.md b/node_modules/gulp/README.md new file mode 100644 index 00000000..eba26acd --- /dev/null +++ b/node_modules/gulp/README.md @@ -0,0 +1,105 @@ +

+ + + +

+ +# gulp +**The streaming build system** + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Support us][gittip-image]][gittip-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +## Like what we do? + +[Support us via Gratipay](https://gratipay.com/WeAreFractal/) + +## Documentation + +For a Getting started guide, API docs, recipes, making a plugin, etc. see the [documentation page](/docs/README.md)! + +## Sample `gulpfile.js` + +This file is just a quick sample to give you a taste of what gulp does. + +```js +var gulp = require('gulp'); +var coffee = require('gulp-coffee'); +var concat = require('gulp-concat'); +var uglify = require('gulp-uglify'); +var imagemin = require('gulp-imagemin'); +var sourcemaps = require('gulp-sourcemaps'); +var del = require('del'); + +var paths = { + scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'], + images: 'client/img/**/*' +}; + +// Not all tasks need to use streams +// A gulpfile is just another node program and you can use all packages available on npm +gulp.task('clean', function(cb) { + // You can use multiple globbing patterns as you would with `gulp.src` + del(['build'], cb); +}); + +gulp.task('scripts', ['clean'], function() { + // Minify and copy all JavaScript (except vendor scripts) + // with sourcemaps all the way down + return gulp.src(paths.scripts) + .pipe(sourcemaps.init()) + .pipe(coffee()) + .pipe(uglify()) + .pipe(concat('all.min.js')) + .pipe(sourcemaps.write()) + .pipe(gulp.dest('build/js')); +}); + +// Copy all static images +gulp.task('images', ['clean'], function() { + return gulp.src(paths.images) + // Pass in options to the task + .pipe(imagemin({optimizationLevel: 5})) + .pipe(gulp.dest('build/img')); +}); + +// Rerun the task when a file changes +gulp.task('watch', function() { + gulp.watch(paths.scripts, ['scripts']); + gulp.watch(paths.images, ['images']); +}); + +// The default task (called when you run `gulp` from cli) +gulp.task('default', ['watch', 'scripts', 'images']); +``` + +## Incremental Builds + +We recommend these plugins: + +- [gulp-changed](https://github.com/sindresorhus/gulp-changed) - only pass through changed files +- [gulp-cached](https://github.com/wearefractal/gulp-cached) - in-memory file cache, not for operation on sets of files +- [gulp-remember](https://github.com/ahaurw01/gulp-remember) - pairs nicely with gulp-cached +- [gulp-newer](https://github.com/tschaub/gulp-newer) - pass through newer source files only, supports many:1 source:dest + +## Want to contribute? + +Anyone can help make this project better - check out the [Contributing guide](/CONTRIBUTING.md)! + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/wearefractal/gulp/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + +[gittip-url]: https://www.gittip.com/WeAreFractal/ +[gittip-image]: http://img.shields.io/gittip/WeAreFractal.svg + +[downloads-image]: http://img.shields.io/npm/dm/gulp.svg +[npm-url]: https://npmjs.org/package/gulp +[npm-image]: http://img.shields.io/npm/v/gulp.svg + +[travis-url]: https://travis-ci.org/gulpjs/gulp +[travis-image]: http://img.shields.io/travis/gulpjs/gulp.svg + +[coveralls-url]: https://coveralls.io/r/gulpjs/gulp +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/gulp/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png diff --git a/node_modules/gulp/bin/gulp.js b/node_modules/gulp/bin/gulp.js new file mode 100755 index 00000000..a5374c11 --- /dev/null +++ b/node_modules/gulp/bin/gulp.js @@ -0,0 +1,212 @@ +#!/usr/bin/env node + +'use strict'; +var gutil = require('gulp-util'); +var prettyTime = require('pretty-hrtime'); +var chalk = require('chalk'); +var semver = require('semver'); +var archy = require('archy'); +var Liftoff = require('liftoff'); +var tildify = require('tildify'); +var interpret = require('interpret'); +var v8flags = require('v8flags'); +var completion = require('../lib/completion'); +var argv = require('minimist')(process.argv.slice(2)); +var taskTree = require('../lib/taskTree'); + +// Set env var for ORIGINAL cwd +// before anything touches it +process.env.INIT_CWD = process.cwd(); + +var cli = new Liftoff({ + name: 'gulp', + completions: completion, + extensions: interpret.jsVariants, + v8flags: v8flags, +}); + +// Exit with 0 or 1 +var failed = false; +process.once('exit', function(code) { + if (code === 0 && failed) { + process.exit(1); + } +}); + +// Parse those args m8 +var cliPackage = require('../package'); +var versionFlag = argv.v || argv.version; +var tasksFlag = argv.T || argv.tasks; +var tasks = argv._; +var toRun = tasks.length ? tasks : ['default']; + +// This is a hold-over until we have a better logging system +// with log levels +var simpleTasksFlag = argv['tasks-simple']; +var shouldLog = !argv.silent && !simpleTasksFlag; + +if (!shouldLog) { + gutil.log = function() {}; +} + +cli.on('require', function(name) { + gutil.log('Requiring external module', chalk.magenta(name)); +}); + +cli.on('requireFail', function(name) { + gutil.log(chalk.red('Failed to load external module'), chalk.magenta(name)); +}); + +cli.on('respawn', function(flags, child) { + var nodeFlags = chalk.magenta(flags.join(', ')); + var pid = chalk.magenta(child.pid); + gutil.log('Node flags detected:', nodeFlags); + gutil.log('Respawned to PID:', pid); +}); + +cli.launch({ + cwd: argv.cwd, + configPath: argv.gulpfile, + require: argv.require, + completion: argv.completion, +}, handleArguments); + +// The actual logic +function handleArguments(env) { + if (versionFlag && tasks.length === 0) { + gutil.log('CLI version', cliPackage.version); + if (env.modulePackage && typeof env.modulePackage.version !== 'undefined') { + gutil.log('Local version', env.modulePackage.version); + } + process.exit(0); + } + + if (!env.modulePath) { + gutil.log( + chalk.red('Local gulp not found in'), + chalk.magenta(tildify(env.cwd)) + ); + gutil.log(chalk.red('Try running: npm install gulp')); + process.exit(1); + } + + if (!env.configPath) { + gutil.log(chalk.red('No gulpfile found')); + process.exit(1); + } + + // Check for semver difference between cli and local installation + if (semver.gt(cliPackage.version, env.modulePackage.version)) { + gutil.log(chalk.red('Warning: gulp version mismatch:')); + gutil.log(chalk.red('Global gulp is', cliPackage.version)); + gutil.log(chalk.red('Local gulp is', env.modulePackage.version)); + } + + // Chdir before requiring gulpfile to make sure + // we let them chdir as needed + if (process.cwd() !== env.cwd) { + process.chdir(env.cwd); + gutil.log( + 'Working directory changed to', + chalk.magenta(tildify(env.cwd)) + ); + } + + // This is what actually loads up the gulpfile + require(env.configPath); + gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath))); + + var gulpInst = require(env.modulePath); + logEvents(gulpInst); + + process.nextTick(function() { + if (simpleTasksFlag) { + return logTasksSimple(env, gulpInst); + } + if (tasksFlag) { + return logTasks(env, gulpInst); + } + gulpInst.start.apply(gulpInst, toRun); + }); +} + +function logTasks(env, localGulp) { + var tree = taskTree(localGulp.tasks); + tree.label = 'Tasks for ' + chalk.magenta(tildify(env.configPath)); + archy(tree) + .split('\n') + .forEach(function(v) { + if (v.trim().length === 0) { + return; + } + gutil.log(v); + }); +} + +function logTasksSimple(env, localGulp) { + console.log(Object.keys(localGulp.tasks) + .join('\n') + .trim()); +} + +// Format orchestrator errors +function formatError(e) { + if (!e.err) { + return e.message; + } + + // PluginError + if (typeof e.err.showStack === 'boolean') { + return e.err.toString(); + } + + // Normal error + if (e.err.stack) { + return e.err.stack; + } + + // Unknown (string, number, etc.) + return new Error(String(e.err)).stack; +} + +// Wire up logging events +function logEvents(gulpInst) { + + // Total hack due to poor error management in orchestrator + gulpInst.on('err', function() { + failed = true; + }); + + gulpInst.on('task_start', function(e) { + // TODO: batch these + // so when 5 tasks start at once it only logs one time with all 5 + gutil.log('Starting', '\'' + chalk.cyan(e.task) + '\'...'); + }); + + gulpInst.on('task_stop', function(e) { + var time = prettyTime(e.hrDuration); + gutil.log( + 'Finished', '\'' + chalk.cyan(e.task) + '\'', + 'after', chalk.magenta(time) + ); + }); + + gulpInst.on('task_err', function(e) { + var msg = formatError(e); + var time = prettyTime(e.hrDuration); + gutil.log( + '\'' + chalk.cyan(e.task) + '\'', + chalk.red('errored after'), + chalk.magenta(time) + ); + gutil.log(msg); + }); + + gulpInst.on('task_not_found', function(err) { + gutil.log( + chalk.red('Task \'' + err.task + '\' is not in your gulpfile') + ); + gutil.log('Please check the documentation for proper gulpfile formatting'); + process.exit(1); + }); +} diff --git a/node_modules/gulp/completion/README.md b/node_modules/gulp/completion/README.md new file mode 100644 index 00000000..c0e8c913 --- /dev/null +++ b/node_modules/gulp/completion/README.md @@ -0,0 +1,20 @@ +# Completion for gulp +> Thanks to grunt team and Tyler Kellen + +To enable tasks auto-completion in shell you should add `eval "$(gulp --completion=shell)"` in your `.shellrc` file. + +## Bash + +Add `eval "$(gulp --completion=bash)"` to `~/.bashrc`. + +## Zsh + +Add `eval "$(gulp --completion=zsh)"` to `~/.zshrc`. + +## Powershell + +Add `Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine)` to `$PROFILE`. + +## Fish + +Add `gulp --completion=fish | source` to `~/.config/fish/config.fish`. diff --git a/node_modules/gulp/completion/bash b/node_modules/gulp/completion/bash new file mode 100644 index 00000000..704c27c1 --- /dev/null +++ b/node_modules/gulp/completion/bash @@ -0,0 +1,27 @@ +#!/bin/bash + +# Borrowed from grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable bash completion for gulp, add the following line (minus the +# leading #, which is the bash comment character) to your ~/.bashrc file: +# +# eval "$(gulp --completion=bash)" + +# Enable bash autocompletion. +function _gulp_completions() { + # The currently-being-completed word. + local cur="${COMP_WORDS[COMP_CWORD]}" + #Grab tasks + local compls=$(gulp --tasks-simple) + # Tell complete what stuff to show. + COMPREPLY=($(compgen -W "$compls" -- "$cur")) +} + +complete -o default -F _gulp_completions gulp diff --git a/node_modules/gulp/completion/fish b/node_modules/gulp/completion/fish new file mode 100644 index 00000000..f27f2248 --- /dev/null +++ b/node_modules/gulp/completion/fish @@ -0,0 +1,10 @@ +#!/usr/bin/env fish + +# Usage: +# +# To enable fish completion for gulp, add the following line to +# your ~/.config/fish/config.fish file: +# +# gulp --completion=fish | source + +complete -c gulp -a "(gulp --tasks-simple)" -f diff --git a/node_modules/gulp/completion/powershell b/node_modules/gulp/completion/powershell new file mode 100644 index 00000000..08ec4382 --- /dev/null +++ b/node_modules/gulp/completion/powershell @@ -0,0 +1,61 @@ +# Copyright (c) 2014 Jason Jarrett +# +# Tab completion for the `gulp` +# +# Usage: +# +# To enable powershell completion for gulp you need to be running +# at least PowerShell v3 or greater and add the below to your $PROFILE +# +# Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine) +# +# + +$gulp_completion_Process = { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + + + # Load up an assembly to read the gulpfile's sha1 + if(-not $global:GulpSHA1Managed) { + [Reflection.Assembly]::LoadWithPartialName("System.Security") | out-null + $global:GulpSHA1Managed = new-Object System.Security.Cryptography.SHA1Managed + } + + # setup a global (in-memory) cache + if(-not $global:GulpfileShaCache) { + $global:GulpfileShaCache = @{}; + } + + $cache = $global:GulpfileShaCache; + + # Get the gulpfile's sha1 + $sha1gulpFile = (resolve-path gulpfile.js -ErrorAction Ignore | %{ + $file = [System.IO.File]::Open($_.Path, "open", "read") + [string]::join('', ($global:GulpSHA1Managed.ComputeHash($file) | %{ $_.ToString("x2") })) + $file.Dispose() + }) + + # lookup the sha1 for previously cached task lists. + if($cache.ContainsKey($sha1gulpFile)){ + $tasks = $cache[$sha1gulpFile]; + } else { + $tasks = (gulp --tasks-simple).split("`n"); + $cache[$sha1gulpFile] = $tasks; + } + + + $tasks | + where { $_.startswith($commandName) } + Sort-Object | + foreach { New-Object System.Management.Automation.CompletionResult $_, $_, 'ParameterValue', ('{0}' -f $_) } +} + +if (-not $global:options) { + $global:options = @{ + CustomArgumentCompleters = @{}; + NativeArgumentCompleters = @{} + } +} + +$global:options['NativeArgumentCompleters']['gulp'] = $gulp_completion_Process +$function:tabexpansion2 = $function:tabexpansion2 -replace 'End\r\n{','End { if ($null -ne $options) { $options += $global:options} else {$options = $global:options}' diff --git a/node_modules/gulp/completion/zsh b/node_modules/gulp/completion/zsh new file mode 100644 index 00000000..8169b22d --- /dev/null +++ b/node_modules/gulp/completion/zsh @@ -0,0 +1,25 @@ +#!/bin/zsh + +# Borrowed from grunt-cli +# http://gruntjs.com/ +# +# Copyright (c) 2012 Tyler Kellen, contributors +# Licensed under the MIT license. +# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + +# Usage: +# +# To enable zsh completion for gulp, add the following line (minus the +# leading #, which is the zsh comment character) to your ~/.zshrc file: +# +# eval "$(gulp --completion=zsh)" + +# Enable zsh autocompletion. +function _gulp_completion() { + # Grab tasks + compls=$(gulp --tasks-simple) + completions=(${=compls}) + compadd -- $completions +} + +compdef _gulp_completion gulp diff --git a/node_modules/gulp/index.js b/node_modules/gulp/index.js new file mode 100644 index 00000000..42bc69b3 --- /dev/null +++ b/node_modules/gulp/index.js @@ -0,0 +1,63 @@ +'use strict'; + +var util = require('util'); +var Orchestrator = require('orchestrator'); +var gutil = require('gulp-util'); +var deprecated = require('deprecated'); +var vfs = require('vinyl-fs'); + +function Gulp() { + Orchestrator.call(this); +} +util.inherits(Gulp, Orchestrator); + +Gulp.prototype.task = Gulp.prototype.add; +Gulp.prototype.run = function() { + // `run()` is deprecated as of 3.5 and will be removed in 4.0 + // Use task dependencies instead + + // Impose our opinion of "default" tasks onto orchestrator + var tasks = arguments.length ? arguments : ['default']; + + this.start.apply(this, tasks); +}; + +Gulp.prototype.src = vfs.src; +Gulp.prototype.dest = vfs.dest; +Gulp.prototype.watch = function(glob, opt, fn) { + if (typeof opt === 'function' || Array.isArray(opt)) { + fn = opt; + opt = null; + } + + // Array of tasks given + if (Array.isArray(fn)) { + return vfs.watch(glob, opt, function() { + this.start.apply(this, fn); + }.bind(this)); + } + + return vfs.watch(glob, opt, fn); +}; + +// Let people use this class from our instance +Gulp.prototype.Gulp = Gulp; + +// Deprecations +deprecated.field('gulp.env has been deprecated. ' + + 'Use your own CLI parser instead. ' + + 'We recommend using yargs or minimist.', + console.warn, + Gulp.prototype, + 'env', + gutil.env +); + +Gulp.prototype.run = deprecated.method('gulp.run() has been deprecated. ' + + 'Use task dependencies or gulp.watch task triggering instead.', + console.warn, + Gulp.prototype.run +); + +var inst = new Gulp(); +module.exports = inst; diff --git a/node_modules/gulp/lib/completion.js b/node_modules/gulp/lib/completion.js new file mode 100644 index 00000000..7000250b --- /dev/null +++ b/node_modules/gulp/lib/completion.js @@ -0,0 +1,22 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); + +module.exports = function(name) { + if (typeof name !== 'string') { + throw new Error('Missing completion type'); + } + var file = path.join(__dirname, '../completion', name); + try { + console.log(fs.readFileSync(file, 'utf8')); + process.exit(0); + } catch (err) { + console.log( + 'echo "gulp autocompletion rules for', + '\'' + name + '\'', + 'not found"' + ); + process.exit(5); + } +}; diff --git a/node_modules/gulp/lib/taskTree.js b/node_modules/gulp/lib/taskTree.js new file mode 100644 index 00000000..accb1a77 --- /dev/null +++ b/node_modules/gulp/lib/taskTree.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function(tasks) { + return Object.keys(tasks) + .reduce(function(prev, task) { + prev.nodes.push({ + label: task, + nodes: tasks[task].dep, + }); + return prev; + }, { + nodes: [], + }); +}; diff --git a/node_modules/gulp/node_modules/.bin/semver b/node_modules/gulp/node_modules/.bin/semver new file mode 120000 index 00000000..317eb293 --- /dev/null +++ b/node_modules/gulp/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/gulp/node_modules/archy/.travis.yml b/node_modules/gulp/node_modules/archy/.travis.yml new file mode 100644 index 00000000..895dbd36 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/gulp/node_modules/archy/LICENSE b/node_modules/gulp/node_modules/archy/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/gulp/node_modules/archy/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/node_modules/gulp/node_modules/archy/examples/beep.js b/node_modules/gulp/node_modules/archy/examples/beep.js new file mode 100644 index 00000000..9c070479 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/examples/beep.js @@ -0,0 +1,24 @@ +var archy = require('../'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/node_modules/gulp/node_modules/archy/examples/multi_line.js b/node_modules/gulp/node_modules/archy/examples/multi_line.js new file mode 100644 index 00000000..8afdfada --- /dev/null +++ b/node_modules/gulp/node_modules/archy/examples/multi_line.js @@ -0,0 +1,25 @@ +var archy = require('../'); + +var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/node_modules/gulp/node_modules/archy/index.js b/node_modules/gulp/node_modules/archy/index.js new file mode 100644 index 00000000..869d64e6 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/index.js @@ -0,0 +1,35 @@ +module.exports = function archy (obj, prefix, opts) { + if (prefix === undefined) prefix = ''; + if (!opts) opts = {}; + var chr = function (s) { + var chars = { + '│' : '|', + '└' : '`', + '├' : '+', + '─' : '-', + '┬' : '-' + }; + return opts.unicode === false ? chars[s] : s; + }; + + if (typeof obj === 'string') obj = { label : obj }; + + var nodes = obj.nodes || []; + var lines = (obj.label || '').split('\n'); + var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' '; + + return prefix + + lines.join(splitter) + '\n' + + nodes.map(function (node, ix) { + var last = ix === nodes.length - 1; + var more = node.nodes && node.nodes.length; + var prefix_ = prefix + (last ? ' ' : chr('│')) + ' '; + + return prefix + + (last ? chr('└') : chr('├')) + chr('─') + + (more ? chr('┬') : chr('─')) + ' ' + + archy(node, prefix_, opts).slice(prefix.length + 2) + ; + }).join('') + ; +}; diff --git a/node_modules/gulp/node_modules/archy/package.json b/node_modules/gulp/node_modules/archy/package.json new file mode 100644 index 00000000..a98bbfe7 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/package.json @@ -0,0 +1,80 @@ +{ + "name": "archy", + "version": "1.0.0", + "description": "render nested hierarchies `npm ls` style with unicode pipes", + "main": "index.js", + "devDependencies": { + "tap": "~0.3.3", + "tape": "~0.1.1" + }, + "scripts": { + "test": "tap test" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "iexplore": [ + "6.0", + "7.0", + "8.0", + "9.0" + ], + "chrome": [ + "20.0" + ], + "firefox": [ + "10.0", + "15.0" + ], + "safari": [ + "5.1" + ], + "opera": [ + "12.0" + ] + } + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-archy.git" + }, + "keywords": [ + "hierarchy", + "npm ls", + "unicode", + "pretty", + "print" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "gitHead": "30223c16191e877bf027b15b12daf077b9b55b84", + "bugs": { + "url": "https://github.com/substack/node-archy/issues" + }, + "homepage": "https://github.com/substack/node-archy", + "_id": "archy@1.0.0", + "_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", + "_from": "archy@>=1.0.0 <2.0.0", + "_npmVersion": "1.4.25", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "dist": { + "shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", + "tarball": "http://registry.npmjs.org/archy/-/archy-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/archy/readme.markdown b/node_modules/gulp/node_modules/archy/readme.markdown new file mode 100644 index 00000000..ef7a5cf3 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/readme.markdown @@ -0,0 +1,88 @@ +# archy + +Render nested hierarchies `npm ls` style with unicode pipes. + +[![browser support](http://ci.testling.com/substack/node-archy.png)](http://ci.testling.com/substack/node-archy) + +[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy) + +# example + +``` js +var archy = require('archy'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); +``` + +output + +``` +beep +├── ity +└─┬ boop + ├─┬ o_O + │ ├─┬ oh + │ │ ├── hello + │ │ └── puny + │ └── human + └── party + time! +``` + +# methods + +var archy = require('archy') + +## archy(obj, prefix='', opts={}) + +Return a string representation of `obj` with unicode pipe characters like how +`npm ls` looks. + +`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields. +`'label'` is a string of text to display at a node level and `'nodes'` is an +array of the descendents of the current node. + +If a node is a string, that string will be used as the `'label'` and an empty +array of `'nodes'` will be used. + +`prefix` gets prepended to all the lines and is used by the algorithm to +recursively update. + +If `'label'` has newlines they will be indented at the present indentation level +with the current prefix. + +To disable unicode results in favor of all-ansi output set `opts.unicode` to +`false`. + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install archy +``` + +# license + +MIT diff --git a/node_modules/gulp/node_modules/archy/test/beep.js b/node_modules/gulp/node_modules/archy/test/beep.js new file mode 100644 index 00000000..4ea74f9c --- /dev/null +++ b/node_modules/gulp/node_modules/archy/test/beep.js @@ -0,0 +1,40 @@ +var test = require('tape'); +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ └── human', + ' └── party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/node_modules/gulp/node_modules/archy/test/multi_line.js b/node_modules/gulp/node_modules/archy/test/multi_line.js new file mode 100644 index 00000000..2cf2154d --- /dev/null +++ b/node_modules/gulp/node_modules/archy/test/multi_line.js @@ -0,0 +1,45 @@ +var test = require('tape'); +var archy = require('../'); + +test('multi-line', function (t) { + var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '│ one', + '│ two', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ │ wheee', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ │ meat', + ' │ └── creature', + ' └── party', + ' time!', + '' + ].join('\n')); + t.end(); +}); diff --git a/node_modules/gulp/node_modules/archy/test/non_unicode.js b/node_modules/gulp/node_modules/archy/test/non_unicode.js new file mode 100644 index 00000000..7204d332 --- /dev/null +++ b/node_modules/gulp/node_modules/archy/test/non_unicode.js @@ -0,0 +1,40 @@ +var test = require('tape'); +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }, '', { unicode : false }); + t.equal(s, [ + 'beep', + '+-- ity', + '`-- boop', + ' +-- o_O', + ' | +-- oh', + ' | | +-- hello', + ' | | `-- puny', + ' | `-- human', + ' `-- party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/node_modules/gulp/node_modules/chalk/index.js b/node_modules/gulp/node_modules/chalk/index.js new file mode 100644 index 00000000..2d85a917 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/node_modules/gulp/node_modules/chalk/license b/node_modules/gulp/node_modules/chalk/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..78945278 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/index.js @@ -0,0 +1,65 @@ +'use strict'; + +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..962e7743 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,80 @@ +{ + "name": "ansi-styles", + "version": "2.1.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/chalk/ansi-styles" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "homepage": "https://github.com/chalk/ansi-styles", + "_id": "ansi-styles@2.1.0", + "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "_from": "ansi-styles@>=2.1.0 <3.0.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "dist": { + "shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..3f933f61 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,86 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + + +## Install + +``` +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## Advanced usage + +By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `ansi.modifiers` +- `ansi.colors` +- `ansi.bgColors` + + +###### Example + +```js +console.log(ansi.colors.green.open); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/index.js b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/index.js new file mode 100644 index 00000000..ac6572ca --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/license b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/package.json new file mode 100644 index 00000000..749f5ded --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -0,0 +1,70 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.3", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/escape-string-regexp" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "regex", + "regexp", + "re", + "regular", + "expression", + "escape", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b", + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "_id": "escape-string-regexp@1.0.3", + "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", + "_from": "escape-string-regexp@>=1.0.2 <2.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.35", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "dist": { + "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/readme.md new file mode 100644 index 00000000..808a963a --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +```sh +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +var escapeStringRegexp = require('escape-string-regexp'); + +var escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> how much \$ for a unicorn\? + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/index.js b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/index.js new file mode 100644 index 00000000..98fae067 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/license b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..4906755b --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; +}; diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..f109fc0a --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/ansi-regex" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_from": "ansi-regex@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..1a4894ec --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,31 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/package.json b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/package.json new file mode 100644 index 00000000..3ad76fc9 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/package.json @@ -0,0 +1,85 @@ +{ + "name": "has-ansi", + "version": "2.0.0", + "description": "Check if a string has ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/has-ansi" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/has-ansi", + "_id": "has-ansi@2.0.0", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/readme.md new file mode 100644 index 00000000..02bc7c23 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/index.js b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/index.js new file mode 100644 index 00000000..099480fb --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex')(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/license b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..4906755b --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; +}; diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..f109fc0a --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/ansi-regex" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_from": "ansi-regex@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..1a4894ec --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,31 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/package.json b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/package.json new file mode 100644 index 00000000..b2d95248 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/package.json @@ -0,0 +1,85 @@ +{ + "name": "strip-ansi", + "version": "3.0.0", + "description": "Strip ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/strip-ansi" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", + "bugs": { + "url": "https://github.com/sindresorhus/strip-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/strip-ansi", + "_id": "strip-ansi@3.0.0", + "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "_from": "strip-ansi@>=3.0.0 <4.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000..76091512 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/index.js new file mode 100644 index 00000000..4346e272 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/index.js @@ -0,0 +1,50 @@ +'use strict'; +var argv = process.argv; + +var terminator = argv.indexOf('--'); +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = (function () { + if ('FORCE_COLOR' in process.env) { + return true; + } + + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/node_modules/gulp/node_modules/chalk/node_modules/supports-color/license b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/gulp/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/package.json new file mode 100644 index 00000000..36ef8614 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/package.json @@ -0,0 +1,79 @@ +{ + "name": "supports-color", + "version": "2.0.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/chalk/supports-color" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect" + ], + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "homepage": "https://github.com/chalk/supports-color", + "_id": "supports-color@2.0.0", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_from": "supports-color@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/readme.md new file mode 100644 index 00000000..b4761f1e --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/node_modules/supports-color/readme.md @@ -0,0 +1,36 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install --save supports-color +``` + + +## Usage + +```js +var supportsColor = require('supports-color'); + +if (supportsColor) { + console.log('Terminal supports color'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp/node_modules/chalk/package.json b/node_modules/gulp/node_modules/chalk/package.json new file mode 100644 index 00000000..a6120d20 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/package.json @@ -0,0 +1,103 @@ +{ + "name": "chalk", + "version": "1.1.1", + "description": "Terminal string styling done right. Much color.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + { + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && mocha", + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^2.1.0", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] + }, + "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "homepage": "https://github.com/chalk/chalk#readme", + "_id": "chalk@1.1.1", + "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019", + "_from": "chalk@>=1.0.0 <2.0.0", + "_npmVersion": "2.13.5", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "509afb67066e7499f7eb3535c77445772ae2d019", + "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/gulp/node_modules/chalk/readme.md b/node_modules/gulp/node_modules/chalk/readme.md new file mode 100644 index 00000000..5cf111e3 --- /dev/null +++ b/node_modules/gulp/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

+
+
+ chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.` + + + + +``` + +You can also mix preprocessor languages in the component file: + +``` html +// app.vue + + + + + +``` + +And you can import using the `src` attribute (note you'll have to save the vue file to trigger a rebuild since the imported file is not tracked by Browserify as a dependency): + +``` html + +``` + +Under the hood, the transform will: + +- extract the styles, compile them and insert them with the `insert-css` module. +- extract the template, compile it and add it to your exported options. + +You can `require()` other stuff in the ` + +``` + +#### ES2015 by Default + +Vueify 4.0+ automatically transforms the JavaScript in your `*.vue` components using Babel. Write ES2015 today! + +The default Babel options used for Vue.js components are: + +``` js +{ + // use babel-runtime library for common helpers + optional: ['runtime'], + // use loose mode for faster builds + loose: 'all', + // disable non-standard stuff (e.g. JSX) + nonStandard: false +} +``` + +If you wish to mofidy this, you can add a `vue.config.js` and configure the option for `babel`: + +``` js +// vue.config.js +module.exports = function (vueify) { + vueify.option('babel', { + stage: 0, // use all the fancy stage 0 features! + optional: ['runtime'], + loose: 'all', + nonStandard: false + }) +} +``` + +## Enabling Pre-Processors + +You need to install the corresponding node modules to enable the compilation. e.g. to get stylus compiled in your Vue components, do `npm install stylus --save-dev`. + +These are the built-in preprocessors: + +- stylus +- less +- scss (via `node-sass`) +- jade +- coffee-script +- myth + +## Pre-Processor Configuration + +Create a `vue.config.js` file at where your build command is run (usually y the root level of your project): + +``` js +module.exports = function (vueify) { + + // configure the options for a built-in language + vueify.option('sass', { + includePaths: [...] + }) + + // register a custom compile function for diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/custom.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/custom.vue new file mode 100644 index 00000000..e5a016e7 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/custom.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/empty.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/empty.vue new file mode 100644 index 00000000..e69de29b diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/jade.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/jade.vue new file mode 100644 index 00000000..5b44d98b --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/jade.vue @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/less.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/less.vue new file mode 100644 index 00000000..012fa62b --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/less.vue @@ -0,0 +1,17 @@ + diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-scripts.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-scripts.vue new file mode 100644 index 00000000..1ae41197 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-scripts.vue @@ -0,0 +1,7 @@ + + + diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-styles.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-styles.vue new file mode 100644 index 00000000..71496f9f --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple-styles.vue @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple.vue new file mode 100644 index 00000000..1bfbc94a --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/multiple.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/myth.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/myth.vue new file mode 100644 index 00000000..ac1b1333 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/myth.vue @@ -0,0 +1,15 @@ + diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/non-minified.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/non-minified.vue new file mode 100644 index 00000000..0e9ecd03 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/non-minified.vue @@ -0,0 +1,9 @@ + + + diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/sass.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/sass.vue new file mode 100644 index 00000000..43537177 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/sass.vue @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/scoped.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/scoped.vue new file mode 100644 index 00000000..cc336443 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/scoped.vue @@ -0,0 +1,8 @@ + + + diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src.vue b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src.vue new file mode 100644 index 00000000..37d642b2 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src.vue @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src/test.js b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src/test.js new file mode 100644 index 00000000..dce344ec --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/src/test.js @@ -0,0 +1,3 @@ +export default { + el: '#hi' +} diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.html b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.html new file mode 100644 index 00000000..67326d33 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.html @@ -0,0 +1 @@ +

hi

\ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.styl b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.styl new file mode 100644 index 00000000..c6fe2650 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/fixtures/test.styl @@ -0,0 +1,2 @@ +h1 + font-size 12px \ No newline at end of file diff --git a/node_modules/laravel-elixir/node_modules/vueify/test/test.js b/node_modules/laravel-elixir/node_modules/vueify/test/test.js new file mode 100644 index 00000000..f3666b50 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/vueify/test/test.js @@ -0,0 +1,75 @@ +var fs = require('fs') +var path = require('path') +var compiler = require('../lib/compiler') +var assert = require('assert') +var hash = require('hash-sum') + +// test custom transform +compiler.register({ + lang: 'test', + type: 'script', + compile: function (content, cb) { + content = content.replace('not ', '') + cb(null, content) + } +}) + +function read (file) { + return fs.readFileSync(path.resolve(__dirname, file), 'utf-8') +} + +function test (name) { + it(name, function (done) { + var filePath = 'fixtures/' + name + '.vue' + var fileContent = read(filePath) + var expected = read('expects/' + name + '.js') + .replace(/\{\{id\}\}/g, '_v-' + hash(require.resolve('./' + filePath))) + + // test src imports registering dependency + var addDep + var deps + if (name === 'src') { + deps = [] + addDep = function (file) { + deps.push(file) + } + compiler.on('dependency', addDep) + } + + process.env.VUEIFY_TEST = true + process.env.NODE_ENV = name === 'non-minified' + ? 'development' + : 'production' + + compiler.compile( + fileContent, + path.resolve(__dirname, filePath), + function (err, result) { + assert(!err) + try { + assert.equal(result, expected) + } catch (e) { + console.log('expected:\n\n' + expected + '\n') + console.log('result:\n\n' + result + '\n') + assert(!e) + } + + if (name === 'src') { + compiler.removeListener('dependency', addDep) + assert.equal(deps[0], __dirname + '/fixtures/test.html') + assert.equal(deps[1], __dirname + '/fixtures/test.styl') + assert.equal(deps[2], __dirname + '/fixtures/src/test.js') + } + + done() + } + ) + }) +} + +describe('Vueify compiler', function () { + fs.readdirSync(path.resolve(__dirname, 'expects')) + .forEach(function (file) { + test(path.basename(file, '.js')) + }) +}) diff --git a/node_modules/laravel-elixir/node_modules/watchify/.npmignore b/node_modules/laravel-elixir/node_modules/watchify/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/laravel-elixir/node_modules/watchify/.travis.yml b/node_modules/laravel-elixir/node_modules/watchify/.travis.yml new file mode 100644 index 00000000..d76c6d0e --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: node_js +node_js: + - "0.10" + - "0.12" + - node diff --git a/node_modules/laravel-elixir/node_modules/watchify/LICENSE b/node_modules/laravel-elixir/node_modules/watchify/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/node_modules/laravel-elixir/node_modules/watchify/bin/args.js b/node_modules/laravel-elixir/node_modules/watchify/bin/args.js new file mode 100644 index 00000000..ccfdd3f8 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/bin/args.js @@ -0,0 +1,16 @@ +var fromArgs = require('browserify/bin/args'); +var watchify = require('../'); +var defined = require('defined'); +var xtend = require('xtend'); + +module.exports = function (args) { + var b = fromArgs(args, watchify.args); + + var opts = {}; + var ignoreWatch = defined(b.argv['ignore-watch'], b.argv.iw); + if (ignoreWatch) { + opts.ignoreWatch = ignoreWatch; + } + + return watchify(b, xtend(opts, b.argv)); +}; diff --git a/node_modules/laravel-elixir/node_modules/watchify/bin/cmd.js b/node_modules/laravel-elixir/node_modules/watchify/bin/cmd.js new file mode 100755 index 00000000..942ac6c9 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/bin/cmd.js @@ -0,0 +1,64 @@ +#!/usr/bin/env node + +var path = require('path'); +var outpipe = require('outpipe'); +var through = require('through2'); + +var fromArgs = require('./args.js'); +var w = fromArgs(process.argv.slice(2)); + +var outfile = w.argv.o || w.argv.outfile; +var verbose = w.argv.v || w.argv.verbose; + +if (w.argv.version) { + console.error('watchify v' + require('../package.json').version + + ' (in ' + path.resolve(__dirname, '..') + ')' + ); + console.error('browserify v' + require('browserify/package.json').version + + ' (in ' + path.dirname(require.resolve('browserify')) + ')' + ); + return; +} + +if (!outfile) { + console.error('You MUST specify an outfile with -o.'); + process.exit(1); +} + +var bytes, time; +w.on('bytes', function (b) { bytes = b }); +w.on('time', function (t) { time = t }); + +w.on('update', bundle); +bundle(); + +function bundle () { + var didError = false; + var writer = through(); + var wb = w.bundle(); + + w.pipeline.get('pack').once('readable', function() { + wb.pipe(writer); + }); + + wb.on('error', function (err) { + console.error(String(err)); + didError = true; + writer.end('console.error(' + JSON.stringify(String(err)) + ');'); + }); + + writer.once('readable', function() { + var outStream = outpipe(outfile); + outStream.on('error', function (err) { + console.error(err); + }); + outStream.on('exit', function () { + if (verbose && !didError) { + console.error(bytes + ' bytes written to ' + outfile + + ' (' + (time / 1000).toFixed(2) + ' seconds)' + ); + } + }); + writer.pipe(outStream); + }); +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/example/files/main.js b/node_modules/laravel-elixir/node_modules/watchify/example/files/main.js new file mode 100644 index 00000000..a01098c1 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/example/files/main.js @@ -0,0 +1,2 @@ +var one = require('./one'); +console.log(one(5)); diff --git a/node_modules/laravel-elixir/node_modules/watchify/example/files/one.js b/node_modules/laravel-elixir/node_modules/watchify/example/files/one.js new file mode 100644 index 00000000..75f7df68 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/example/files/one.js @@ -0,0 +1,3 @@ +var two = require('./two'); + +module.exports = function (x) { return x * two(x + 5) }; diff --git a/node_modules/laravel-elixir/node_modules/watchify/example/files/two.js b/node_modules/laravel-elixir/node_modules/watchify/example/files/two.js new file mode 100644 index 00000000..5d48ef2d --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/example/files/two.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 11 }; diff --git a/node_modules/laravel-elixir/node_modules/watchify/index.js b/node_modules/laravel-elixir/node_modules/watchify/index.js new file mode 100644 index 00000000..0753b9f1 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/index.js @@ -0,0 +1,165 @@ +var through = require('through2'); +var path = require('path'); +var chokidar = require('chokidar'); +var xtend = require('xtend'); +var anymatch = require('anymatch'); + +module.exports = watchify; +module.exports.args = { + cache: {}, packageCache: {} +}; + +function watchify (b, opts) { + if (!opts) opts = {}; + var cache = b._options.cache; + var pkgcache = b._options.packageCache; + var delay = typeof opts.delay === 'number' ? opts.delay : 100; + var changingDeps = {}; + var pending = false; + var updating = false; + + var wopts = {persistent: true}; + if (opts.ignoreWatch) { + var ignored = opts.ignoreWatch !== true + ? opts.ignoreWatch + : '**/node_modules/**'; + } + if (opts.poll || typeof opts.poll === 'number') { + wopts.usePolling = true; + wopts.interval = opts.poll !== true + ? opts.poll + : undefined; + } + + if (cache) { + b.on('reset', collect); + collect(); + } + + function collect () { + b.pipeline.get('deps').push(through.obj(function(row, enc, next) { + var file = row.expose ? b._expose[row.id] : row.file; + cache[file] = { + source: row.source, + deps: xtend(row.deps) + }; + this.push(row); + next(); + })); + } + + b.on('file', function (file) { + watchFile(file); + }); + + b.on('package', function (pkg) { + var file = path.join(pkg.__dirname, 'package.json'); + watchFile(file); + if (pkgcache) pkgcache[file] = pkg; + }); + + b.on('reset', reset); + reset(); + + function reset () { + var time = null; + var bytes = 0; + b.pipeline.get('record').on('end', function () { + time = Date.now(); + }); + + b.pipeline.get('wrap').push(through(write, end)); + function write (buf, enc, next) { + bytes += buf.length; + this.push(buf); + next(); + } + function end () { + var delta = Date.now() - time; + b.emit('time', delta); + b.emit('bytes', bytes); + b.emit('log', bytes + ' bytes written (' + + (delta / 1000).toFixed(2) + ' seconds)' + ); + this.push(null); + } + } + + var fwatchers = {}; + var fwatcherFiles = {}; + var ignoredFiles = {}; + + b.on('transform', function (tr, mfile) { + tr.on('file', function (dep) { + watchFile(mfile, dep); + }); + }); + b.on('bundle', function (bundle) { + updating = true; + bundle.on('error', onend); + bundle.on('end', onend); + function onend () { updating = false } + }); + + function watchFile (file, dep) { + dep = dep || file; + if (ignored) { + if (!ignoredFiles.hasOwnProperty(file)) { + ignoredFiles[file] = anymatch(ignored, file); + } + if (ignoredFiles[file]) return; + } + if (!fwatchers[file]) fwatchers[file] = []; + if (!fwatcherFiles[file]) fwatcherFiles[file] = []; + if (fwatcherFiles[file].indexOf(dep) >= 0) return; + + var w = b._watcher(dep, wopts); + w.setMaxListeners(0); + w.on('error', b.emit.bind(b, 'error')); + w.on('change', function () { + invalidate(file); + }); + fwatchers[file].push(w); + fwatcherFiles[file].push(dep); + } + + function invalidate (id) { + if (cache) delete cache[id]; + if (pkgcache) delete pkgcache[id]; + changingDeps[id] = true; + + if (!updating && fwatchers[id]) { + fwatchers[id].forEach(function (w) { + w.close(); + }); + delete fwatchers[id]; + delete fwatcherFiles[id]; + } + + // wait for the disk/editor to quiet down first: + if (pending) clearTimeout(pending); + pending = setTimeout(notify, delay); + } + + function notify () { + if (updating) { + pending = setTimeout(notify, delay); + } else { + pending = false; + b.emit('update', Object.keys(changingDeps)); + changingDeps = {}; + } + } + + b.close = function () { + Object.keys(fwatchers).forEach(function (id) { + fwatchers[id].forEach(function (w) { w.close() }); + }); + }; + + b._watcher = function (file, opts) { + return chokidar.watch(file, opts); + }; + + return b; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/package.json b/node_modules/laravel-elixir/node_modules/watchify/package.json new file mode 100644 index 00000000..5c38b07e --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/package.json @@ -0,0 +1,81 @@ +{ + "name": "watchify", + "version": "3.6.0", + "description": "watch mode for browserify builds", + "main": "index.js", + "bin": { + "watchify": "bin/cmd.js" + }, + "dependencies": { + "anymatch": "^1.3.0", + "browserify": "^12.0.1", + "chokidar": "^1.0.0", + "defined": "^1.0.0", + "outpipe": "^1.1.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "devDependencies": { + "brfs": "^1.0.1", + "mkdirp": "~0.5.1", + "split": "^1.0.0", + "tape": "^4.2.2", + "uglify-js": "^2.5.0", + "win-spawn": "^2.0.0" + }, + "scripts": { + "test": "tape test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/watchify.git" + }, + "homepage": "https://github.com/substack/watchify", + "keywords": [ + "browserify", + "browserify-tool", + "watch", + "bundle", + "build", + "browser" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "gitHead": "8a77ac0476d292980fcf2fb78e5d6c71e711ceb7", + "bugs": { + "url": "https://github.com/substack/watchify/issues" + }, + "_id": "watchify@3.6.0", + "_shasum": "5fe08e9f004b52d6a1c4520abfc71762b5ac62f2", + "_from": "watchify@>=3.2.3 <4.0.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "zertosh", + "email": "zertosh@gmail.com" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "zertosh", + "email": "zertosh@gmail.com" + }, + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "dist": { + "shasum": "5fe08e9f004b52d6a1c4520abfc71762b5ac62f2", + "tarball": "http://registry.npmjs.org/watchify/-/watchify-3.6.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/watchify/-/watchify-3.6.0.tgz" +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/readme.markdown b/node_modules/laravel-elixir/node_modules/watchify/readme.markdown new file mode 100644 index 00000000..c277d9e5 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/readme.markdown @@ -0,0 +1,226 @@ +# watchify + +watch mode for [browserify](https://github.com/substack/node-browserify) builds + +[![build status](https://secure.travis-ci.org/substack/watchify.png)](http://travis-ci.org/substack/watchify) + +Update any source file and your browserify bundle will be recompiled on the +spot. + +# example + +``` +$ watchify main.js -o static/bundle.js +``` + +Now as you update files, `static/bundle.js` will be automatically +incrementally rebuilt on the fly. + +The `-o` option can be a file or a shell command (not available on Windows) +that receives piped input: + +``` sh +watchify main.js -o 'exorcist static/bundle.js.map > static/bundle.js' -d +``` + +``` sh +watchify main.js -o 'uglifyjs -cm > static/bundle.min.js' +``` + +You can use `-v` to get more verbose output to show when a file was written and how long the bundling took (in seconds): + +``` +$ watchify browser.js -d -o static/bundle.js -v +610598 bytes written to static/bundle.js (0.23 seconds) +610606 bytes written to static/bundle.js (0.10 seconds) +610597 bytes written to static/bundle.js (0.14 seconds) +610606 bytes written to static/bundle.js (0.08 seconds) +610597 bytes written to static/bundle.js (0.08 seconds) +610597 bytes written to static/bundle.js (0.19 seconds) +``` + +# usage + +Use `watchify` with all the same options as `browserify` except that `-o` (or +`--outfile`) is mandatory. Additionally, there are also: + +``` +Standard Options: + + --outfile=FILE, -o FILE + + This option is required. Write the browserify bundle to this file. If + the file contains the operators `|` or `>`, it will be treated as a + shell command, and the output will be piped to it. + + --verbose, -v [default: false] + + Show when a file was written and how long the bundling took (in + seconds). + + --version + + Show the watchify and browserify versions with their module paths. +``` + +``` +Advanced Options: + + --delay [default: 600] + + Amount of time in milliseconds to wait before emitting an "update" + event after a change. + + --ignore-watch=GLOB, --iw GLOB [default: false] + + Ignore monitoring files for changes that match the pattern. Omitting + the pattern will default to "**/node_modules/**". + + --poll=INTERVAL [default: false] + + Use polling to monitor for changes. Omitting the interval will default + to 100ms. This option is useful if you're watching an NFS volume. +``` + +# methods + +``` js +var watchify = require('watchify'); +``` + +## watchify(b, opts) + +watchify is a browserify [plugin](https://github.com/substack/node-browserify#bpluginplugin-opts), so it can be applied like any other plugin. +However, when creating the browserify instance `b`, **you MUST set the `cache` +and `packageCache` properties**: + +``` js +var b = browserify({ cache: {}, packageCache: {} }); +b.plugin(watchify); +``` + +```js +var b = browserify({ + cache: {}, + packageCache: {}, + plugin: [watchify] +}); +``` + +**By default, watchify doesn't display any output, see [events](https://github.com/substack/watchify#events) for more info.** + +`b` continues to behave like a browserify instance except that it caches file +contents and emits an `'update'` event when a file changes. You should call +`b.bundle()` after the `'update'` event fires to generate a new bundle. +Calling `b.bundle()` extra times past the first time will be much faster due +to caching. + +**Important:** Watchify will not emit `'update'` events until you've called +`w.bundle()` once and completely drained the stream it returns. + +```js +var fs = require('fs'); +var browserify = require('browserify'); +var watchify = require('watchify'); + +var b = browserify({ + entries: ['path/to/entry.js'], + cache: {}, + packageCache: {}, + plugin: [watchify] +}); + +b.on('update', bundle); +bundle(); + +function bundle() { + b.bundle().pipe(fs.createWriteStream('output.js')); +} +``` + +### options + +You can to pass an additional options object as a second parameter of +watchify. Its properties are: + +`opts.delay` is the amount of time in milliseconds to wait before emitting +an "update" event after a change. Defaults to `100`. + +`opts.ignoreWatch` ignores monitoring files for changes. If set to `true`, +then `**/node_modules/**` will be ignored. For other possible values see +Chokidar's [documentation](https://github.com/paulmillr/chokidar#path-filtering) on "ignored". + +`opts.poll` enables polling to monitor for changes. If set to `true`, then +a polling interval of 100ms is used. If set to a number, then that amount of +milliseconds will be the polling interval. For more info see Chokidar's +[documentation](https://github.com/paulmillr/chokidar#performance) on +"usePolling" and "interval". +**This option is useful if you're watching an NFS volume.** + +```js +var b = browserify({ cache: {}, packageCache: {} }); +// watchify defaults: +b.plugin(bundle, { + delay: 100, + ignoreWatch: ['**/node_modules/**'], + poll: false +}); +``` + +## b.close() + +Close all the open watch handles. + +# events + +## b.on('update', function (ids) {}) + +When the bundle changes, emit the array of bundle `ids` that changed. + +## b.on('bytes', function (bytes) {}) + +When a bundle is generated, this event fires with the number of bytes. + +## b.on('time', function (time) {}) + +When a bundle is generated, this event fires with the time it took to create the +bundle in milliseconds. + +## b.on('log', function (msg) {}) + +This event fires after a bundle was created with messages of the form: + +``` +X bytes written (Y seconds) +``` + +with the number of bytes in the bundle X and the time in seconds Y. + +# install + +With [npm](https://npmjs.org) do: + +``` +$ npm install -g watchify +``` + +to get the watchify command and: + +``` +$ npm install watchify +``` + +to get just the library. + +# troubleshooting + +## rebuilds on OS X never trigger + +It may be related to a bug in `fsevents` (see [#250](https://github.com/substack/watchify/issues/205#issuecomment-98672850) +and [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files/28610124#28610124)). +Try the `--poll` flag +and/or renaming the project's directory - that might help. + +# license + +MIT diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api.js b/node_modules/laravel-elixir/node_modules/watchify/test/api.js new file mode 100644 index 00000000..5877b2a3 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api.js @@ -0,0 +1,44 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('api', function (t) { + t.plan(5); + var w = watchify(browserify(file, watchify.args)); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + setTimeout(function () { + fs.writeFile(file, 'console.log(333)', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api_brfs.js b/node_modules/laravel-elixir/node_modules/watchify/test/api_brfs.js new file mode 100644 index 00000000..0078d452 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api_brfs.js @@ -0,0 +1,53 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + lines: path.join(tmpdir, 'lines.txt') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('api with brfs', function (t) { + t.plan(5); + var w = watchify(browserify(files.main, watchify.args)); + w.transform('brfs'); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'ROBO-BOOGIE\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'BEEP\nBOOP\n'); + setTimeout(function () { + fs.writeFile(files.lines, 'rObO-bOOgie', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch.js b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch.js new file mode 100644 index 00000000..17139a38 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: '**/be*.js' + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep BOOP ROBOT\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_default.js b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_default.js new file mode 100644 index 00000000..9a7a48dc --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_default.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch default', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: true + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'BEEP BOOP robot\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_multiple.js b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_multiple.js new file mode 100644 index 00000000..91857ef5 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api_ignore_watch_multiple.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch multiple paths', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: ['**/be*.js', '**/robot/*.js'] + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep BOOP robot\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/api_implicit_cache.js b/node_modules/laravel-elixir/node_modules/watchify/test/api_implicit_cache.js new file mode 100644 index 00000000..0f115280 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/api_implicit_cache.js @@ -0,0 +1,44 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('api implicit cache', function (t) { + t.plan(5); + var w = watchify(browserify(file)); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + setTimeout(function () { + fs.writeFile(file, 'console.log(333)', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin.js new file mode 100644 index 00000000..099e87ce --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin.js @@ -0,0 +1,52 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(555)'); + +test('bin', function (t) { + t.plan(4); + var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v' ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '555\n'); + fs.writeFile(files.main, 'console.log(333)'); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '333\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_brfs.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_brfs.js new file mode 100644 index 00000000..47b0fcaa --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_brfs.js @@ -0,0 +1,62 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('bin brfs', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'BEEP\nBOOP\n'); + fs.writeFile(files.lines, 'robo-bOOgie'); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'ROBO-BOOGIE\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch.js new file mode 100644 index 00000000..358090f7 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch.js @@ -0,0 +1,71 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', '**/be*.js', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep BOOP ROBOT\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_default.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_default.js new file mode 100644 index 00000000..f7013488 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_default.js @@ -0,0 +1,71 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'BEEP BOOP robot\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_multiple.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_multiple.js new file mode 100644 index 00000000..37ff91f9 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_ignore_watch_multiple.js @@ -0,0 +1,72 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch multiple paths', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', '**/be*.js', + '--ignore-watch', '**/robot/*.js', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep BOOP robot\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_pipe.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_pipe.js new file mode 100644 index 00000000..be25f774 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_pipe.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(num * 2)'); + +test('bin with pipe', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '-o', 'uglifyjs - --enclose 11:num > ' + files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '22\n'); + fs.writeFile(files.main, 'console.log(num * 3)'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '33\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/bin_standalone.js b/node_modules/laravel-elixir/node_modules/watchify/test/bin_standalone.js new file mode 100644 index 00000000..6378253c --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/bin_standalone.js @@ -0,0 +1,52 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(555)'); + +test('bin with standalone', function (t) { + t.plan(4); + var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v', '-s', 'XXX' ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '555\n'); + fs.writeFile(files.main, 'console.log(333)'); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '333\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/errors.js b/node_modules/laravel-elixir/node_modules/watchify/test/errors.js new file mode 100644 index 00000000..059e553b --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/errors.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('errors', function (t) { + t.plan(5); + var w = watchify(browserify(file, watchify.args)); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + breakTheBuild(); + }); + function breakTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log('); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ok(err instanceof Error, 'should be error'); + fixTheBuild(); + }); + }); + } + function fixTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log(333)'); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + } +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/errors_transform.js b/node_modules/laravel-elixir/node_modules/watchify/test/errors_transform.js new file mode 100644 index 00000000..c4586900 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/errors_transform.js @@ -0,0 +1,83 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var through = require('through2'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var main = path.join(tmpdir, 'main.js'); +var file = path.join(tmpdir, 'dep.jsnum'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(main, 'require("./dep.jsnum")'); +fs.writeFileSync(file, 'console.log(555)'); + +function someTransform(file) { + if (!/\.jsnum$/.test(file)) { + return through(); + } + function write (chunk, enc, next) { + if (/\d/.test(chunk)) { + this.push(chunk); + } else { + this.emit('error', new Error('No number in this chunk')); + } + next(); + } + return through(write); +} + +test('errors in transform', function (t) { + t.plan(6); + var b = browserify(main, watchify.args); + b.transform(someTransform); + var w = watchify(b); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + breakTheBuild(); + }); + function breakTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log()'); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ok(err instanceof Error, 'should be error'); + t.ok(/^No number in this chunk/.test(err.message)); + fixTheBuild(); + }); + }); + } + function fixTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log(333)'); + }, 1000); + var safety = setTimeout(function() { + t.fail("gave up waiting"); + w.close(); + t.end(); + }, 5000); + w.once('update', function () { + clearTimeout(safety); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + } +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/expose.js b/node_modules/laravel-elixir/node_modules/watchify/test/expose.js new file mode 100644 index 00000000..e42c62de --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/expose.js @@ -0,0 +1,72 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpbase = fs.realpathSync((os.tmpdir || os.tmpDir)()); +var tmpdir = path.join(tmpbase, 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + abc: path.join(tmpdir, 'lib', 'abc.js'), + xyz: path.join(tmpdir, 'lib', 'xyz.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.join(tmpdir, 'lib')); + +fs.writeFileSync(files.main, [ + 'var abc = require("abc");', + 'var xyz = require("xyz");', + 'var beep = require("./beep");', + 'console.log(abc + " " + xyz + " " + beep);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = require("./boop");'); +fs.writeFileSync(files.boop, 'module.exports = require("xyz");'); +fs.writeFileSync(files.abc, 'module.exports = "abc";'); +fs.writeFileSync(files.xyz, 'module.exports = "xyz";'); + +test('properly caches exposed files', function (t) { + t.plan(4); + var cache = {}; + var w = watchify(browserify({ + entries: [files.main], + basedir: tmpdir, + cache: cache, + packageCache: {} + })); + + w.require('./lib/abc', {expose: 'abc'}); + w.require('./lib/xyz', {expose: 'xyz'}); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'ABC XYZ XYZ\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'abc xyz xyz\n'); + setTimeout(function () { + // If we're incorrectly caching exposed files, + // then "files.abc" would be re-read from disk. + cache[files.abc].source = 'module.exports = "ABC";'; + fs.writeFileSync(files.xyz, 'module.exports = "XYZ";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/many.js b/node_modules/laravel-elixir/node_modules/watchify/test/many.js new file mode 100644 index 00000000..bc6b22cc --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/many.js @@ -0,0 +1,101 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + robot: path.join(tmpdir, 'robot.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +var edits = [ + { file: 'lines', source: 'robo-boogie' }, + { file: 'lines', source: 'dinosaurus rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 111 }', + next: true + }, + { file: 'main', source: [ + 'var fs = require("fs");', + 'var robot = require("./robot.js");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase() + " " + robot(src.length));' + ].join('\n') }, + { file: 'lines', source: 't-rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 100 }', + } +]; + +var expected = [ + 'BEEP\nBOOP\n', + 'ROBO-BOOGIE\n', + 'DINOSAURUS REX\n', + 'DINOSAURUS REX 1554\n', + 'T-REX 555\n', + 'T-REX 500\n' +]; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('many edits', function (t) { + t.plan(expected.length * 2 + edits.length); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + ps.stdout.pipe(process.stdout); + ps.stderr.pipe(process.stdout); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + if (line.length === 0) return; + + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, expected.shift()); + + (function next () { + if (edits.length === 0) return; + var edit = edits.shift(); + setTimeout(function () { + fs.writeFile(files[edit.file], edit.source, function (err) { + t.ifError(err); + if (edit.next) next(); + }); + }, 25); + })(); + }) + }); + + t.on('end', function () { + ps.kill(); + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/many_immediate.js b/node_modules/laravel-elixir/node_modules/watchify/test/many_immediate.js new file mode 100644 index 00000000..290b95e8 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/many_immediate.js @@ -0,0 +1,99 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + robot: path.join(tmpdir, 'robot.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +var edits = [ + { file: 'lines', source: 'robo-boogie' }, + { file: 'lines', source: 'dinosaurus rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 111 }', + next: true + }, + { file: 'main', source: [ + 'var fs = require("fs");', + 'var robot = require("./robot.js");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase() + " " + robot(src.length));' + ].join('\n') }, + { file: 'lines', source: 't-rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 100 }', + } +]; + +var expected = [ + 'BEEP\nBOOP\n', + 'ROBO-BOOGIE\n', + 'DINOSAURUS REX\n', + 'DINOSAURUS REX 1554\n', + 'T-REX 555\n', + 'T-REX 500\n' +]; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('many immediate', function (t) { + t.plan(expected.length * 2 + edits.length); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + ps.stdout.pipe(process.stdout); + ps.stderr.pipe(process.stdout); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + if (line.length === 0) return; + + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, expected.shift()); + + (function next () { + if (edits.length === 0) return; + var edit = edits.shift(); + fs.writeFile(files[edit.file], edit.source, function (err) { + t.ifError(err); + if (edit.next) next(); + }); + })(); + }) + }); + + t.on('end', function () { + ps.kill(); + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/laravel-elixir/node_modules/watchify/test/zzz.js b/node_modules/laravel-elixir/node_modules/watchify/test/zzz.js new file mode 100644 index 00000000..bf1ec919 --- /dev/null +++ b/node_modules/laravel-elixir/node_modules/watchify/test/zzz.js @@ -0,0 +1,10 @@ +var test = require('tape'); + +test('__END__', function (t) { + t.on('end', function () { + setTimeout(function () { + process.exit(0); + }, 100) + }); + t.end(); +}); diff --git a/node_modules/laravel-elixir/package.json b/node_modules/laravel-elixir/package.json new file mode 100644 index 00000000..bf45e85a --- /dev/null +++ b/node_modules/laravel-elixir/package.json @@ -0,0 +1,95 @@ +{ + "name": "laravel-elixir", + "version": "3.4.2", + "description": "Laravel Elixir Core", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/laravel/elixir.git" + }, + "keywords": [ + "laravel", + "elixir", + "gulp" + ], + "author": { + "name": "Taylor Otwell, Jeffrey Way" + }, + "license": "MIT", + "homepage": "https://github.com/laravel/elixir", + "dependencies": { + "babelify": "^6.1.3", + "browser-sync": "^2.7.10", + "browserify": "^11.2.0", + "del": "^1.2.0", + "glob": "^5.0.14", + "gulp-autoprefixer": "^2.3.1", + "gulp-babel": "^5.1.0", + "gulp-batch": "^1.0.5", + "gulp-coffee": "^2.3.1", + "gulp-concat": "^2.6.0", + "gulp-if": "^1.2.5", + "gulp-less": "^3.0.3", + "gulp-load-plugins": "^1.0.0-rc.1", + "gulp-minify-css": "^1.2.0", + "gulp-notify": "^2.2.0", + "gulp-phpspec": "^0.5.3", + "gulp-phpunit": "0.9.0", + "gulp-rename": "^1.2.2", + "gulp-rev": "^5.1.0", + "gulp-rev-replace": "^0.4.2", + "gulp-sass": "^2.0.3", + "gulp-sourcemaps": "^1.5.2", + "gulp-uglify": "^1.4.2", + "gulp-util": "^3.0.6", + "gulp-watch": "^4.2.4", + "insert-css": "^0.2.0", + "merge-stream": "^0.1.8", + "parse-filepath": "^0.5.0", + "partialify": "^3.1.3", + "path": "^0.11.14", + "require-dir": "^0.3.0", + "run-sequence": "^1.1.1", + "underscore": "^1.8.3", + "underscore-deep-extend": "0.0.5", + "vinyl-buffer": "^1.0.0", + "vinyl-paths": "^1.0.0", + "vinyl-source-stream": "^1.1.0", + "vueify": "^4.0.1", + "watchify": "^3.2.3" + }, + "devDependencies": { + "gulp": "^3.8.8", + "chai": "^3.2.0", + "mocha": "^2.2.5", + "rimraf": "^2.4.2" + }, + "gitHead": "d901479b16041166278caf86ac5084577ed1695b", + "bugs": { + "url": "https://github.com/laravel/elixir/issues" + }, + "_id": "laravel-elixir@3.4.2", + "_shasum": "dd6446cfc388d1eeff6946e77b4fdcb6841cbb83", + "_from": "laravel-elixir@*", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jeffreyway", + "email": "jeffrey@laracasts.com" + }, + "maintainers": [ + { + "name": "jeffreyway", + "email": "jeffrey@laracasts.com" + } + ], + "dist": { + "shasum": "dd6446cfc388d1eeff6946e77b4fdcb6841cbb83", + "tarball": "http://registry.npmjs.org/laravel-elixir/-/laravel-elixir-3.4.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/laravel-elixir/-/laravel-elixir-3.4.2.tgz" +} diff --git a/node_modules/laravel-elixir/readme.md b/node_modules/laravel-elixir/readme.md new file mode 100644 index 00000000..4068af1f --- /dev/null +++ b/node_modules/laravel-elixir/readme.md @@ -0,0 +1,16 @@ +# Laravel Elixir + +## Introduction + +Laravel Elixir provides a clean, fluent API for defining basic Gulp tasks for your Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools. + +If you've ever been confused about how to get started with Gulp and asset compilation, you will love Laravel Elixir! + + +## Official Documentation + +Documentation for Elixir can be found on the [Laravel website](http://laravel.com/docs/elixir). + +### License + +Laravel Elixir is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) diff --git a/node_modules/laravel-elixir/tasks/browserify.js b/node_modules/laravel-elixir/tasks/browserify.js new file mode 100644 index 00000000..60d6c0cf --- /dev/null +++ b/node_modules/laravel-elixir/tasks/browserify.js @@ -0,0 +1,126 @@ +var gulp = require('gulp'); +var gutil = require('gulp-util'); +var babelify = require('babelify'); +var watchify = require('watchify'); +var buffer = require('vinyl-buffer'); +var Elixir = require('laravel-elixir'); +var browserify = require('browserify'); +var partialify = require('partialify'); +var source = require('vinyl-source-stream'); + +var bundle; +var $ = Elixir.Plugins; +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | Browserify Task + |---------------------------------------------------------------- + | + | This task will manage your entire Browserify workflow, from + | scratch! Also, it will channel all files through Babelify + | so that you may use all the ES6 goodness you can stand. + | + */ + +Elixir.extend('browserify', function(src, output, baseDir, options) { + var paths = prepGulpPaths(src, baseDir, output); + + new Elixir.Task('browserify', function() { + var stream = config.js.browserify.watchify.enabled + ? watchifyStream + : browserifyStream; + + bundle = function(stream, paths) { + this.log(paths.src, paths.output); + + return ( + stream + .bundle() + .on('error', function(e) { + new Elixir.Notification().error(e, 'Browserify Failed!'); + + this.emit('end'); + }) + .pipe(source(paths.output.name)) + .pipe(buffer()) + .pipe($.if(config.production, $.uglify())) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(new Elixir.Notification('Browserify Compiled!')) + ); + }.bind(this); + + return bundle( + stream({ + paths: paths, + options: options || config.js.browserify.options + }), + paths + ); + }) + // We'll add this task to be watched, but Watchify + // will handle the process, to speed things up. + .watch(); +}); + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string} baseDir + * @param {string|null} output + */ +var prepGulpPaths = function(src, baseDir, output) { + baseDir = baseDir || config.get('assets.js.folder'); + + return new Elixir.GulpPaths() + .src(src, baseDir) + .output(output || config.get('public.js.outputFolder'), 'bundle.js'); +}; + + +/** + * Get a standard Browserify stream. + * + * @param {string|array} src + * @param {object} options + */ +var browserifyStream = function(data) { // just use two arguments + var stream = browserify(data.paths.src.path, data.options); + + config.js.browserify.transformers.forEach(function(transformer) { + stream.transform( + require(transformer.name), transformer.options || {} + ); + }); + + config.js.browserify.plugins.forEach(function(plugin) { + stream.plugin( + require(plugin.name), plugin.options || {} + ); + }); + + return stream; +}; + + +/** + * Get a Browserify stream, wrapped in Watchify. + * + * @param {object} data + */ +var watchifyStream = function(data) { + var browserify = watchify( + browserifyStream(data), + config.js.browserify.watchify.options + ); + + browserify.on('log', gutil.log); + browserify.on('update', function() { + bundle(browserify, data.paths); + }); + + return browserify; +}; diff --git a/node_modules/laravel-elixir/tasks/browsersync.js b/node_modules/laravel-elixir/tasks/browsersync.js new file mode 100644 index 00000000..3f5ded57 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/browsersync.js @@ -0,0 +1,40 @@ +var gulp = require('gulp'); +var _ = require('underscore'); +var gutils = require('gulp-util'); +var Elixir = require('laravel-elixir'); +var browserSync = require('browser-sync').create(); + +var config = Elixir.config; + +/* + |---------------------------------------------------------------- + | BrowserSync + |---------------------------------------------------------------- + | + | Browsersync makes your browser testing workflow faster by + | synchronizing URLs, behavior, and code changes across + | across multiple devices. And, now it's in Elixir! + | + */ + +Elixir.extend('browserSync', function (options) { + options = _.extend(config.browserSync, { + files: [ + config.appPath + '/**/*.php', + config.get('public.css.outputFolder') + '/**/*.css', + config.get('public.js.outputFolder') + '/**/*.js', + config.get('public.versioning.buildFolder') + '/rev-manifest.json', + 'resources/views/**/*.php' + ], + watchOptions: { + usePolling: true + } + }, options); + + // Browsersync will only run during `gulp watch`. + if (gutils.env._.indexOf('watch') > -1) { + browserSync.init(options); + } + + new Elixir.Task('browserSync', function () {}).watch(); +}); \ No newline at end of file diff --git a/node_modules/laravel-elixir/tasks/coffee.js b/node_modules/laravel-elixir/tasks/coffee.js new file mode 100644 index 00000000..124561ac --- /dev/null +++ b/node_modules/laravel-elixir/tasks/coffee.js @@ -0,0 +1,57 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + +var $ = Elixir.Plugins; +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | CoffeeScript Compilation + |---------------------------------------------------------------- + | + | This task will compile your CoffeeScript, minify it, and then + | optionally generate a "manifest" file that helps with your + | browser cache-busting of previous versions of your code. + | + */ + +Elixir.extend('coffee', function(src, output, options) { + new Elixir.Task('coffee', function() { + var paths = prepGulpPaths(src, output); + + this.log(paths.src, paths.output); + + return ( + gulp + .src(paths.src.path) + .pipe($.if(config.sourcemaps, $.sourcemaps.init())) + .pipe($.coffee(options || config.js.coffee.options) + .on('error', function(e) { + new Elixir.Notification().error(e, 'CoffeeScript Compilation Failed!'); + + this.emit('end'); + })) + .pipe($.concat(paths.output.name)) + .pipe($.if(config.production, $.uglify())) + .pipe($.if(config.sourcemaps, $.sourcemaps.write('.'))) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(new Elixir.Notification('CoffeeScript Compiled!')) + ); + }) + .watch(config.get('assets.js.coffee.folder') + '/**/*.coffee') +}); + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} output + * @return {object} + */ +var prepGulpPaths = function(src, output) { + return new Elixir.GulpPaths() + .src(src, config.get('assets.js.coffee.folder')) + .output(output || config.get('public.js.outputFolder'), 'app.js'); +}; diff --git a/node_modules/laravel-elixir/tasks/copy.js b/node_modules/laravel-elixir/tasks/copy.js new file mode 100644 index 00000000..8189a43b --- /dev/null +++ b/node_modules/laravel-elixir/tasks/copy.js @@ -0,0 +1,33 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + +var $ = Elixir.Plugins; + + +/* + |---------------------------------------------------------------- + | Copying + |---------------------------------------------------------------- + | + | This task offers a simple way to copy files from one place to + | another. No more complicated than that! You may either set + | a single file or alternatively you can copy a full dir. + | + */ + +Elixir.extend('copy', function(src, output) { + var paths = new Elixir.GulpPaths().src(src).output(output); + + new Elixir.Task('copy', function() { + this.log(paths.src, paths.output); + + return ( + gulp + .src(paths.src.path) + .pipe($.if(! paths.output.isDir, $.rename(paths.output.name))) + .pipe(gulp.dest(paths.output.baseDir)) + ); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); diff --git a/node_modules/laravel-elixir/tasks/default.js b/node_modules/laravel-elixir/tasks/default.js new file mode 100644 index 00000000..628b67f9 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/default.js @@ -0,0 +1,20 @@ +var gulp = require('gulp'); +var _ = require('underscore'); +var Elixir = require('laravel-elixir'); +var inSequence = require('run-sequence'); + + +/* + |---------------------------------------------------------------- + | Default Task + |---------------------------------------------------------------- + | + | This task will run when the developer executes "gulp" on the + | command line. We'll use this configuration object to know + | which tasks should be fired when this task is executed. + | + */ + +gulp.task('default', function() { + inSequence.apply(this, _.pluck(Elixir.tasks, 'name')); +}); diff --git a/node_modules/laravel-elixir/tasks/less.js b/node_modules/laravel-elixir/tasks/less.js new file mode 100644 index 00000000..83f34057 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/less.js @@ -0,0 +1,47 @@ +var gulp = require('gulp'); +var compile = require('./shared/Css'); +var Elixir = require('laravel-elixir'); + +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | Less Compilation Task + |---------------------------------------------------------------- + | + | This task will compile your Less, including minification and + | and auto-prefixing. Less is one of the CSS pre-processors + | supported by Elixir, along with the Sass CSS processor. + | + */ + +Elixir.extend('less', function(src, output, options) { + new Elixir.Task('less', function() { + var paths = prepGulpPaths(src, output); + + return compile({ + name: 'Less', + compiler: require('gulp-less'), + src: paths.src, + output: paths.output, + task: this, + pluginOptions: options || config.css.less.pluginOptions + }); + }) + .watch(config.get('assets.css.less.folder') + '/**/*.less'); +}); + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} output + * @return {object} + */ +var prepGulpPaths = function(src, output) { + return new Elixir.GulpPaths() + .src(src, config.get('assets.css.less.folder')) + .output(output || config.get('public.css.outputFolder'), 'app.css'); +}; diff --git a/node_modules/laravel-elixir/tasks/phpspec.js b/node_modules/laravel-elixir/tasks/phpspec.js new file mode 100644 index 00000000..597989a2 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/phpspec.js @@ -0,0 +1,25 @@ +var Elixir = require('laravel-elixir'); +var runTests = require('./shared/Tests'); + +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | PHPSpec Testing + |---------------------------------------------------------------- + | + | This task will trigger your entire PHPSpec test suite and it + | will show notifications indicating the success or failure + | of that test suite. It's works great with the tdd task. + | + */ + +Elixir.extend('phpSpec', function(src, options) { + runTests({ + name: 'phpSpec', + src: src || (config.testing.phpSpec.path + '/**/*Spec.php'), + plugin: Elixir.Plugins.phpspec, + pluginOptions: options || config.testing.phpSpec.options + }); +}); diff --git a/node_modules/laravel-elixir/tasks/phpunit.js b/node_modules/laravel-elixir/tasks/phpunit.js new file mode 100644 index 00000000..3c86402a --- /dev/null +++ b/node_modules/laravel-elixir/tasks/phpunit.js @@ -0,0 +1,25 @@ +var Elixir = require('laravel-elixir'); +var runTests = require('./shared/Tests'); + +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | PHPUnit Testing + |---------------------------------------------------------------- + | + | This task will trigger your entire PHPUnit test suite and it + | will show notifications indicating the success or failure + | of that test suite. It's works great with the tdd task. + | + */ + +Elixir.extend('phpUnit', function(src, options) { + runTests({ + name: 'phpUnit', + src: src || (config.testing.phpUnit.path + '/**/*Test.php'), + plugin: Elixir.Plugins.phpunit, + pluginOptions: options || config.testing.phpUnit.options + }); +}); diff --git a/node_modules/laravel-elixir/tasks/sass.js b/node_modules/laravel-elixir/tasks/sass.js new file mode 100644 index 00000000..ea3b70f6 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/sass.js @@ -0,0 +1,58 @@ +var gulp = require('gulp'); +var compile = require('./shared/Css'); +var Elixir = require('laravel-elixir'); + +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | Sass Compilation Task + |---------------------------------------------------------------- + | + | This task will compile your Sass, including minification and + | and auto-prefixing. Sass is one of the CSS pre-precessors + | supported by Elixir, along with the Less CSS processor. + | + */ + +var gulpTask = function(src, output, options) { + new Elixir.Task('sass', function() { + var paths = prepGulpPaths(src, output); + + return compile({ + name: 'Sass', + compiler: require('gulp-sass'), + src: paths.src, + output: paths.output, + task: this, + pluginOptions: options || config.css.sass.pluginOptions + }); + }) + .watch(config.get('assets.css.sass.folder') + '/**/*.+(sass|scss)'); +}; + + +Elixir.extend('sass', function() { + gulpTask.apply(this, arguments); +}); + + +// Deprecated. Only for backward compatibility. +Elixir.extend('rubySass', function() { + gulpTask.apply(this, arguments); +}); + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} output + * @return {object} + */ +var prepGulpPaths = function(src, output) { + return new Elixir.GulpPaths() + .src(src, config.get('assets.css.sass.folder')) + .output(output || config.get('public.css.outputFolder'), 'app.css'); +}; diff --git a/node_modules/laravel-elixir/tasks/scripts.js b/node_modules/laravel-elixir/tasks/scripts.js new file mode 100644 index 00000000..5804c760 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/scripts.js @@ -0,0 +1,92 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + +var $ = Elixir.Plugins; +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | JavaScript File Concatenation + |---------------------------------------------------------------- + | + | This task will concatenate and minify your JavaScript files + | in order. This provides a quick and simple way to reduce + | the number of HTTP requests your application executes. + | + */ + +Elixir.extend('scripts', function(scripts, output, baseDir) { + var paths = prepGulpPaths(scripts, baseDir, output); + + new Elixir.Task('scripts', function() { + return gulpTask.call(this, paths); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); + + +Elixir.extend('scriptsIn', function(baseDir, output) { + var paths = prepGulpPaths('**/*.js', baseDir, output); + + new Elixir.Task('scriptsIn', function() { + return gulpTask.call(this, paths); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); + + +Elixir.extend('babel', function(scripts, output, baseDir, options) { + var paths = prepGulpPaths(scripts, baseDir, output); + + new Elixir.Task('babel', function() { + var babelOptions = options || config.js.babel.options; + + return gulpTask.call(this, paths, babelOptions); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); + + +/** + * Trigger the Gulp task logic. + * + * @param {object} paths + * @param {object|null} babel + */ +var gulpTask = function(paths, babel) { + this.log(paths.src, paths.output); + + return ( + gulp + .src(paths.src.path) + .pipe($.if(config.sourcemaps, $.sourcemaps.init())) + .pipe($.concat(paths.output.name)) + .pipe($.if(babel, $.babel(babel))) + .on('error', function(e) { + new Elixir.Notification().error(e, 'Babel Compilation Failed!'); + this.emit('end'); + }) + .pipe($.if(config.production, $.uglify())) + .pipe($.if(config.sourcemaps, $.sourcemaps.write('.'))) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(new Elixir.Notification('Scripts Merged!')) + ); +}; + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} baseDir + * @param {string|null} output + */ +var prepGulpPaths = function(src, baseDir, output) { + return new Elixir.GulpPaths() + .src(src, baseDir || config.get('assets.js.folder')) + .output(output || config.get('public.js.outputFolder'), 'all.js'); +}; diff --git a/node_modules/laravel-elixir/tasks/shared/Css.js b/node_modules/laravel-elixir/tasks/shared/Css.js new file mode 100644 index 00000000..235894a7 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/shared/Css.js @@ -0,0 +1,30 @@ +var gulp = require('gulp'); +var Elixir = require('../../index'); + +var $ = Elixir.Plugins; +var config = Elixir.config; + + +module.exports = function(options) { + var name = options.name; + + options.task.log(options.src, options.output); + + return ( + gulp + .src(options.src.path) + .pipe($.if(config.sourcemaps, $.sourcemaps.init())) + .pipe(options.compiler(options.pluginOptions)) + .on('error', function(e) { + new Elixir.Notification().error(e, name + ' Compilation Failed'); + + this.emit('end'); + }) + .pipe($.if(config.css.autoprefix.enabled, $.autoprefixer(config.css.autoprefix.options))) + .pipe($.concat(options.output.name)) + .pipe($.if(config.production, $.minifyCss(config.css.minifyCss.pluginOptions))) + .pipe($.if(config.sourcemaps, $.sourcemaps.write('.'))) + .pipe(gulp.dest(options.output.baseDir)) + .pipe(new Elixir.Notification(name + ' Compiled!')) + ); +}; diff --git a/node_modules/laravel-elixir/tasks/shared/Tests.js b/node_modules/laravel-elixir/tasks/shared/Tests.js new file mode 100644 index 00000000..22efa170 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/shared/Tests.js @@ -0,0 +1,26 @@ +var gulp = require('gulp'); +var Elixir = require('../../index'); + +var notify = new Elixir.Notification(); + + +module.exports = function(options) { + new Elixir.Task(options.name, function() { + this.log(options.src); + + return ( + gulp + .src(options.src) + .pipe(options.plugin('', options.pluginOptions)) + .on('error', function(e) { + notify.forFailedTests(e, options.name); + + this.emit('end'); + }) + .pipe(notify.forPassedTests(options.name)) + ); + }) + .watch(options.src, 'tdd') + .watch(Elixir.config.appPath + '/**/*.php', 'tdd') + .watch('./resources/views/**/*.php', 'tdd') +}; diff --git a/node_modules/laravel-elixir/tasks/styles.js b/node_modules/laravel-elixir/tasks/styles.js new file mode 100644 index 00000000..240b8391 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/styles.js @@ -0,0 +1,73 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + +var $ = Elixir.Plugins; +var config = Elixir.config; + + +/* + |---------------------------------------------------------------- + | CSS File Concatenation + |---------------------------------------------------------------- + | + | This task will concatenate and minify your style sheet files + | in order, which provides a quick and simple way to reduce + | the number of HTTP requests your application fires off. + | + */ + +Elixir.extend('styles', function(styles, output, baseDir) { + var paths = prepGulpPaths(styles, baseDir, output); + + new Elixir.Task('styles', function() { + return gulpTask.call(this, paths); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); + + +Elixir.extend('stylesIn', function(baseDir, output) { + var paths = prepGulpPaths('**/*.css', baseDir, output); + + new Elixir.Task('stylesIn', function() { + return gulpTask.call(this, paths); + }) + .watch(paths.src.path) + .ignore(paths.output.path); +}); + + +/** + * Trigger the Gulp task logic. + * + * @param {object} paths + */ +var gulpTask = function(paths) { + this.log(paths.src, paths.output); + + return ( + gulp + .src(paths.src.path) + .pipe($.if(config.sourcemaps, $.sourcemaps.init())) + .pipe($.concat(paths.output.name)) + .pipe($.if(config.production, $.minifyCss(config.css.minifyCss.pluginOptions))) + .pipe($.if(config.sourcemaps, $.sourcemaps.write('.'))) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(new Elixir.Notification('Stylesheets Merged!')) + ); +}; + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} output + * @return {object} + */ +var prepGulpPaths = function(src, baseDir, output) { + return new Elixir.GulpPaths() + .src(src, baseDir || config.get('assets.css.folder')) + .output(output || config.get('public.css.outputFolder'), 'all.css'); +}; diff --git a/node_modules/laravel-elixir/tasks/task.js b/node_modules/laravel-elixir/tasks/task.js new file mode 100644 index 00000000..901e8fe7 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/task.js @@ -0,0 +1,24 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + + +/* + |---------------------------------------------------------------- + | Custom Gulp Tasks + |---------------------------------------------------------------- + | + | Sometimes, you'll want to hook your custom Gulp tasks into + | Elixir. Simple! Simply call Elixir's task() method, and + | provide the name of your task, and a regex to watch. + | + */ + +Elixir.extend('task', function(name, watcher) { + var task = new Elixir.Task('task', function() { + return gulp.start(name); + }); + + if (watcher) { + task.watch(watcher); + } +}); diff --git a/node_modules/laravel-elixir/tasks/tdd.js b/node_modules/laravel-elixir/tasks/tdd.js new file mode 100644 index 00000000..50d239c4 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/tdd.js @@ -0,0 +1,26 @@ +var gulp = require('gulp'); +var Elixir = require('laravel-elixir'); + + +/* + |---------------------------------------------------------------- + | TDD Watcher + |---------------------------------------------------------------- + | + | This task will keep an eye on any tasks that are part of the + | tdd category. By default this includes PHPUnit and PHPSpec + | tests. Run `gulp tdd` and your tests will auto-trigger. + | + */ + +gulp.task('tdd', function() { + new Elixir.Log.message('Watching for tests...'); + + Elixir.tasks + .filter(function(task) { + return task.category == 'tdd'; + }) + .forEach(function(task) { + gulp.watch(task.watchers, [task.name]); + }); +}); diff --git a/node_modules/laravel-elixir/tasks/version.js b/node_modules/laravel-elixir/tasks/version.js new file mode 100644 index 00000000..f0493d4a --- /dev/null +++ b/node_modules/laravel-elixir/tasks/version.js @@ -0,0 +1,126 @@ +var fs = require('fs'); +var del = require('del'); +var glob = require('glob'); +var gulp = require('gulp'); +var rev = require('gulp-rev'); +var Elixir = require('laravel-elixir'); +var vinylPaths = require('vinyl-paths'); +var parsePath = require('parse-filepath'); +var publicPath = Elixir.config.publicPath; +var revReplace = require('gulp-rev-replace'); + + +/* + |---------------------------------------------------------------- + | Versioning / Cache Busting + |---------------------------------------------------------------- + | + | This task will append a small hash on the end of your file + | and generate a manifest file which contains the current + | "version" of the filename for the application to use. + | + */ + +Elixir.extend('version', function(src, buildPath) { + var paths = prepGulpPaths(src, buildPath); + + new Elixir.Task('version', function() { + var files = vinylPaths(); + var manifest = paths.output.baseDir + '/rev-manifest.json'; + + this.log(paths.src, paths.output); + + emptyBuildPathFiles(paths.output.baseDir, manifest); + + // We need to remove the publicPath from the output base to get the + // correct prefix path. + var filePathPrefix = paths.output.baseDir.replace(publicPath, '') + '/'; + + return ( + gulp.src(paths.src.path, { base: './' + publicPath }) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(files) + .pipe(rev()) + .pipe(revReplace({prefix: filePathPrefix})) + .pipe(gulp.dest(paths.output.baseDir)) + .pipe(rev.manifest()) + .pipe(gulp.dest(paths.output.baseDir)) + .on('end', function() { + // We'll get rid of the duplicated file that + // usually gets put in the "build" folder, + // alongside the suffixed version. + del(files.paths, { force: true }); + + // We'll also copy over relevant sourcemap files. + copyMaps(paths.src.path, paths.output.baseDir); + }) + ); + }) + .watch(paths.src.path); +}); + + +/** + * Prep the Gulp src and output paths. + * + * @param {string|array} src + * @param {string|null} buildPath + * @return {object} + */ +var prepGulpPaths = function(src, buildPath) { + src = Array.isArray(src) ? src : [src]; + + return new Elixir.GulpPaths() + .src(src, config.publicPath) + .output(buildPath || config.get('public.versioning.buildFolder')); +}; + + +/** + * Empty all relevant files from the build directory. + * + * @param {string} buildPath + * @param {string} manifest + */ +var emptyBuildPathFiles = function(buildPath, manifest) { + fs.stat(manifest, function(err, stat) { + if (! err) { + manifest = JSON.parse(fs.readFileSync(manifest)); + + for (var key in manifest) { + del.sync(buildPath + '/' + manifest[key], { force: true }); + } + } + }); +}; + + +/** + * Copy source maps to the build directory. + * + * @param {string} src + * @param {string} buildPath + * @return {object} + */ +var copyMaps = function(src, buildPath) { + src.forEach(function(file) { + // We'll first get any files from the src + // array that have companion .map files. + + glob(file, {}, function(error, files) { + if (error) return; + + files + .filter(function(file) { + return fs.existsSync(file + '.map'); + }) + .forEach(function(file) { + // We will loop over this files array, and + // copy each map to the build directory. + var map = file.replace(publicPath, buildPath); + + gulp.src(file + '.map').pipe(gulp.dest(parsePath(map).dirname)); + }); + }); + }); +}; diff --git a/node_modules/laravel-elixir/tasks/watch.js b/node_modules/laravel-elixir/tasks/watch.js new file mode 100644 index 00000000..8e4b13b3 --- /dev/null +++ b/node_modules/laravel-elixir/tasks/watch.js @@ -0,0 +1,56 @@ +var gulp = require('gulp'); +var _ = require('underscore'); +var batch = require('gulp-batch'); +var Elixir = require('laravel-elixir'); + +/* + |---------------------------------------------------------------- + | Watcher + |---------------------------------------------------------------- + | + | When you want to keep an eye on your files for changes, and + | then re-trigger Gulp, then you should use the gulp watch + | command. This way, you can auto-compile on each save! + | + */ + +gulp.task('watch', function() { + var tasks = _.sortBy(Elixir.tasks, 'name'); + var mergedTasks = {}; + + if (isWatchingBrowserify(tasks)) { + Elixir.config.js.browserify.watchify.enabled = true; + + gulp.start('browserify'); + } + + tasks.forEach(function(task) { + if (task.name in mergedTasks) { + return mergedTasks[task.name].watchers = _.union(mergedTasks[task.name].watchers, task.watchers); + } + + mergedTasks[task.name] = { + name: task.name, + watchers: Array.isArray(task.watchers) ? task.watchers : [task.watchers] + }; + }); + + _.sortBy(mergedTasks, 'name').forEach(function(task) { + if (task.watchers.length > 0) { + gulp.watch(task.watchers, batch(Elixir.config.batchOptions, function(events) { + events.on('end', gulp.start(task.name)); + })); + } + }); +}); + + +/** + * Determine if Browserify is included in the list. + * + * @param {object} tasks + * @return {Boolean} + */ +var isWatchingBrowserify = function(tasks) { + return _.contains(_.pluck(tasks, 'name'), 'browserify'); +}; diff --git a/public/themes/default/css/components/boxed-group.css b/public/themes/default/css/components/boxed-group.css new file mode 100755 index 00000000..6c88ea98 --- /dev/null +++ b/public/themes/default/css/components/boxed-group.css @@ -0,0 +1,187 @@ +.boxed-group { + position: relative; + border-radius: 3px; + margin-bottom: 30px +} + +.boxed-group .counter { + color: #fff; + background-color: #babec0 +} + +.boxed-group.flush .boxed-group-inner { + padding: 0 +} + +.boxed-group.condensed .boxed-group-inner { + font-size: 12px; + padding: 0 +} + +.boxed-group .heading, .boxed-group > h3 { + background-color: #f5f5f5; + margin: 0; + border-radius: 3px 3px 0 0; + border: 1px solid #d8d8d8; + border-bottom: 0; + padding: 9px 10px 10px; + font-size: 14px; + line-height: 17px; + display: block +} + +.boxed-group .heading a, .boxed-group > h3 a { + color: inherit +} + +.boxed-group .heading a.boxed-group-breadcrumb, .boxed-group > h3 a.boxed-group-breadcrumb { + color: #666; + font-weight: 400; + text-decoration: none +} + +.boxed-group .heading .avatar, .boxed-group > h3 .avatar { + margin-top: -4px +} + +.boxed-group .tabnav.heading { + padding: 0 +} + +.boxed-group .tabnav.heading .tabnav-tab.selected { + border-top: 0 +} + +.boxed-group .tabnav.heading li:first-child .selected { + border-left-color: #fff; + border-top-left-radius: 3px +} + +.boxed-group .tabnav-tab { + border-radius: 0; + border-top: 0 +} + +.boxed-group code.heading { + font-size: 12px +} + +.boxed-group.dangerzone > h3 { + background-color: #df3e3e; + border: 1px solid #a00; + color: #fff; + text-shadow: 0 -1px 0 #900 +} + +.boxed-group.dangerzone .boxed-group-inner { + border-top: 0 +} + +.boxed-group.condensed > h3 { + padding: 6px 6px 7px; + font-size: 12px +} + +.boxed-group.condensed > h3 .octicon { + padding: 0 6px 0 2px +} + +.dashboard-sidebar .boxed-group, .one-half .boxed-group { + margin-bottom: 20px +} + +.boxed-group .bleed-flush { + width: 100%; + padding: 0 10px; + margin-left: -10px +} + +.boxed-group .compact { + margin-top: 10px; + margin-bottom: 10px +} + +.boxed-group-inner { + padding: 1px 10px; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + color: #666; + font-size: 13px +} + +.boxed-group-inner .help, .boxed-group-inner .tabnav-tab.selected { + border-top: 1px solid #ddd +} + +.boxed-group-inner .markdown-body { + padding: 20px 10px 10px; + font-size: 13px +} + +.boxed-group-inner.markdown-body { + padding-top: 10px; + padding-bottom: 10px +} + +.boxed-group-inner.seamless { + padding: 0 +} + +.boxed-group-inner h4 { + margin: 15px 0 -5px; + font-size: 14px; + color: #000 +} + +.boxed-group-inner .tabnav { + margin-left: -10px; + margin-right: -10px; + padding-left: 10px; + padding-right: 10px +} + +.boxed-group-inner .help { + clear: both; + margin: 1em -10px 0; + padding: 1em 10px 1em 35px; + color: #999 +} + +.boxed-group-inner .help .octicon { + margin-left: -25px; + margin-right: 5px +} + +.boxed-group-inner .flash-global { + margin-left: -10px; + margin-right: -10px; + border-top: 0 +} + +.boxed-action { + float: right; + margin-left: 10px +} + +.boxed-group-action { + float: right; + margin: 6px 10px 0 0; + position: relative; + z-index: 2 +} + +.boxed-group-action.flush { + margin-top: 0; + margin-right: 0 +} + +.boxed-group-action > button { + background-color: transparent; + border: 0; + -webkit-appearance: none +} + +.boxed-group-icon { + padding: 4px; + color: #777 +} \ No newline at end of file diff --git a/public/themes/default/css/components/collection.css b/public/themes/default/css/components/collection.css new file mode 100755 index 00000000..e7d51f80 --- /dev/null +++ b/public/themes/default/css/components/collection.css @@ -0,0 +1 @@ +.collection-head,.side-collection-image{-webkit-box-shadow:inset 0 10px 20px rgba(0,0,0,.1);text-shadow:0 1px 2px rgba(0,0,0,.3)}.collection-card-image,.collection-head,.side-collection-image{text-shadow:0 1px 2px rgba(0,0,0,.3)}.collection-head{padding:1.5rem 0;margin-top:-20px;margin-bottom:20px;background:url(/assets/images/octicons-bg.png) center #302F2F;box-shadow:inset 0 10px 20px rgba(0,0,0,.1);color:#fff}.collection-head.small{padding:.8rem 0}.collection-head.small .collection-title{padding:10px 0}.collection-head.small .collection-title h1.collection-header{font-size:30px}.collection-head a{color:#fff}.collection-head a:hover{text-decoration:none}.collection-head .collection-title{display:table-cell;padding:20px 0;vertical-align:middle}.collection-head .collection-info{margin:0}.collection-head .collection-info .meta-info{margin-right:15px}.collection-head .collection-info .avatar{background-color:rgba(255,255,255,.7);border:1px solid rgba(255,255,255,.7)}.collection-head .collection-head .container{position:relative}.collection-head .draft-tag{position:absolute;top:0;left:0}.collection-head .collection-header{margin-top:0;font-size:45px;line-height:1.5;font-weight:400}.collection-head .collection-description{position:relative;font-size:16px}.collection-page .collection-info{margin-top:10px;margin-bottom:20px;font-size:13px;color:#999}.collection-page .column.main{margin-right:260px!important}.collection-page .column.sidebar{width:240px}.collection-page .other-content{padding:20px 0 20px 20px;border-left:1px solid #f1f1f1}.collection-page .other-content .subnav-search{margin-left:0}.collection-page .other-content input.subnav-search-input{width:100%}.collection-page .other-content-title{margin-top:40px}.collection-page .other-content-title:first-child,.collection-search-result-title{margin-top:0}.side-collection-list{margin:0;list-style-type:none}.side-collection-link{display:table;width:100%;height:100px;color:#fff}.collection-card-title,.side-collection-image{height:100%;text-align:center;vertical-align:middle}.side-collection-item-title{font-size:16px;font-weight:100}.side-collection-image{background:url(/assets/images/octicons-bg.png) center #555;box-shadow:inset 0 10px 20px rgba(0,0,0,.1);color:#fff;display:table-cell;width:100%;margin-bottom:5px;border-radius:3px}.side-collection-list-item{margin-bottom:20px}.collection-tools{list-style-type:none;margin-bottom:10px;font-size:15px}.collection-tools .edit-link{color:#333}.collection-tools .edit-link:hover{color:#4183c4;cursor:pointer}.collection-tools .octicon{margin-right:5px}.collection-tools .select-menu-button{position:relative;display:inline-block;color:#333}.collection-tools .select-menu-button :hover{color:#4183c4;cursor:pointer}.collection-tool{margin-left:20px}.collection-search-results em{padding:.1em;background-color:#faffa6}.collection-search-result{margin-bottom:40px;list-style-type:none}.collection-search-page .search-results-info{line-height:33px;float:right;margin-left:10px;font-size:15px}.collection-listing{text-align:center}.collection-card{position:relative;display:inline-block;width:30%;max-width:313px;margin:0 10px 20px;list-style-type:none;background:#f7f7f7;border:1px solid #ddd;border-radius:3px;overflow:hidden}.collection-card .draft-tag{position:absolute;top:-1px;left:10px}.collection-card-title{padding:0 15px;margin:10px 0;display:table-cell;width:100%;font-size:19px;font-weight:700}.collection-card-body{padding:0 15px;margin:0 0 10px;height:3em;overflow:hidden;font-size:15px;line-height:1.5em}.collection-card-image{position:relative;display:table;width:101%;height:120px;margin:-1px -1px 15px;background:url(/assets/images/octicons-bg.png) center #555;-webkit-box-shadow:inset 0 10px 20px rgba(0,0,0,.1);box-shadow:inset 0 10px 20px rgba(0,0,0,.1);color:#fff;border-top-right-radius:3px;border-top-left-radius:3px}.collection-card-meta{padding:0 15px;margin-top:5px;margin-bottom:15px;color:#777;font-size:12px}.collection-card-meta .meta-info{margin-right:10px}.collection-card-meta .last-updated{float:right;margin-right:0} \ No newline at end of file diff --git a/public/themes/default/css/components/repo-card.css b/public/themes/default/css/components/repo-card.css new file mode 100755 index 00000000..2764482a --- /dev/null +++ b/public/themes/default/css/components/repo-card.css @@ -0,0 +1,96 @@ +.repo-card { + position: relative; + width: 100%; + margin-bottom: 20px; + list-style-type: none; + border-radius: 3px; + overflow: hidden +} + +.repo-card:hover .repo-card-title { + text-shadow: 0 0 8px #fffcfc; + color: transparent +} + +.repo-card:hover .repo-card-body { + opacity: 1 +} + +.repo-card .draft-tag { + position: absolute; + top: -1px; + left: 10px +} + +.repo-card:nth-child(3n+3) { + margin-right: 0 +} + +.repo-card-title { + padding: 0 15px; + margin: 10px 0; + display: table-cell; + width: 100%; + height: 100%; + font-size: 19px; + font-weight: 700; + text-align: center; + vertical-align: middle +} + +.repo-card-body-wrapper { + display: table +} + +.repo-card-body { + padding: 10px; + margin-top: 0; + display: table-cell; + overflow: hidden; + font-size: 12px; + line-height: 1.5em; + position: absolute; + bottom: 0; + top: 0; + right: 0; + left: 0; + background: rgba(0, 0, 0, .6); + opacity: 0; + color: #fff; + text-align: center; + -webkit-transition: opacity .3s ease-in-out; + -moz-transition: opacity .3s ease-in-out; + transition: opacity .3s ease-in-out +} + +.repo-card-image { + position: relative; + display: table; + width: 100.5%; + height: 100px; + margin: -1px; + background: url(/assets/images/octicons-bg.png) center #555; + -webkit-box-shadow: inset 0 10px 20px rgba(0, 0, 0, .1); + box-shadow: inset 0 10px 20px rgba(0, 0, 0, .1); + text-shadow: 0 1px 2px rgba(0, 0, 0, .3); + color: #fff; + border-top-right-radius: 3px; + border-top-left-radius: 3px +} + +.repo-card-meta { + padding: 0 8px; + margin-top: 5px; + margin-bottom: 5px; + color: #fff; + font-size: 13px +} + +.repo-card-meta .meta-info { + margin-right: 10px +} + +.repo-card-meta .last-updated { + float: right; + margin-right: 0 +} \ No newline at end of file diff --git a/public/themes/default/css/globals/common.css b/public/themes/default/css/globals/common.css new file mode 100755 index 00000000..95d911b0 --- /dev/null +++ b/public/themes/default/css/globals/common.css @@ -0,0 +1 @@ +.site-header,.site-header-actions .select-menu{position:relative}body{font-family:"PingFang SC","Lantinghei SC","Open Sans",Arial,"Hiragino Sans GB","Microsoft YaHei","微软雅黑",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;font-size:16px;line-height:1.6;word-wrap:break-word;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased}@font-face{font-family:octicons;src:font-url(../fonts/octicons.eot?#iefix) format("embedded-opentype"),font-url(../fonts/octicons.woff) format("woff"),font-url(../fonts/octicons.ttf) format("truetype"),font-url(../fonts/octicons.svg#octicons) format("svg");font-weight:400;font-style:normal}.pagination{padding:20px 0}.pagination a.active{background:#337ab7;border-color:#337ab7;z-index:2;color:#fff;cursor:default}.text-center{text-align:center}.btn-inline .btn{margin:5px}.site-header{padding-top:20px;padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #eee}.site-header .account-switcher{display:inline-block;margin-top:-2px;margin-bottom:-6px}.site-header-actions .select-menu:after,.site-header-actions .select-menu:before{display:table;content:""}.site-header ul.site-header-actions{z-index:21;float:right;margin:0}.site-header ul.site-header-actions .feed-icon{margin-top:5px}.site-header .path-divider{margin:0 .25em}.site-header h1{float:left}.site-header h1,.site-header h1 .octicon{margin-top:0;margin-bottom:0;font-size:32px;font-weight:400;line-height:28px}.context-loader,.markdown-body dl dt,.markdown-body table th,.pl-mb,.pl-mdr,.pl-mh,.pl-mh .pl-en,.pl-ms,.pl-sr .pl-cce,.site-header h1 strong{font-weight:700}.site-header h1 a{white-space:nowrap;color:#333}.site-header h1 a:hover{text-decoration:none}.site-header h1 .avatar{margin-top:-2px;margin-right:9px;margin-bottom:-2px}.site-header-actions>li{float:left;margin:0 10px 0 0;font-size:11px;color:#333;list-style-type:none}.site-header-actions>li:last-child{margin-right:0}.site-header-actions .octicon-mute{color:#c00}.site-header-actions .select-menu:after{clear:both}.site-header-actions .select-menu-modal-holder{top:100%}.context-loader{position:absolute;top:0;left:50%;z-index:20;width:154px;padding:10px 10px 10px 30px;margin-left:-75px;font-size:12px;color:#666;background:url(../images/min/octocat-spinner-16px.gif) 10px 50% no-repeat #eee;border:1px solid #ddd;border-top:1px solid #fff;border-radius:0 0 5px 5px}.site-header-nav{float:right;margin-bottom:-20px}.site-header-nav-item{display:inline-block;padding:6px 10px 15px;margin-left:1.25rem;font-size:1rem;color:#777}.site-footer:after,.site-footer:before{display:table;content:""}.site-header-nav-item:hover{color:#333;text-decoration:none}.site-header-nav-item.selected{color:#333;padding:6px 10px 13px;border-bottom:2px solid #d26911}.site-header-nav-item+.btn-outline{margin-top:-1px;margin-left:20px}.site-footer{position:relative;margin-top:40px;padding-top:40px;padding-bottom:40px;font-size:12px;line-height:1.5;color:#777;border-top:1px solid #eee}.site-footer .copyright{padding-right:20px}.site-footer:after{clear:both}.site-footer .octicon-mark-github{position:absolute;top:38px;left:50%;height:24px;width:24px;margin-left:-12px;font-size:24px;color:#ccc}.site-footer .octicon-mark-github:hover{color:#bbb}.site-footer-links{margin:0;list-style:none}.site-footer-links li{display:inline-block;line-height:16px}.site-footer-links li+li{margin-left:10px}.sns-share{padding:30px 0}.markdown-body h1,.markdown-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.sns-share i{display:inline-block;margin-right:6px}.sns-share i svg{display:inline-block;width:32px;height:32px;fill:#666;cursor:pointer}.sns-share i svg:hover{fill:#1abc9c}.markdown-body{overflow:hidden}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:#c00}.markdown-body .anchor{position:absolute;top:0;left:0;display:block;padding-right:6px;padding-left:30px;margin-left:-30px}.markdown-body .anchor:focus{outline:0}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{position:relative;margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{display:none;color:#000;vertical-align:middle}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{padding-left:8px;margin-left:-30px;text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{display:inline-block}.markdown-body h1 code,.markdown-body h1 tt,.markdown-body h2 code,.markdown-body h2 tt,.markdown-body h3 code,.markdown-body h3 tt,.markdown-body h4 code,.markdown-body h4 tt,.markdown-body h5 code,.markdown-body h5 tt,.markdown-body h6 code,.markdown-body h6 tt{font-size:inherit}.markdown-body h1{font-size:2.25em;line-height:1.2}.markdown-body h1 .anchor{line-height:1}.markdown-body h2{font-size:1.75em;line-height:1.225}.markdown-body h2 .anchor{line-height:1}.markdown-body h3{font-size:1.5em;line-height:1.43}.markdown-body h3 .anchor,.markdown-body h4 .anchor{line-height:1.2}.markdown-body h4{font-size:1.25em}.markdown-body h5 .anchor,.markdown-body h6 .anchor{line-height:1.1}.markdown-body h5{font-size:1em}.markdown-body h6{font-size:1em;color:#777}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body hr{height:4px;padding:0;margin:16px 0;background-color:#e7e7e7;border:0}.markdown-body ol,.markdown-body ul{padding-left:2em}.markdown-body ol.no-list,.markdown-body ul.no-list{padding:0;list-style-type:none}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:16px}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}.markdown-body blockquote{padding:0 15px;color:#777;border-left:4px solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body img{max-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body .emoji{max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid #ddd}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:#333}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before,.markdown-body tt:after,.markdown-body tt:before{letter-spacing:-.2em;content:" "}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:0 0;border:0}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body pre{word-wrap:normal}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body pre code:after,.markdown-body pre code:before,.markdown-body pre tt:after,.markdown-body pre tt:before{content:normal}.markdown-body kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:1px solid #ccc;border-bottom-color:#bbb;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 #bbb;box-shadow:inset 0 -1px 0 #bbb}.pl-c{color:#969896}.pl-c1,.pl-s .pl-v{color:#0086b3}.pl-e,.pl-en{color:#795da3}.pl-s .pl-s1,.pl-smi{color:#333}.pl-ent{color:#63a35c}.pl-k{color:#a71d5d}.pl-pds,.pl-s,.pl-s .pl-pse .pl-s1,.pl-sr,.pl-sr .pl-cce,.pl-sr .pl-sra,.pl-sr .pl-sre{color:#183691}.pl-v{color:#ed6a43}.pl-id{color:#b52a1d}.pl-ii{background-color:#b52a1d;color:#f8f8f8}.pl-sr .pl-cce{color:#63a35c}.pl-ml{color:#693a17}.pl-mh,.pl-mh .pl-en,.pl-ms{color:#1d3e81}.pl-mq{color:teal}.pl-mi{color:#333;font-style:italic}.pl-mb{color:#333}.pl-md{background-color:#ffecec;color:#bd2c00}.pl-mi1{background-color:#eaffea;color:#55a532}.pl-mdr{color:#795da3}.pl-mo{color:#1d3e81}@media screen and (-webkit-min-device-pixel-ratio:2),screen and (max--moz-device-pixel-ratio:2){.context-loader{background:url(../images/min/octocat-spinner-32-EAF2F5.gif) 10px 50% no-repeat #eee;background-size:16px auto}} \ No newline at end of file diff --git a/public/themes/default/css/globals/prism.css b/public/themes/default/css/globals/prism.css new file mode 100755 index 00000000..1603467e --- /dev/null +++ b/public/themes/default/css/globals/prism.css @@ -0,0 +1,98 @@ +code[class*=language-], pre[class*=language-] { + color: #000; + text-shadow: 0 1px #fff; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none +} + +code[class*=language-] ::-moz-selection, code[class*=language-]::-moz-selection, pre[class*=language-] ::-moz-selection, pre[class*=language-]::-moz-selection { + text-shadow: none; + background: #b3d4fc +} + +code[class*=language-] ::selection, code[class*=language-]::selection, pre[class*=language-] ::selection, pre[class*=language-]::selection { + text-shadow: none; + background: #b3d4fc +} + +pre[class*=language-] { + padding: 1em; + margin: .5em 0; + overflow: auto +} + +:not(pre) > code[class*=language-], pre[class*=language-] { + background: #f9f9f9 +} + +:not(pre) > code[class*=language-] { + padding: .1em; + border-radius: .3em +} + +.token.cdata, .token.comment, .token.doctype, .token.prolog { + color: #708090 +} + +.token.punctuation { + color: #999 +} + +.namespace { + opacity: .7 +} + +.token.boolean, .token.constant, .token.deleted, .token.number, .token.property, .token.symbol, .token.tag { + color: #905 +} + +.token.attr-name, .token.builtin, .token.char, .token.inserted, .token.selector, .token.string { + color: #690 +} + +.language-css .token.string, .style .token.string, .token.entity, .token.operator, .token.url { + color: #a67f59; + background: rgba(255, 255, 255, .5) +} + +.token.atrule, .token.attr-value, .token.keyword { + color: #07a +} + +.token.function { + color: #DD4A68 +} + +.token.important, .token.regex, .token.variable { + color: #e90 +} + +.token.bold, .token.important { + font-weight: 700 +} + +.token.italic { + font-style: italic +} + +.token.entity { + cursor: help +} + +@media print { + code[class*=language-], pre[class*=language-] { + text-shadow: none + } +} \ No newline at end of file diff --git a/public/themes/default/css/globals/responsive.css b/public/themes/default/css/globals/responsive.css new file mode 100755 index 00000000..802a39f0 --- /dev/null +++ b/public/themes/default/css/globals/responsive.css @@ -0,0 +1 @@ +.container{width:auto;max-width:1020px;padding-left:20px;padding-right:20px}.mobile-visible{display:none}@media (max-width:60em){.collection-card{width:45%;height:225px}}@media (max-width:50em){.mobile-block{display:block;float:none}.mobile-hidden{display:none}.mobile-visible{display:inline-block}.mobile-md-section{padding:10px 0}.column{width:100%!important;float:none;margin-bottom:1.25rem}.home .banner .collection-head{padding:1rem!important}.collection-head h1.collection-header{font-size:2rem!important}.site-header{padding-bottom:0}.site-header h1{float:none;text-align:center;border-bottom:1px solid #eee;padding-bottom:20px;margin-bottom:20px}.site-header .site-header-nav{float:none;display:block;margin-bottom:0;text-align:center}.site-header .site-header-nav .site-header-nav-item{padding:0 .5rem;margin-left:0;font-size:1rem;height:2rem;line-height:2rem;display:inline-block}.mini-repo-list-item .owner.css-truncate-target,.mini-repo-list-item .repo-and-owner.css-truncate-target{max-width:300px}.markdown-body h1{font-size:2rem}.markdown-body h2{font-size:1.4rem}.markdown-body h3{font-size:1.2rem}.markdown-body h4{font-size:1.1em}.markdown-body h5{font-size:1em}}@media (max-width:35em){.collection-card{width:100%;max-width:350px;margin:10px auto}}@media (max-width:20em){.site-header-nav .site-header-nav-item{min-width:20%}.collection-head .collection-info .meta-info{display:block;margin-top:15px}} \ No newline at end of file diff --git a/public/themes/default/css/pages/index.css b/public/themes/default/css/pages/index.css new file mode 100755 index 00000000..46c30428 --- /dev/null +++ b/public/themes/default/css/pages/index.css @@ -0,0 +1,128 @@ +.home .site-header { + background: #ffffff; + color: #fff +} + + +.home .banner .collection-head { + padding: 4rem 0; + color: #fff; + background: 0 0; + box-shadow: none; + -webkit-box-shadow: none +} + +.home .site-header { + border-bottom: none +} + +.home .site-header h1 a { + color: #777 +} + +.home .site-header .site-header-nav-item { + color: #777 +} + +.home .site-header .site-header-nav-item:hover { + color: #f4645f +} +.banner{ + background-image: url('../../images/header.jpg'); +} + + +a:hover{ + color: #f4645f; + text-decoration: none; +} + +.widget .tag-cloud a { + border: 1px solid #ebebeb; + padding: 2px 7px; + color: #959595; + line-height: 1.2em; + display: inline-block; + margin: 0 7px 7px 0; + -webkit-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; +} + +.widget .tag-cloud a:hover { + color: #ffffff; + background: #f4645f; + border: 1px solid #f4645f; + text-decoration: none; +} + +.tag-cloud{ + padding: 1px 10px; +} + +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; + font-size: 14px; +} + +.pager li { + display: inline; +} + +.pager li>a, .pager li>span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} + +.pager .previous>a, .pager .previous>span { + float: left; +} + + +.demo_search { + display: inline-block; + padding: 6px 10px 15px; + margin-left: 1.25rem; + height:27px; +} + + +.demo_search .demo_sinput { + float:left; + height:19px; + line-height:19px; + padding:3px 5px; + border:#ebebeb 1px solid; + background:white; + color:#888; + font-size:12px; + + width:200px; + display:none; +} + + + + +.icon_search{ + background:url(../../images/search.png) no-repeat 1% 50%; + width:28px; + height:28px; + display:block; + cursor:pointer; +} + +.img-circle { + border-radius: 50%; +} +#author img { + width: 80px; + height: 80px; + top: 2em; +} \ No newline at end of file diff --git a/public/themes/default/css/sections/article.css b/public/themes/default/css/sections/article.css new file mode 100755 index 00000000..e69de29b diff --git a/public/themes/default/css/sections/mini-repo-list.css b/public/themes/default/css/sections/mini-repo-list.css new file mode 100755 index 00000000..c03a9ee9 --- /dev/null +++ b/public/themes/default/css/sections/mini-repo-list.css @@ -0,0 +1,70 @@ +.mini-repo-list .repo-name, .mini-repo-list-item .repo { + font-weight: 700 +} + +.mini-repo-list { + list-style: none +} + +.mini-repo-list > li:first-child .mini-repo-list-item { + border-top: 0 +} + +.mini-repo-list > li:last-child .mini-repo-list-item { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px +} + +.mini-repo-list .no-repo { + padding: 15px; + color: #999; + text-align: center +} + +.mini-repo-list-item { + position: relative; + display: block; + padding: 6px 64px 6px 3px; + font-size: 14px; + border-top: 1px solid #e5e5e5 +} + +.mini-repo-list-item.nostars { + padding: 6px 6px 6px 30px +} + +.mini-repo-list-item:hover { + text-decoration: none +} + +.mini-repo-list-item:hover .owner, .mini-repo-list-item:hover .repo { + text-decoration: underline +} + +.mini-repo-list-item .repo-icon { + float: left; + margin-top: 2px; + margin-left: -20px; + color: #666 +} + +.mini-repo-list-item .owner, .mini-repo-list-item .owner.css-truncate-target, .mini-repo-list-item .repo-and-owner.css-truncate-target { + max-width: 100% +} + +.mini-repo-list-item .stars { + position: absolute; + top: 0; + right: 10px; + margin-top: 6px; + font-size: 12px; + color: #888 +} + +.mini-repo-list-item .repo-description { + display: block; + max-width: 100%; + font-size: 12px; + color: #777; + line-height: 21px +} \ No newline at end of file diff --git a/public/themes/default/css/sections/repo-list.css b/public/themes/default/css/sections/repo-list.css new file mode 100755 index 00000000..80165b53 --- /dev/null +++ b/public/themes/default/css/sections/repo-list.css @@ -0,0 +1,111 @@ +.repo-list-name, .repo-list-name .prefix, .repo-list-name .slash { + font-weight: 400 +} + +.repo-list { + position: relative; + padding-left: 0 +} + +.repo-list .participation-graph { + position: absolute; + right: 0; + bottom: 0; + left: 0; + z-index: -1 +} + +.repo-list .participation-graph.disabled { + display: none +} + +.repo-list .participation-graph .bars { + position: absolute; + bottom: 0 +} + +.repo-list-item { + position: relative; + padding-top: 30px; + padding-bottom: 30px; + list-style: none; + border-bottom: 1px solid #eee +} + +.repo-list-name { + margin: 0 0 8px; + font-size: 20px; + line-height: 1.2 +} + +.repo-list-name:hover { + text-decoration: none; +} + +.repo-list-name .slash { + margin-right: -4px; + margin-left: -4px +} + +.repo-list-description { + max-width: 550px; + margin-top: 8px; + margin-bottom: 0; + font-size: 14px; + color: #666 +} + +.repo-list-stats { + margin-top: 6px; + float: right; + font-size: 12px; + font-weight: 700; + color: #888 +} + +.repo-list-stats .repo-list-stat-item { + margin-left: 8px; + display: inline-block; + color: #888; + text-decoration: none +} + +.repo-list-stats .repo-list-stat-item:hover { + color: #4183c4 +} + +.repo-list-stats .repo-list-stat-item > .octicon { + font-size: 14px +} + +.repo-list-info { + display: inline-block; + height: 100%; + margin-top: 0; + margin-bottom: 0; + font-size: 12px; + color: #888; + vertical-align: middle +} + +.repo-list-info .octicon { + margin-top: -3px; + font-size: 12px; + vertical-align: middle +} + +.repo-list-meta { + display: block; + margin-top: 8px; + margin-bottom: 0; + font-size: 13px; + color: #888 +} + +.repo-list-meta .avatar { + margin-top: -2px +} + +.repo-list-meta a:hover { + text-decoration: none +} \ No newline at end of file diff --git a/public/themes/default/fonts/codropsicons/codropsicons.eot b/public/themes/default/fonts/codropsicons/codropsicons.eot new file mode 100755 index 00000000..f46c7f48 Binary files /dev/null and b/public/themes/default/fonts/codropsicons/codropsicons.eot differ diff --git a/public/themes/default/fonts/codropsicons/codropsicons.svg b/public/themes/default/fonts/codropsicons/codropsicons.svg new file mode 100755 index 00000000..d202d212 --- /dev/null +++ b/public/themes/default/fonts/codropsicons/codropsicons.svg @@ -0,0 +1,24 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/themes/default/fonts/codropsicons/codropsicons.ttf b/public/themes/default/fonts/codropsicons/codropsicons.ttf new file mode 100755 index 00000000..72bed1fc Binary files /dev/null and b/public/themes/default/fonts/codropsicons/codropsicons.ttf differ diff --git a/public/themes/default/fonts/codropsicons/codropsicons.woff b/public/themes/default/fonts/codropsicons/codropsicons.woff new file mode 100755 index 00000000..1003218f Binary files /dev/null and b/public/themes/default/fonts/codropsicons/codropsicons.woff differ diff --git a/public/themes/default/fonts/codropsicons/license.txt b/public/themes/default/fonts/codropsicons/license.txt new file mode 100755 index 00000000..88a5cbc9 --- /dev/null +++ b/public/themes/default/fonts/codropsicons/license.txt @@ -0,0 +1,6 @@ +Icon Set: Font Awesome -- http://fortawesome.github.com/Font-Awesome/ +License: SIL -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL + + +Icon Set: Eco Ico -- http://dribbble.com/shots/665585-Eco-Ico +License: CC0 -- http://creativecommons.org/publicdomain/zero/1.0/ \ No newline at end of file diff --git a/public/themes/default/fonts/font-awesome-4.2.0/css/font-awesome.min.css b/public/themes/default/fonts/font-awesome-4.2.0/css/font-awesome.min.css new file mode 100755 index 00000000..ec53d4d6 --- /dev/null +++ b/public/themes/default/fonts/font-awesome-4.2.0/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.2.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"} \ No newline at end of file diff --git a/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.eot b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.eot new file mode 100755 index 00000000..84677bc0 Binary files /dev/null and b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.eot differ diff --git a/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.svg b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.svg new file mode 100755 index 00000000..d907b25a --- /dev/null +++ b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.ttf b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.ttf new file mode 100755 index 00000000..96a3639c Binary files /dev/null and b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.ttf differ diff --git a/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.woff b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.woff new file mode 100755 index 00000000..628b6a52 Binary files /dev/null and b/public/themes/default/fonts/font-awesome-4.2.0/fonts/fontawesome-webfont.woff differ diff --git a/public/themes/default/images/header.jpg b/public/themes/default/images/header.jpg new file mode 100755 index 00000000..93d95655 Binary files /dev/null and b/public/themes/default/images/header.jpg differ diff --git a/public/themes/keylime/img/ico/120.png b/public/themes/default/images/ico/120.png old mode 100755 new mode 100644 similarity index 100% rename from public/themes/keylime/img/ico/120.png rename to public/themes/default/images/ico/120.png diff --git a/public/themes/keylime/img/ico/152.png b/public/themes/default/images/ico/152.png old mode 100755 new mode 100644 similarity index 100% rename from public/themes/keylime/img/ico/152.png rename to public/themes/default/images/ico/152.png diff --git a/public/themes/keylime/img/ico/32.png b/public/themes/default/images/ico/32.png old mode 100755 new mode 100644 similarity index 100% rename from public/themes/keylime/img/ico/32.png rename to public/themes/default/images/ico/32.png diff --git a/public/themes/keylime/img/ico/60.png b/public/themes/default/images/ico/60.png old mode 100755 new mode 100644 similarity index 100% rename from public/themes/keylime/img/ico/60.png rename to public/themes/default/images/ico/60.png diff --git a/public/themes/keylime/img/ico/72.png b/public/themes/default/images/ico/72.png old mode 100755 new mode 100644 similarity index 100% rename from public/themes/keylime/img/ico/72.png rename to public/themes/default/images/ico/72.png diff --git a/public/themes/default/images/line-transparent.png b/public/themes/default/images/line-transparent.png new file mode 100755 index 00000000..39a0017e Binary files /dev/null and b/public/themes/default/images/line-transparent.png differ diff --git a/public/themes/default/images/magnifier.svg b/public/themes/default/images/magnifier.svg new file mode 100755 index 00000000..45baabff --- /dev/null +++ b/public/themes/default/images/magnifier.svg @@ -0,0 +1,7 @@ + + + + + + diff --git a/public/themes/default/images/octicons-bg.png b/public/themes/default/images/octicons-bg.png new file mode 100755 index 00000000..86eccbcb Binary files /dev/null and b/public/themes/default/images/octicons-bg.png differ diff --git a/public/themes/default/images/octocat-spinner-16px.gif b/public/themes/default/images/octocat-spinner-16px.gif new file mode 100755 index 00000000..91c53284 Binary files /dev/null and b/public/themes/default/images/octocat-spinner-16px.gif differ diff --git a/public/themes/default/images/octocat-spinner-32-EAF2F5.gif b/public/themes/default/images/octocat-spinner-32-EAF2F5.gif new file mode 100755 index 00000000..13cc6553 Binary files /dev/null and b/public/themes/default/images/octocat-spinner-32-EAF2F5.gif differ diff --git a/public/themes/default/images/search.png b/public/themes/default/images/search.png new file mode 100755 index 00000000..4897a3bb Binary files /dev/null and b/public/themes/default/images/search.png differ diff --git a/public/themes/default/js/geopattern.js b/public/themes/default/js/geopattern.js new file mode 100755 index 00000000..9172650c --- /dev/null +++ b/public/themes/default/js/geopattern.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof global?r=global:"undefined"!=typeof self&&(r=self),r.GeoPattern=t()}}(function(){return function t(r,s,e){function i(o,a){if(!s[o]){if(!r[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(n)return n(o,!0);throw new Error("Cannot find module '"+o+"'")}var l=s[o]={exports:{}};r[o][0].call(l.exports,function(t){var s=r[o][1][t];return i(s?s:t)},l,l.exports,t,r,s,e)}return s[o].exports}for(var n="function"==typeof require&&require,o=0;o.5?l/(2-o-a):l/(o+a),o){case r:i=(s-e)/l+(e>s?6:0);break;case s:i=(e-r)/l+2;break;case e:i=(r-s)/l+4}i/=6}return{h:i,s:n,l:h}}function n(t){function r(t,r,s){return 0>s&&(s+=1),s>1&&(s-=1),1/6>s?t+6*(r-t)*s:.5>s?r:2/3>s?t+(r-t)*(2/3-s)*6:t}var s,e,i,n=t.h,o=t.s,a=t.l;if(0===o)s=e=i=a;else{var h=.5>a?a*(1+o):a+o-a*o,l=2*a-h;s=r(l,h,n+1/3),e=r(l,h,n),i=r(l,h,n-1/3)}return{r:Math.round(255*s),g:Math.round(255*e),b:Math.round(255*i)}}r.exports={hex2rgb:s,rgb2hex:e,rgb2hsl:i,hsl2rgb:n,rgb2rgbString:function(t){return"rgb("+[t.r,t.g,t.b].join(",")+")"}}},{}],3:[function(t,r){!function(s){"use strict";function e(t){return function(r,s){return"object"==typeof r&&(s=r,r=null),(null===r||void 0===r)&&(r=(new Date).toString()),s||(s={}),t.call(this,r,s)}}var i=t("./pattern"),n=r.exports={generate:e(function(t,r){return new i(t,r)})};s&&(s.fn.geopattern=e(function(t,r){return this.each(function(){var e=s(this).attr("data-title-sha");e&&(r=s.extend({hash:e},r));var i=n.generate(t,r);s(this).css("background-image",i.toDataUrl())})}))}("undefined"!=typeof jQuery?jQuery:null)},{"./pattern":4}],4:[function(t,r){(function(s){"use strict";function e(t,r,s){return parseInt(t.substr(r,s||1),16)}function i(t,r,s,e,i){var n=parseFloat(t),o=s-r,a=i-e;return(n-r)*a/o+e}function n(t){return t%2===0?C:j}function o(t){return i(t,0,15,M,W)}function a(t){var r=t,s=r/2,e=Math.sin(60*Math.PI/180)*r;return[0,e,s,0,s+r,0,2*r,e,s+r,2*e,s,2*e,0,e].join(",")}function h(t,r){var s=.66*r;return[[0,0,t/2,r-s,t/2,r,0,s,0,0],[t/2,r-s,t,0,t,s,t/2,r,t/2,r-s]].map(function(t){return t.join(",")})}function l(t){return[[t,0,t,3*t],[0,t,3*t,t]]}function c(t){var r=t,s=.33*r;return[s,0,r-s,0,r,s,r,r-s,r-s,r,s,r,0,r-s,0,s,s,0].join(",")}function f(t,r){var s=t/2;return[s,0,t,r,0,r,s,0].join(",")}function u(t,r){return[t/2,0,t,r/2,t/2,r,0,r/2].join(",")}function p(t){return[0,0,t,t,0,t,0,0].join(",")}function g(t,r,s,e,i){var a=p(e),h=o(i[0]),l=n(i[0]),c={stroke:S,"stroke-opacity":A,"fill-opacity":h,fill:l};t.polyline(a,c).transform({translate:[r+e,s],scale:[-1,1]}),t.polyline(a,c).transform({translate:[r+e,s+2*e],scale:[1,-1]}),h=o(i[1]),l=n(i[1]),c={stroke:S,"stroke-opacity":A,"fill-opacity":h,fill:l},t.polyline(a,c).transform({translate:[r+e,s+2*e],scale:[-1,-1]}),t.polyline(a,c).transform({translate:[r+e,s],scale:[1,1]})}function v(t,r,s,e,i){var a=o(i),h=n(i),l=p(e),c={stroke:S,"stroke-opacity":A,"fill-opacity":a,fill:h};t.polyline(l,c).transform({translate:[r,s+e],scale:[1,-1]}),t.polyline(l,c).transform({translate:[r+2*e,s+e],scale:[-1,-1]}),t.polyline(l,c).transform({translate:[r,s+e],scale:[1,1]}),t.polyline(l,c).transform({translate:[r+2*e,s+e],scale:[-1,1]})}function y(t,r){var s=t/2;return[0,0,r,s,0,t,0,0].join(",")}var d=t("extend"),b=t("./color"),m=t("./sha1"),k=t("./svg"),x={baseColor:"#933c3c"},w=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],j="#222",C="#ddd",S="#000",A=.02,M=.02,W=.15,H=r.exports=function(t,r){return this.opts=d({},x,r),this.hash=r.hash||m(t),this.svg=new k,this.generateBackground(),this.generatePattern(),this};H.prototype.toSvg=function(){return this.svg.toString()},H.prototype.toString=function(){return this.toSvg()},H.prototype.toBase64=function(){var t,r=this.toSvg();return t="undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(r):new s(r).toString("base64")},H.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},H.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},H.prototype.generateBackground=function(){var t,r,s,n;this.opts.color?s=b.hex2rgb(this.opts.color):(r=i(e(this.hash,14,3),0,4095,0,359),n=e(this.hash,17),t=b.rgb2hsl(b.hex2rgb(this.opts.baseColor)),t.h=(360*t.h-r+360)%360/360,t.s=n%2===0?Math.min(1,(100*t.s+n)/100):Math.max(0,(100*t.s-n)/100),s=b.hsl2rgb(t)),this.color=b.rgb2hex(s),this.svg.rect(0,0,"100%","100%",{fill:b.rgb2rgbString(s)})},H.prototype.generatePattern=function(){var t=this.opts.generator;if(t){if(w.indexOf(t)<0)throw new Error("The generator "+t+" does not exist.")}else t=w[e(this.hash,20)];return this["geo"+t.slice(0,1).toUpperCase()+t.slice(1)]()},H.prototype.geoHexagons=function(){var t,r,s,h,l,c,f,u,p=e(this.hash,0),g=i(p,0,15,8,60),v=g*Math.sqrt(3),y=2*g,d=a(g);for(this.svg.setWidth(3*y+3*g),this.svg.setHeight(6*v),s=0,u=0;6>u;u++)for(f=0;6>f;f++)c=e(this.hash,s),t=f%2===0?u*v:u*v+v/2,h=o(c),r=n(c),l={fill:r,"fill-opacity":h,stroke:S,"stroke-opacity":A},this.svg.polyline(d,l).transform({translate:[f*g*1.5-y/2,t-v/2]}),0===f&&this.svg.polyline(d,l).transform({translate:[6*g*1.5-y/2,t-v/2]}),0===u&&(t=f%2===0?6*v:6*v+v/2,this.svg.polyline(d,l).transform({translate:[f*g*1.5-y/2,t-v/2]})),0===f&&0===u&&this.svg.polyline(d,l).transform({translate:[6*g*1.5-y/2,5*v+v/2]}),s++},H.prototype.geoSineWaves=function(){var t,r,s,a,h,l,c,f=Math.floor(i(e(this.hash,0),0,15,100,400)),u=Math.floor(i(e(this.hash,1),0,15,30,100)),p=Math.floor(i(e(this.hash,2),0,15,3,30));for(this.svg.setWidth(f),this.svg.setHeight(36*p),r=0;36>r;r++)l=e(this.hash,r),s=o(l),t=n(l),c=f/4*.7,h={fill:"none",stroke:t,opacity:s,"stroke-width":""+p+"px"},a="M0 "+u+" C "+c+" 0, "+(f/2-c)+" 0, "+f/2+" "+u+" S "+(f-c)+" "+2*u+", "+f+" "+u+" S "+(1.5*f-c)+" 0, "+1.5*f+", "+u,this.svg.path(a,h).transform({translate:[-f/4,p*r-1.5*u]}),this.svg.path(a,h).transform({translate:[-f/4,p*r-1.5*u+36*p]})},H.prototype.geoChevrons=function(){var t,r,s,a,l,c,f,u=i(e(this.hash,0),0,15,30,80),p=i(e(this.hash,0),0,15,30,80),g=h(u,p);for(this.svg.setWidth(6*u),this.svg.setHeight(6*p*.66),r=0,f=0;6>f;f++)for(c=0;6>c;c++)l=e(this.hash,r),s=o(l),t=n(l),a={stroke:S,"stroke-opacity":A,fill:t,"fill-opacity":s,"stroke-width":1},this.svg.group(a).transform({translate:[c*u,f*p*.66-p/2]}).polyline(g).end(),0===f&&this.svg.group(a).transform({translate:[c*u,6*p*.66-p/2]}).polyline(g).end(),r+=1},H.prototype.geoPlusSigns=function(){var t,r,s,a,h,c,f,u,p=i(e(this.hash,0),0,15,10,25),g=3*p,v=l(p);for(this.svg.setWidth(12*p),this.svg.setHeight(12*p),s=0,u=0;6>u;u++)for(f=0;6>f;f++)c=e(this.hash,s),a=o(c),r=n(c),t=u%2===0?0:1,h={fill:r,stroke:S,"stroke-opacity":A,"fill-opacity":a},this.svg.group(h).transform({translate:[f*g-f*p+t*p-p,u*g-u*p-g/2]}).rect(v).end(),0===f&&this.svg.group(h).transform({translate:[4*g-f*p+t*p-p,u*g-u*p-g/2]}).rect(v).end(),0===u&&this.svg.group(h).transform({translate:[f*g-f*p+t*p-p,4*g-u*p-g/2]}).rect(v).end(),0===f&&0===u&&this.svg.group(h).transform({translate:[4*g-f*p+t*p-p,4*g-u*p-g/2]}).rect(v).end(),s++},H.prototype.geoXes=function(){var t,r,s,a,h,c,f,u,p=i(e(this.hash,0),0,15,10,25),g=l(p),v=3*p*.943;for(this.svg.setWidth(3*v),this.svg.setHeight(3*v),s=0,u=0;6>u;u++)for(f=0;6>f;f++)c=e(this.hash,s),a=o(c),t=f%2===0?u*v-.5*v:u*v-.5*v+v/4,r=n(c),h={fill:r,opacity:a},this.svg.group(h).transform({translate:[f*v/2-v/2,t-u*v/2],rotate:[45,v/2,v/2]}).rect(g).end(),0===f&&this.svg.group(h).transform({translate:[6*v/2-v/2,t-u*v/2],rotate:[45,v/2,v/2]}).rect(g).end(),0===u&&(t=f%2===0?6*v-v/2:6*v-v/2+v/4,this.svg.group(h).transform({translate:[f*v/2-v/2,t-6*v/2],rotate:[45,v/2,v/2]}).rect(g).end()),5===u&&this.svg.group(h).transform({translate:[f*v/2-v/2,t-11*v/2],rotate:[45,v/2,v/2]}).rect(g).end(),0===f&&0===u&&this.svg.group(h).transform({translate:[6*v/2-v/2,t-6*v/2],rotate:[45,v/2,v/2]}).rect(g).end(),s++},H.prototype.geoOverlappingCircles=function(){var t,r,s,a,h,l,c,f=e(this.hash,0),u=i(f,0,15,25,200),p=u/2;for(this.svg.setWidth(6*p),this.svg.setHeight(6*p),r=0,c=0;6>c;c++)for(l=0;6>l;l++)h=e(this.hash,r),s=o(h),t=n(h),a={fill:t,opacity:s},this.svg.circle(l*p,c*p,p,a),0===l&&this.svg.circle(6*p,c*p,p,a),0===c&&this.svg.circle(l*p,6*p,p,a),0===l&&0===c&&this.svg.circle(6*p,6*p,p,a),r++},H.prototype.geoOctogons=function(){var t,r,s,a,h,l,f=i(e(this.hash,0),0,15,10,60),u=c(f);for(this.svg.setWidth(6*f),this.svg.setHeight(6*f),r=0,l=0;6>l;l++)for(h=0;6>h;h++)a=e(this.hash,r),s=o(a),t=n(a),this.svg.polyline(u,{fill:t,"fill-opacity":s,stroke:S,"stroke-opacity":A}).transform({translate:[h*f,l*f]}),r+=1},H.prototype.geoSquares=function(){var t,r,s,a,h,l,c=i(e(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*c),this.svg.setHeight(6*c),r=0,l=0;6>l;l++)for(h=0;6>h;h++)a=e(this.hash,r),s=o(a),t=n(a),this.svg.rect(h*c,l*c,c,c,{fill:t,"fill-opacity":s,stroke:S,"stroke-opacity":A}),r+=1},H.prototype.geoConcentricCircles=function(){var t,r,s,a,h,l,c=e(this.hash,0),f=i(c,0,15,10,60),u=f/5;for(this.svg.setWidth(6*(f+u)),this.svg.setHeight(6*(f+u)),r=0,l=0;6>l;l++)for(h=0;6>h;h++)a=e(this.hash,r),s=o(a),t=n(a),this.svg.circle(h*f+h*u+(f+u)/2,l*f+l*u+(f+u)/2,f/2,{fill:"none",stroke:t,opacity:s,"stroke-width":u+"px"}),a=e(this.hash,39-r),s=o(a),t=n(a),this.svg.circle(h*f+h*u+(f+u)/2,l*f+l*u+(f+u)/2,f/4,{fill:t,"fill-opacity":s}),r+=1},H.prototype.geoOverlappingRings=function(){var t,r,s,a,h,l,c,f=e(this.hash,0),u=i(f,0,15,10,60),p=u/4;for(this.svg.setWidth(6*u),this.svg.setHeight(6*u),r=0,c=0;6>c;c++)for(l=0;6>l;l++)h=e(this.hash,r),s=o(h),t=n(h),a={fill:"none",stroke:t,opacity:s,"stroke-width":p+"px"},this.svg.circle(l*u,c*u,u-p/2,a),0===l&&this.svg.circle(6*u,c*u,u-p/2,a),0===c&&this.svg.circle(l*u,6*u,u-p/2,a),0===l&&0===c&&this.svg.circle(6*u,6*u,u-p/2,a),r+=1},H.prototype.geoTriangles=function(){var t,r,s,a,h,l,c,u,p=e(this.hash,0),g=i(p,0,15,15,80),v=g/2*Math.sqrt(3),y=f(g,v);for(this.svg.setWidth(3*g),this.svg.setHeight(6*v),r=0,u=0;6>u;u++)for(c=0;6>c;c++)l=e(this.hash,r),s=o(l),t=n(l),h={fill:t,"fill-opacity":s,stroke:S,"stroke-opacity":A},a=u%2===0?c%2===0?180:0:c%2!==0?180:0,this.svg.polyline(y,h).transform({translate:[c*g*.5-g/2,v*u],rotate:[a,g/2,v/2]}),0===c&&this.svg.polyline(y,h).transform({translate:[6*g*.5-g/2,v*u],rotate:[a,g/2,v/2]}),r+=1},H.prototype.geoDiamonds=function(){var t,r,s,a,h,l,c,f,p=i(e(this.hash,0),0,15,10,50),g=i(e(this.hash,1),0,15,10,50),v=u(p,g);for(this.svg.setWidth(6*p),this.svg.setHeight(3*g),s=0,f=0;6>f;f++)for(c=0;6>c;c++)l=e(this.hash,s),a=o(l),r=n(l),h={fill:r,"fill-opacity":a,stroke:S,"stroke-opacity":A},t=f%2===0?0:p/2,this.svg.polyline(v,h).transform({translate:[c*p-p/2+t,g/2*f-g/2]}),0===c&&this.svg.polyline(v,h).transform({translate:[6*p-p/2+t,g/2*f-g/2]}),0===f&&this.svg.polyline(v,h).transform({translate:[c*p-p/2+t,g/2*6-g/2]}),0===c&&0===f&&this.svg.polyline(v,h).transform({translate:[6*p-p/2+t,g/2*6-g/2]}),s+=1},H.prototype.geoNestedSquares=function(){var t,r,s,a,h,l,c,f=i(e(this.hash,0),0,15,4,12),u=7*f;for(this.svg.setWidth(6*(u+f)+6*f),this.svg.setHeight(6*(u+f)+6*f),r=0,c=0;6>c;c++)for(l=0;6>l;l++)h=e(this.hash,r),s=o(h),t=n(h),a={fill:"none",stroke:t,opacity:s,"stroke-width":f+"px"},this.svg.rect(l*u+l*f*2+f/2,c*u+c*f*2+f/2,u,u,a),h=e(this.hash,39-r),s=o(h),t=n(h),a={fill:"none",stroke:t,opacity:s,"stroke-width":f+"px"},this.svg.rect(l*u+l*f*2+f/2+2*f,c*u+c*f*2+f/2+2*f,3*f,3*f,a),r+=1},H.prototype.geoMosaicSquares=function(){var t,r,s,n=i(e(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*n),this.svg.setHeight(8*n),t=0,s=0;4>s;s++)for(r=0;4>r;r++)r%2===0?s%2===0?v(this.svg,r*n*2,s*n*2,n,e(this.hash,t)):g(this.svg,r*n*2,s*n*2,n,[e(this.hash,t),e(this.hash,t+1)]):s%2===0?g(this.svg,r*n*2,s*n*2,n,[e(this.hash,t),e(this.hash,t+1)]):v(this.svg,r*n*2,s*n*2,n,e(this.hash,t)),t+=1},H.prototype.geoPlaid=function(){var t,r,s,i,a,h,l,c=0,f=0;for(r=0;36>r;)i=e(this.hash,r),c+=i+5,l=e(this.hash,r+1),s=o(l),t=n(l),a=l+5,this.svg.rect(0,c,"100%",a,{opacity:s,fill:t}),c+=a,r+=2;for(r=0;36>r;)i=e(this.hash,r),f+=i+5,l=e(this.hash,r+1),s=o(l),t=n(l),h=l+5,this.svg.rect(f,0,h,"100%",{opacity:s,fill:t}),f+=h,r+=2;this.svg.setWidth(f),this.svg.setHeight(c)},H.prototype.geoTessellation=function(){var t,r,s,a,h,l=i(e(this.hash,0),0,15,5,40),c=l*Math.sqrt(3),f=2*l,u=l/2*Math.sqrt(3),p=y(l,u),g=3*l+2*u,v=2*c+2*l;for(this.svg.setWidth(g),this.svg.setHeight(v),r=0;20>r;r++)switch(h=e(this.hash,r),s=o(h),t=n(h),a={stroke:S,"stroke-opacity":A,fill:t,"fill-opacity":s,"stroke-width":1},r){case 0:this.svg.rect(-l/2,-l/2,l,l,a),this.svg.rect(g-l/2,-l/2,l,l,a),this.svg.rect(-l/2,v-l/2,l,l,a),this.svg.rect(g-l/2,v-l/2,l,l,a);break;case 1:this.svg.rect(f/2+u,c/2,l,l,a);break;case 2:this.svg.rect(-l/2,v/2-l/2,l,l,a),this.svg.rect(g-l/2,v/2-l/2,l,l,a);break;case 3:this.svg.rect(f/2+u,1.5*c+l,l,l,a);break;case 4:this.svg.polyline(p,a).transform({translate:[l/2,-l/2],rotate:[0,l/2,u/2]}),this.svg.polyline(p,a).transform({translate:[l/2,v- -l/2],rotate:[0,l/2,u/2],scale:[1,-1]});break;case 5:this.svg.polyline(p,a).transform({translate:[g-l/2,-l/2],rotate:[0,l/2,u/2],scale:[-1,1]}),this.svg.polyline(p,a).transform({translate:[g-l/2,v+l/2],rotate:[0,l/2,u/2],scale:[-1,-1]});break;case 6:this.svg.polyline(p,a).transform({translate:[g/2+l/2,c/2]});break;case 7:this.svg.polyline(p,a).transform({translate:[g-g/2-l/2,c/2],scale:[-1,1]});break;case 8:this.svg.polyline(p,a).transform({translate:[g/2+l/2,v-c/2],scale:[1,-1]});break;case 9:this.svg.polyline(p,a).transform({translate:[g-g/2-l/2,v-c/2],scale:[-1,-1]});break;case 10:this.svg.polyline(p,a).transform({translate:[l/2,v/2-l/2]});break;case 11:this.svg.polyline(p,a).transform({translate:[g-l/2,v/2-l/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,l,l,a).transform({translate:[l/2,l/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,l,l,a).transform({scale:[-1,1],translate:[-g+l/2,l/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,l,l,a).transform({translate:[l/2,v/2-l/2-l],rotate:[30,0,l]});break;case 15:this.svg.rect(0,0,l,l,a).transform({scale:[-1,1],translate:[-g+l/2,v/2-l/2-l],rotate:[30,0,l]});break;case 16:this.svg.rect(0,0,l,l,a).transform({scale:[1,-1],translate:[l/2,-v+v/2-l/2-l],rotate:[30,0,l]});break;case 17:this.svg.rect(0,0,l,l,a).transform({scale:[-1,-1],translate:[-g+l/2,-v+v/2-l/2-l],rotate:[30,0,l]});break;case 18:this.svg.rect(0,0,l,l,a).transform({scale:[1,-1],translate:[l/2,-v+l/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,l,l,a).transform({scale:[-1,-1],translate:[-g+l/2,-v+l/2],rotate:[-30,0,0]})}}}).call(this,t("buffer").Buffer)},{"./color":2,"./sha1":5,"./svg":6,buffer:8,extend:9}],5:[function(t,r){"use strict";function s(){function t(){for(var t=16;80>t;t++){var r=f[t-3]^f[t-8]^f[t-14]^f[t-16];f[t]=r<<1|r>>>31}var s,e,i=o,n=a,p=h,g=l,v=c;for(t=0;80>t;t++){20>t?(s=g^n&(p^g),e=1518500249):40>t?(s=n^p^g,e=1859775393):60>t?(s=n&p|g&(n|p),e=2400959708):(s=n^p^g,e=3395469782);var y=(i<<5|i>>>27)+s+v+e+(0|f[t]);v=g,g=p,p=n<<30|n>>>2,n=i,i=y}for(o=o+i|0,a=a+n|0,h=h+p|0,l=l+g|0,c=c+v|0,u=0,t=0;16>t;t++)f[t]=0}function r(r){f[u]|=(255&r)<e;e++)r(t.charCodeAt(e))}function e(t){if("string"==typeof t)return s(t);var e=t.length;g+=8*e;for(var i=0;e>i;i++)r(t[i])}function i(t){for(var r="",s=28;s>=0;s-=4)r+=(t>>s&15).toString(16);return r}function n(){r(128),(u>14||14===u&&24>p)&&t(),u=14,p=24,r(0),r(0),r(g>0xffffffffff?g/1099511627776:0),r(g>4294967295?g/4294967296:0);for(var s=24;s>=0;s-=8)r(g>>s);return i(o)+i(a)+i(h)+i(l)+i(c)}var o=1732584193,a=4023233417,h=2562383102,l=271733878,c=3285377520,f=new Uint32Array(80),u=0,p=24,g=0;return{update:e,digest:n}}r.exports=function(t){if(void 0===t)return s();var r=s();return r.update(t),r.digest()}},{}],6:[function(t,r){"use strict";function s(){return this.width=100,this.height=100,this.svg=new i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}var e=t("extend"),i=t("./xml");r.exports=s,s.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},s.prototype.end=function(){return this.context.pop(),this},s.prototype.currentNode=function(){var t=this.currentContext();return t.lastChild||t},s.prototype.transform=function(t){return this.currentNode().setAttribute("transform",Object.keys(t).map(function(r){return r+"("+t[r].join(",")+")"}).join(" ")),this},s.prototype.setAttributes=function(t,r){Object.keys(r).forEach(function(s){t.setAttribute(s,r[s])})},s.prototype.setWidth=function(t){this.svg.setAttribute("width",Math.floor(t))},s.prototype.setHeight=function(t){this.svg.setAttribute("height",Math.floor(t))},s.prototype.toString=function(){return this.svg.toString()},s.prototype.rect=function(t,r,s,n,o){var a=this;if(Array.isArray(t))return t.forEach(function(t){a.rect.apply(a,t.concat(o))}),this;var h=new i("rect");return this.currentContext().appendChild(h),this.setAttributes(h,e({x:t,y:r,width:s,height:n},o)),this},s.prototype.circle=function(t,r,s,n){var o=new i("circle");return this.currentContext().appendChild(o),this.setAttributes(o,e({cx:t,cy:r,r:s},n)),this},s.prototype.path=function(t,r){var s=new i("path");return this.currentContext().appendChild(s),this.setAttributes(s,e({d:t},r)),this},s.prototype.polyline=function(t,r){var s=this;if(Array.isArray(t))return t.forEach(function(t){s.polyline(t,r)}),this;var n=new i("polyline");return this.currentContext().appendChild(n),this.setAttributes(n,e({points:t},r)),this},s.prototype.group=function(t){var r=new i("g");return this.currentContext().appendChild(r),this.context.push(r),this.setAttributes(r,e({},t)),this}},{"./xml":7,extend:9}],7:[function(t,r){"use strict";var s=r.exports=function(t){return this instanceof s?(this.tagName=t,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new s(t)};s.prototype.appendChild=function(t){return this.children.push(t),this.lastChild=t,this},s.prototype.setAttribute=function(t,r){return this.attributes[t]=r,this},s.prototype.toString=function(){var t=this;return["<",t.tagName,Object.keys(t.attributes).map(function(r){return[" ",r,'="',t.attributes[r],'"'].join("")}).join(""),">",t.children.map(function(t){return t.toString()}).join(""),""].join("")}},{}],8:[function(){},{}],9:[function(t,r){function s(t){if(!t||"[object Object]"!==i.call(t)||t.nodeType||t.setInterval)return!1;var r=e.call(t,"constructor"),s=e.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!s)return!1;var n;for(n in t);return void 0===n||e.call(t,n)}var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString;r.exports=function n(){var t,r,e,i,o,a,h=arguments[0]||{},l=1,c=arguments.length,f=!1;for("boolean"==typeof h&&(f=h,h=arguments[1]||{},l=2),"object"!=typeof h&&"function"!=typeof h&&(h={});c>l;l++)if(null!=(t=arguments[l]))for(r in t)e=h[r],i=t[r],h!==i&&(f&&i&&(s(i)||(o=Array.isArray(i)))?(o?(o=!1,a=e&&Array.isArray(e)?e:[]):a=e&&s(e)?e:{},h[r]=n(f,a,i)):void 0!==i&&(h[r]=i));return h}},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/public/themes/default/js/prism.js b/public/themes/default/js/prism.js new file mode 100755 index 00000000..37340c9e --- /dev/null +++ b/public/themes/default/js/prism.js @@ -0,0 +1 @@ +self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{};var Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(m instanceof a)){u.lastIndex=0;var h=u.exec(m);if(h){p&&(g=h[1].length);var b=h.index-1+g,h=h[0].slice(g),w=h.length,y=b+w,k=m.slice(0,b+1),P=m.slice(y+1),v=[f,1];k&&v.push(k);var _=new a(s,c?t.tokenize(h,c):h,d);v.push(_),P&&v.push(P),Array.prototype.splice.apply(i,v)}}}}}return i},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var i,r=0;i=a[r++];)i(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,i){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var r={type:e.type,content:n.stringify(e.content,a,i),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:i};if("comment"==r.type&&(r.attributes.spellcheck="true"),e.alias){var s="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(r.classes,s)}t.hooks.run("wrap",r);var o="";for(var l in r.attributes)o+=l+'="'+(r.attributes[l]||"")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'" '+o+">"+r.content+""},!self.document)return self.addEventListener?(self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,i=n.code;self.postMessage(JSON.stringify(t.util.encode(t.tokenize(i,t.languages[a])))),self.close()},!1),self.Prism):self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),Prism.languages.markup={comment://,prolog:/<\?.+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/i,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/=|>|"/}},punctuation:/\/?>/,"attr-name":{pattern:/[\w:-]+/,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{punctuation:/[;:]/}},url:/url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/,string:/("|')(\\\n|\\?.)*?\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,punctuation:/[\{\};:]/,"function":/[-a-z0-9]+(?=\()/i},Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\\n|\\?.)*?\1/,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":{pattern:/[a-z0-9_]+\(/i,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/,ignore:/&(lt|gt|amp);/i,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/,"function":/(?!\d)[a-z0-9_$]+(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}}),Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+(?:\(.*\))?/,"class":/\.[-:\.\w]+/,id:/#[-:\.\w]+/}},Prism.languages.insertBefore("css","function",{hexcode:/#[\da-f]{3,6}/i,entity:/\\[\da-f]{1,8}/i,number:/[\d%\.]+/}),Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/,lookbehind:!0}}),Prism.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*?(\r?\n|$)/,lookbehind:!0,alias:"comment"}}),Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>|<\?php|<\?)/i,variable:/(\$\w+)\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(e){"php"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(t){return e.tokenStack.push(t),"{{{PHP"+e.tokenStack.length+"}}}"}))}),Prism.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),Prism.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t,n=0;t=e.tokenStack[n];n++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(n+1)+"}}}",Prism.highlight(t,e.grammar,"php"));e.element.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),Prism.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),Prism.languages.insertBefore("php","variable",{"this":/\$this/,global:/\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}}}),Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/i,url:/([-a-z]+-)*url(?=\()/i,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m}),Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i}),Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i}),Prism.languages.insertBefore("scss","function",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/i,"boolean":/\b(true|false)\b/,"null":/\b(null)\b/,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/}),Prism.languages.swift=Prism.languages.extend("clike",{keyword:/\b(as|associativity|break|case|class|continue|convenience|default|deinit|didSet|do|dynamicType|else|enum|extension|fallthrough|final|for|func|get|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|required|return|right|safe|self|Self|set|static|struct|subscript|super|switch|Type|typealias|unowned|unowned|unsafe|var|weak|where|while|willSet|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\b/,number:/\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(IBOutlet|IBDesignable|IBAction|IBInspectable|class_protocol|exported|noreturn|NSCopying|NSManaged|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b([A-Z]\S+|abs|advance|alignof|alignofValue|assert|contains|count|countElements|debugPrint|debugPrintln|distance|dropFirst|dropLast|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lazy|lexicographicalCompare|map|max|maxElement|min|minElement|numericCast|overlaps|partition|prefix|print|println|reduce|reflect|reverse|sizeof|sizeofValue|sort|sorted|split|startsWith|stride|strideof|strideofValue|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|withExtendedLifetime|withUnsafeMutablePointer|withUnsafeMutablePointers|withUnsafePointer|withUnsafePointers|withVaList)\b/}),Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:(\n[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#[^\n]+/,key:{pattern:/(\s*[:\-,[{\n?][ \t]*(![^\s]+)?[ \t]*)[^\n{[\]},#]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/((^|\n)[ \t]*)%[^\n]+/,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*(\n|$|,|]|}))/,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=\n|$|,|]|})/i,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=\n|$|,|]|})/i,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')(?=[ \t]*(\n|$|,|]|}))/,lookbehind:!0},number:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\dA-Fa-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=\n|$|,|]|})/i,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/([:[\]{}\-,|>?]|---|\.\.\.)/}; \ No newline at end of file diff --git a/public/themes/default/vendor/jquery/MIT-LICENSE.txt b/public/themes/default/vendor/jquery/MIT-LICENSE.txt new file mode 100755 index 00000000..cdd31b5c --- /dev/null +++ b/public/themes/default/vendor/jquery/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +Copyright 2014 jQuery Foundation and other contributors +http://jquery.com/ + +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. diff --git a/public/themes/default/vendor/jquery/bower.json b/public/themes/default/vendor/jquery/bower.json new file mode 100755 index 00000000..0c80cd53 --- /dev/null +++ b/public/themes/default/vendor/jquery/bower.json @@ -0,0 +1,28 @@ +{ + "name": "jquery", + "version": "2.1.4", + "main": "dist/jquery.js", + "license": "MIT", + "ignore": [ + "**/.*", + "build", + "dist/cdn", + "speed", + "test", + "*.md", + "AUTHORS.txt", + "Gruntfile.js", + "package.json" + ], + "devDependencies": { + "sizzle": "2.1.1-jquery.2.1.2", + "requirejs": "2.1.10", + "qunit": "1.14.0", + "sinon": "1.8.1" + }, + "keywords": [ + "jquery", + "javascript", + "library" + ] +} diff --git a/public/themes/default/vendor/jquery/dist/jquery.js b/public/themes/default/vendor/jquery/dist/jquery.js new file mode 100755 index 00000000..eed17778 --- /dev/null +++ b/public/themes/default/vendor/jquery/dist/jquery.js @@ -0,0 +1,9210 @@ +/*! + * jQuery JavaScript Library v2.1.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-04-28T16:01Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +// + +var arr = []; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + version = "2.1.4", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; + }, + + isPlainObject: function( obj ) { + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.constructor && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + // Support: Android<4.0, iOS<6 (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call(obj) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + var script, + indirect = eval; + + code = jQuery.trim( code ); + + if ( code ) { + // If the code includes a valid, prologue position + // strict mode pragma, execute code by injecting a + // script tag into the document. + if ( code.indexOf("use strict") === 1 ) { + script = document.createElement("script"); + script.text = code; + document.head.appendChild( script ).parentNode.removeChild( script ); + } else { + // Otherwise, avoid the DOM node creation, insertion + // and removal by using an indirect global eval + indirect( code ); + } + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE9-11+ + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Support: Android<4.1 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.0-pre + * http://sizzlejs.com/ + * + * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-12-16 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + characterEncoding + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + nodeType = context.nodeType; + + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + if ( !seed && documentIsHTML ) { + + // Try to shortcut find operations when possible (e.g., not under DocumentFragment) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document (jQuery #6963) + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + nid = old = expando; + newContext = context; + newSelector = nodeType !== 1 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = attrs.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + parent = doc.defaultView; + + // Support: IE>8 + // If iframe document is assigned to "document" variable and if iframe has been reloaded, + // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 + // IE6-8 do not support the defaultView property so parent will be undefined + if ( parent && parent !== parent.top ) { + // IE11 does not have attachEvent, so all must suffer + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Support tests + ---------------------------------------------------------------------- */ + documentIsHTML = !isXML( doc ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = doc.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return doc; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (oldCache = outerCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + outerCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context !== document && context; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is no seed and only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + }); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + }); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; + }); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + })); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var i, + len = this.length, + ret = [], + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow(this, selector || [], false) ); + }, + not: function( selector ) { + return this.pushStack( winnow(this, selector || [], true) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +}); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Support: Blackberry 4.6 + // gEBID returns nodes no longer in the document (#6963) + if ( elem && elem.parentNode ) { + // Inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof rootjQuery.ready !== "undefined" ? + rootjQuery.ready( selector ) : + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.extend({ + dir: function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; + }, + + sibling: function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; + } +}); + +jQuery.fn.extend({ + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter(function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments + if ( cur.nodeType < 11 && (pos ? + pos.index(cur) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector(cur, selectors)) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.unique( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +function sibling( cur, dir ) { + while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.unique( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +}); +var rnotwhite = (/\S+/g); + + + +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + firingLength = 0; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( list && ( !fired || stack ) ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // Add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // If we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend({ + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +}); + +/** + * The ready event handler and self cleanup method + */ +function completed() { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + jQuery.ready(); +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // We once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + } else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + len ? fn( elems[0], key ) : emptyGet; +}; + + +/** + * Determines whether an object can have data + */ +jQuery.acceptData = function( owner ) { + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + /* jshint -W018 */ + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + +function Data() { + // Support: Android<4, + // Old WebKit does not have Object.preventExtensions/freeze method, + // return new empty object instead with no [[set]] accessor + Object.defineProperty( this.cache = {}, 0, { + get: function() { + return {}; + } + }); + + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; +Data.accepts = jQuery.acceptData; + +Data.prototype = { + key: function( owner ) { + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return the key for a frozen object. + if ( !Data.accepts( owner ) ) { + return 0; + } + + var descriptor = {}, + // Check if the owner object already has a cache key + unlock = owner[ this.expando ]; + + // If not, create one + if ( !unlock ) { + unlock = Data.uid++; + + // Secure it in a non-enumerable, non-writable property + try { + descriptor[ this.expando ] = { value: unlock }; + Object.defineProperties( owner, descriptor ); + + // Support: Android<4 + // Fallback to a less secure definition + } catch ( e ) { + descriptor[ this.expando ] = unlock; + jQuery.extend( owner, descriptor ); + } + } + + // Ensure the cache object + if ( !this.cache[ unlock ] ) { + this.cache[ unlock ] = {}; + } + + return unlock; + }, + set: function( owner, data, value ) { + var prop, + // There may be an unlock assigned to this node, + // if there is no entry for this "owner", create one inline + // and set the unlock as though an owner entry had always existed + unlock = this.key( owner ), + cache = this.cache[ unlock ]; + + // Handle: [ owner, key, value ] args + if ( typeof data === "string" ) { + cache[ data ] = value; + + // Handle: [ owner, { properties } ] args + } else { + // Fresh assignments by object are shallow copied + if ( jQuery.isEmptyObject( cache ) ) { + jQuery.extend( this.cache[ unlock ], data ); + // Otherwise, copy the properties one-by-one to the cache object + } else { + for ( prop in data ) { + cache[ prop ] = data[ prop ]; + } + } + } + return cache; + }, + get: function( owner, key ) { + // Either a valid cache is found, or will be created. + // New caches will be created and the unlock returned, + // allowing direct access to the newly created + // empty data object. A valid owner object must be provided. + var cache = this.cache[ this.key( owner ) ]; + + return key === undefined ? + cache : cache[ key ]; + }, + access: function( owner, key, value ) { + var stored; + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ((key && typeof key === "string") && value === undefined) ) { + + stored = this.get( owner, key ); + + return stored !== undefined ? + stored : this.get( owner, jQuery.camelCase(key) ); + } + + // [*]When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, name, camel, + unlock = this.key( owner ), + cache = this.cache[ unlock ]; + + if ( key === undefined ) { + this.cache[ unlock ] = {}; + + } else { + // Support array or space separated string of keys + if ( jQuery.isArray( key ) ) { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = key.concat( key.map( jQuery.camelCase ) ); + } else { + camel = jQuery.camelCase( key ); + // Try the string as a key before any manipulation + if ( key in cache ) { + name = [ key, camel ]; + } else { + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + name = camel; + name = name in cache ? + [ name ] : ( name.match( rnotwhite ) || [] ); + } + } + + i = name.length; + while ( i-- ) { + delete cache[ name[ i ] ]; + } + } + }, + hasData: function( owner ) { + return !jQuery.isEmptyObject( + this.cache[ owner[ this.expando ] ] || {} + ); + }, + discard: function( owner ) { + if ( owner[ this.expando ] ) { + delete this.cache[ owner[ this.expando ] ]; + } + } +}; +var data_priv = new Data(); + +var data_user = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + data_user.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend({ + hasData: function( elem ) { + return data_user.hasData( elem ) || data_priv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return data_user.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + data_user.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to data_priv methods, these can be deprecated. + _data: function( elem, name, data ) { + return data_priv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + data_priv.remove( elem, name ); + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = data_user.get( elem ); + + if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + data_priv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + data_user.set( this, key ); + }); + } + + return access( this, function( value ) { + var data, + camelKey = jQuery.camelCase( key ); + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + // Attempt to get data from the cache + // with the key as-is + data = data_user.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to get data from the cache + // with the key camelized + data = data_user.get( elem, camelKey ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, camelKey, undefined ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each(function() { + // First, attempt to store a copy or reference of any + // data that might've been store with a camelCased key. + var data = data_user.get( this, camelKey ); + + // For HTML5 data-* attribute interop, we have to + // store property names with dashes in a camelCase form. + // This might not apply to all properties...* + data_user.set( this, camelKey, value ); + + // *... In the case of properties that might _actually_ + // have dashes, we need to also store a copy of that + // unchanged property. + if ( key.indexOf("-") !== -1 && data !== undefined ) { + data_user.set( this, key, value ); + } + }); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each(function() { + data_user.remove( this, key ); + }); + } +}); + + +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = data_priv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = data_priv.access( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return data_priv.get( elem, key ) || data_priv.access( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + data_priv.remove( elem, [ type + "queue", key ] ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = data_priv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + }; + +var rcheckableType = (/^(?:checkbox|radio)$/i); + + + +(function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Safari<=5.1 + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari<=5.1, Android<4.2 + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<=11+ + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +})(); +var strundefined = typeof undefined; + + + +support.focusinBubbles = "onfocusin" in window; + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = data_priv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = data_priv.hasData( elem ) && data_priv.get( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + data_priv.remove( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && jQuery.acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && + jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: Cordova 2.5 (WebKit) (#13255) + // All events should have a target; Cordova deviceready doesn't + if ( !event.target ) { + event.target = document; + } + + // Support: Safari 6.0+, Chrome<28 + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } +}; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + // Support: Android<4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && e.preventDefault ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && e.stopPropagation ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// Support: Chrome 15+ +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// Support: Firefox, Chrome, Safari +// Create "bubbling" focus and blur events +if ( !support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = data_priv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = data_priv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + data_priv.remove( doc, fix ); + + } else { + data_priv.access( doc, fix, attaches ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +}); + + +var + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rhtml = /<|&#?\w+;/, + rnoInnerhtml = /<(?:script|style|link)/i, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /^$|\/(?:java|ecma)script/i, + rscriptTypeMasked = /^true\/(.*)/, + rcleanScript = /^\s*\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + + // Support: IE9 + option: [ 1, "" ], + + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] + }; + +// Support: IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: 1.x compatibility +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName("tbody")[0] || + elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute("type"); + } + + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + data_priv.set( + elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) + ); + } +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( data_priv.hasData( src ) ) { + pdataOld = data_priv.access( src ); + pdataCur = data_priv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( data_user.hasData( src ) ) { + udataOld = data_user.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + data_user.set( dest, udataCur ); + } +} + +function getAll( context, tag ) { + var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : + context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : + []; + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], ret ) : + ret; +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + // Support: QtWebKit, PhantomJS + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: QtWebKit, PhantomJS + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; + }, + + cleanData: function( elems ) { + var data, elem, type, key, + special = jQuery.event.special, + i = 0; + + for ( ; (elem = elems[ i ]) !== undefined; i++ ) { + if ( jQuery.acceptData( elem ) ) { + key = elem[ data_priv.expando ]; + + if ( key && (data = data_priv.cache[ key ]) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + if ( data_priv.cache[ key ] ) { + // Discard any remaining `private` data + delete data_priv.cache[ key ]; + } + } + } + // Discard any remaining `user` data + delete data_user.cache[ elem[ data_user.expando ] ]; + } + } +}); + +jQuery.fn.extend({ + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each(function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + }); + }, null, value, arguments.length ); + }, + + append: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + remove: function( selector, keepData /* Internal Use Only */ ) { + var elem, + elems = selector ? jQuery.filter( selector, this ) : this, + i = 0; + + for ( ; (elem = elems[i]) != null; i++ ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map(function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var arg = arguments[ 0 ]; + + // Make the changes, replacing each context element with the new content + this.domManip( arguments, function( elem ) { + arg = this.parentNode; + + jQuery.cleanData( getAll( this ) ); + + if ( arg ) { + arg.replaceChild( elem, this ); + } + }); + + // Force removal if there was no new content (e.g., from empty arguments) + return arg && (arg.length || arg.nodeType) ? this : this.remove(); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, callback ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + self.domManip( args, callback ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + // Support: QtWebKit + // jQuery.merge because push.apply(_, arraylike) throws + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( this[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); + } + } + } + } + } + } + + return this; + } +}); + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: QtWebKit + // .get() because push.apply(_, arraylike) throws + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + + +var iframe, + elemdisplay = {}; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var style, + elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + // getDefaultComputedStyle might be reliably used only on attached element + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + + // Use of this method is a temporary fix (more like optimization) until something better comes along, + // since it was removed from specification and supported only in FF + style.display : jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = (iframe || jQuery( "