forked from numbbbbb/githuber.info
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split the controllers
- Loading branch information
Showing
7 changed files
with
110 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
App.controller('aboutCtl', ['$scope', '$location', function($scope, $location) { | ||
$('#bar-search').show(0) | ||
clearBDShare() | ||
$scope.search = function() { | ||
if ($scope.sw.replace(/\s/g, "") != "") { | ||
window.bigcache = {} | ||
$location.path("/search/" + $scope.sw); | ||
} | ||
}; | ||
$(".label-info").hover(function() { | ||
$(this).css("cursor", "pointer") | ||
}).click(function() { | ||
window.open($(this).data("url")) | ||
}) | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var clearBDShare = function() { | ||
$(".bdshare-slide-button-box").remove() | ||
window._bd_share_is_recently_loaded = false | ||
window._bd_share_main = null | ||
} | ||
|
||
function drawChart(id, option, type) { | ||
require( | ||
[ | ||
'echarts', | ||
'echarts/chart/' + type | ||
], | ||
function(ec) { | ||
var myChart = ec.init(document.getElementById(id)) | ||
myChart.setOption(option) | ||
} | ||
) | ||
} | ||
|
||
var db = new LocalDB("githuber.info"); | ||
var collection = db.collection("userInfo"); | ||
|
||
function updateLocalDB() { | ||
collection.drop(); | ||
collection.insert(window.config); | ||
} | ||
collection.find().then(function(data) { | ||
if (data.length) { | ||
window.config = data[0]; | ||
} else { | ||
window.config = {}; | ||
} | ||
}) | ||
|
||
function utf8_to_b64(str) { | ||
return window.btoa(unescape(encodeURIComponent(str))); | ||
} | ||
|
||
function b64_to_utf8(str) { | ||
return decodeURIComponent(escape(window.atob(str))); | ||
} | ||
Object.size = function(obj) { | ||
var size = 0, | ||
key; | ||
for (key in obj) { | ||
if (obj.hasOwnProperty(key)) size++; | ||
} | ||
return size; | ||
}; | ||
|
||
$(function() { | ||
$(".navbar a").click(function() { | ||
$(".navbar-toggle").not(".collapsed").click() | ||
}) | ||
var triggerFeedback = function() { | ||
$(document).trigger("feedback", [$("#feedback-email").val(), $("#feedback-content").val()]) | ||
$("#feedback-main").hide(0); | ||
$("#feedback-gangnam-style").show(0); | ||
setTimeout(function() { | ||
$("#feedback-btn").trigger("click") | ||
$("#feedback-gangnam-style").hide(0); | ||
$("#feedback-email, #feedback-content").val("") | ||
$("#feedback-main").show(0); | ||
setTimeout(function() { | ||
$("#feedback-btn").one("click", triggerFeedback) | ||
}, 5000) | ||
}, 2000) | ||
return false | ||
} | ||
$("#feedback-btn").one("click", triggerFeedback) | ||
$("#feedback-main").click(function() { | ||
return false; | ||
}) | ||
$.digits = function(text){ | ||
return text.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
App.controller('navCtl', ['$scope', '$location', function($scope, $location) { | ||
clearBDShare() | ||
$scope.search = function() { | ||
if ($scope.sw.replace(/\s/g, "") != "") { | ||
window.bigcache = {} | ||
$location.path("/search/" + $scope.sw); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,3 +263,6 @@ p { | |
.info-number { | ||
font-family: Constantia, Georgia; | ||
} | ||
.suggestionDrop { | ||
cursor: pointer; | ||
} |