Sort the Knowlege

Developer
Size
3,915 Kb
Views
20,240

How do I make an sort the knowlege?

Playing with the Wikipedia API. Drag each page into the correct category.. What is a sort the knowlege? How do you make a sort the knowlege? This script and codes were developed by Eprouver on 15 September 2022, Thursday.

Sort the Knowlege Previews

Sort the Knowlege - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Sort the Knowlege</title> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div ng-app> <div ng-controller="board">	<h3>Drag Black Boxes into the Blue Categories</h3> <h4>Categories</h4> <div class="spliter"> <div ng-repeat="c in categories" class="droppable" ng-cloak ng-controller="drop">{{c.title}} <ol> <li ng-repeat="a in c.accepted">{{a.text}} <a class="linker" target="_BLANK" ng-href="{{a.link}}">link</a> </li> </ol> </div> </div> <h4>Pages Remaining: {{remaining}}</h4> <div class="spliter"> <div ng-repeat="s in subcats" class="draggable" data-id="{{s.pageid}}" ng-controller="drag">{{s.title}}</div> </div> </div> <p>Powered by Wikipedia</p>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.1.1/angular.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Sort the Knowlege - Script Codes CSS Codes

* { font-family:Arial; text-align:center;	}
h4{ text-align:left;
}	body { background:#eee;	}	.spliter { display:-webkit-box; -webkit-box-pack: horizontal; margin-top:20px; border-radius:15px; overflow:visible; padding:5px 15px; background: linear-gradient(to top, rgba(240,240,240,1) 0%, rgba(197, 197, 197, 1) 100%); box-shadow:0px 1px 2px rgba(0,0,0,0.3) inset,0px -1px 2px rgba(255,255,255,1) inset;	} .droppable:first-child{ border-top-left-radius: 3px; border-bottom-left-radius: 3px; border-left-color: rgba(0,0,0,0.50); } .droppable:last-child{ border-top-right-radius: 3px; border-bottom-right-radius: 3px; }	.droppable { border: 1px solid rgba(0,0,0,0.50); border-left-color: rgb(111, 169, 255); transition: 1s ease all; -webkit-transition: 1s ease all; -webkit-box-flex: 1; margin: 10px 0; padding: 20px 15px 7px 15px; width: auto; height: auto; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; font-style: normal; font-smoothing: antialiased; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -o-font-smoothing: antialiased; -ms-font-smoothing: antialiased; text-decoration: none; text-shadow: 0 -1px 1px rgba(0,0,0,0.50); -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 0; border-top: 1px solid rgba(0,0,0,0.001); box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -moz-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -o-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -ms-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); cursor: pointer; background: #0066cc;	}	.draggable { margin: 5px; padding: 4px 15px 7px 15px; display: inline-block; width: auto; height: auto; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; font-style: normal; font-smoothing: antialiased; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -o-font-smoothing: antialiased; -ms-font-smoothing: antialiased; text-decoration: none; text-shadow: 0 -1px 1px rgba(0,0,0,0.50); border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border: 1px solid rgba(0,0,0,0.50); border-top: 1px solid rgba(0,0,0,0.001); box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -moz-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -o-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); -ms-box-shadow: 0 0 10px rgba(0,0,0,0.35), 0px 1px 3px rgba(0,0,0,0.18), inset 0px -3px 0px rgba(0,0,0,0.35), inset 0px 14px 14px rgba(255,255,255,0.10); cursor: pointer; background: #444444;	}	.linker { display:none;	}	.finished .linker { display: inline; color: yellow; text-decoration: none; margin-left: 2px; text-transform: capitalize;	}	

Sort the Knowlege - Script Codes JS Codes

var totalscore = 0;
var remaining = 0;
function drop($scope, $element) { $($element).droppable({ accept: function (ui) { var id = ui.data('id'), subs = angular.element(this).scope().$parent.c.subs; var contained = $.grep(subs, function (v) { return v.pageid === id }).length; if (contained) { return true; } else { return false; } }, drop: function (e, ui) { angular.element(this).scope().c.accepted.push({ text: ui.draggable.text(), link: 'http://en.wikipedia.org/wiki?curid=' + ui.draggable.data('id') }); ui.draggable.remove(); $scope.$emit('correctAnswer'); $scope.$apply(); if (angular.element(this).scope().c.accepted.length >= 5) { $(this).css({ background: '#336600', 'border-left-color': 'rgb(66, 134, 83)' }); } } });
}
function drag($element) { $($element).draggable({ revert: 'invalid' });
}
function board($scope, $http) { $scope.remaining = remaining; $scope.totalscore = totalscore; $scope.$on('correctAnswer', function () { $scope.totalscore += 3; $scope.remaining -= 1; if ($scope.remaining === 0) { $('body').addClass('finished'); } }); $scope.categories = [], $scope.subcats = []; var root = 'http://en.wikipedia.org'; $.getJSON(root + '/w/api.php?action=query&list=random&format=json&rnnamespace=14&rnlimit=20&indexpageids=&converttitles=&callback=?', function (data) { $.each(data.query.random, function (i, v) { if (v.title.toLowerCase().indexOf('templates') !== -1) return; if (v.title.toLowerCase().indexOf('stubs') !== -1) return; if (v.title.toLowerCase().indexOf('lists') !== -1) return; if (v.title.toLowerCase().indexOf('wikipedia') !== -1) return; if ($scope.categories.length > 5) return; var cat = { title: v.title.replace('Category:', '').replace('Talk:', '').replace('Stub-Class', '').replace('List-Class', '').trim() }; cat.subs = []; $.getJSON(root + '/w/api.php?action=query&list=categorymembers&format=json&cmpageid=' + v.id + '&cmlimit=30&cmsort=timestamp&cmdir=asc&callback=?', function (data) { if (data.query.categorymembers.length < 5) { return; } var nowords = cat.title.split(' '), title; nowords.push(cat.title); nowords.push('wikipedia'); nowords.push('list'); nowords.push('user'); nowords.push('file'); for (var i = 0; i < data.query.categorymembers.length; i++) { title = data.query.categorymembers[i].title.replace('Category:', '').replace('Talk:', '').replace('Template:', '').trim(); for (var j = 0; j < nowords.length; j++) { if (title.toLowerCase().indexOf(nowords[j].toLowerCase()) !== -1) { title = false; break; } } if (title !== false) { data.query.categorymembers[i].title = title; cat.subs.push(data.query.categorymembers[i]); } } while (cat.subs.length > 5) { cat.subs.splice(~~ (Math.random() * cat.subs.length), 1); } if (cat.subs.length === 5) { $scope.subcats = $scope.subcats.concat(cat.subs); $scope.subcats.sort(function () { return 0.5 - Math.random() }); $scope.remaining = $scope.subcats.length; cat.accepted = []; $scope.categories.push(cat); $scope.$apply(); } }); }); });
}
Sort the Knowlege - Script Codes
Sort the Knowlege - Script Codes
Home Page Home
Developer Eprouver
Username eprouver
Uploaded September 15, 2022
Rating 3
Size 3,915 Kb
Views 20,240
Do you need developer help for Sort the Knowlege?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Eprouver (eprouver) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!