").addClass(wrapperClass),$window=$(window);function Plugin(element,options){this.element=element;this.$element=$(element);this.options=$.extend({},defaults,
2 | options);this._defaults=defaults;this._name=pluginName;this.vars={elemHeight:this.$element.height()};this.init()}Plugin.prototype={init:function(){var cling=this,scrollTimeout,throttle=cling.options.throttle,extraClass=cling.options.extraClass;cling.$element.wrap($buildPlaceholder.height(cling.vars.elemHeight)).wrap($buildWrapper);if(extraClass!==""&&typeof extraClass==="string"){cling.findWrapper().addClass(extraClass);cling.findPlaceholder().addClass(extraClass)}$window.on("scroll resize",function(event){if(!scrollTimeout)scrollTimeout=
3 | setTimeout(function(){if(event.type==="resize"&&typeof cling.options.resized==="function")cling.options.resized();cling.checkElemStatus();scrollTimeout=null},throttle)})},checkCoords:function(){var coords={windowWidth:$window.width(),windowOffset:$window.scrollTop(),placeholderOffset:this.findPlaceholder().offset().top};return coords},detachElem:function(){if(typeof this.options.detached==="function")this.options.detached();this.findWrapper().removeClass(lockedClass)},lockElem:function(){if(typeof this.options.locked===
4 | "function")this.options.locked();this.findWrapper().addClass(lockedClass)},findPlaceholder:function(){return this.$element.closest("."+placeholderClass)},findWrapper:function(){return this.$element.closest("."+wrapperClass)},checkElemStatus:function(){var cling=this,currentCoords=cling.checkCoords(),isScrolledPast=function(){if(currentCoords.windowOffset>=currentCoords.placeholderOffset)return true;else return false},isWideEnough=function(){if(currentCoords.windowWidth>=cling.options.breakpoint)return true;
5 | else return false};if(isScrolledPast()&&isWideEnough())cling.lockElem();else if(!isScrolledPast()||!isWideEnough())cling.detachElem()}};$.fn[pluginName]=function(options){return this.each(function(){if(!$.data(this,"plugin_"+pluginName))$.data(this,"plugin_"+pluginName,new Plugin(this,options))})}})(jQuery,window,document);
--------------------------------------------------------------------------------
/static/js/jquery.extend.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | (function(){
4 |
5 | // extend jQuery ajax, set xsrf token value
6 | var ajax = $.ajax;
7 | $.extend({
8 | ajax: function(url, options) {
9 | if (typeof url === 'object') {
10 | options = url;
11 | url = undefined;
12 | }
13 | options = options || {};
14 | url = options.url;
15 | var xsrftoken = $('meta[name=_xsrf]').attr('content');
16 | var oncetoken = $('[name=_once]').filter(':last').val();
17 | var headers = options.headers || {};
18 | var domain = document.domain.replace(/\./ig, '\\.');
19 | if (!/^(http:|https:).*/.test(url) || eval('/^(http:|https:)\\/\\/(.+\\.)*' + domain + '.*/').test(url)) {
20 | headers = $.extend(headers, {'X-Xsrftoken':xsrftoken, 'X-Form-Once':oncetoken});
21 | }
22 | options.headers = headers;
23 | var callback = options.success;
24 | options.success = function(data){
25 | if(data.once){
26 | // change all _once value if ajax data.once exist
27 | $('[name=_once]').val(data.once);
28 | }
29 | if(callback){
30 | callback.apply(this, arguments);
31 | }
32 | };
33 | return ajax(url, options);
34 | }
35 | });
36 |
37 | })();
38 | })(jQuery);
--------------------------------------------------------------------------------
/static/js/jquery.jpanelmenu.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * jPanelMenu 1.3.0 (http://jpanelmenu.com)
4 | * By Anthony Colangelo (http://acolangelo.com)
5 | *
6 | * */
7 | (function(e){e.jPanelMenu=function(t){if(typeof t=="undefined"||t==null)t={};var n={options:e.extend({menu:"#menu",trigger:".menu-trigger",excludedPanelContent:"style, script",direction:"left",openPosition:"250px",animated:!0,closeOnContentClick:!0,keyboardShortcuts:[{code:27,open:!1,close:!0},{code:37,open:!1,close:!0},{code:39,open:!0,close:!0},{code:77,open:!0,close:!0}],duration:150,openDuration:t.duration||150,closeDuration:t.duration||150,easing:"ease-in-out",openEasing:t.easing||"ease-in-out",closeEasing:t.easing||"ease-in-out",before:function(){},beforeOpen:function(){},beforeClose:function(){},after:function(){},afterOpen:function(){},afterClose:function(){},beforeOn:function(){},afterOn:function(){},beforeOff:function(){},afterOff:function(){}},t),settings:{transitionsSupported:"WebkitTransition"in document.body.style||"MozTransition"in document.body.style||"msTransition"in document.body.style||"OTransition"in document.body.style||"Transition"in document.body.style,shiftFixedChildren:!1,panelPosition:"relative",positionUnits:"px"},menu:"#jPanelMenu-menu",panel:".jPanelMenu-panel",fixedChildren:[],timeouts:{},clearTimeouts:function(){clearTimeout(n.timeouts.open);clearTimeout(n.timeouts.afterOpen);clearTimeout(n.timeouts.afterClose)},setPositionUnits:function(){var e=!1,t=["%","px","em"];for(unitID in t){var r=t[unitID];if(n.options.openPosition.toString().substr(-r.length)==r){e=!0;n.settings.positionUnits=r}}e||(n.options.openPosition=parseInt(n.options.openPosition)+n.settings.positionUnits)},checkFixedChildren:function(){n.disableTransitions();var t={position:e(n.panel).css("position")};t[n.options.direction]=e(n.panel).css(n.options.direction)=="auto"?0:e(n.panel).css(n.options.direction);e(n.panel).find("> *").each(function(){e(this).css("position")=="fixed"&&e(this).css(n.options.direction)=="auto"&&n.fixedChildren.push(this)});if(n.fixedChildren.length>0){var r={position:"relative"};r[n.options.direction]="1px";n.setPanelStyle(r);parseInt(e(n.fixedChildren[0]).offset().left)==0&&(n.settings.shiftFixedChildren=!0)}n.setPanelStyle(t)},setjPanelMenuStyles:function(){var t="#fff",r=e("html").css("background-color"),i=e("body").css("background-color");i!="transparent"&&i!="rgba(0, 0, 0, 0)"?t=i:r!="transparent"&&r!="rgba(0, 0, 0, 0)"?t=r:t="#fff";e("#jPanelMenu-style-master").length==0&&e("body").append('")},setMenuState:function(t){var n=t?"open":"closed";e("body").attr("data-menu-position",n)},getMenuState:function(){return e("body").attr("data-menu-position")},menuIsOpen:function(){return n.getMenuState()=="open"?!0:!1},setMenuStyle:function(t){e(n.menu).css(t)},setPanelStyle:function(t){e(n.panel).css(t)},showMenu:function(){n.setMenuStyle({display:"block"});n.setMenuStyle({"z-index":"1"})},hideMenu:function(){n.setMenuStyle({"z-index":"-1"});n.setMenuStyle({display:"none"})},enableTransitions:function(t,r){var i=t/1e3,s=n.getCSSEasingFunction(r);n.disableTransitions();e("body").append('")},disableTransitions:function(){e("#jPanelMenu-style-transitions").remove()},enableFixedTransitions:function(t,r,i,s){var o=i/1e3,u=n.getCSSEasingFunction(s);n.disableFixedTransitions(r);e("body").append('")},disableFixedTransitions:function(t){e("#jPanelMenu-style-fixed-"+t).remove()},getCSSEasingFunction:function(e){switch(e){case"linear":return e;case"ease":return e;case"ease-in":return e;case"ease-out":return e;case"ease-in-out":return e;default:return"ease-in-out"}},getJSEasingFunction:function(e){switch(e){case"linear":return e;default:return"swing"}},openMenu:function(t){if(typeof t=="undefined"||t==null)t=n.options.animated;n.clearTimeouts();n.options.before();n.options.beforeOpen();n.setMenuState(!0);n.setPanelStyle({position:"relative"});n.showMenu();var r={none:t?!1:!0,transitions:t&&n.settings.transitionsSupported?!0:!1};if(r.transitions||r.none){r.none&&n.disableTransitions();r.transitions&&n.enableTransitions(n.options.openDuration,n.options.openEasing);var i={};i[n.options.direction]=n.options.openPosition;n.setPanelStyle(i);n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t=e(this).prop("tagName").toLowerCase()+" "+e(this).attr("class"),i=t.replace(" ","."),t=t.replace(" ","-");r.none&&n.disableFixedTransitions(t);r.transitions&&n.enableFixedTransitions(i,t,n.options.openDuration,n.options.openEasing);var s={};s[n.options.direction]=n.options.openPosition;e(this).css(s)});n.timeouts.afterOpen=setTimeout(function(){n.disableTransitions();n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t=e(this).prop("tagName").toLowerCase()+" "+e(this).attr("class"),t=t.replace(" ","-");n.disableFixedTransitions(t)});n.options.after();n.options.afterOpen();n.initiateContentClickListeners()},n.options.openDuration)}else{var s=n.getJSEasingFunction(n.options.openEasing),o={};o[n.options.direction]=n.options.openPosition;e(n.panel).stop().animate(o,n.options.openDuration,s,function(){n.options.after();n.options.afterOpen();n.initiateContentClickListeners()});n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t={};t[n.options.direction]=n.options.openPosition;e(this).stop().animate(t,n.options.openDuration,s)})}},closeMenu:function(t){if(typeof t=="undefined"||t==null)t=n.options.animated;n.clearTimeouts();n.options.before();n.options.beforeClose();n.setMenuState(!1);var r={none:t?!1:!0,transitions:t&&n.settings.transitionsSupported?!0:!1};if(r.transitions||r.none){r.none&&n.disableTransitions();r.transitions&&n.enableTransitions(n.options.closeDuration,n.options.closeEasing);var i={};i[n.options.direction]=0+n.settings.positionUnits;n.setPanelStyle(i);n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t=e(this).prop("tagName").toLowerCase()+" "+e(this).attr("class"),i=t.replace(" ","."),t=t.replace(" ","-");r.none&&n.disableFixedTransitions(t);r.transitions&&n.enableFixedTransitions(i,t,n.options.closeDuration,n.options.closeEasing);var s={};s[n.options.direction]=0+n.settings.positionUnits;e(this).css(s)});n.timeouts.afterClose=setTimeout(function(){n.setPanelStyle({position:n.settings.panelPosition});n.disableTransitions();n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t=e(this).prop("tagName").toLowerCase()+" "+e(this).attr("class"),t=t.replace(" ","-");n.disableFixedTransitions(t)});n.hideMenu();n.options.after();n.options.afterClose();n.destroyContentClickListeners()},n.options.closeDuration)}else{var s=n.getJSEasingFunction(n.options.closeEasing),o={};o[n.options.direction]=0+n.settings.positionUnits;e(n.panel).stop().animate(o,n.options.closeDuration,s,function(){n.setPanelStyle({position:n.settings.panelPosition});n.hideMenu();n.options.after();n.options.afterClose();n.destroyContentClickListeners()});n.settings.shiftFixedChildren&&e(n.fixedChildren).each(function(){var t={};t[n.options.direction]=0+n.settings.positionUnits;e(this).stop().animate(t,n.options.closeDuration,s)})}},triggerMenu:function(e){n.menuIsOpen()?n.closeMenu(e):n.openMenu(e)},initiateClickListeners:function(){e(document).on("click",n.options.trigger,function(){n.triggerMenu(n.options.animated);return!1})},destroyClickListeners:function(){e(document).off("click",n.options.trigger,null)},initiateContentClickListeners:function(){if(!n.options.closeOnContentClick)return!1;e(document).on("click",n.panel,function(e){n.menuIsOpen()&&n.closeMenu(n.options.animated)});e(document).on("touchend",n.panel,function(e){n.menuIsOpen()&&n.closeMenu(n.options.animated)})},destroyContentClickListeners:function(){if(!n.options.closeOnContentClick)return!1;e(document).off("click",n.panel,null);e(document).off("touchend",n.panel,null)},initiateKeyboardListeners:function(){var t=["input","textarea"];e(document).on("keydown",function(r){var i=e(r.target),s=!1;e.each(t,function(){i.is(this.toString())&&(s=!0)});if(s)return!0;for(mapping in n.options.keyboardShortcuts)if(r.which==n.options.keyboardShortcuts[mapping].code){var o=n.options.keyboardShortcuts[mapping];o.open&&o.close?n.triggerMenu(n.options.animated):o.open&&!o.close&&!n.menuIsOpen()?n.openMenu(n.options.animated):!o.open&&o.close&&n.menuIsOpen()&&n.closeMenu(n.options.animated);return!1}})},destroyKeyboardListeners:function(){e(document).off("keydown",null)},setupMarkup:function(){e("html").addClass("jPanelMenu");e("body > *").not(n.menu+", "+n.options.excludedPanelContent).wrapAll('
');e(n.options.menu).clone().attr("id",n.menu.replace("#","")).insertAfter("body > "+n.panel)},resetMarkup:function(){e("html").removeClass("jPanelMenu");e("body > "+n.panel+" > *").unwrap();e(n.menu).remove()},init:function(){n.options.beforeOn();n.initiateClickListeners();Object.prototype.toString.call(n.options.keyboardShortcuts)==="[object Array]"&&n.initiateKeyboardListeners();n.setjPanelMenuStyles();n.setMenuState(!1);n.setupMarkup();n.setMenuStyle({width:n.options.openPosition});n.checkFixedChildren();n.setPositionUnits();n.closeMenu(!1);n.options.afterOn()},destroy:function(){n.options.beforeOff();n.closeMenu();n.destroyClickListeners();Object.prototype.toString.call(n.options.keyboardShortcuts)==="[object Array]"&&n.destroyKeyboardListeners();n.resetMarkup();var t={};t[n.options.direction]="auto";e(n.fixedChildren).each(function(){e(this).css(t)});n.fixedChildren=[];n.options.afterOff()}};return{on:n.init,off:n.destroy,trigger:n.triggerMenu,open:n.openMenu,close:n.closeMenu,isOpen:n.menuIsOpen,menu:n.menu,getMenu:function(){return e(n.menu)},panel:n.panel,getPanel:function(){return e(n.panel)}}}})(jQuery);
--------------------------------------------------------------------------------
/static/js/main.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | // Avoid embed thie site in an iframe of other WebSite
4 | if (top.location != location) {
5 | top.location.href = location.href;
6 | }
7 |
8 | // btn checked box toggle
9 | $(document).on('click', '.btn-checked', function(){
10 | var $e = $(this);
11 | var $i = $e.siblings('[name='+$e.data('name')+']');
12 | if($e.hasClass('active')) {
13 | $i.val('true');
14 | } else {
15 | $i.val('false');
16 | }
17 | $e.blur();
18 | });
19 |
20 | // change locale and reload page
21 | $(document).on('click', '.lang-changed', function(){
22 | var $e = $(this);
23 | var lang = $e.data('lang');
24 | $.cookie('lang', lang, {path: '/', expires: 365});
25 | window.location.reload();
26 | });
27 |
28 | (function(){
29 | var v = $.cookie('JsStorage');
30 | if(v){
31 | var values = v.split(':::');
32 | if(values.length > 1){
33 | $.jStorage[values[0]].apply(this, values.splice(1));
34 | }
35 | $.removeCookie('JsStorage', {path: '/'});
36 | }
37 | })();
38 |
39 | (function(){
40 |
41 | $.fn.mdFilter = function(){
42 | var $e = $(this);
43 | $e.find('img').each(function(_,img){
44 | var $img = $(img);
45 | $img.addClass('img-responsive');
46 | });
47 |
48 | var $pre = $e.find('pre > code').parent();
49 | $pre.addClass("prettyprint");
50 | prettyPrint();
51 | };
52 |
53 | })();
54 |
55 | (function(){
56 |
57 | var caches = {};
58 | $.fn.showGithub = function(user, repo, type, count){
59 |
60 | $(this).each(function(){
61 | var $e = $(this);
62 |
63 | var user = $e.data('user') || user,
64 | repo = $e.data('repo') || repo,
65 | type = $e.data('type') || type || 'watch',
66 | count = $e.data('count') == 'true' || count || true;
67 |
68 | var $mainButton = $e.html('
').find('.github-btn'),
69 | $button = $mainButton.find('.btn'),
70 | $text = $mainButton.find('.gh-text'),
71 | $counter = $mainButton.find('.gh-count');
72 |
73 | function addCommas(a) {
74 | return String(a).replace(/(\d)(?=(\d{3})+$)/g, '$1,');
75 | }
76 |
77 | function callback(a) {
78 | if (type == 'watch') {
79 | $counter.html(addCommas(a.watchers));
80 | } else {
81 | if (type == 'fork') {
82 | $counter.html(addCommas(a.forks));
83 | } else {
84 | if (type == 'follow') {
85 | $counter.html(addCommas(a.followers));
86 | }
87 | }
88 | }
89 |
90 | if (count) {
91 | $counter.css('display', 'inline-block');
92 | }
93 | }
94 |
95 | function jsonp(url) {
96 | var ctx = caches[url] || {};
97 | caches[url] = ctx;
98 | if(ctx.onload || ctx.data){
99 | if(ctx.data){
100 | callback(ctx.data);
101 | } else {
102 | setTimeout(jsonp, 500, url);
103 | }
104 | }else{
105 | ctx.onload = true;
106 | $.getJSON(url, function(a){
107 | ctx.onload = false;
108 | ctx.data = a;
109 | callback(a);
110 | });
111 | }
112 | }
113 |
114 | var urlBase = 'https://github.com/' + user + '/' + repo;
115 |
116 | $button.attr('href', urlBase + '/');
117 |
118 | if (type == 'watch') {
119 | $mainButton.addClass('github-watchers');
120 | $text.html('Star');
121 | $counter.attr('href', urlBase + '/stargazers');
122 | } else {
123 | if (type == 'fork') {
124 | $mainButton.addClass('github-forks');
125 | $text.html('Fork');
126 | $counter.attr('href', urlBase + '/network');
127 | } else {
128 | if (type == 'follow') {
129 | $mainButton.addClass('github-me');
130 | $text.html('Follow @' + user);
131 | $button.attr('href', 'https://github.com/' + user);
132 | $counter.attr('href', 'https://github.com/' + user + '/followers');
133 | }
134 | }
135 | }
136 |
137 | if (type == 'follow') {
138 | jsonp('https://api.github.com/users/' + user);
139 | } else {
140 | jsonp('https://api.github.com/repos/' + user + '/' + repo);
141 | }
142 |
143 | });
144 | };
145 |
146 | })();
147 |
148 |
149 | $(function(){
150 | // Encode url.
151 | var $doc = $('.docs-markdown');
152 | $doc.find('a').each(function () {
153 | var node = $(this);
154 | var link = node.attr('href');
155 | var index = link.indexOf('#');
156 | if (link.indexOf('http') === 0 && link.indexOf(window.location.hostname) == -1) {
157 | return;
158 | }
159 | if (index < 0 || index + 1 > link.length) {
160 | return;
161 | }
162 | var val = link.substring(index + 1, link.length);
163 | val = encodeURIComponent(decodeURIComponent(val).toLowerCase().replace(/\s+/g, '-'));
164 | node.attr('href', link.substring(0, index) + '#' + val);
165 | });
166 |
167 | // Set anchor.
168 | $doc.find('h1, h2, h3, h4, h5, h6').each(function () {
169 | var node = $(this);
170 | if (node.hasClass('ui')) {
171 | return;
172 | }
173 | var val = encodeURIComponent(node.text().toLowerCase().replace(/\s+/g, "-"));
174 | node = node.wrap('
');
175 | node.append('
');
176 | });
177 | });
178 |
179 | $(function(){
180 | // on dom ready
181 |
182 | $('[data-show=tooltip]').each(function(k, e){
183 | var $e = $(e);
184 | $e.tooltip({placement: $e.data('placement'), title: $e.data('tooltip-text')});
185 | $e.tooltip('show');
186 | });
187 |
188 | $('[rel=select2]').select2();
189 |
190 | $('.markdown').mdFilter();
191 |
192 | $('[rel=show-github]').showGithub();
193 |
194 | if($.jPanelMenu && $('[data-toggle=jpanel-menu]').size() > 0) {
195 | var jpanelMenuTrigger = $('[data-toggle=jpanel-menu]');
196 |
197 | var jPM = $.jPanelMenu({
198 | animated: false,
199 | menu: jpanelMenuTrigger.data('target'),
200 | direction: 'left',
201 | trigger: '.'+ jpanelMenuTrigger.attr('class'),
202 | excludedPanelContent: '.jpanel-menu-exclude',
203 | openPosition: '180px',
204 | afterOpen: function() {
205 | jpanelMenuTrigger.addClass('open');
206 | $('html').addClass('jpanel-menu-open');
207 | },
208 | afterClose: function() {
209 | jpanelMenuTrigger.removeClass('open');
210 | $('html').removeClass('jpanel-menu-open');
211 | }
212 | });
213 |
214 | //jRespond settings
215 | var jRes = jRespond([{
216 | label: 'small',
217 | enter: 0,
218 | exit: 1010
219 | }]);
220 |
221 | //turn jPanel Menu on/off as needed
222 | jRes.addFunc({
223 | breakpoint: 'small',
224 | enter: function() {
225 | jPM.on();
226 | },
227 | exit: function() {
228 | jPM.off();
229 | }
230 | });
231 | }
232 |
233 | var $container = $('#products-showcase');
234 | $container.imagesLoaded(function(){
235 | $container.masonry({
236 | itemSelector : '.product'
237 | });
238 | });
239 |
240 | });
241 |
242 | })(jQuery);
--------------------------------------------------------------------------------
/static/js/respond.min.js:
--------------------------------------------------------------------------------
1 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
2 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3 | window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
4 |
5 | /*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
6 | (function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
7 |
--------------------------------------------------------------------------------
/templates/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{include "base/head.html"}}
5 |
{{i18n .Lang "about"}} - xorm: {{i18n .Lang "app_intro"}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{include "base/navbar.html"}}
17 |
18 |
19 |
20 |
21 |
22 | {{if eq .Lang "en-US"}}
23 |
24 | About
25 |
26 |
This manual documents aspects of Xorm.
27 |
28 |
29 | New to Xorm?
30 |
31 |
Read about the Quick Start .
32 |
33 |
34 | Can't find what you're looking for?
35 |
36 |
Search our mailing list (xorm@googlegroups.com) .
37 |
38 |
39 | Need help?
40 |
41 |
Send an email to the xorm@googlegroups.com .
42 |
43 |
44 | Find a bug?
45 |
46 |
Open an issue on github .
47 |
48 |
49 | Want to be a contributor?
50 |
51 |
Fork the documentation project , edit and pull request.
52 |
53 |
54 | Source code of this website?
55 |
56 |
Please visit Xorm Web .
57 | {{else}}
58 |
59 | 关于
60 |
61 |
本网站文档页面详细描述了 Xorm 的各个方面。
62 |
63 |
64 | 新手指导
65 |
66 |
如果您是首次了解 Xorm,我们建议您先阅读 快速入门 。
67 |
68 |
69 | 其它资源
70 |
71 |
如果您无法找到相关问题的满意答案,可以在 邮件列表 (xorm@googlegroups.com) 中搜索。
72 |
73 |
74 | 寻求帮助
75 |
76 |
如果您遇到无法解决的问题,可以发送邮件到 xorm@googlegroups.com 提问。
77 |
78 |
79 | 问题提交
80 |
81 |
如果您在使用过程中发现 Xorm 有潜在的问题,请通过 Xorm 上的问题列表提交。
82 |
83 |
84 | 完善文档
85 |
86 |
您可以通过派生 文档项目 、编辑,然后提交合并请求。
87 |
88 |
89 | 网站源码
90 |
91 |
请移步 Xorm Web 。
92 | {{end}}
93 |
94 |
95 |
96 |
97 |
98 |
99 | {{include "base/footer.html"}}
100 |
101 |
102 |
--------------------------------------------------------------------------------
/templates/base/disqus.html:
--------------------------------------------------------------------------------
1 |
2 |
13 |
Please enable JavaScript to view the comments powered by Disqus.
14 |
comments powered by
--------------------------------------------------------------------------------
/templates/base/footer.html:
--------------------------------------------------------------------------------
1 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | {{if .T.IsPro}}
56 |
66 | {{end}}
--------------------------------------------------------------------------------
/templates/base/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/templates/base/navbar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
33 |
34 |
42 |
43 |
44 | {{i18n .Lang "current_lang"}}{{i18n .Lang .Lang}}
45 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/templates/docs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{include "base/head.html"}}
5 |
{{i18n .Lang "docs"}} - xorm: {{i18n .Lang "app_intro"}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {{include "base/navbar.html"}}
19 |
20 |
21 |
22 | {{include "base/disqus.html"}}
23 |
24 |
25 |
26 | {{include "base/footer.html"}}
27 |
28 |
--------------------------------------------------------------------------------
/templates/donate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{include "base/head.html"}}
5 |
{{i18n .Lang "donate"}} - xorm: {{i18n .Lang "app_intro"}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{include "base/navbar.html"}}
18 |
19 |
20 |
21 |
22 |
23 |
24 | {{if eq .Lang "en-US"}}
25 |
26 | Donation
27 |
28 |
29 |
30 | We will continue hard working with your huge support!
31 |
32 |
33 |
34 |
35 | Donate by Paypal:
36 |
37 |
38 |
39 |
40 |
41 |
42 | Your donation will be used as:
43 |
44 |
45 | Supports the development of Beego
46 | Supports maintaining the communities
47 | Upgrade to better server
48 | Award the outstanding contributors
49 | Holds community activities and lectures
50 |
51 |
52 | {{else}}
53 |
54 | 捐赠我们
55 |
56 |
57 |
58 | 在您的支持与鼓励下,Xorm 开发团队将会更加努力地开发出更好的产品!
59 |
60 |
61 |
62 |
63 | 支付宝捐赠 :
64 |
65 |
66 |
67 |
68 |
69 |
70 | Paypal 捐赠
71 |
72 |
73 |
74 |
75 | 您的捐赠将被用于:
76 |
77 |
78 | 持续和深入的开发
79 | 维护社区的运行稳定
80 | 租用更好的带宽
81 | 奖励团队的杰出贡献者
82 | 社区活动或讲座
83 |
84 | {{end}}
85 |
86 |
87 | Donation Lists (descending by donating time)
88 |
89 |
90 |
91 |
92 | Donated at
93 | Donator
94 | Amount
95 | Contact
96 | Comments
97 |
98 |
99 |
100 |
101 | 2014-11-14
102 | Eyu.鼎盛国际
103 | 500¥
104 | eyu8.ds@gmail.com
105 | xorm so good
106 |
107 |
108 | 2014-7-8
109 | Steven Wang
110 | 100¥
111 | easykooc@gmail.com
112 | xorm目前做得最好的orm for golang
113 |
114 |
115 | 2014-7-8
116 | 韩天峰
117 | 20¥
118 | apolov@vip.qq.com
119 | xorm是Golang里最好用的DB库
120 |
121 |
122 | 2014-7-8
123 | sunhongjian
124 | 100¥
125 | shongjiang@gmail.com
126 | 支持开源,支持美好的事物!
127 |
128 |
129 | 2014-7-8
130 | Jimmy Kuu
131 | 200¥
132 | jimmy.kuu@gmail.com
133 | 再接再厉,持续发展
134 |
135 |
136 | 2014-7-8
137 | 张仲东
138 | 100¥
139 | GoCMS作者
140 | 支持XORM!!
141 |
142 |
143 | 2014-7-8
144 | wangwei
145 | 100¥
146 | iamjcww@gmail.com
147 | 鄙视楼下
148 |
149 |
150 | 2014-7-8
151 | Jazz
152 | 2¥
153 | 1002376560@qq.com
154 | 这个沙发必须抢
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 | {{include "base/footer.html"}}
165 |
166 |
167 |
168 |
--------------------------------------------------------------------------------
/templates/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{include "base/head.html"}}
5 |
{{i18n .Lang "homepage"}} - xorm: {{i18n .Lang "app_intro"}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{include "base/navbar.html"}}
18 |
19 |
20 |
21 |
22 | XORM - eXtra ORM for Go
23 |
24 |
25 | {{i18n .Lang "home.gogs_desc"}}
26 |
27 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
{{i18n .Lang "home.quick_start"}}
39 |
40 |
61 |
62 |
63 | {{if eq .Lang "zh-CN"}}
64 |
运行及初始化:
65 |
66 | 初始化 orm, err := xorm.NewEngine("sqlite3", "./test.db")
67 | 同步数据库结构 err = orm.Sync(new(User), new(Article))
68 |
69 |
恭喜!您已经成功地运行了 Xorm。
70 |
请阅读 使用手册 以获取更多信息。
71 | {{else}}
72 |
Run and setup:
73 |
74 | Init orm orm, err := xorm.NewEngine("sqlite3", "./test.db")
75 | Sync database structs err = orm.Sync(new(User), new(Article))
76 |
77 |
Congratulations! You just get your Xorm running.
78 |
Please see Documentation for going further.
79 | {{end}}
80 |
81 |
82 |
83 |
84 |
85 |
86 |
{{i18n .Lang "home.further_reading"}}
87 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
{{i18n .Lang "home.features"}}
114 |
115 |
116 |
117 |
118 | {{if eq .Lang "zh-CN"}}
119 | 少依赖
120 | {{else}}
121 | LESS DEPENDENCY
122 | {{end}}
123 |
124 |
125 | {{if eq .Lang "zh-CN"}}
126 | xorm除了依赖github.com/go-xorm/core之外不依赖其它第三方库。
127 | {{else}}
128 | Only depends github.com/go-xorm/core.
129 | {{end}}
130 |
131 |
132 |
133 |
134 |
135 |
136 | {{if eq .Lang "zh-CN"}}
137 | 易使用
138 | {{else}}
139 | EASY USAGE
140 | {{end}}
141 |
142 |
143 | {{if eq .Lang "zh-CN"}}
144 | 通过连写操作,可以通过很少的语句完成数据库操作。
145 | {{else}}
146 | By join function design, use less codes to finish DB operations.
147 | {{end}}
148 |
149 |
150 |
151 |
152 |
153 |
154 | {{if eq .Lang "zh-CN"}}
155 | 功能全
156 | {{else}}
157 | RICH FUNCTIONS
158 | {{end}}
159 |
160 |
161 | {{if eq .Lang "zh-CN"}}
162 | 支持缓存,事务,乐观锁,多种数据库支持,反转等等特性。
163 | {{else}}
164 | Support cache, transaction, Optimistic Lock, Multiple Database support, Reverse and tect.
165 | {{end}}
166 |
167 |
168 |
169 |
170 |
171 |
172 | {{if eq .Lang "zh-CN"}}
173 | 开源化
174 | {{else}}
175 | OPEN SOURCE
176 | {{end}}
177 |
178 |
179 | {{if eq .Lang "zh-CN"}}
180 | 通过加入我们来参与、分享和学习,并成为一个贡献者。
181 | {{else}}
182 | Join, share and learn by involving this great project and be a contributor.
183 | {{end}}
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
{{i18n .Lang "home.who_are_use"}}
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
{{i18n .Lang "home.friends"}}
209 |
214 |
215 |
216 |
217 | {{include "base/footer.html"}}
218 |
219 |
220 |
--------------------------------------------------------------------------------
/templates/link.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{include "base/head.html"}}
5 |
{{i18n .Lang "link"}} - xorm: {{i18n .Lang "app_intro"}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{include "base/navbar.html"}}
18 |
36 | {{include "base/footer.html"}}
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------