├── mpcomp ├── __init__.py ├── admin.py ├── models.py ├── tests.py └── views.py ├── mslice ├── __init__.py ├── models.py ├── urls.py ├── templatetags │ ├── __init__.py │ └── slicetags.py ├── tests.py └── views.py ├── MongoSlice ├── __init__.py ├── wsgi.py ├── urls.py └── settings.py ├── .gitignore~ ├── .gitignore ├── static ├── img │ ├── arrow-down.png │ └── arrow-left.png ├── fonts │ ├── lato │ │ ├── lato-bold.eot │ │ ├── lato-bold.ttf │ │ ├── lato-black.eot │ │ ├── lato-black.ttf │ │ ├── lato-black.woff │ │ ├── lato-bold.woff │ │ ├── lato-italic.eot │ │ ├── lato-italic.ttf │ │ ├── lato-italic.woff │ │ ├── lato-light.eot │ │ ├── lato-light.ttf │ │ ├── lato-light.woff │ │ ├── lato-regular.eot │ │ ├── lato-regular.ttf │ │ ├── lato-regular.woff │ │ ├── lato-bolditalic.eot │ │ ├── lato-bolditalic.ttf │ │ └── lato-bolditalic.woff │ └── glyphicons │ │ ├── flat-ui-icons-regular.eot │ │ ├── flat-ui-icons-regular.ttf │ │ ├── flat-ui-icons-regular.woff │ │ └── flat-ui-icons-regular.svg ├── css │ ├── tree_view.css │ ├── demo_itip.css │ ├── demo_itip.css~ │ ├── Itip.css~ │ ├── Itip.css │ ├── demo.css │ └── m-style.css └── js │ ├── application.js │ ├── jquery.treeView.js │ ├── jQuery.Itip.js │ ├── jQuery.Itip.js~ │ └── jquery.flippy.min.js ├── requirements.txt ├── manage.py ├── docs ├── source │ ├── index.rst │ └── conf.py └── Makefile ├── .travis.yml ├── README.rst ├── templates ├── base.html ├── home.html └── login.html └── LICENSE /mpcomp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mpcomp/admin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mpcomp/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mslice/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mslice/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mslice/urls.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MongoSlice/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mslice/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore~: -------------------------------------------------------------------------------- 1 | *.pyc 2 | db.sqlite3 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | db.sqlite3 3 | env 4 | -------------------------------------------------------------------------------- /mpcomp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /static/img/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/img/arrow-down.png -------------------------------------------------------------------------------- /static/img/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/img/arrow-left.png -------------------------------------------------------------------------------- /static/fonts/lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bold.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bold.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-black.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-black.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-black.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-black.woff -------------------------------------------------------------------------------- /static/fonts/lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bold.woff -------------------------------------------------------------------------------- /static/fonts/lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-italic.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-italic.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-italic.woff -------------------------------------------------------------------------------- /static/fonts/lato/lato-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-light.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-light.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-light.woff -------------------------------------------------------------------------------- /static/fonts/lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-regular.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-regular.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-regular.woff -------------------------------------------------------------------------------- /static/fonts/lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /static/fonts/lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /static/fonts/lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons/flat-ui-icons-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/glyphicons/flat-ui-icons-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons/flat-ui-icons-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/glyphicons/flat-ui-icons-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons/flat-ui-icons-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/Mongo-Slice/HEAD/static/fonts/glyphicons/flat-ui-icons-regular.woff -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.7.4 2 | argparse==1.2.1 3 | astroid==1.3.4 4 | logilab-common==0.63.2 5 | pylint==1.4.1 6 | six==1.9.0 7 | wsgiref==0.1.2 8 | pymongo==2.8 9 | -------------------------------------------------------------------------------- /MongoSlice/wsgi.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MongoSlice.settings") 4 | 5 | from django.core.wsgi import get_wsgi_application 6 | application = get_wsgi_application() 7 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MongoSlice.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Mongo Slice's documentation! 2 | ======================================= 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | 10 | 11 | Indices and tables 12 | ================== 13 | 14 | * :ref:`genindex` 15 | * :ref:`modindex` 16 | * :ref:`search` 17 | 18 | -------------------------------------------------------------------------------- /MongoSlice/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | urlpatterns = patterns('', 4 | url(r'^$', 'mslice.views.index'), 5 | url(r'^logout/$', 'mslice.views.mlogout'), 6 | url(r'^info/(?P[a-zA-Z0-9_-]+)/$', 'mslice.views.info'), 7 | url(r'^query-process/$', 'mslice.views.query_process'), 8 | ) 9 | -------------------------------------------------------------------------------- /mslice/templatetags/slicetags.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | 5 | @register.filter("mongo_id") 6 | def mongo_id(value): 7 | try: 8 | return str(value['_id']) 9 | except Exception as e: 10 | return "Unknown" 11 | 12 | 13 | @register.filter("dtype") 14 | def dtype(value): 15 | try: 16 | return value.__class__.__name__ 17 | except Exception as e: 18 | return "Unknown" 19 | -------------------------------------------------------------------------------- /static/css/tree_view.css: -------------------------------------------------------------------------------- 1 | .treeview, 2 | .treeview ul { 3 | list-style-type: none; 4 | overflow: hidden; 5 | } 6 | 7 | .treeview li { 8 | text-indent: 1%; 9 | /* margin-top: 0.2em;*/ 10 | padding:2px 24px; 11 | line-height: 22px; 12 | background-repeat: no-repeat; 13 | background-size: 24px 24px; 14 | } 15 | 16 | .treeview li.contains-items { background-image: url('/static/img/arrow-left.png'); } 17 | 18 | .treeview li.items-expanded { background-image: url('/static/img/arrow-down.png'); } 19 | 20 | .treeview>li:hover { cursor: pointer; } 21 | 22 | .treeview span:hover { background-color: rgba(246, 246, 246, 0.7); } 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | 5 | #to start mongodb in travis 6 | services: 7 | - mongodb 8 | 9 | #Django & Database 10 | env: 11 | -DJANGO=1.7.4 DB=mysql 12 | -DJANGO=1.7.4 DB=sqlite3 13 | 14 | install: 15 | - pip install -r requirements.txt 16 | - pip install coveralls 17 | - pip install mysql-python --use-mirrors 18 | 19 | 20 | # command to run tests 21 | script: 22 | - python manage.py test 23 | - coverage run --source=mslice manage.py test 24 | 25 | #submiting result to coverals.io 26 | after_success: 27 | coveralls 28 | 29 | # .travis.yml 30 | before_script: 31 | - mongo slice --eval 'db.addUser("root", "root");' -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Mongo-Slice 2 | =========== 3 | 4 | MongoDB tool to monitor, interact with your mongodb servers. 5 | 6 | .. image:: https://travis-ci.org/MicroPyramid/Mongo-Slice.svg?branch=master 7 | :target: https://travis-ci.org/MicroPyramid/Mongo-Slice 8 | 9 | .. image:: https://readthedocs.org/projects/mongo-slice/badge/?version=latest 10 | :target: https://readthedocs.org/projects/mongo-slice/?badge=latest 11 | :alt: Documentation Status 12 | 13 | .. image:: https://coveralls.io/repos/MicroPyramid/Mongo-Slice/badge.svg 14 | :target: https://coveralls.io/r/MicroPyramid/Mongo-Slice 15 | 16 | .. image:: https://landscape.io/github/MicroPyramid/Mongo-Slice/master/landscape.svg?style=flat 17 | :target: https://landscape.io/github/MicroPyramid/Mongo-Slice/master 18 | :alt: Code Health 19 | 20 | head to http://mongo-slice.readthedocs.org/ for latest documentation 21 | 22 | Visit our MongoDB Development Services page `Here`_ 23 | 24 | .. _Here: https://micropyramid.com/mongodb-development-services/ 25 | 26 | -------------------------------------------------------------------------------- /mpcomp/views.py: -------------------------------------------------------------------------------- 1 | from json.encoder import JSONEncoder 2 | from bson.objectid import ObjectId 3 | import datetime 4 | import json 5 | from bson import json_util 6 | import string 7 | import random 8 | 9 | 10 | def getConn(request): 11 | import pymongo 12 | 13 | client = pymongo.MongoClient(request.session['host'], int(request.session['port'])) 14 | db = client[request.session['db']] 15 | db.authenticate(request.session['uid'], request.session['pwd']) 16 | return db 17 | 18 | 19 | def mongoauth(host, port, db, uid, pwd): 20 | import pymongo 21 | if host == "" or host is None or port == "" or port is None or db == "" or db is None or uid == "" or uid is None or pwd == "" or pwd is None: 22 | return False 23 | 24 | try: 25 | client = pymongo.MongoClient(host, int(port)) 26 | db = client[db] 27 | db.authenticate(uid, pwd) 28 | return True 29 | except pymongo.errors.PyMongoError: 30 | return False 31 | 32 | 33 | class MongoEncoder(JSONEncoder): 34 | def default(self, obj, **kwargs): 35 | if isinstance(obj, ObjectId): 36 | return str(obj) 37 | elif isinstance(obj, datetime.datetime): 38 | return json.dumps(obj, default=json_util.default) 39 | else: 40 | return JSONEncoder.default(obj, **kwargs) 41 | 42 | 43 | def rand_string(size=6, chars=string.ascii_uppercase + string.digits): 44 | return ''.join(random.choice(chars) for x in range(size)) 45 | -------------------------------------------------------------------------------- /mslice/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | """ 5 | 6 | from django.test import TestCase 7 | from django.test import Client 8 | import pymongo 9 | 10 | class SimpleTest(TestCase): 11 | def test_basic_addition(self): 12 | """ 13 | Tests that 1 + 1 always equals 2. 14 | """ 15 | self.assertEqual(1 + 1, 2) 16 | 17 | 18 | class Test_Mongo(TestCase): 19 | 20 | def setUp(self): 21 | self.client = Client() 22 | self.mongoclient = pymongo.MongoClient() 23 | self.db = self.mongoclient.slice 24 | self.db.add_user('root', 'root') 25 | self.db.post.insert({'auther': 'ravi', 'title': 'Pymongo tut','description': 'desc'}) 26 | 27 | 28 | 29 | def test_mongo_db(self): 30 | self.response = self.client.get('/') 31 | self.assertEqual(self.response.status_code, 200) 32 | 33 | self.response = self.client.post('/',{}) 34 | self.assertTrue('false' in self.response.content) 35 | self.assertEqual(self.response.status_code, 200) 36 | 37 | self.response = self.client.post('/', {'host': self.mongoclient.host, 'port': self.mongoclient.port, 'db' : 'slice', 'uid': 'root', 'pwd': 'root'}) 38 | 39 | self.assertTrue('true' in self.response.content) 40 | self.assertEqual(self.response.status_code, 200) 41 | 42 | self.response = self.client.get('/info/post/') 43 | self.assertTrue('Pymongo tut' in self.response.content) 44 | self.assertEqual(self.response.status_code, 200) 45 | 46 | -------------------------------------------------------------------------------- /static/css/demo_itip.css: -------------------------------------------------------------------------------- 1 | /*ngo tien thai*/ 2 | *{ 3 | margin: 0px; 4 | padding: 0px; 5 | } 6 | header { 7 | background: #EFF0F2; 8 | color: #2980B9; 9 | padding: 50px; 10 | 11 | } 12 | header h1,header p{ 13 | width: 100%; 14 | text-align: center; 15 | 16 | } 17 | header h1 { 18 | font-size: 3em; 19 | 20 | } 21 | header p { 22 | font-size: 1.5em; 23 | } 24 | section#main-content { 25 | background: #99CD33 ; 26 | color:#4C6619 ; 27 | text-align: center; 28 | overflow: hidden; 29 | } 30 | 31 | section#main-content .demo-wrap { 32 | border-bottom: 1px dotted #FFFFFF; 33 | padding: 20px; 34 | width: 47%; 35 | float:left; 36 | height: 400px; 37 | 38 | } 39 | section#main-content div.demo-wrap div.item { 40 | width: 100px; 41 | height: 100px; 42 | border-radius: 1000%; 43 | background: #CCE699; 44 | margin: 0px auto; 45 | line-height: 100px; 46 | font-size: 1.5em; 47 | cursor: pointer; 48 | color: #FF4351; 49 | 50 | } 51 | section#main-content div.demo-wrap h2 { 52 | margin-top: 20px; 53 | } 54 | 55 | section#main-content div.demo-wrap pre { 56 | width: 80%; 57 | margin:0px auto; 58 | margin-top: 20px; 59 | text-align: left; 60 | } 61 | #position div { 62 | display: inline; 63 | padding: 10px; 64 | 65 | } 66 | #position div label { 67 | cursor: pointer; 68 | } 69 | footer { 70 | text-align: center; 71 | padding: 20px; 72 | background: #CCCCCC; 73 | 74 | } 75 | footer a { 76 | color: #4F7F9F; 77 | font-size: 2em; 78 | border-left: 2px solid #5A5A5A; 79 | padding-left: 20px; 80 | text-decoration: none; 81 | } 82 | footer a:hover { 83 | color: #FF667A; 84 | } 85 | footer a:first-child { 86 | border: none; 87 | padding-right: 20px; 88 | } 89 | -------------------------------------------------------------------------------- /static/css/demo_itip.css~: -------------------------------------------------------------------------------- 1 | /*ngo tien thai*/ 2 | *{ 3 | margin: 0px; 4 | padding: 0px; 5 | } 6 | header { 7 | background: #EFF0F2; 8 | color: #2980B9; 9 | padding: 50px; 10 | 11 | } 12 | header h1,header p{ 13 | width: 100%; 14 | text-align: center; 15 | 16 | } 17 | header h1 { 18 | font-size: 3em; 19 | 20 | } 21 | header p { 22 | font-size: 1.5em; 23 | } 24 | section#main-content { 25 | background: #99CD33 ; 26 | color:#4C6619 ; 27 | text-align: center; 28 | overflow: hidden; 29 | } 30 | 31 | section#main-content .demo-wrap { 32 | border-bottom: 1px dotted #FFFFFF; 33 | padding: 20px; 34 | width: 47%; 35 | float:left; 36 | height: 400px; 37 | 38 | } 39 | section#main-content div.demo-wrap div.item { 40 | width: 100px; 41 | height: 100px; 42 | border-radius: 1000%; 43 | background: #CCE699; 44 | margin: 0px auto; 45 | line-height: 100px; 46 | font-size: 1.5em; 47 | cursor: pointer; 48 | color: #FF4351; 49 | 50 | } 51 | section#main-content div.demo-wrap h2 { 52 | margin-top: 20px; 53 | } 54 | 55 | section#main-content div.demo-wrap pre { 56 | width: 80%; 57 | margin:0px auto; 58 | margin-top: 20px; 59 | text-align: left; 60 | } 61 | #position div { 62 | display: inline; 63 | padding: 10px; 64 | 65 | } 66 | #position div label { 67 | cursor: pointer; 68 | } 69 | footer { 70 | text-align: center; 71 | padding: 20px; 72 | background: #CCCCCC; 73 | 74 | } 75 | footer a { 76 | color: #4F7F9F; 77 | font-size: 2em; 78 | border-left: 2px solid #5A5A5A; 79 | padding-left: 20px; 80 | text-decoration: none; 81 | } 82 | footer a:hover { 83 | color: #FF667A; 84 | } 85 | footer a:first-child { 86 | border: none; 87 | padding-right: 20px; 88 | } 89 | -------------------------------------------------------------------------------- /static/css/Itip.css~: -------------------------------------------------------------------------------- 1 | /*ngô tiến thái*/ 2 | body,html { 3 | height: 100%; 4 | } 5 | div.Itip{ 6 | width: 200px; 7 | height: 200px; 8 | background: #FEAE1B; 9 | border-radius: 50%; 10 | line-height: 200px; 11 | text-align: center; 12 | font-size: 2em; 13 | color: #fff; 14 | position: relative; 15 | top: 30%; 16 | left: 30%; 17 | cursor: pointer; 18 | } 19 | 20 | .itip { 21 | min-width: 100px; 22 | background: #ED4694; 23 | border-radius: 5px; 24 | text-align: center; 25 | font-size: 2em; 26 | color: #fff; 27 | cursor: pointer; 28 | 29 | 30 | 31 | } 32 | .itip> .Itip-inner { 33 | position: relative; 34 | width: 100%; 35 | } 36 | .itip div.Itip-content { 37 | font-size: 20px; 38 | padding: 10px 20px; 39 | } 40 | span.arrow{ 41 | width: 0px; 42 | height: 0px; 43 | position: absolute; 44 | } 45 | span.arrow.right { 46 | 47 | /*right*/ 48 | 49 | top: calc(50% - 10px); right: -10px; 50 | border-top: 11px solid transparent; 51 | border-bottom: 11px solid transparent; 52 | border-left: 10px solid #ED4694; 53 | } 54 | span.arrow.bottom { 55 | /*bottom*/ 56 | 57 | top: 100%; left: calc(50% - 10px); 58 | border-top: 11px solid #ED4694; 59 | border-left: 10px solid transparent; 60 | border-right: 10px solid transparent; 61 | } 62 | span.arrow.top { 63 | /*top*/ 64 | 65 | top: -10px; left: calc(50% - 10px); 66 | border-bottom: 11px solid #ED4694; 67 | border-left: 10px solid transparent; 68 | border-right: 10px solid transparent; 69 | 70 | } 71 | span.arrow.left { 72 | /*left*/ 73 | 74 | top: calc(50% - 10px); left: -10px; 75 | border-top: 11px solid transparent; 76 | border-bottom: 11px solid transparent; 77 | border-right: 10px solid #ED4694; 78 | } -------------------------------------------------------------------------------- /static/css/Itip.css: -------------------------------------------------------------------------------- 1 | /*ngô tiến thái*/ 2 | body,html { 3 | height: 100%; 4 | } 5 | div.Itip{ 6 | width: 200px; 7 | height: 200px; 8 | background: #FEAE1B; 9 | border-radius: 50%; 10 | line-height: 200px; 11 | text-align: center; 12 | font-size: 2em; 13 | color: #fff; 14 | position: relative; 15 | top: 30%; 16 | left: 30%; 17 | cursor: pointer; 18 | } 19 | 20 | .itip { 21 | min-width: 100px; 22 | background: #ED4694; 23 | border-radius: 5px; 24 | text-align: center; 25 | font-size: 2em; 26 | color: #fff; 27 | cursor: pointer; 28 | 29 | 30 | 31 | } 32 | 33 | 34 | 35 | .itip> .Itip-inner { 36 | position: relative; 37 | width: 100%; 38 | } 39 | .itip div.Itip-content { 40 | font-size: 20px; 41 | padding: 10px 20px; 42 | } 43 | span.arrow{ 44 | width: 0px; 45 | height: 0px; 46 | position: absolute; 47 | } 48 | span.arrow.right { 49 | 50 | /*right*/ 51 | 52 | top: calc(50% - 10px); right: -10px; 53 | border-top: 11px solid transparent; 54 | border-bottom: 11px solid transparent; 55 | border-left: 10px solid #ED4694; 56 | } 57 | span.arrow.bottom { 58 | /*bottom*/ 59 | 60 | top: 100%; left: calc(50% - 10px); 61 | border-top: 11px solid #ED4694; 62 | border-left: 10px solid transparent; 63 | border-right: 10px solid transparent; 64 | } 65 | span.arrow.top { 66 | /*top*/ 67 | 68 | top: -10px; left: calc(50% - 10px); 69 | border-bottom: 11px solid #ED4694; 70 | border-left: 10px solid transparent; 71 | border-right: 10px solid transparent; 72 | 73 | } 74 | span.arrow.left { 75 | /*left*/ 76 | 77 | top: calc(50% - 10px); left: -10px; 78 | border-top: 11px solid transparent; 79 | border-bottom: 11px solid transparent; 80 | border-right: 10px solid #ED4694; 81 | } 82 | -------------------------------------------------------------------------------- /MongoSlice/settings.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 4 | 5 | DEBUG = True 6 | TEMPLATE_DEBUG = DEBUG 7 | 8 | VERSION = "0.1" 9 | 10 | ALLOWED_HOSTS = [] 11 | 12 | 13 | STATIC_URL = '/static/' 14 | 15 | STATICFILES_DIRS = (BASE_DIR + "/static",) 16 | 17 | STATICFILES_FINDERS = ( 18 | 'django.contrib.staticfiles.finders.FileSystemFinder', 19 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 20 | ) 21 | 22 | 23 | SECRET_KEY = '0e%-7s*&g+4z%x4y*$9&4^30ddeisrf2_msn9y+10tz$is$kz6' 24 | 25 | MIDDLEWARE_CLASSES = ( 26 | 'django.contrib.sessions.middleware.SessionMiddleware', 27 | 'django.middleware.common.CommonMiddleware', 28 | 'django.middleware.csrf.CsrfViewMiddleware', 29 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 30 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 31 | 'django.contrib.messages.middleware.MessageMiddleware', 32 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 33 | ) 34 | 35 | ROOT_URLCONF = 'MongoSlice.urls' 36 | 37 | WSGI_APPLICATION = 'MongoSlice.wsgi.application' 38 | 39 | TEMPLATE_DIRS = (BASE_DIR + "/templates",) 40 | 41 | SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" 42 | SESSION_EXPIRE_AT_BROWSER_CLOSE = True 43 | 44 | INSTALLED_APPS = ( 45 | 'django.contrib.auth', 46 | 'django.contrib.contenttypes', 47 | 'django.contrib.sessions', 48 | 'django.contrib.sites', 49 | 'django.contrib.messages', 50 | 'django.contrib.staticfiles', 51 | 'mpcomp', 52 | 'mslice', 53 | ) 54 | 55 | SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' 56 | 57 | LOGGING = { 58 | 'version': 1, 59 | 'disable_existing_loggers': False, 60 | 'filters': { 61 | 'require_debug_false': { 62 | '()': 'django.utils.log.RequireDebugFalse' 63 | } 64 | }, 65 | 'handlers': { 66 | 'mail_admins': { 67 | 'level': 'ERROR', 68 | 'filters': ['require_debug_false'], 69 | 'class': 'django.utils.log.AdminEmailHandler' 70 | } 71 | }, 72 | 'loggers': { 73 | 'django.request': { 74 | 'handlers': ['mail_admins'], 75 | 'level': 'ERROR', 76 | 'propagate': True, 77 | }, 78 | } 79 | } 80 | 81 | DATABASES = { 82 | 'default': { 83 | 'ENGINE': 'django.db.backends.sqlite3', 84 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 85 | } 86 | } -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mongo-Slice 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 |
28 |
29 | 30 | 31 |
32 | 45 |
46 |
47 | 48 | 49 |
50 | 51 |
52 |
    53 |
  • 54 | {{ request.session.db }} 55 |
      56 |
    • 57 | Collections 58 |
        59 | {% if content.collections %} 60 | {% for col in content.collections %} 61 |
      • {{col}}
      • 62 | {% endfor %} 63 | {% endif %} 64 | {% for col in collections %} 65 |
      • {{col}}
      • 66 | {% endfor %} 67 | 68 | 69 |
      70 |
    • 71 |
    72 |
  • 73 |
74 | 75 |
76 | 77 | 78 |
79 | 80 |
81 | {{ request.session.uid }} 82 | {{ request.session.host }}:{{ request.session.port}} 83 | {{ request.session.db }} 84 |
85 | 86 | 87 |
88 | {% csrf_token %} 89 |
90 | 91 |
92 | 93 | {% block content %}{% endblock %} -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 | {% load slicetags %} 4 | 5 | {% if documents %} 6 |
7 |
8 |
9 | {{coll_name}} 10 | 11 |
12 |
Statistics
22 | 23 |
24 | 25 | {{current_page}} of {{last_page}} 26 |
27 | 28 |
29 | Key 30 | Type 31 | Value 32 |
33 |
34 |
    35 | {% for doc in documents %} 36 |
  • 37 | {{ doc|mongo_id }} 38 | 39 | 40 |
    41 |
      42 | {% for key, value in doc.items %} 43 |
    • 44 | {{ key }} 45 | {{ value | dtype }} 46 | {{ value }} 47 |
      48 |
    • 49 | {% endfor %} 50 |
    51 |
  • 52 | {% endfor %} 53 |
54 |
55 | 56 |
57 |
58 | {% endif %} 59 | {% if resp %} 60 |
61 |
62 |
63 | {{ resp }} 64 |
65 |
66 | {% endif %} 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 87 | 88 | 98 | 99 | 100 | 101 | 102 | 107 | {% endblock %} -------------------------------------------------------------------------------- /static/js/application.js: -------------------------------------------------------------------------------- 1 | // Some general UI pack related JS 2 | // Extend JS String with repeat method 3 | String.prototype.repeat = function (num) { 4 | return new Array(Math.round(num) + 1).join(this); 5 | }; 6 | 7 | (function ($) { 8 | 9 | // Add segments to a slider 10 | $.fn.addSliderSegments = function () { 11 | return this.each(function () { 12 | var $this = $(this), 13 | option = $this.slider('option'), 14 | amount = (option.max - option.min)/option.step, 15 | orientation = option.orientation; 16 | if ( 'vertical' === orientation ) { 17 | var output = '', i; 18 | console.log(amount); 19 | for (i = 1; i <= amount - 1; i++) { 20 | output += '
'; 21 | } 22 | $this.prepend(output); 23 | } else { 24 | var segmentGap = 100 / (amount) + '%'; 25 | var segment = '
'; 26 | $this.prepend(segment.repeat(amount - 1)); 27 | } 28 | }); 29 | }; 30 | 31 | $(function () { 32 | 33 | // Todo list 34 | $('.todo').on('click', 'li', function () { 35 | $(this).toggleClass('todo-done'); 36 | }); 37 | 38 | // Custom Selects 39 | if ($('[data-toggle="select"]').length) { 40 | $('[data-toggle="select"]').select2(); 41 | } 42 | 43 | // Checkboxes and Radio buttons 44 | $('[data-toggle="checkbox"]').radiocheck(); 45 | $('[data-toggle="radio"]').radiocheck(); 46 | 47 | // Tooltips 48 | $('[data-toggle=tooltip]').tooltip('show'); 49 | 50 | // jQuery UI Sliders 51 | var $slider = $('#slider'); 52 | if ($slider.length > 0) { 53 | $slider.slider({ 54 | max: 15, 55 | step: 6, 56 | value: 3, 57 | orientation: 'horizontal', 58 | range: 'min' 59 | }).addSliderSegments(); 60 | } 61 | 62 | var $verticalSlider = $('#vertical-slider'); 63 | if ($verticalSlider.length) { 64 | $verticalSlider.slider({ 65 | min: 1, 66 | max: 5, 67 | value: 3, 68 | orientation: 'vertical', 69 | range: 'min' 70 | }).addSliderSegments($verticalSlider.slider('option').max, 'vertical'); 71 | } 72 | 73 | // Focus state for append/prepend inputs 74 | $('.input-group').on('focus', '.form-control', function () { 75 | $(this).closest('.input-group, .form-group').addClass('focus'); 76 | }).on('blur', '.form-control', function () { 77 | $(this).closest('.input-group, .form-group').removeClass('focus'); 78 | }); 79 | 80 | // Make pagination demo work 81 | $('.pagination').on('click', 'a', function () { 82 | $(this).parent().siblings('li').removeClass('active').end().addClass('active'); 83 | }); 84 | 85 | $('.btn-group').on('click', 'a', function () { 86 | $(this).siblings().removeClass('active').end().addClass('active'); 87 | }); 88 | 89 | // Disable link clicks to prevent page scrolling 90 | $(document).on('click', 'a[href="#fakelink"]', function (e) { 91 | e.preventDefault(); 92 | }); 93 | 94 | // Switches 95 | if ($('[data-toggle="switch"]').length) { 96 | $('[data-toggle="switch"]').bootstrapSwitch(); 97 | } 98 | 99 | // Typeahead 100 | if ($('#typeahead-demo-01').length) { 101 | var states = new Bloodhound({ 102 | datumTokenizer: function (d) { return Bloodhound.tokenizers.whitespace(d.word); }, 103 | queryTokenizer: Bloodhound.tokenizers.whitespace, 104 | limit: 4, 105 | local: [ 106 | { word: 'Alabama' }, 107 | { word: 'Alaska' }, 108 | { word: 'Arizona' }, 109 | { word: 'Arkansas' }, 110 | { word: 'California' }, 111 | { word: 'Colorado' } 112 | ] 113 | }); 114 | 115 | states.initialize(); 116 | 117 | $('#typeahead-demo-01').typeahead(null, { 118 | name: 'states', 119 | displayKey: 'word', 120 | source: states.ttAdapter() 121 | }); 122 | } 123 | 124 | // make code pretty 125 | window.prettyPrint && prettyPrint(); 126 | 127 | }); 128 | 129 | })(jQuery); 130 | -------------------------------------------------------------------------------- /static/js/jquery.treeView.js: -------------------------------------------------------------------------------- 1 | (function ($){ 2 | // doesn't work without jquery 3 | if (!$) return; 4 | // treeView 5 | function treeView($me) { 6 | // add treeview class name if not present 7 | $me.addClass('treeview'); 8 | // collapsable elements i.e. the li with a ul in it 9 | var $collapse = $me.find('li>ul').parent(); 10 | // generate tree from data 11 | function generateTree(data, $root, useSpan, imgList) { 12 | // create a node from a node object 13 | function createNode(nObj, $target) { 14 | var li = $('
  • ').appendTo($target); 15 | // node icons require using a span element 16 | useSpan = useSpan || imgList.length > 0; 17 | if (useSpan) { 18 | li.append($('').text(nObj.label)); 19 | } else { 20 | li.text(nObj.label); 21 | } 22 | if(imgList.length > 0){ 23 | // the image 24 | var image = 'url('+imgList[nObj.imageIndex]+')'; 25 | // requires using span 26 | var $span = li.find('span'); 27 | // indicates that it has a node image 28 | $span.addClass('has-node-icon'); 29 | $span.css('background-image', image); 30 | } 31 | if (nObj.children != undefined && nObj.children.length > 0) { 32 | var innerList = $('
      ').appendTo(li); 33 | for (var i = 0; i < nObj.children.length; i++) { 34 | var child = nObj.children[i]; 35 | createNode(child, innerList); 36 | }; 37 | } 38 | 39 | return li; 40 | } 41 | for (var i = 0; i < data.length; i++) { 42 | createNode(data[i], $root); 43 | } 44 | } 45 | 46 | return { 47 | //initialize control 48 | init: function (data) { 49 | // handle undefined error 50 | data = data || { }; 51 | 52 | // default optoins 53 | var defaults = { 54 | model: null, // treeview data model 55 | useSpan: false, // use to build model 56 | imageList: [], // add icons to nodes 57 | // ajax: null, TODO: load data using ajax 58 | expanded: false // the tree is expanded 59 | }; 60 | // configuration 61 | var options = { }; 62 | 63 | if (typeof data.concat != 'undefined') { 64 | // concat is an array method, thus checks if data is array 65 | // typeof array returns object otherwise 66 | defaults.model = data; 67 | // data has model only, which is transferred to defaults.model 68 | // prevents wrong merge in $.extend 69 | data = null; 70 | } 71 | // merge options 72 | options = $.extend(defaults, data); 73 | 74 | if (options.model != null) { 75 | // generate the tree 76 | generateTree(options.model, $me, options.useSpan, options.imageList); 77 | // re assign var value for new dom structure 78 | $collapse = $me.find('li>ul').parent(); 79 | } 80 | // all the collapsable items which have something 81 | $collapse.addClass('contains-items'); 82 | // user config 83 | if (options.expanded){ 84 | $collapse.addClass('items-expanded') 85 | } else { 86 | $me.find('ul').css('display', 'none'); 87 | } 88 | // expand items which have something 89 | $me.find('.contains-items').on('click', function (event) { 90 | if ($(event.target).hasClass('contains-items')){ 91 | // expand icon 92 | $(this).toggleClass('items-expanded'); 93 | // the inner list 94 | var $a = $(this).find('>ul'); 95 | // slide effect 96 | $a.slideToggle(); 97 | // stop propagation of inner elements 98 | event.stopPropagation(); 99 | } 100 | }); 101 | }, 102 | // expand all items 103 | expandAll: function() { 104 | var items = $me.find('.contains-items'); 105 | items.find('ul').slideDown(); 106 | items.addClass('items-expanded'); 107 | }, 108 | // collapse all items 109 | collapseAll: function() { 110 | var items = $me.find('.contains-items'); 111 | items.find('ul').slideUp(); 112 | items.removeClass('items-expanded'); 113 | } 114 | } 115 | } 116 | // treeView jQuery plugin 117 | $.fn.treeView = function(options) { 118 | // if it's a function arguments 119 | var args = (arguments.length > 1) ? Array.prototype.slice.call(arguments, 1) : undefined; 120 | // all the elements by selector 121 | return this.each(function () { 122 | var instance = new treeView($(this)); 123 | if ( instance[options] ) { 124 | // has requested method 125 | return instance[options](args); 126 | } else { 127 | // no method requested, so initialize 128 | instance.init(options); 129 | } 130 | }); 131 | } 132 | 133 | })(window.jQuery); -------------------------------------------------------------------------------- /templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mongo Slice 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 23 | 61 | 62 |
      63 |
      64 | Authenticating... 65 |
      66 |
      67 | 68 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /mslice/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from django.http import HttpResponse 3 | from django.core.context_processors import csrf 4 | from django.views.decorators.csrf import csrf_exempt 5 | from bson.json_util import dumps 6 | import json 7 | import ast 8 | import re 9 | from mpcomp.views import getConn, mongoauth 10 | import math 11 | 12 | 13 | def index(request): 14 | if request.method == "POST": 15 | db = mongoauth(request.POST.get('host'), request.POST.get('port'), request.POST.get('db'), request.POST.get('uid'), request.POST.get('pwd')) 16 | 17 | if not db: 18 | data = {'login': False} 19 | return HttpResponse(json.dumps(data)) 20 | 21 | else: 22 | request.session['host'] = request.POST.get('host') 23 | request.session['port'] = request.POST.get('port') 24 | request.session['db'] = request.POST.get('db') 25 | request.session['uid'] = request.POST.get('uid') 26 | request.session['pwd'] = request.POST.get('pwd') 27 | request.session['login'] = True 28 | data = {'login': True} 29 | return HttpResponse(json.dumps(data)) 30 | 31 | elif 'login' in request.session: 32 | content = {} 33 | db = getConn(request) 34 | content['collections'] = db.collection_names() 35 | content['request'] = request 36 | return render_to_response('home.html', content) 37 | 38 | else: 39 | c = {} 40 | c.update(csrf(request)) 41 | return render_to_response('login.html', {'csrf_token': c['csrf_token']}) 42 | 43 | 44 | def mlogout(request): 45 | from django.http import HttpResponseRedirect 46 | request.session.flush() 47 | return HttpResponseRedirect('/') 48 | 49 | 50 | def info(request, coll_name): 51 | content = {} 52 | db = getConn(request) 53 | 54 | # db = connection[request.session['db']] 55 | items_per_page = 10 56 | if "page" in request.GET: 57 | page = int(request.GET.get('page')) 58 | else: 59 | page = 1 60 | no_pages = int(math.ceil(float(db[coll_name].find().count()) / items_per_page)) 61 | 62 | content = { 63 | 'count': db[coll_name].count(), 64 | 'documents': list(db[coll_name].find())[(page - 1) * items_per_page:page * items_per_page], 65 | 'collstats': db.command("collstats", coll_name), 66 | 'collections': db.collection_names(), 67 | 'db': request.session['db'], 68 | 'name': coll_name, 69 | 'read': True, 70 | 'coll_name': coll_name, 71 | 'dbstats': db.command("dbstats"), 72 | 'current_page': page, 73 | 'last_page': no_pages, 74 | 'request': request, 75 | } 76 | return render_to_response('home.html', content) 77 | 78 | 79 | @csrf_exempt 80 | def query_process(request): 81 | content = {} 82 | coll_name = request.POST.get('collection') 83 | # db = connection[request.session['db']] 84 | db = getConn(request) 85 | content = { 86 | 'collections': db.collection_names(), 87 | 'db': request.session['db'], 88 | 'request': request, 89 | } 90 | if request.method == 'GET': 91 | c = {} 92 | c.update(csrf(request)) 93 | return render_to_response('home.html', {'csrf_token': c['csrf_token'], 'request': request, 'content': content}) 94 | 95 | q = request.POST.get('ta') 96 | if not q.startswith('db'): 97 | resp = 'Please Enter Valid Query:' 98 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 99 | 100 | m = re.search("({.*})", q) 101 | if m is None: 102 | d = None 103 | else: 104 | d = m.group(0) 105 | resp = None 106 | 107 | try: 108 | 109 | if 'insert' in q: 110 | 111 | try: 112 | c = db[q.split('.')[1]] 113 | except Exception as e: 114 | c = db.createCollection(q.split('.')[1]) 115 | try: 116 | d = ast.literal_eval(d) 117 | resp = c.save(d) 118 | resp = 'Status: Document Inserted Succesfully ' + str(resp) 119 | except (SyntaxError, TypeError, ValueError, NameError): 120 | resp = 'Please Enter Valid Query' 121 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 122 | if 'remove' in q: 123 | try: 124 | c = db[q.split('.')[1]] 125 | except Exception as e: 126 | pass 127 | if d is None: 128 | c.remove() 129 | resp = 'Status: Documents Removed Succesfully' 130 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 131 | try: 132 | d = ast.literal_eval(d) 133 | resp = c.remove(d) 134 | resp = 'Status: ' + str(resp) 135 | except (SyntaxError, TypeError, ValueError, NameError): 136 | resp = 'Please Enter valid Query' 137 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 138 | if 'update' in q: 139 | try: 140 | c = db[q.split('.')[1]] 141 | except Exception as e: 142 | pass 143 | 144 | try: 145 | d = ast.literal_eval(d) 146 | resp = c.update(d[0], {'$set': d[1]}) 147 | resp = 'Status: ' + str(resp) 148 | except (SyntaxError, TypeError, ValueError, NameError): 149 | resp = "Please Enter valid Query" 150 | 151 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 152 | 153 | if 'find' in q: 154 | c = db[q.split('.')[1]] 155 | if d: 156 | d = ast.literal_eval(d) 157 | 158 | if c is None: 159 | resp = 'Collection not found' 160 | else: 161 | if 'findOne' in q: 162 | resp = dumps(c.find_one(d)) 163 | resp = list(resp) 164 | else: 165 | resp = c.find(d) 166 | 167 | resp = list(resp) 168 | 169 | return render_to_response('home.html', {'documents': resp, 'request': request, 'coll_name': c.name, 'content': content}) 170 | resp = list(c.find()) 171 | return render_to_response('home.html', {'documents': resp, 'request': request, 'coll_name': c.name, 'content': content}) 172 | 173 | if 'drop' in q: 174 | try: 175 | c = db[q.split('.')[1]] 176 | c.drop() 177 | resp = "Status: Collection Dropped Succesfully" 178 | except Exception as e: 179 | resp = "Please Enter Valid Collection Name or Query" 180 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 181 | resp = "'Please Enter valid Query'" 182 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 183 | 184 | except Exception as e: 185 | return render_to_response('home.html', {'resp': resp, 'request': request, 'content': content}) 186 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MongoSlice.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MongoSlice.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/MongoSlice" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MongoSlice" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /static/js/jQuery.Itip.js: -------------------------------------------------------------------------------- 1 | ;(function($,document,window){ 2 | function Itip(element, options) { 3 | this.showItip = function(){ 4 | showItip(); 5 | }; 6 | 7 | this.hideItip = function(){ 8 | hideItip(); 9 | }; 10 | 11 | var defaults = { 12 | position: 'right', 13 | color: "#fff", 14 | backGround: '#24B2DA', 15 | fontSize: '12', 16 | interaction: false, 17 | content : false, //'false' 18 | autoClose: true, 19 | triggerBy: 'hover', 20 | animate: '', 21 | minWidth : "100", //auto, px 22 | maxWidth : "150", 23 | AfterOpen: function(){}, 24 | AfterClose: function(){} 25 | 26 | },$this, arrowColor,seftMain=this, 27 | _init = function(){ 28 | 29 | seftMain.options = $.extend(true,{},defaults,options); 30 | arrowColor = seftMain.options.position; 31 | seftMain.el = $(element); 32 | 33 | seftMain.elPos = {}; 34 | seftMain.elementPos = {}; 35 | _getElementPos(); 36 | _setProperty(); 37 | _setTooltipPos(seftMain.options.position); 38 | _initEvent(); 39 | }, 40 | _getElementPos = function(){ 41 | 42 | seftMain.elPos.left = seftMain.el.offset().left; 43 | seftMain.elPos.top = seftMain.el.offset().top - $(window).scrollTop(); 44 | seftMain.elPos.width = seftMain.el.width(); 45 | seftMain.elPos.height = seftMain.el.height(); 46 | if(seftMain.options.position === 'LorR') { 47 | arrowColor = seftMain.elPos.left < ($(window).width()-(seftMain.elPos.width+seftMain.elPos.left)) ? 'right':'left'; 48 | } 49 | 50 | }, 51 | 52 | setArrowColor = function(){ 53 | 54 | var bc = 'border-'+arrowColor+'-color', 55 | obj = {}; 56 | obj[bc] = seftMain.options.backGround; 57 | seftMain.mainTooltip.find('.arrow').css(obj); 58 | }, 59 | 60 | _setProperty = function(){ 61 | 62 | seftMain.tooltipWrapEl = $('
      ',{class: 'Itip-wrap'}); 63 | defaultCss = { 64 | 'position' : 'fixed', 65 | 'top': '20px', 66 | 'left': '50px' 67 | }; 68 | seftMain.options.content = seftMain.options.content == false ? seftMain.el.attr('data-Itip') : seftMain.options.content; 69 | seftMain.tooltipWrapEl.css(defaultCss).addClass("itip"); 70 | seftMain.itipInner = $('
      ',{ class: 'Itip-inner'}); 71 | seftMain.arrow = $('',{class : 'arrow',id : "arrow"}); 72 | seftMain.itipInner.append(seftMain.arrow,$('
      '+seftMain.options.content+'
      ')); 73 | seftMain.tooltipWrapEl.append(seftMain.itipInner); 74 | $('body').append(seftMain.tooltipWrapEl); 75 | seftMain.mainTooltip = seftMain.tooltipWrapEl;//-> can xem lai doan nay 76 | seftMain.mainTooltip.addClass('animated '+seftMain.options.animate).css({display: 'none','background': seftMain.options.backGround}); 77 | seftMain.mainTooltip.find('.Itip-content').css({'font-size': seftMain.options.fontSize + 'px','color': seftMain.options.color }); 78 | setArrowColor(); 79 | 80 | 81 | 82 | if (seftMain.options.minWidth != "auto" ) { 83 | seftMain.mainTooltip.css({"min-width": seftMain.options.minWidth + "px"}); 84 | }; 85 | if (seftMain.options.maxWidth != "auto" ) { 86 | seftMain.mainTooltip.css({"max-width": seftMain.options.maxWidth + "px"}); 87 | }; 88 | }, 89 | _setTooltipPos = function(pos){ 90 | 91 | var SetPos = function(arrow,top,right,bottom,left){ 92 | seftMain.mainTooltip.css({top: top ,right: right,bottom: bottom,left: left }); 93 | seftMain.arrow.removeClass(); 94 | seftMain.arrow.addClass(arrow + ' arrow'); 95 | } 96 | if(pos=='left'){ 97 | SetPos("right",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),$(window).width()-seftMain.elPos.left,"auto","auto"); 98 | } 99 | if(pos=='right'){ 100 | SetPos("left",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),"auto","auto",(seftMain.elPos.left + seftMain.elPos.width)); 101 | } 102 | if(pos=='bottom'){ 103 | SetPos("top",(seftMain.elPos.top + seftMain.elPos.height),'auto','auto',(seftMain.elPos.left + (seftMain.elPos.width-seftMain.mainTooltip.width())/2)); 104 | } 105 | if(pos=='top'){ 106 | SetPos('bottom',seftMain.elPos.top - seftMain.mainTooltip.height(),'auto','auto',seftMain.elPos.left + (seftMain.elPos.width-seftMain.mainTooltip.width())/2); 107 | } 108 | if(pos=='LorR'){ 109 | if(seftMain.elPos.left < ($(window).width()-(seftMain.elPos.width+seftMain.elPos.left))) { 110 | SetPos("left",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),"auto","auto",(seftMain.elPos.left + seftMain.elPos.width)); 111 | arrowColor = 'right'; 112 | setArrowColor(); 113 | //seftMain.options.position = 'right'; 114 | } else{ 115 | SetPos("right",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),$(window).width()-seftMain.elPos.left,"auto","auto"); 116 | //seftMain.options.position = 'left'; 117 | arrowColor = 'left'; 118 | setArrowColor(); 119 | } 120 | 121 | } 122 | }, 123 | _setInScreen =function(){ 124 | 125 | if(seftMain.mainTooltip.offset().left<0){ 126 | seftMain.mainTooltip.css({left: 0,right:"auto"}); 127 | }else if( (seftMain.mainTooltip.offset().left + seftMain.mainTooltip.width()) > $(window).width()){ 128 | seftMain.mainTooltip.css({right: 0,left: "auto"}); 129 | } 130 | } , 131 | showItip =function(){ 132 | 133 | seftMain.mainTooltip.show(50,function(){ 134 | seftMain.options.AfterOpen(); 135 | _setInScreen(); 136 | }); 137 | } , 138 | hideItip =function(){ 139 | 140 | seftMain.mainTooltip.hide(10,function(){ 141 | seftMain.options.AfterClose(); 142 | }); 143 | } , 144 | _initEvent = function(){ 145 | 146 | $(window).scroll(function(event) { 147 | /* Act on the event */ 148 | setTimeout(function(){ 149 | _getElementPos(); 150 | _setTooltipPos(seftMain.options.position); 151 | 152 | },10); 153 | }); 154 | 155 | $(window).resize(function(event) { 156 | /* Act on the event */ 157 | setTimeout(function(){ 158 | _getElementPos(); 159 | _setTooltipPos(seftMain.options.position); 160 | 161 | },10); 162 | }); 163 | 164 | var self = seftMain,attr = $(seftMain.el).attr('id') != undefined ? '#'+$(seftMain.el).attr('id') : '.' + $(seftMain.el).attr('class'); 165 | if(seftMain.options.triggerBy == "hover"){ 166 | 167 | $(seftMain.el).on('mouseenter', function(e) { 168 | if(!self.mainTooltip.is(':visible')) { 169 | showItip(); 170 | } 171 | e.preventDefault(); 172 | }); 173 | 174 | if(seftMain.options.autoClose == true ){ 175 | if( seftMain.options.interaction == true) { 176 | 177 | $(seftMain.el).on('mouseleave', function(e) { 178 | if($('.Itip-wrap:hover').length <= 0){ 179 | hideItip(); 180 | } 181 | e.preventDefault(); 182 | }); 183 | 184 | self.mainTooltip.on('mouseleave', function(event) { 185 | if($(attr+':hover').length ==0){ 186 | hideItip(); 187 | } 188 | }); 189 | 190 | }else { 191 | $(seftMain.el).on('mouseleave', function(e) { 192 | 193 | hideItip(); 194 | 195 | e.preventDefault(); 196 | }); 197 | } 198 | 199 | 200 | } 201 | } else if(seftMain.options.triggerBy == "click"){ 202 | 203 | $(seftMain.el).on('click', function(e) { 204 | if($(".Itip-wrap").is(':visible') == false) { 205 | showItip(); 206 | }else { 207 | hideItip(); 208 | } 209 | e.preventDefault(); 210 | }); 211 | } 212 | }; 213 | 214 | 215 | _init(); 216 | } 217 | 218 | $.fn["Itip"] = function(options){ 219 | var args = arguments; 220 | //debugger; 221 | if(options === undefined || typeof options === 'object') { 222 | return this.each(function(){ 223 | if(!$(this).data('Itip')){ 224 | $(this).data('Itip',new Itip(this,options)); 225 | } 226 | }); 227 | } else if(typeof options === 'string' && options[0] !== '_' && options){ 228 | var returns; 229 | this.each(function(){ 230 | var instance = $(this).data('Itip') == undefined ? $(this).data('Itip',new Itip(this,options)) : $(this).data('Itip') ; 231 | if(instance instanceof Itip && typeof instance[options] === 'function') { 232 | returns = instance[options].apply(instance,Array.prototype.slice.call(args,1)); 233 | } 234 | }); 235 | return returns !== undefined ? returns : this; 236 | } 237 | } 238 | 239 | 240 | }(jQuery,document,window)); 241 | -------------------------------------------------------------------------------- /static/js/jQuery.Itip.js~: -------------------------------------------------------------------------------- 1 | ;(function($,document,window){ 2 | function Itip(element, options) { 3 | this.showItip = function(){ 4 | showItip(); 5 | }; 6 | 7 | this.hideItip = function(){ 8 | hideItip(); 9 | }; 10 | 11 | var defaults = { 12 | position: 'right', 13 | color: "#fff", 14 | backGround: '#24B2DA', 15 | fontSize: '12', 16 | interaction: false, 17 | content : false, //'false' 18 | autoClose: true, 19 | triggerBy: 'hover', 20 | animate: '', 21 | minWidth : "100", //auto, px 22 | maxWidth : "150", 23 | AfterOpen: function(){}, 24 | AfterClose: function(){} 25 | 26 | },$this, arrowColor,seftMain=this, 27 | _init = function(){ 28 | 29 | seftMain.options = $.extend(true,{},defaults,options); 30 | arrowColor = seftMain.options.position; 31 | seftMain.el = $(element); 32 | 33 | seftMain.elPos = {}; 34 | seftMain.elementPos = {}; 35 | _getElementPos(); 36 | _setProperty(); 37 | _setTooltipPos(seftMain.options.position); 38 | _initEvent(); 39 | }, 40 | _getElementPos = function(){ 41 | 42 | seftMain.elPos.left = seftMain.el.offset().left; 43 | seftMain.elPos.top = seftMain.el.offset().top - $(window).scrollTop(); 44 | seftMain.elPos.width = seftMain.el.width(); 45 | seftMain.elPos.height = seftMain.el.height(); 46 | if(seftMain.options.position === 'LorR') { 47 | arrowColor = seftMain.elPos.left < ($(window).width()-(seftMain.elPos.width+seftMain.elPos.left)) ? 'right':'left'; 48 | } 49 | 50 | }, 51 | 52 | setArrowColor = function(){ 53 | 54 | var bc = 'border-'+arrowColor+'-color', 55 | obj = {}; 56 | obj[bc] = seftMain.options.backGround; 57 | seftMain.mainTooltip.find('.arrow').css(obj); 58 | }, 59 | 60 | _setProperty = function(){ 61 | 62 | seftMain.tooltipWrapEl = $('
      ',{class: 'Itip-wrap'}); 63 | defaultCss = { 64 | 'position' : 'fixed', 65 | 'top': '20px', 66 | 'left': '50px' 67 | }; 68 | seftMain.options.content = seftMain.options.content == false ? seftMain.el.attr('data-Itip') : seftMain.options.content; 69 | seftMain.tooltipWrapEl.css(defaultCss).addClass("itip"); 70 | seftMain.itipInner = $('
      ',{ class: 'Itip-inner'}); 71 | seftMain.arrow = $('',{class : 'arrow',id : "arrow"}); 72 | seftMain.itipInner.append(seftMain.arrow,$('
      '+seftMain.options.content+'
      ')); 73 | seftMain.tooltipWrapEl.append(seftMain.itipInner); 74 | $('body').append(seftMain.tooltipWrapEl); 75 | seftMain.mainTooltip = seftMain.tooltipWrapEl;//-> can xem lai doan nay 76 | seftMain.mainTooltip.addClass('animated '+seftMain.options.animate).css({display: 'none','background': seftMain.options.backGround}); 77 | seftMain.mainTooltip.find('.Itip-content').css({'font-size': seftMain.options.fontSize + 'px','color': seftMain.options.color }); 78 | setArrowColor(); 79 | 80 | 81 | 82 | if (seftMain.options.minWidth != "auto" ) { 83 | seftMain.mainTooltip.css({"min-width": seftMain.options.minWidth + "px"}); 84 | }; 85 | if (seftMain.options.maxWidth != "auto" ) { 86 | seftMain.mainTooltip.css({"max-width": seftMain.options.maxWidth + "px"}); 87 | }; 88 | }, 89 | _setTooltipPos = function(pos){ 90 | 91 | var SetPos = function(arrow,top,right,bottom,left){ 92 | seftMain.mainTooltip.css({top: top ,right: right,bottom: bottom,left: left }); 93 | seftMain.arrow.removeClass(); 94 | seftMain.arrow.addClass(arrow + ' arrow'); 95 | } 96 | if(pos=='left'){ 97 | SetPos("right",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),$(window).width()-seftMain.elPos.left,"auto","auto"); 98 | } 99 | if(pos=='right'){ 100 | SetPos("left",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),"auto","auto",(seftMain.elPos.left + seftMain.elPos.width)); 101 | } 102 | if(pos=='bottom'){ 103 | SetPos("top",(seftMain.elPos.top + seftMain.elPos.height),'auto','auto',(seftMain.elPos.left + (seftMain.elPos.width-seftMain.mainTooltip.width())/2)); 104 | } 105 | if(pos=='top'){ 106 | SetPos('bottom',seftMain.elPos.top - seftMain.mainTooltip.height(),'auto','auto',seftMain.elPos.left + (seftMain.elPos.width-seftMain.mainTooltip.width())/2); 107 | } 108 | if(pos=='LorR'){ 109 | if(seftMain.elPos.left < ($(window).width()-(seftMain.elPos.width+seftMain.elPos.left))) { 110 | SetPos("left",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),"auto","auto",(seftMain.elPos.left + seftMain.elPos.width)); 111 | arrowColor = 'right'; 112 | setArrowColor(); 113 | //seftMain.options.position = 'right'; 114 | } else{ 115 | SetPos("right",(seftMain.elPos.top + (seftMain.elPos.height/2) - seftMain.mainTooltip.height()/2),$(window).width()-seftMain.elPos.left,"auto","auto"); 116 | //seftMain.options.position = 'left'; 117 | arrowColor = 'left'; 118 | setArrowColor(); 119 | } 120 | 121 | } 122 | }, 123 | _setInScreen =function(){ 124 | 125 | if(seftMain.mainTooltip.offset().left<0){ 126 | seftMain.mainTooltip.css({left: 0,right:"auto"}); 127 | }else if( (seftMain.mainTooltip.offset().left + seftMain.mainTooltip.width()) > $(window).width()){ 128 | seftMain.mainTooltip.css({right: 0,left: "auto"}); 129 | } 130 | } , 131 | showItip =function(){ 132 | 133 | seftMain.mainTooltip.show(50,function(){ 134 | seftMain.options.AfterOpen(); 135 | _setInScreen(); 136 | }); 137 | } , 138 | hideItip =function(){ 139 | 140 | seftMain.mainTooltip.hide(10,function(){ 141 | seftMain.options.AfterClose(); 142 | }); 143 | } , 144 | _initEvent = function(){ 145 | 146 | $(window).scroll(function(event) { 147 | /* Act on the event */ 148 | setTimeout(function(){ 149 | _getElementPos(); 150 | _setTooltipPos(seftMain.options.position); 151 | 152 | },10); 153 | }); 154 | 155 | $(window).resize(function(event) { 156 | /* Act on the event */ 157 | setTimeout(function(){ 158 | _getElementPos(); 159 | _setTooltipPos(seftMain.options.position); 160 | 161 | },10); 162 | }); 163 | 164 | var self = seftMain,attr = $(seftMain.el).attr('id') != undefined ? '#'+$(seftMain.el).attr('id') : '.' + $(seftMain.el).attr('class'); 165 | if(seftMain.options.triggerBy == "hover"){ 166 | 167 | $(seftMain.el).on('mouseenter', function(e) { 168 | if(!self.mainTooltip.is(':visible')) { 169 | showItip(); 170 | } 171 | e.preventDefault(); 172 | }); 173 | 174 | if(seftMain.options.autoClose == true ){ 175 | if( seftMain.options.interaction == true) { 176 | 177 | $(seftMain.el).on('mouseleave', function(e) { 178 | if($('.Itip-wrap:hover').length <= 0){ 179 | hideItip(); 180 | } 181 | e.preventDefault(); 182 | }); 183 | 184 | self.mainTooltip.on('mouseleave', function(event) { 185 | if($(attr+':hover').length ==0){ 186 | hideItip(); 187 | } 188 | }); 189 | 190 | }else { 191 | $(seftMain.el).on('mouseleave', function(e) { 192 | 193 | hideItip(); 194 | 195 | e.preventDefault(); 196 | }); 197 | } 198 | 199 | 200 | } 201 | } else if(seftMain.options.triggerBy == "click"){ 202 | 203 | $(seftMain.el).on('click', function(e) { 204 | if($(".Itip-wrap").is(':visible') == false) { 205 | showItip(); 206 | }else { 207 | hideItip(); 208 | } 209 | e.preventDefault(); 210 | }); 211 | } 212 | }; 213 | 214 | 215 | _init(); 216 | } 217 | 218 | $.fn["Itip"] = function(options){ 219 | var args = arguments; 220 | //debugger; 221 | if(options === undefined || typeof options === 'object') { 222 | return this.each(function(){ 223 | if(!$(this).data('Itip')){ 224 | $(this).data('Itip',new Itip(this,options)); 225 | } 226 | }); 227 | } else if(typeof options === 'string' && options[0] !== '_' && options){ 228 | var returns; 229 | this.each(function(){ 230 | var instance = $(this).data('Itip') == undefined ? $(this).data('Itip',new Itip(this,options)) : $(this).data('Itip') ; 231 | if(instance instanceof Itip && typeof instance[options] === 'function') { 232 | returns = instance[options].apply(instance,Array.prototype.slice.call(args,1)); 233 | } 234 | }); 235 | return returns !== undefined ? returns : this; 236 | } 237 | } 238 | 239 | 240 | }(jQuery,document,window)); 241 | -------------------------------------------------------------------------------- /static/css/demo.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Flat UI Free v2.2.2 (http://designmodo.github.io/Flat-UI/) 3 | * Copyright 2013-2014 Designmodo, Inc. 4 | */ 5 | 6 | /* Prettyfy Theme */ 7 | .prettyprint { 8 | padding: 15px 21px; 9 | font-family: Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace; 10 | background-color: #f7f7f9; 11 | border: 2px solid #e1e1e8; 12 | } 13 | .pln { 14 | color: #333; 15 | } 16 | @media screen { 17 | .str { 18 | color: #d14; 19 | } 20 | .kwd { 21 | color: #333; 22 | } 23 | .com { 24 | color: #998; 25 | } 26 | .typ { 27 | color: #458; 28 | } 29 | .lit { 30 | color: #458; 31 | } 32 | .pun { 33 | color: #333; 34 | } 35 | .opn { 36 | color: #333; 37 | } 38 | .clo { 39 | color: #333; 40 | } 41 | .tag { 42 | color: navy; 43 | } 44 | .atn { 45 | color: teal; 46 | } 47 | .atv { 48 | color: #d14; 49 | } 50 | .dec { 51 | color: #333; 52 | } 53 | .var { 54 | color: teal; 55 | } 56 | .fun { 57 | color: #900; 58 | } 59 | } 60 | @media print, projection { 61 | .str { 62 | color: #060; 63 | } 64 | .kwd { 65 | font-weight: bold; 66 | color: #006; 67 | } 68 | .com { 69 | font-style: italic; 70 | color: #600; 71 | } 72 | .typ { 73 | font-weight: bold; 74 | color: #404; 75 | } 76 | .lit { 77 | color: #044; 78 | } 79 | .pun, 80 | .opn, 81 | .clo { 82 | color: #440; 83 | } 84 | .tag { 85 | font-weight: bold; 86 | color: #006; 87 | } 88 | .atn { 89 | color: #404; 90 | } 91 | .atv { 92 | color: #060; 93 | } 94 | } 95 | /* Specify class=linenums on a pre to get line numbering */ 96 | ol.linenums { 97 | margin-top: 0; 98 | margin-bottom: 0; 99 | } 100 | .container { 101 | width: 970px !important; 102 | } 103 | .demo-headline { 104 | padding: 73px 0 110px; 105 | text-align: center; 106 | } 107 | .demo-logo { 108 | margin: 10px 0; 109 | font: 900 90px/100px "Helvetica Neue", Helvetica, Arial, sans-serif; 110 | letter-spacing: -2px; 111 | } 112 | .demo-logo .logo { 113 | width: 236px; 114 | height: 181px; 115 | margin: 0 auto 26px; 116 | overflow: hidden; 117 | text-indent: -9999em; 118 | background: url(../img/demo/logo-mask.png) center 0 no-repeat; 119 | background-size: 236px 181px; 120 | } 121 | .demo-logo small { 122 | display: block; 123 | padding-top: 5px; 124 | font-size: 22px; 125 | font-weight: 700; 126 | color: rgba(52, 73, 94, .3); 127 | letter-spacing: 0; 128 | } 129 | .demo-row { 130 | margin-bottom: 20px; 131 | } 132 | .demo-row .demo-heading-note, 133 | .demo-row .demo-text-note { 134 | position: absolute; 135 | bottom: 10px; 136 | left: 0; 137 | display: block; 138 | width: 260px; 139 | font-size: 13px; 140 | font-weight: 400; 141 | line-height: 13px; 142 | color: #c0c1c2; 143 | } 144 | .demo-row .demo-text-note { 145 | top: 10px; 146 | bottom: auto; 147 | } 148 | .demo-row.typography-row .demo-content { 149 | float: none; 150 | width: auto; 151 | clear: both; 152 | } 153 | .demo-row.typography-row .demo-type-example { 154 | position: relative; 155 | padding-left: 25%; 156 | margin-bottom: 40px; 157 | } 158 | .demo-section-title { 159 | margin: 10px 0; 160 | font: 900 32px/40px "Helvetica Neue", Helvetica, Arial, sans-serif; 161 | } 162 | .demo-panel-title { 163 | padding-top: 20px; 164 | margin: 2px 0 20px; 165 | font: bold 23px/40px "Helvetica Neue", Helvetica, Arial, sans-serif; 166 | } 167 | .demo-panel-title small { 168 | font-size: inherit; 169 | font-weight: 400; 170 | color: #798795; 171 | } 172 | .demo-navigation { 173 | margin-top: -10px; 174 | margin-bottom: -4px; 175 | } 176 | .demo-pager { 177 | margin-top: -20px; 178 | } 179 | .demo-tooltips { 180 | height: 126px; 181 | } 182 | .demo-tooltips .tooltip { 183 | position: relative !important; 184 | top: -8px !important; 185 | left: -8px !important; 186 | } 187 | .demo-headings { 188 | margin-bottom: 12px; 189 | } 190 | .demo-tiles { 191 | margin-bottom: 46px; 192 | } 193 | .demo-icons { 194 | padding-left: 20px; 195 | margin-left: -20px; 196 | font-size: 32px; 197 | } 198 | .demo-icons .demo-content { 199 | margin: 0 0 0 -35px; 200 | } 201 | .demo-icons .demo-content > span { 202 | display: inline-block; 203 | width: 24px; 204 | margin: 0 0 32px 35px; 205 | font-size: 24px; 206 | } 207 | .demo-icons-tooltip { 208 | position: absolute; 209 | bottom: 0; 210 | left: 100%; 211 | width: 80px; 212 | margin-left: 0 !important; 213 | font-size: 12px; 214 | color: #c2c8cf; 215 | } 216 | .demo-illustrations .demo-content { 217 | padding-top: 20px; 218 | margin: 0 0 0 -40px; 219 | } 220 | .demo-illustrations .demo-content:before, 221 | .demo-illustrations .demo-content:after { 222 | display: table; 223 | content: " "; 224 | } 225 | .demo-illustrations .demo-content:after { 226 | clear: both; 227 | } 228 | .demo-illustrations .demo-content > div { 229 | float: left; 230 | width: 100px; 231 | height: 100px; 232 | margin: 0 0 40px 40px; 233 | line-height: 100px; 234 | text-align: center; 235 | } 236 | .demo-illustrations img { 237 | display: inline-block; 238 | max-width: 100px; 239 | max-height: 100px; 240 | vertical-align: middle; 241 | } 242 | .demo-samples { 243 | margin-bottom: 46px; 244 | } 245 | .demo-download-section { 246 | float: none; 247 | padding: 60px 0 90px 20px; 248 | margin: 0 auto; 249 | text-align: center; 250 | } 251 | .demo-download-section [class*='fui-'] { 252 | margin: 3px 0 -3px; 253 | } 254 | .demo-download { 255 | width: 190px; 256 | height: 190px; 257 | padding: 40px 28px 30px 32px; 258 | margin: 0 auto 32px; 259 | text-align: center; 260 | background-color: #ebedef; 261 | border-radius: 50%; 262 | } 263 | .demo-download img { 264 | width: 82px; 265 | height: 104px; 266 | } 267 | .demo-download-text { 268 | padding: 20px 0; 269 | font-size: 15px; 270 | text-align: center; 271 | } 272 | .demo-text-box a:hover { 273 | color: #1abc9c; 274 | } 275 | .demo-browser { 276 | padding-top: 42px; 277 | margin: 0 41px 140px 0; 278 | color: #fff; 279 | background: #2c3e50 url(../img/demo/browser.png) 0 0 no-repeat; 280 | background-size: 659px 42px; 281 | border-radius: 0 0 6px 6px; 282 | } 283 | .demo-browser-side { 284 | float: left; 285 | width: 151px; 286 | padding: 22px 20px; 287 | } 288 | .demo-browser-side > h5 { 289 | margin-top: 4px; 290 | margin-bottom: 3px; 291 | font-size: 16px; 292 | font-weight: 400; 293 | text-transform: none; 294 | } 295 | .demo-browser-side > h6 { 296 | margin-top: 3px; 297 | font-size: 11px; 298 | font-weight: 300; 299 | line-height: 18px; 300 | text-transform: none; 301 | 302 | -webkit-font-smoothing: subpixel-antialiased; 303 | } 304 | .demo-browser-author { 305 | display: block; 306 | width: 84px; 307 | height: 84px; 308 | margin: 0 auto; 309 | background: url(../img/demo/browser-author.jpg) center no-repeat; 310 | border: 3px solid #fff; 311 | border-radius: 50%; 312 | } 313 | .demo-browser-action { 314 | padding: 30px 0 12px; 315 | } 316 | .demo-browser-action > .btn { 317 | padding: 7px 0 8px 11px !important; 318 | text-align: left; 319 | border-radius: 3px; 320 | } 321 | .demo-browser-action > .btn > [class^="fui-"] { 322 | position: relative; 323 | top: 1px; 324 | margin-right: 12px; 325 | } 326 | .demo-browser-content { 327 | padding: 21px 0 0 20px; 328 | overflow: hidden; 329 | background-color: #34495e; 330 | border-radius: 0 0 6px; 331 | } 332 | .demo-browser-content > img { 333 | float: left; 334 | width: 146px; 335 | margin: 0 15px 20px 0; 336 | border: 6px solid #fff; 337 | } 338 | @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 2) { 339 | .logo { 340 | background-image: url(../img/demo/logo-mask-2x.png); 341 | } 342 | .demo-browser { 343 | background-image: url(../img/demo/browser-2x.png); 344 | } 345 | } 346 | .demo-swatches-row [class*="col"] { 347 | float: left; 348 | min-height: 1px; 349 | } 350 | .demo-swatches-row .swatches-col { 351 | width: 800px; 352 | margin-left: -5px; 353 | } 354 | .demo-swatches-row .swatches-desc-col { 355 | width: 140px; 356 | margin-left: 20px; 357 | } 358 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Mongo Slice documentation build configuration file, created by 4 | # sphinx-quickstart on Wed Feb 25 14:03:50 2015. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [ 32 | 'sphinx.ext.autodoc', 33 | ] 34 | 35 | # Add any paths that contain templates here, relative to this directory. 36 | templates_path = ['ntemplates'] 37 | 38 | # The suffix of source filenames. 39 | source_suffix = '.rst' 40 | 41 | # The encoding of source files. 42 | #source_encoding = 'utf-8-sig' 43 | 44 | # The master toctree document. 45 | master_doc = 'index' 46 | 47 | # General information about the project. 48 | project = u'Mongo Slice' 49 | copyright = u'2015, Ashwin Kumar' 50 | 51 | # The version info for the project you're documenting, acts as replacement for 52 | # |version| and |release|, also used in various other places throughout the 53 | # built documents. 54 | # 55 | # The short X.Y version. 56 | version = '0.1' 57 | # The full version, including alpha/beta/rc tags. 58 | release = '0.1' 59 | 60 | # The language for content autogenerated by Sphinx. Refer to documentation 61 | # for a list of supported languages. 62 | #language = None 63 | 64 | # There are two options for replacing |today|: either, you set today to some 65 | # non-false value, then it is used: 66 | #today = '' 67 | # Else, today_fmt is used as the format for a strftime call. 68 | #today_fmt = '%B %d, %Y' 69 | 70 | # List of patterns, relative to source directory, that match files and 71 | # directories to ignore when looking for source files. 72 | exclude_patterns = [] 73 | 74 | # The reST default role (used for this markup: `text`) to use for all 75 | # documents. 76 | #default_role = None 77 | 78 | # If true, '()' will be appended to :func: etc. cross-reference text. 79 | #add_function_parentheses = True 80 | 81 | # If true, the current module name will be prepended to all description 82 | # unit titles (such as .. function::). 83 | #add_module_names = True 84 | 85 | # If true, sectionauthor and moduleauthor directives will be shown in the 86 | # output. They are ignored by default. 87 | #show_authors = False 88 | 89 | # The name of the Pygments (syntax highlighting) style to use. 90 | pygments_style = 'sphinx' 91 | 92 | # A list of ignored prefixes for module index sorting. 93 | #modindex_common_prefix = [] 94 | 95 | # If true, keep warnings as "system message" paragraphs in the built documents. 96 | #keep_warnings = False 97 | 98 | 99 | # -- Options for HTML output ---------------------------------------------- 100 | 101 | # The theme to use for HTML and HTML Help pages. See the documentation for 102 | # a list of builtin themes. 103 | html_theme = 'default' 104 | 105 | # Theme options are theme-specific and customize the look and feel of a theme 106 | # further. For a list of options available for each theme, see the 107 | # documentation. 108 | #html_theme_options = {} 109 | 110 | # Add any paths that contain custom themes here, relative to this directory. 111 | #html_theme_path = [] 112 | 113 | # The name for this set of Sphinx documents. If None, it defaults to 114 | # " v documentation". 115 | #html_title = None 116 | 117 | # A shorter title for the navigation bar. Default is the same as html_title. 118 | #html_short_title = None 119 | 120 | # The name of an image file (relative to this directory) to place at the top 121 | # of the sidebar. 122 | #html_logo = None 123 | 124 | # The name of an image file (within the static path) to use as favicon of the 125 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 126 | # pixels large. 127 | #html_favicon = None 128 | 129 | # Add any paths that contain custom static files (such as style sheets) here, 130 | # relative to this directory. They are copied after the builtin static files, 131 | # so a file named "default.css" will overwrite the builtin "default.css". 132 | html_static_path = ['nstatic'] 133 | 134 | # Add any extra paths that contain custom files (such as robots.txt or 135 | # .htaccess) here, relative to this directory. These files are copied 136 | # directly to the root of the documentation. 137 | #html_extra_path = [] 138 | 139 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 140 | # using the given strftime format. 141 | #html_last_updated_fmt = '%b %d, %Y' 142 | 143 | # If true, SmartyPants will be used to convert quotes and dashes to 144 | # typographically correct entities. 145 | #html_use_smartypants = True 146 | 147 | # Custom sidebar templates, maps document names to template names. 148 | #html_sidebars = {} 149 | 150 | # Additional templates that should be rendered to pages, maps page names to 151 | # template names. 152 | #html_additional_pages = {} 153 | 154 | # If false, no module index is generated. 155 | #html_domain_indices = True 156 | 157 | # If false, no index is generated. 158 | #html_use_index = True 159 | 160 | # If true, the index is split into individual pages for each letter. 161 | #html_split_index = False 162 | 163 | # If true, links to the reST sources are added to the pages. 164 | #html_show_sourcelink = True 165 | 166 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 167 | #html_show_sphinx = True 168 | 169 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 170 | #html_show_copyright = True 171 | 172 | # If true, an OpenSearch description file will be output, and all pages will 173 | # contain a tag referring to it. The value of this option must be the 174 | # base URL from which the finished HTML is served. 175 | #html_use_opensearch = '' 176 | 177 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 178 | #html_file_suffix = None 179 | 180 | # Output file base name for HTML help builder. 181 | htmlhelp_basename = 'MongoSlicedoc' 182 | 183 | 184 | # -- Options for LaTeX output --------------------------------------------- 185 | 186 | latex_elements = { 187 | # The paper size ('letterpaper' or 'a4paper'). 188 | #'papersize': 'letterpaper', 189 | 190 | # The font size ('10pt', '11pt' or '12pt'). 191 | #'pointsize': '10pt', 192 | 193 | # Additional stuff for the LaTeX preamble. 194 | #'preamble': '', 195 | } 196 | 197 | # Grouping the document tree into LaTeX files. List of tuples 198 | # (source start file, target name, title, 199 | # author, documentclass [howto, manual, or own class]). 200 | latex_documents = [ 201 | ('index', 'MongoSlice.tex', u'Mongo Slice Documentation', 202 | u'Ashwin Kumar', 'manual'), 203 | ] 204 | 205 | # The name of an image file (relative to this directory) to place at the top of 206 | # the title page. 207 | #latex_logo = None 208 | 209 | # For "manual" documents, if this is true, then toplevel headings are parts, 210 | # not chapters. 211 | #latex_use_parts = False 212 | 213 | # If true, show page references after internal links. 214 | #latex_show_pagerefs = False 215 | 216 | # If true, show URL addresses after external links. 217 | #latex_show_urls = False 218 | 219 | # Documents to append as an appendix to all manuals. 220 | #latex_appendices = [] 221 | 222 | # If false, no module index is generated. 223 | #latex_domain_indices = True 224 | 225 | 226 | # -- Options for manual page output --------------------------------------- 227 | 228 | # One entry per manual page. List of tuples 229 | # (source start file, name, description, authors, manual section). 230 | man_pages = [ 231 | ('index', 'mongoslice', u'Mongo Slice Documentation', 232 | [u'Ashwin Kumar'], 1) 233 | ] 234 | 235 | # If true, show URL addresses after external links. 236 | #man_show_urls = False 237 | 238 | 239 | # -- Options for Texinfo output ------------------------------------------- 240 | 241 | # Grouping the document tree into Texinfo files. List of tuples 242 | # (source start file, target name, title, author, 243 | # dir menu entry, description, category) 244 | texinfo_documents = [ 245 | ('index', 'MongoSlice', u'Mongo Slice Documentation', 246 | u'Ashwin Kumar', 'MongoSlice', 'One line description of project.', 247 | 'Miscellaneous'), 248 | ] 249 | 250 | # Documents to append as an appendix to all manuals. 251 | #texinfo_appendices = [] 252 | 253 | # If false, no module index is generated. 254 | #texinfo_domain_indices = True 255 | 256 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 257 | #texinfo_show_urls = 'footnote' 258 | 259 | # If true, do not generate a @detailmenu in the "Top" node's menu. 260 | #texinfo_no_detailmenu = False 261 | -------------------------------------------------------------------------------- /static/css/m-style.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | body{font-family: 'Exo 2', sans-serif; 4 | padding:0px;margin:0px;/*padding-top:50px;*/background:#ededeb; font-size: 13px;} 5 | 6 | .row{margin:0px;padding:0px;} 7 | span{display:block;} 8 | .fn12{font-size:12px;font-weight:normal;} 9 | .fn13{font-size:13px;font-weight:normal;} 10 | .fn14{font-size:14px;font-weight:normal;} 11 | .fn16{font-size:16px;font-weight:normal;} 12 | .fb12{font-size:12px;font-weight:bold;} 13 | .fb13{font-size:13px;font-weight:bold;} 14 | .fb14{font-size:14px;font-weight:bold;} 15 | .fb15{font-size:15px;font-weight:bold;} 16 | .fb16{font-size:16px;font-weight:bold;} 17 | .fb20{font-size:20px;font-weight:bold;} 18 | .tup{text-transform:uppercase;} 19 | .top-bg{} 20 | .top-bg .navbar-default {background-color: #3f4d57;border:none;} 21 | .top-bg .navbar {border-radius: 0px;} 22 | .top-bg .navbar-brand{color:#ffcc00;display:inline-block;text-shadow: 0 1px 0px #dca403;text-shadow:none;} 23 | .top-bg .navbar-brand:hover{background:#b23b20;color:#fff;text-shadow:none;} 24 | .login{} .login .panel{border-radius:4px;background: #f3f3f3; /* Old browsers */ 25 | box-shadow: 0 0 15px #bbb;} 26 | .login .panel-default>.panel-heading{background:#eb6126;} 27 | .login .panel-title{font-size:13px;font-weight:bold;text-shadow: 0 2px 0px #d94506;} 28 | .login .panel .panel-heading{text-shadow: 0 1px 0px #86250e;color:#fff;padding:15px;} 29 | .login .panel-body{background:#f3f3f3;color:#d5d5d5;} 30 | .login .input-group{margin-bottom:14px;} .login .input-group:last-child{margin-bottom:0px;} 31 | .login .input-group span{background:#40bac8;color:#259fad;border:1px solid #40bac8;} 32 | .login .form-control{background:#fff;color:#000;border:0px;border-radius:3px;box-shadow:none;border:1px solid #d5d5d5;padding:18px 13px;font-size:13px;} 33 | .login .log-btn{color: #FFFFFF;border:none;background-color: #56b76a;border:1px solid #4db062;padding:10px 15px;border-radius:3px;} 34 | .login .log-btn:hover{background:#4db062;} 35 | .login .panel-footer{background:none;border:none;}.container{padding-top:20px;}.odd {background:#f3f3f3;} 36 | .db-box{font-size:12px;color:#999;} 37 | .db-box .panel{border-radius:4px;border:8px solid #e7e7e5;box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;}.db-box .table>tbody>tr>td a{color:#999;}.db-box .table>tbody>tr>td a:hover{text-decoration:none;} 38 | .db-box .panel .panel-heading{background:#2d3c48;color:#9da7af;}.db-box .table>thead>tr>th{color:#fff;background:#9da7af;} 39 | .db-box .table>tbody>tr>td{border:none;padding:9px 8px;} 40 | 41 | 42 | .menu{border-right:3px solid #ccc;width:15%;float:left;background:#eee;display: block;position: fixed;top: 0px;height: 100%;left:0px;z-index: 1;overflow: hidden;padding-top:50px;} 43 | .menu .list-group{text-align:center;}.menu .list-group span{font-size:24px;margin-bottom:5px;display:block;} 44 | .menu .list-group .list-group-item{border:none;background:#eee;margin-bottom:2px;border-radius:0px;display:block;width:100%; 45 | padding:0px;} 46 | .menu .list-group .list-group-item a{color:#fff;display:block;padding:10px;background:#eb6126;text-shadow: 0 1px 0px #d84d11;} 47 | .menu .list-group .list-group-item a:hover{color:#fcd53b;display:block;text-decoration:none;background:#40bac8;transition:0.4s all ease-out;text-shadow: 0 1px 0px #259fad;} 48 | 49 | .container{width:85%;float:left;display: block;position: absolute;left:15%;height:auto;"} 50 | .footer{width:85%;bottom:0px;background:#40bac8;border-top:3px solid #ffcc00;position:fixed;overflow:hidden;z-index:1;left:15%;color:#fff;} 51 | .footer ul{margin:0px;padding:0px;}.footer ul li{float:left;background:none;border:none;border-radius:0px;background:#259fad;margin-right:4px;} 52 | .footer .list-group-item{border-radius:0px;}.footer .list-group-item:last-child{float:right;margin-right:0px;} 53 | 54 | 55 | /*wireframe */ 56 | article.wireframe-container, 57 | article.wire_robo{ 58 | position: absolute; 59 | height: 100%; 60 | width: 100%; 61 | } 62 | .tree-div{ 63 | padding:0px !important; 64 | position: absolute; 65 | height: 100%; 66 | background: #fff; 67 | /*background: #3f4d57; 68 | color: #fff;*/ 69 | border-right:2px solid #ddd; 70 | } 71 | .treeview{ 72 | padding:0px; 73 | } 74 | .treeview i{ 75 | padding-right: 5px; 76 | } 77 | .treeview i.fa-database, 78 | .connect-db-div span i.fa-database{ 79 | color: #95A5A6; 80 | } 81 | .treeview i.fa-folder{ 82 | color: #E67E22; 83 | } 84 | .treeview i.fa-table { 85 | color: #2980B9; 86 | } 87 | .treeview li ul{ 88 | padding-left:0px; 89 | margin-top:5px; 90 | } 91 | .treeview li ul li ul li{ 92 | padding-left:8px; 93 | } 94 | 95 | .mt{ 96 | margin:0px; 97 | } 98 | .txt-area-div{ 99 | margin-top: 20px; 100 | } 101 | .txt-area-div textarea.form-control{ 102 | background:#494c4e; 103 | color: #fff; 104 | } 105 | .form-control{ 106 | border-radius: 0px; 107 | } 108 | .submit-btn-wireframe{ 109 | width: 15%; 110 | float: right; 111 | margin-top: 15px; 112 | } 113 | .submit-btn-wireframe a{ 114 | padding: 5px 19px; 115 | } 116 | .result-div-wireframe{ 117 | min-height: 380px; 118 | border:2px solid #ddd; 119 | margin-top: 20px; 120 | background: #fff; 121 | padding: 10px; 122 | } 123 | .tree-div .file-icon{ 124 | padding-right: 5px; 125 | } 126 | /* wireframe*/ 127 | /*nav-bar*/ 128 | .navbar{ 129 | margin-bottom: 0px; 130 | } 131 | /*.top-bg .navbar-default { 132 | background-color: #1abc9c; 133 | } 134 | .top-bg .navbar-brand{ 135 | color: #34495e; 136 | font-weight: 600; 137 | padding-top: 20px; 138 | } 139 | .top-bg .navbar-brand:hover{ 140 | background:#34495e; 141 | color: #1abc9c !important; 142 | }*/ 143 | /*nav-bar*/ 144 | /*login*/ 145 | .login_title{ 146 | text-align: center; 147 | font-weight: bold; 148 | color: #fff; 149 | text-shadow:0 0 15px #bbb; 150 | font-size: 37px; 151 | } 152 | /*login*/ 153 | 154 | /*wire_robo*/ 155 | .wire_robo .top-row{ 156 | padding: 5px 10px; 157 | background: #f2f2f2; 158 | border-bottom: 2px solid #ddd; 159 | } 160 | .wire_robo .top-row .stop_play{ 161 | padding-top: 3px; 162 | } 163 | .wire_robo .top-row .stop_play i{ 164 | font-size:18px; 165 | } 166 | .wire_robo .top-row .stop_play span{ 167 | display: inline-block; 168 | padding-right: 9px; 169 | font-size: 18px; 170 | } 171 | .wire_robo .top-row .stop_play a.stop-debug{ 172 | color: #D35400; 173 | } 174 | .wire_robo .top-row .stop_play a.stop-debug:hover{ 175 | color: #E67E22; 176 | } 177 | .wire_robo .top-row .stop_play a.stop-debug i{ 178 | font-size: 23px; 179 | } 180 | .home-page-btn a{ 181 | float: right; 182 | padding: 5px 10px; 183 | border-radius: 0px; 184 | font-size: 13px; 185 | border: 1px solid #e74c3c; 186 | } 187 | .home-page-btn a:hover{ 188 | background: inherit; 189 | border: 1px solid #e74c3c; 190 | color: #e74c3c; 191 | } 192 | .home-page-btn a.btn-block{ 193 | width: auto; 194 | } 195 | .home-page-btn a span{ 196 | display: inline-block; 197 | padding-right: 0px; 198 | } 199 | .content-div-robo{ 200 | padding: 0px; 201 | } 202 | .connect-db-div{ 203 | /*background: #fff; 204 | box-shadow: 1px 1px 0.5px #bbb;*/ 205 | margin-top: 1px; 206 | padding: 10px 5px; 207 | padding-left: 12px; 208 | } 209 | .connect-db-div span{ 210 | display: inline-block; 211 | padding-right: 25px; 212 | } 213 | .connect-db-div span i{ 214 | padding-right: 8px; 215 | } 216 | .connect-db-div span i.fa-desktop{ 217 | color: #8E44AD; 218 | } 219 | .connect-db-div span i.fa-user{ 220 | color: #3498DB; 221 | } 222 | .sublime-div textarea, 223 | .result-div-tree, 224 | .result-div-error{ 225 | width: 98%; 226 | margin: 0px auto; 227 | } 228 | .sublime-div textarea{ 229 | background:#272822; 230 | color: #fff; 231 | } 232 | .result-div-tree, 233 | .result-div-error{ 234 | margin-top: 15px; 235 | height: 100%; 236 | background: #fff; 237 | } 238 | .result-div-error{ 239 | /*display: none;*/ 240 | } 241 | .result-div-tree .tree-view-div{ 242 | padding: 0px; 243 | min-height: 510px; 244 | background: #fff; 245 | } 246 | .result-div-tree .tree-view-div .icons{ 247 | border-bottom: 1px solid #ddd; 248 | padding:5px; 249 | } 250 | .result-div-tree .tree-view-div .icons span, 251 | .result-div-tree .tree-view-div .icons div.demo-wrap { 252 | display: inline-block; 253 | padding-right: 25px; 254 | } 255 | .result-div-tree .tree-view-div .icons span i{ 256 | color: #95A5A6; 257 | padding-right: 5px; 258 | } 259 | .result-div-tree .tree-view-div .icons span.pagenation{ 260 | float: right; 261 | padding-right: 5px; 262 | } 263 | .result-div-tree .tree-view-div .icons span.pagenation i{ 264 | font-size:16px; 265 | padding-top: 2px; 266 | } 267 | .result-div-tree .tree-view-div .icons span.pagenation i.fa-caret-left{ 268 | padding-right: 15px; 269 | } 270 | .result-div-tree .tree-view-div .icons span.pagenation i.fa-caret-right{ 271 | padding-right: 0px; 272 | padding-left: 15px; 273 | } 274 | .tree-table-div .treeview li, 275 | .tree-table-div .treeview li ul li{ 276 | text-indent: 0%; 277 | padding-right: 0px; 278 | } 279 | .tree-table-div .treeview .value_type, 280 | .head-tree-result-div .value_type{ 281 | width: 250px; 282 | float: right; 283 | } 284 | .head-tree-result-div{ 285 | background: #1abc9c; 286 | color: #fff; 287 | font-weight: 600; 288 | } 289 | .home-page-btn{ 290 | Padding:0px; 291 | } 292 | .home-page-btn .list-inline { 293 | padding-left: 0; 294 | margin-left: -5px; 295 | list-style: none; 296 | margin: 0px; 297 | padding: 0px; 298 | text-align: RIGHT; 299 | } 300 | /*wire_robo*/ -------------------------------------------------------------------------------- /static/js/jquery.flippy.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | FLIPPY jQuery plugin (http://guilhemmarty.com/flippy) 4 | Released under MIT Licence (http://www.opensource.org/licenses/MIT) 5 | 6 | @author : Guilhem MARTY (bonjour@guilhemmarty.com) 7 | 8 | @version: 1.3 9 | 10 | @changelog: 11 | 12 | May 21 2013 - v1.3 : added revert callbacks, direction option is not case sensitive 13 | 14 | Apr 06 2013 - v1.2 : can now use CSS3 transform property for better visual result in modern web browsers 15 | 16 | Apr 03 2013 - v1.1 : code cleanup (Object Oriented) + add Revert action + add onAnimation callback 17 | 18 | Mar 30 2013 - v1.0.3 : bug fix on IE8/IE9 with explorerCanvas + add multiple simultaneous flippy animations 19 | 20 | Mar 17 2013 - v1.0.2 : bug fix with IE10+. Can use rgba in color and color target 21 | 22 | Feb 11 2012 - v1.0.1 : bug fix with IE9 23 | 24 | Feb 11 2012 - v1.0 : First release 25 | 26 | */ 27 | (function(e){function n(){e("document").ready(function(){var e=document.createElement("p"),t,n={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.appendChild(e);for(var r in n){if(e.style[r]!==undefined){e.style[r]="rotateX(1deg)";t=window.getComputedStyle(e).getPropertyValue(n[r])}}document.body.removeChild(e);s=t!==undefined&&t.length>0&&t!=="none"})}var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var r=navigator.appName=="Microsoft Internet Explorer";var i=window.HTMLCanvasElement;var s=null;n();var o=Math.PI;var u=function(n,u,a){this.animate=function(t){if(t){this._RBefore()}else{this._Before()}if(typeof t!==a&&t){var n=this._Recto;var r=this._Recto_color;this._Recto=this._Verso;this._Color=this._Recto_color=this._Verso_color;this._Verso=n;this._Color_target=this._Verso_color=r;this._Reversing=true;switch(this._Direction){case"TOP":this._Direction="BOTTOM";break;case"BOTTOM":this._Direction="TOP";break;case"LEFT":this._Direction="RIGHT";break;case"RIGHT":this._Direction="LEFT";break}}if(this._noCSS||!s){this.initiateFlippy();this.cvO=document.getElementById("flippy"+this._UID);this.jO.data("_oFlippy_",this);this._Int=setInterval(e.proxy(this.drawFlippy,this),this._Refresh_rate)}else{this.jO.addClass("flippy_active").parent().css({perspective:this._nW+"px"});this.jO.data("_oFlippy_",this);this._Int=setInterval(e.proxy(this.drawFlippyCSS,this),this._Refresh_rate)}};this.drawFlippyCSS=function(){this._Ang=this._Direction=="RIGHT"||this._Direction=="TOP"?this._Ang+this._Step_ang:this._Ang-this._Step_ang;var e=this._Direction=="RIGHT"||this._Direction=="LEFT"?"Y":"X";if((this._Direction=="RIGHT"||this._Direction=="TOP")&&this._Ang>90&&this._Ang<=90+this._Step_ang||(this._Direction=="LEFT"||this._Direction=="BOTTOM")&&this._Ang<-90&&this._Ang>=-90-this._Step_ang){if(this._Reversing){this._RMidway()}else{this._Midway()}this.jO.css({opacity:this._Color_target_alpha,background:this._Color_target}).empty().append(this._Verso);this._Ang=this._Direction=="RIGHT"||this._Direction=="TOP"?-90:90;this._Half=true}if(this._Direction=="RIGHT"||this._Direction=="TOP"){this._Ang=this._Ang>this._Step_ang&&this._Half?this._Ang-this._Step_ang:this._Ang}else{this._Ang=this._Ang<-this._Step_ang&&this._Half?this._Ang+this._Step_ang:this._Ang}if((this._Direction=="RIGHT"||this._Direction=="TOP")&&this._Ang>0&&this._Half||(this._Direction=="LEFT"||this._Direction=="BOTTOM")&&this._Ang<0&&this._Half){this.jO.removeClass("flippy_active").css({"-webkit-transform":"rotate"+e+"(0deg)","-moz-transform":"rotate"+e+"(0deg)","-o-transform":"rotate"+e+"(0deg)","-ms-transform":"rotate"+e+"(0deg)",transform:"rotate"+e+"(0deg)"}).find(".flippy_light").remove();clearInterval(this._Int);this._Half=false;if(this._Reversing){this._RAfter()}else{this._After()}return}else{this.jO.css({"-webkit-transform":"rotate"+e+"("+this._Ang+"deg)","-moz-transform":"rotate"+e+"("+this._Ang+"deg)","-o-transform":"rotate"+e+"("+this._Ang+"deg)","-ms-transform":"rotate"+e+"("+this._Ang+"deg)",transform:"rotate"+e+"("+this._Ang+"deg)"})}this.applyLight();if(this._Reversing){this._RDuring()}else{this._During()}};this.applyLight=function(){if(this.jO.find(".flippy_light").size()===0){this.jO.append('
      ').find(".flippy_light").css({position:"absolute",top:"0",left:"0","min-width":this._nW+"px","min-height":this._nH+"px",width:this._nW+"px",height:this._nH+"px","background-color":this._Direction=="LEFT"&&this._Half||this._Direction=="RIGHT"&&!this._Half||this._Direction=="TOP"&&this._Half||this._Direction=="BOTTOM"&&!this._Half?"#000":"#FFF",opacity:Math.abs(this._Ang)*this._Light/90/100})}else{this.jO.find(".flippy_light").css({"background-color":this._Direction=="LEFT"&&this._Half||this._Direction=="RIGHT"&&!this._Half||this._Direction=="TOP"&&this._Half||this._Direction=="BOTTOM"&&!this._Half?"#000":"#FFF",opacity:Math.abs(this._Ang)*this._Light/90/100})}};this.initiateFlippy=function(){var e;this.jO.addClass("flippy_active").empty().css({opacity:this._Color_alpha,background:"none",position:"relative",overflow:"visible"});switch(this._Direction){case"TOP":this._CenterX=Math.sin(o/2)*this._nW*this._Depth;this._CenterY=this._H/2;e='';this.new_flippy(e);this.jO.find("#flippy"+this._UID).css({position:"absolute",top:"0",left:"-"+this._CenterX+"px"});break;case"BOTTOM":this._CenterX=Math.sin(o/2)*this._nW*this._Depth;this._CenterY=this._H/2;e='';this.new_flippy(e);this.jO.find("#flippy"+this._UID).css({position:"absolute",top:"0",left:"-"+this._CenterX+"px"});break;case"LEFT":this._CenterY=Math.sin(o/2)*this._nH*this._Depth;this._CenterX=this._W/2;e='';this.new_flippy(e);this.jO.find("#flippy"+this._UID).css({position:"absolute",top:"-"+this._CenterY+"px",left:"0"});break;case"RIGHT":this._CenterY=Math.sin(o/2)*this._nH*this._Depth;this._CenterX=this._W/2;e='';this.new_flippy(e);this.jO.find("#flippy"+this._UID).css({position:"absolute",top:"-"+this._CenterY+"px",left:"0"});break}};this.drawFlippy=function(){this._Ang+=this._Step_ang;if(this._Ang>90&&this._Ang<=90+this._Step_ang){if(this._Reversing){this._RMidway()}else{this._Midway()}this.jO.css({opacity:this._Color_target_alpha})}this._Ang=this._Ang>180+this._Step_ang?this._Ang-(180+this._Step_ang):this._Ang;var e=this._Ang/180*o;if(this.cvO===null){return}if(r&&!i){G_vmlCanvasManager.initElement(this.cvO)}var t=this.cvO.getContext("2d");t.clearRect(0,0,this._W+2*this._CenterX,this._H+2*this._CenterY);t.beginPath();var n=Math.sin(e)*this._H*this._Depth;var s=Math.sin(e)*this._W*this._Depth;var u,a;switch(this._Direction){case"LEFT":u=Math.cos(e)*(this._W/2);t.fillStyle=this._Ang>90?this.changeColor(this._Color_target,Math.floor(Math.sin(e)*this._Light)):this.changeColor(this._Color,-Math.floor(Math.sin(e)*this._Light));t.moveTo(this._CenterX-u,this._CenterY+n);t.lineTo(this._CenterX+u,this._CenterY-n);t.lineTo(this._CenterX+u,this._CenterY+this._H+n);t.lineTo(this._CenterX-u,this._CenterY+this._H-n);t.lineTo(this._CenterX-u,this._CenterY);t.fill();break;case"RIGHT":u=Math.cos(e)*(this._W/2);t.fillStyle=this._Ang>90?this.changeColor(this._Color_target,-Math.floor(Math.sin(e)*this._Light)):this.changeColor(this._Color,Math.floor(Math.sin(e)*this._Light));t.moveTo(this._CenterX+u,this._CenterY+n);t.lineTo(this._CenterX-u,this._CenterY-n);t.lineTo(this._CenterX-u,this._CenterY+this._H+n);t.lineTo(this._CenterX+u,this._CenterY+this._H-n);t.lineTo(this._CenterX+u,this._CenterY);t.fill();break;case"TOP":a=Math.cos(e)*(this._H/2);t.fillStyle=this._Ang>90?this.changeColor(this._Color_target,-Math.floor(Math.sin(e)*this._Light)):this.changeColor(this._Color,Math.floor(Math.sin(e)*this._Light));t.moveTo(this._CenterX+s,this._CenterY-a);t.lineTo(this._CenterX-s,this._CenterY+a);t.lineTo(this._CenterX+this._W+s,this._CenterY+a);t.lineTo(this._CenterX+this._W-s,this._CenterY-a);t.lineTo(this._CenterX,this._CenterY-a);t.fill();break;case"BOTTOM":a=Math.cos(e)*(this._H/2);t.fillStyle=this._Ang>90?this.changeColor(this._Color_target,Math.floor(Math.sin(e)*this._Light)):this.changeColor(this._Color,-Math.floor(Math.sin(e)*this._Light));t.moveTo(this._CenterX+s,this._CenterY+a);t.lineTo(this._CenterX-s,this._CenterY-a);t.lineTo(this._CenterX+this._W+s,this._CenterY-a);t.lineTo(this._CenterX+this._W-s,this._CenterY+a);t.lineTo(this._CenterX,this._CenterY+a);t.fill();break}if(this._Ang>180){this.jO.removeClass("flippy_active").css({background:this._Color_target}).append(this._Verso).removeClass("flippy_container").find(".flippy").remove();clearInterval(this._Int);if(this._Reversing){this._RAfter()}else{this._After()}return}if(this._Reversing){this._RDuring()}else{this._During()}};this.new_flippy=function(e){if(r&&!i){this.jO.addClass("flippy_container").attr("id","flippy_container"+this._UID);var t=document.getElementById("flippy_container"+this._UID);var n=document.createElement(e);t.appendChild(n)}else{this.jO.append(e)}};this.convertColor=function(e){var n=t.hasOwnProperty(e)?t[e]:e;if(/^transparent$/i.test(n))return"#ffffff";if(n.substr(0,4)=="rgb("){return["#",this.toHex(n.substr(4,n.length).split(",")[0]>>>0),this.toHex(n.substr(3,n.length).split(",")[1]>>>0),this.toHex(n.substr(3,n.length-4).split(",")[2]>>>0)].join("")}if(n.substr(0,5)=="rgba("){return["#",this.toHex(n.substr(5,n.length).split(",")[0]>>>0),this.toHex(n.substr(3,n.length).split(",")[1]>>>0),this.toHex(n.substr(3,n.length-4).split(",")[2]>>>0)].join("")}return n};this.toHex=function(e){var t=[];while(Math.floor(e)>16){t.push(e%16);e=Math.floor(e/16)}var n,r;switch(e){case 10:n="A";break;case 11:n="B";break;case 12:n="C";break;case 13:n="D";break;case 14:n="E";break;case 15:n="F";break;default:n=""+e;break}for(r=t.length-1;r>=0;r--){switch(t[r]){case 10:n+="A";break;case 11:n+="B";break;case 12:n+="C";break;case 13:n+="D";break;case 14:n+="E";break;case 15:n+="F";break;default:n+=""+t[r];break}}if(n.length==1){return"0"+n}else{return n}};this.changeColor=function(e,t){var n=e.substr(1,2);var r=e.substr(3,2);var i=e.substr(5,2);var s=parseInt(n,16)+t>255?255:parseInt(n,16)+t;var o=parseInt(r,16)+t>255?255:parseInt(r,16)+t;var u=parseInt(i,16)+t>255?255:parseInt(i,16)+t;n=s<=0?"00":this.toHex(s);r=o<=0?"00":this.toHex(o);i=u<=0?"00":this.toHex(u);return"#"+n+r+i};u=e.extend({step_ang:10,refresh_rate:15,duration:300,depth:.12,color_target:"white",light:60,content:"",direction:"LEFT",noCSS:false,onStart:function(){},onMidway:function(){},onAnimation:function(){},onFinish:function(){},onReverseStart:function(){},onReverseMidway:function(){},onReverseAnimation:function(){},onReverseFinish:function(){}},u);this._Reversing=false;this._Half=false;this._UID=Math.floor(Math.random()*1e6);this.jO=n;this._noCSS=u.noCSS;this._Ang=0;this._Step_ang=u.refresh_rate/u.duration*200;this._Refresh_rate=u.refresh_rate;this._Duration=u.duration;this._Depth=u.depth;this._Color_target_is_rgba=u.color_target.substr(0,5)=="rgba(";this._Color=n.css("background-color");this._Color_target_alpha=this._Color_target_is_rgba?u.color_target.substr(3,u.color_target.length-4).split(",")[3]>>>0:1;this._Color_alpha=/^transparent$/i.test(""+this._Color)?0:this._Color.substr(0,5)=="rgba("?this._Color.substr(3,this._Color.length-4).split(",")[3]>>>0:1;this._Color_target=this.convertColor(u.color_target);this._Color=this.convertColor(this._Color);this._Direction=u.direction.toUpperCase();this._Light=u.light;this._Content=typeof u.content=="object"?u.content.html():u.content;this._Recto_color=this._Color;this._Verso_color=this._Color_target;this._Recto=u.recto!==a?u.recto:this.jO.html();this._Verso=u.verso!==a?u.verso:this._Content;this._Before=u.onStart;this._During=u.onAnimation;this._Midway=u.onMidway;this._After=u.onFinish;this._RBefore=u.onReverseStart;this._RDuring=u.onReverseAnimation;this._RMidway=u.onReverseMidway;this._RAfter=u.onReverseFinish;this._nW=this.jO.width();this._nH=this.jO.height();this._W=this.jO.outerWidth();this._H=this.jO.outerHeight();u=null};e.fn.flippy=function(t){return this.each(function(){$t=e(this);if(!$t.hasClass("flippy_active")){var n=new u($t,t);n.animate()}})};e.fn.flippyReverse=function(){return this.each(function(){$t=e(this);if(!$t.hasClass("flippy_active")){var t=$t.data("_oFlippy_");t.animate(true)}})}})(jQuery); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /static/fonts/glyphicons/flat-ui-icons-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | { 7 | "fontFamily": "flat-ui-icons", 8 | "majorVersion": 1, 9 | "minorVersion": 1, 10 | "fontURL": "http://designmodo.com/flat", 11 | "designer": "Sergey Shmidt", 12 | "designerURL": "http://designmodo.com", 13 | "license": "Attribution-NonCommercial-NoDerivs 3.0 Unported", 14 | "licenseURL": "http://creativecommons.org/licenses/by-nc-nd/3.0/", 15 | "version": "Version 1.1", 16 | "fontId": "flat-ui-icons", 17 | "psName": "flat-ui-icons", 18 | "subFamily": "Regular", 19 | "fullName": "flat-ui-icons", 20 | "description": "Generated by IcoMoon" 21 | } 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | --------------------------------------------------------------------------------