将搜索放在了书签页面里面,点详情的时候弹出
This commit is contained in:
parent
e1a6b26b1d
commit
b31a121126
|
|
@ -0,0 +1,9 @@
|
|||
/*!
|
||||
* # Semantic UI 0.0.2 - Calendar
|
||||
* http://github.com/semantic-org/semantic-ui/
|
||||
*
|
||||
*
|
||||
* Released under the MIT license
|
||||
* http://opensource.org/licenses/MIT
|
||||
*
|
||||
*/.ui.calendar .ui.popup{max-width:none;padding:0;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui.calendar .calendar:focus{outline:0}.ui.calendar .ui.table.minute,.ui.calendar .ui.table.month,.ui.calendar .ui.table.year{min-width:15em}.ui.calendar .ui.table.day{min-width:18em}.ui.calendar .ui.table.hour{min-width:20em}.ui.calendar .ui.table tr td,.ui.calendar .ui.table tr th{padding:.5em;white-space:nowrap}.ui.calendar .ui.table tr th{border-left:none}.ui.calendar .ui.table tr th .icon{margin:0}.ui.calendar .ui.table tr:first-child th{position:relative;padding-left:0;padding-right:0}.ui.calendar .ui.table.day tr:first-child th{border:none}.ui.calendar .ui.table.day tr:nth-child(2) th{padding-top:.2em;padding-bottom:.3em}.ui.calendar .ui.table tr td{padding-left:.1em;padding-right:.1em}.ui.calendar .ui.table tr .link{cursor:pointer}.ui.calendar .ui.table tr .prev.link{width:14.28571429%;position:absolute;left:0}.ui.calendar .ui.table tr .next.link{width:14.28571429%;position:absolute;right:0}.ui.calendar .ui.table tr .disabled{pointer-events:none;color:rgba(40,40,40,.3)}.ui.calendar .ui.table tr td.today{font-weight:700}.ui.calendar .ui.table tr td.range{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95);box-shadow:none}.ui.calendar .ui.table.inverted tr td.range{background:rgba(255,255,255,.08);color:#fff;box-shadow:none}.ui.calendar .calendar.active .ui.table tbody tr td.focus,.ui.calendar .calendar.active .ui.table.inverted tbody tr td.focus,.ui.calendar .calendar:focus .ui.table tbody tr td.focus,.ui.calendar .calendar:focus .ui.table.inverted tbody tr td.focus{box-shadow:inset 0 0 0 1px #85B7D9}
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="bookmark">
|
||||
<meta name="author" content="luchenqun">
|
||||
<title>我的书签</title>
|
||||
<link href="/css/externe/semantic.min.css " rel="stylesheet"/>
|
||||
<link href="/css/style.css " rel="stylesheet"/>
|
||||
<link href="/css/externe/semantic.min.css " rel="stylesheet" />
|
||||
<link href="/css/externe/calendar.min.css" rel="stylesheet" />
|
||||
<link href="/css/style.css " rel="stylesheet" />
|
||||
|
||||
<base href="/">
|
||||
</head>
|
||||
<body ng-app="bookmarkApp">
|
||||
</head>
|
||||
|
||||
<body ng-app="bookmarkApp">
|
||||
<div class="ui container ">
|
||||
<!-- directive:菜单 -->
|
||||
<menus></menus>
|
||||
|
|
@ -35,5 +39,7 @@
|
|||
<script src="/scripts/controllers/menus-controller.js"></script>
|
||||
<script src="/scripts/controllers/edit-controller.js"></script>
|
||||
<script src="/scripts/externe/semantic.min.js"></script>
|
||||
</body>
|
||||
<script src="/scripts/externe/calendar.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ app.config(function($stateProvider, $urlRouterProvider) {
|
|||
.state('bookmarks', {
|
||||
url: '/bookmarks',
|
||||
templateUrl: '/views/bookmarks.html',
|
||||
params: {
|
||||
foo: null,
|
||||
bar: null
|
||||
},
|
||||
controller: 'bookmarksCtr'
|
||||
|
||||
})
|
||||
.state('addBookmark', {
|
||||
url: '/addBookmark',
|
||||
|
|
@ -35,10 +40,6 @@ app.config(function($stateProvider, $urlRouterProvider) {
|
|||
url: '/intro',
|
||||
templateUrl: '/views/intro.html'
|
||||
})
|
||||
.state('search', {
|
||||
url: '/search',
|
||||
templateUrl: '/views/search.html'
|
||||
})
|
||||
.state('/', {
|
||||
url: '/',
|
||||
templateUrl: '/views/intro.html'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
app.controller('bookmarksCtr', ['$scope', '$filter', 'bookmarkService', 'pubSubService', function($scope, $filter, bookmarkService, pubSubService) {
|
||||
console.log("Hello bookmarksCtr...");
|
||||
app.controller('bookmarksCtr', ['$scope', '$stateParams', '$filter', 'bookmarkService', 'pubSubService', function($scope, $stateParams, $filter, bookmarkService, pubSubService) {
|
||||
console.log("Hello bookmarksCtr...", $stateParams);
|
||||
$scope.bookmarks = []; // 书签数据
|
||||
$scope.showSearch = false; // 书签数据
|
||||
semanticInit();
|
||||
|
||||
var params = {
|
||||
s: 111,
|
||||
b: 222,
|
||||
|
|
@ -10,6 +13,10 @@ app.controller('bookmarksCtr', ['$scope', '$filter', 'bookmarkService', 'pubSubS
|
|||
|
||||
pubSubService.subscribe('MenuCtr.bookmarks', $scope, function(event, data) {
|
||||
console.log('subscribe MenuCtr.bookmarks', data);
|
||||
$scope.showSearch = (Math.random() >= 0.5);
|
||||
if ($scope.showSearch) {
|
||||
semanticInit();
|
||||
}
|
||||
getBookmarks(data);
|
||||
});
|
||||
|
||||
|
|
@ -29,4 +36,34 @@ app.controller('bookmarksCtr', ['$scope', '$filter', 'bookmarkService', 'pubSubS
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
function semanticInit() {
|
||||
$('.ui.dropdown').dropdown();
|
||||
$('.ui.calendar.js-date-begin').calendar({
|
||||
type: 'date',
|
||||
formatter: {
|
||||
date: function(date, settings) {
|
||||
if (!date) return '';
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1;
|
||||
var year = date.getFullYear();
|
||||
return year + '/' + month + '/' + day;
|
||||
}
|
||||
},
|
||||
endCalendar: $('.ui.calendar.js-date-end')
|
||||
});
|
||||
$('.ui.calendar.js-date-end').calendar({
|
||||
type: 'date',
|
||||
formatter: {
|
||||
date: function(date, settings) {
|
||||
if (!date) return '';
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1;
|
||||
var year = date.getFullYear();
|
||||
return year + '/' + month + '/' + day;
|
||||
}
|
||||
},
|
||||
startCalendar: $('.ui.calendar.js-date-begin')
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -3,21 +3,14 @@ app.controller('menuCtr', ['$scope', '$state', 'pubSubService', function($scope,
|
|||
$scope.selectLoginIndex = 0; /**< 默认登陆之后的选择的菜单索引,下表从 0 开始 */
|
||||
$scope.selectNotLoginIndex = 0; /**< 默认未登陆之后的选择的菜单索引,下表从 0 开始 */
|
||||
$scope.keyword = ''; /**< 搜索关键字 */
|
||||
$scope.showSearchInput = true; /**< 是否显示输入搜索关键字的输入框 */
|
||||
if ($scope.login) {
|
||||
setTimeout(() => {
|
||||
$state.go('bookmarks')
|
||||
}, 0);
|
||||
}
|
||||
semanticInit();
|
||||
|
||||
|
||||
/**
|
||||
* @todo http://stackoverflow.com/questions/31449948/ui-router-state-go-not-working
|
||||
*/
|
||||
if ($scope.login) {
|
||||
setTimeout(() => {
|
||||
$state.go('bookmarks')
|
||||
$state.go('bookmarks', {foo: 'i love you', bar: 'hello world'})
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +77,6 @@ app.controller('menuCtr', ['$scope', '$state', 'pubSubService', function($scope,
|
|||
* @desc 点击下拉列表详情搜索
|
||||
*/
|
||||
$scope.searchDetail = function() {
|
||||
$scope.showSearchInput = false;
|
||||
pubSubService.publish('MenuCtr.searchDetail', {
|
||||
'key': 'JavaScript'
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,58 @@
|
|||
<table class="ui celled table">
|
||||
<div class="ui small menu js-search-detail" ng-if="showSearch">
|
||||
<div class="ui dropdown item">
|
||||
<div class="text">搜索范围</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item">自己书签</div>
|
||||
<div class="item">全站书签</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width:136px;">
|
||||
<div class="ui calendar js-date-begin">
|
||||
<div class="ui transparent input left icon">
|
||||
<i class="calendar icon"></i>
|
||||
<input type="text" placeholder="开始日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="width:136px;">
|
||||
<div class="ui calendar js-date-end">
|
||||
<div class="ui transparent input left icon">
|
||||
<i class="calendar icon"></i>
|
||||
<input type="text" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dropdown item">
|
||||
<div class="text">点击次数</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item">大于</div>
|
||||
<div class="item">小于</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui item transparent icon input" style="width:120px;">
|
||||
<input class="prompt" type="text" ng-model="keyword" placeholder="点击次数">
|
||||
</div>
|
||||
|
||||
<div class="ui item transparent icon input" style="width:120px;">
|
||||
<input class="prompt" type="text" ng-model="keyword" placeholder="用户账号">
|
||||
</div>
|
||||
|
||||
<div class="ui item transparent icon input" style="width:160px;">
|
||||
<input type="text" placeholder="标题,链接,分类">
|
||||
</div>
|
||||
|
||||
<div class="right item">
|
||||
<div class="ui button">搜索</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table class="ui celled table" ng-show="bookmarks.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>标题</th>
|
||||
|
|
|
|||
|
|
@ -2,21 +2,16 @@
|
|||
<div class="ui small menu js-login-in" ng-show="login">
|
||||
<a class="item" ng-class="{active:$index==selectLoginIndex}" ui-sref="{{ menu.uiSref }}" ng-click="selectMenu($index, login)" ng-repeat="menu in loginMenus">{{ menu.title}}</a>
|
||||
<div class="right menu">
|
||||
<div class="ui dropdown item">
|
||||
<div class="text">搜索设置</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item" ng-click="showSearchInput = true">自己书签</div>
|
||||
<div class="item" ng-click="searchDetail()" ui-sref="search">详情搜索</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui category right search item" ng-show="showSearchInput">
|
||||
<div class="ui category right search item">
|
||||
<div class="ui transparent icon input">
|
||||
<input class="prompt" type="text" ng-model="keyword" placeholder="标题,链接,分类...">
|
||||
<i class="search link icon" ng-click="searchBookmarks()" ui-sref="bookmarks"></i>
|
||||
<i class="search link icon" ng-click="searchBookmarks()" ui-sref="bookmarks({foo: 'fooVal1', bar: 'barVal1'})"></i>
|
||||
</div>
|
||||
<div class="results"></div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="ui button" ng-click="searchDetail()" ui-sref="bookmarks">详情搜索</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="ui button" ng-click="showAddBookmarkMoadl()" ui-sref="bookmarks">添加书签</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
<p>
|
||||
这是详情搜索页
|
||||
</p>
|
||||
Loading…
Reference in New Issue