Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Multiple Tagging #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 278 additions & 0 deletions css/bootstrap-select.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
/*!
* bootstrap-select v1.3.7
* http://silviomoreto.github.io/bootstrap-select/
*
* Copyright 2013 bootstrap-select
* Licensed under the MIT license
*/

.bootstrap-select.btn-group,
.bootstrap-select.btn-group[class*="span"] {
float: none;
display: inline-block;
margin-bottom: 10px;
margin-left: 0;
}
.form-search .bootstrap-select.btn-group,
.form-inline .bootstrap-select.btn-group,
.form-horizontal .bootstrap-select.btn-group {
margin-bottom: 0;
}

.bootstrap-select.form-control {
margin-bottom: 0;
padding: 0;
border: none;
}

.bootstrap-select.btn-group.pull-right,
.bootstrap-select.btn-group[class*="span"].pull-right,
.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right {
float: right;
}

.input-append .bootstrap-select.btn-group {
margin-left: -1px;
}

.input-prepend .bootstrap-select.btn-group {
margin-right: -1px;
}

.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]) {
width: 220px;
}

.bootstrap-select {
/*width: 220px\9; IE8 and below*/
width: 220px\0; /*IE9 and below*/
}

.bootstrap-select.form-control:not([class*="span"]) {
width: 100%;
}

.bootstrap-select > .btn {
width: 100%;
}

.error .bootstrap-select .btn {
border: 1px solid #b94a48;
}


.dropdown-menu {
z-index: 2000;
}

.bootstrap-select.show-menu-arrow.open > .btn {
z-index: 2051;
}

.bootstrap-select .btn:focus {
outline: thin dotted #333333 !important;
outline: 5px auto -webkit-focus-ring-color !important;
outline-offset: -2px;
}

.bootstrap-select.btn-group .btn .filter-option {
overflow: hidden;
position: absolute;
left: 12px;
right: 25px;
text-align: left;
}

.bootstrap-select.btn-group .btn .caret {
position: absolute;
top: 50%;
right: 12px;
margin-top: -2px;
vertical-align: middle;
}

.bootstrap-select.btn-group > .disabled,
.bootstrap-select.btn-group .dropdown-menu li.disabled > a {
cursor: not-allowed;
}

.bootstrap-select.btn-group > .disabled:focus {
outline: none !important;
}

.bootstrap-select.btn-group[class*="span"] .btn {
width: 100%;
}

.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

.bootstrap-select.btn-group .dropdown-menu.inner {
position: static;
border: 0;
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}

.bootstrap-select.btn-group .dropdown-menu dt {
display: block;
padding: 3px 20px;
cursor: default;
}

.bootstrap-select.btn-group .div-contain {
overflow: hidden;
}

.bootstrap-select.btn-group .dropdown-menu li {
position: relative;
}

.bootstrap-select.btn-group .dropdown-menu li > a.opt {
position: relative;
padding-left: 35px;
}

.bootstrap-select.btn-group .dropdown-menu li > a {
cursor: pointer;
}

.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}

.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark {
display: inline-block;
position: absolute;
right: 15px;
margin-top: 2.5px;
}

.bootstrap-select.btn-group .dropdown-menu li a i.check-mark {
display: none;
}

.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}

.bootstrap-select.btn-group .dropdown-menu li small {
padding-left: 0.5em;
}

.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:hover small,
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:focus small,
.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) > a small {
color: #64b1d8;
color: rgba(255,255,255,0.4);
}

.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}

.bootstrap-select.show-menu-arrow .dropdown-toggle:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #CCC;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: -4px;
left: 9px;
display: none;
}

.bootstrap-select.show-menu-arrow .dropdown-toggle:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
bottom: -4px;
left: 10px;
display: none;
}

.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before {
bottom: auto;
top: -3px;
border-top: 7px solid #ccc;
border-bottom: 0;
border-top-color: rgba(0, 0, 0, 0.2);
}

.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after {
bottom: auto;
top: -3px;
border-top: 6px solid #ffffff;
border-bottom: 0;
}

.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before {
right: 12px;
left: auto;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after {
right: 13px;
left: auto;
}

.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before,
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after {
display: block;
}

.bootstrap-select.btn-group .no-results {
padding: 3px;
background: #f5f5f5;
margin: 0 5px;
}

.mobile-device {
position: absolute;
top: 0;
left: 0;
display: block !important;
width: 100%;
height: 100% !important;
opacity: 0;
}

.bootstrap-select.fit-width {
width: auto !important;
}

.bootstrap-select.btn-group.fit-width .btn .filter-option {
position: static;
}

.bootstrap-select.btn-group.fit-width .btn .caret {
position: static;
top: auto;
margin-top: -1px;
}

.control-group.error .bootstrap-select .dropdown-toggle{
border-color: #b94a48;
}

.bootstrap-select-searchbox {
padding: 4px 8px;
}

.bootstrap-select-searchbox input {
margin-bottom: 0;
}
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

<link rel="shortcut icon" href="icon/favicon.ico" />

<script src="js/bootstrap-select.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/bootstrap-select.css" />

<title>Quora Archive</title>
</head>
<body>
Expand All @@ -22,7 +25,7 @@

<div id="classifyAnswerOptions">
<span style="margin-right: 15px;"><strong>Select bucket</strong></span>
<select id="answerBucketDD" style="font-size: 12px;"></select>
<select id="answerBucketDD" style="font-size: 12px;" multiple data-live-search="true"></select>
<button id="classifyAnswers" class="btn btn-small btn-success" type="button" style="margin-left: 30px;">Classify</button>
<button id="closeClassifyDD" class="btn btn-small" type="button" style="margin-left: 20px;">Close</button>
</div>
Expand Down Expand Up @@ -168,8 +171,6 @@
<span id="button-container"></span>
</div>
</div>


</body>

<script src="js/jquery.clippy.min.js" type="text/javascript"></script>
Expand All @@ -178,5 +179,4 @@
<script src="js/menuAction.js" type="text/javascript"></script>
<script src="js/FileSaver.js" type="text/javascript"></script>


</html>
31 changes: 24 additions & 7 deletions js/Indexscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function checkUserLoggedIn(){
storage.get(data_key, function(items) {
var data_version = items[data_key];

if (typeof data_version == 'undefined' || data_version["data_version"] != "v2") {
if (typeof data_version == 'undefined' || data_version["data_version"] != "v2.2") {
migrateArchiveData(user);
return -1;
}
Expand All @@ -50,7 +50,8 @@ function checkUserLoggedIn(){


populateBuckets();
populateClassifyAnswersMenu();
//Commented By Rumit, as sometimes it was getting called before populateBuckets async call completes, resulting into blank classify ddl.
//populateClassifyAnswersMenu();
populateArchiveStatus(); // populates the archive status div.
populateUserInformation();

Expand Down Expand Up @@ -83,7 +84,7 @@ function populateBuckets() {
if (typeof buckets == 'undefined') // no buckets.
return ;

buckets = buckets.split(";");
//buckets = buckets.split(";");
global_buckets = buckets;
populateClassifyAnswersMenu();

Expand Down Expand Up @@ -125,7 +126,8 @@ function populateClassifyAnswersMenu () {

$('#answerBucketDD').append(temp_html);
}

console.log(global_buckets);
$("#answerBucketDD").selectpicker();
}


Expand Down Expand Up @@ -259,9 +261,24 @@ function contentPopulate(bucket) {
tempAnswerBucket = userLinks[tempAnswerLink]["bucket"];

// skips answers that do not match the specified bucket
if (bucket.toLowerCase() != "all" && tempAnswerBucket.toLowerCase() != bucket.toLowerCase())
continue;

if (bucket.toLowerCase() != "all") {//&& tempAnswerBucket.toLowerCase() != bucket.toLowerCase())
var found = false;

if(bucket == '') {
found = (tempAnswerBucket.length == 0);
}

for(var b in tempAnswerBucket){
if(tempAnswerBucket[b].toLowerCase() == bucket.toLowerCase()){
found = true;
break;
}
}
if(!found) {
continue;
}
}

if (tempAnswerLink.match(/(http|https):\/\/[\w\-+]+\.quora\.com\/[\w\-+]+/i) != null || tempAnswerLink.indexOf('answer') == -1) // if the link is that of a post
displayBlogLink(tempAnswerLink);
else
Expand Down
Loading