Skip to content

Commit b735b7f

Browse files
committed
Merge branch 'gh-pages' of github.com:jupiterjs/jquerypp into gh-pages
2 parents d058dfb + f6bc6cd commit b735b7f

File tree

10 files changed

+11101
-4418
lines changed

10 files changed

+11101
-4418
lines changed

_includes/builder.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h4><a href="#dom_helpers">DOM HELPERS</a> - faster and easier DOM manipulation
2828

2929
<label>
3030
<input type="checkbox" value="jquery/dom/form_params" name="plugins"/>
31-
<a href="#formparams">jQuery.formParams</a> - serializes a form into an object
31+
<a href="#dimensions">jQuery.formParams</a> - serializes a form into an object
3232
</label>
3333

3434
<label>
@@ -90,7 +90,7 @@ <h4><a href="#events">EVENTS</a> - listen to special events with:</h4>
9090

9191
<label>
9292
<input type="checkbox" value="jquery/event/resize" name="plugins"/>
93-
<a href="#resize">jQuery.event.resize</a> - listen to a resize event on any element
93+
<a href="#resize">jQuery.event.resize</a> - listen to a resize event on every object
9494
</label>
9595

9696
<label>

_layouts/default.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
})();
2222

2323
</script>
24+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
2425
</head>
2526
<body>
2627
<div id='bg'>
@@ -34,7 +35,7 @@
3435
</div>
3536
</div>
3637
<div class='cf' id='buttons'>
37-
<a href='https://forum.javascriptmvc.com/jquery'>Forums</a>
38+
<a href='https://forum.javascriptmvc.com/#Forum/jquerymx'>Forums</a>
3839
<a href='http://bitovi.com/blog/tag/jquerypp/'>Blog</a>
3940
<a href='https://twitter.com/jquerypp'>Twitter</a>
4041
</div>
@@ -55,6 +56,7 @@
5556
<script src="javascripts/jquery-1.7.1.js" type="text/javascript"></script>
5657
<script src="javascripts/can.jquery-1.0.2.js" type="text/javascript"></script>
5758
<script src="javascripts/can.construct.proxy.js" type="text/javascript"></script>
59+
<script src="javascripts/jquerypp.js" type="text/javascript"></script>
5860
<script src="javascripts/application.js" type="text/javascript"></script>
5961
</body>
6062
</html>

images/logo.png

448 Bytes
Loading

images/swipe.png

4.5 KB
Loading

index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 1.0b2
55

66
# Hi, I'm jQuery++.
77

8-
I am an MIT licensed collection of extremely useful DOM helpers and special events for jQuery 1.7 and
8+
I am a MIT licensed collection of extremely useful DOM helpers and special events for jQuery 1.7 and
99
later. I'm not a UI project like [jQuery UI](http://jqueryui.com/) or
1010
[jQuery Tools](http://jquerytools.org/). Instead, I'm all about providing
1111
low-level utilities for things that jQuery doesn't support. If [Underscore](http://underscorejs.org/)
@@ -637,7 +637,7 @@ $('panel').triggerAsync('show', function(){
637637

638638
[Annotated source](http://donejs.com/jquery/docs/jquery.event.default.html)
639639

640-
[jQuery.even.default](http://donejs.com/docs.html#!jQuery.even.default) adds default event handlers. A default event runs when all other event handlers have been triggered and none has called `event.preventDefault()` or returned `false`. Default events are prefixed with the `default` namespace. The following example adds a default `toggle` event:
640+
[jQuery.event.default](http://donejs.com/docs.html#!jQuery.event.default) adds default event handlers. A default event runs when all other event handlers have been triggered and none has called `event.preventDefault()` or returned `false`. Default events are prefixed with the `default` namespace. The following example adds a default `toggle` event:
641641

642642
{% highlight javascript %}
643643
$('#text').on('toggle.default', function(ev) {

javascripts/application.js

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
var isMobile = false;
2+
3+
if(window.matchMedia && window.matchMedia("(max-device-width: 480px)").matches){
4+
isMobile = true;
5+
}
6+
7+
18
var currentH2slug = "";
29
var animationCount = 0;
310

@@ -210,15 +217,17 @@ can.Control('Menu', {
210217
}, 1);
211218
},
212219
resizeMenu : function(){
213-
var menuWrapHeight = this.element.find('#menu-wrapper').height(),
220+
if(!isMobile){
221+
var menuWrapHeight = this.element.find('#menu-wrapper').height(),
214222
menuHeight = this._menu.height(),
215223
windowHeight = $(window).height();
216-
this.element.find('#inner-menu-wrap').css('maxHeight', (windowHeight - (menuWrapHeight - menuHeight) - 40) + "px");
217-
if(this.element.find('#inner-menu-wrap').innerHeight() - menuHeight > 2){ // top and bottom borders
218-
this._menuShouldScroll = true;
219-
} else {
220-
this._menuShouldScroll = false;
221-
this._menu.css('marginTop', 0);
224+
this.element.find('#inner-menu-wrap').css('maxHeight', (windowHeight - (menuWrapHeight - menuHeight) - 40) + "px");
225+
if(this.element.find('#inner-menu-wrap').innerHeight() - menuHeight > 2){ // top and bottom borders
226+
this._menuShouldScroll = true;
227+
} else {
228+
this._menuShouldScroll = false;
229+
this._menu.css('marginTop', 0);
230+
}
222231
}
223232
},
224233
"#inner-menu-wrap mousemove" : function(el, ev){
@@ -292,6 +301,38 @@ can.Control('Menu', {
292301
}
293302
});
294303

304+
can.Control('MobileMenu', {}, {
305+
"{document} swiperight" : function(el, ev){
306+
$('#menu-wrapper').css({
307+
top: $(window).scrollTop() + "px"
308+
}).animate({
309+
marginLeft: 0
310+
}, 150)
311+
},
312+
" touchstart" : function(el, ev){
313+
var target = $(ev.target);
314+
if(target.closest('#menu-wrapper').length > 0 && target.is('a')){
315+
var cb = function(){
316+
window.location = target.attr('href');
317+
}
318+
this.hideMenu(cb);
319+
ev.preventDefault();
320+
}
321+
},
322+
"{document} swipeleft" : "hideMenu",
323+
"#inner-menu-wrapper li a swipeleft" : "hideMenu",
324+
hideMenu : function(cb){
325+
if(arguments.length > 1){
326+
cb = function(){};
327+
}
328+
$('#menu-wrapper').animate({
329+
marginLeft: "-100%"
330+
}, 150, cb)
331+
}
332+
})
333+
334+
335+
295336
can.Control('Builder', {
296337
'input[type="checkbox"] click' : function() {
297338
var button = this.element.find('button');
@@ -323,6 +364,22 @@ if($('.lt-ie7, .lt-ie8, .lt-ie9').length == 0){
323364
} else {
324365
new Menu($('#wrapper'), 'html,body');
325366
}
326-
367+
if(isMobile){
368+
new MobileMenu(document.documentElement)
369+
var header = $('#logo-and-download').clone();
370+
header.find('a').remove();
371+
header.append("<img src='/images/swipe.png' id='swipe' />")
372+
$('#content-wrapper').prepend(header)
373+
}
327374
$('a[href$=#dom_helpers], a[href$=#events]').prepend('<span class="special">&#x2605;</span>');
328375

376+
// google analytics
377+
var _gaq = _gaq || [];
378+
_gaq.push(['_setAccount', 'UA-2302003-11']);
379+
_gaq.push(['_trackPageview']);
380+
381+
(function() {
382+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
383+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
384+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
385+
})();

0 commit comments

Comments
 (0)