Simple jQuery gallery

Template system: Laravel Blade

The my_gallery_pics  DIV contains the pics. First the script  collected to array, then show first item.

 

<script>

function addImageTodiv(current_pic) {
$(‘#picture_place’).prepend($(‘<img>’, {
id: current_pic,
src: “{{ URL::to(‘/uploads/pics’) }}” + ‘/’ + current_pic,
width: 360,
height: 425,
class: “img-responsive”}));
}

$(document).ready(function() {
picArr = new Array();
$(“#my_gallery_pics img”).each(function() {
//console.log(‘id:’ + $(this).attr(“id”));
picArr.push($(this).attr(“id”));
});
curr_pic = picArr[0];
$(‘#picture_place’).prepend($(‘<img>’, {id: picArr[0], src: “{{ URL::to(‘/uploads/profile_images/resized/medium’) }}” + ‘/’ + picArr[0]}));

arr_index = 0;
$(‘#gallery_arrow_right_box, #gallery_arrow_right’).click(function() {

$(‘#gallery_arrow_left’).show();

if (picArr.length – 1 > arr_index) {
arr_index++;
}
if (picArr.length – 1 == arr_index) {
$(‘#gallery_arrow_right’).hide();
}

//console.log(picArr.length + ‘ current_index: ‘ + arr_index);
addImageTodiv(picArr[arr_index]);

});

$(‘#gallery_arrow_left_box, #gallery_arrow_left’).click(function() {
$(‘#gallery_arrow_right’).show();
if (arr_index > 0) {
arr_index–;
}
if (arr_index == 0) {
$(‘#gallery_arrow_left’).hide();
}

// console.log(picArr.length + ‘ current_index: ‘ + arr_index);
addImageTodiv(picArr[arr_index]);

});

});
</script>

 

<div class=”pic” >
<div class=’left_box’  id=’gallery_arrow_left_box’ ></div>
<div class=’right_box’ id=’gallery_arrow_right_box’></div>
<a class=”arrow left”  id=’gallery_arrow_left’ ></a>
<a class=”arrow right”  id=’gallery_arrow_right’></a>
<div id=’picture_place’></div>
<div class=”text”>Lorem Ipsum</div>
<i class=”triangle”></i>
</div>

<div id=”my_gallery_pics” style=’display:none;’ >

@foreach ($pictures as $item)
@if($item->filename !=”)
{{ HTML::image(‘/uploads/pics/’.$item->filename, ‘profile picture’, array(‘style’ => ‘height:50px;’, ‘id’=> $item->filename)) }}
@endif
@endforeach
</div>

 

Creating Image Gallery with jQuery with swipe gestures

How to Make an Elegant Sliding Image Gallery with jQuery: http://www.elated.com/articles/elegant-sliding-image-gallery-with-jquery/

jQuery Swipe, a jQuery plugin that we can use to detect swipe gestures on mobile devices. We’ll use this to let users swipe left and right to move between the gallery images.

Other image gallery creating tutorial without swipe gestures:

http://w3lessons.info/2013/06/14/simple-image-gallery-with-jquery/

http://www.frontendwebhelp.com/javascript/jquery-photo-gallery.php

Hallgatni: Ambient és más

Remember When We Were Happy: https://soundcloud.com/miserere-nobis1277/remember-when-we-were-happy
Tag: Ambient: http://bandcamp.com/tag/ambient?artist=1969444599

Gitár ! Hopeless: http://nakedmd.bandcamp.com/album/hopeless

Lowercase Noises (guitar) http://music.lowercasenoises.com/track/2

Altered Dimensions http://cryochamber.bandcamp.com/album/altered-dimensions

Italian experimental https://unexplainedsoundsgroup.bandcamp.com/album/italian-experimental-underground-015-survey-volume-i

Burning Embers Underwater https://soundcloud.com/barry_snaith/burning-embers-underwater-tij-luciole-langevine-richard-devine

Demon Of Mild Annoyances http://mahlerhaze.bandcamp.com/album/demon-of-mild-annoyances

The Graveyard Melancholia: http://mora-tau.bandcamp.com/album/the-graveyard-melancholia

Noct https://vertebral.bandcamp.com/album/noct

fogdog http://gordondisley.bandcamp.com/album/fogdog

Buffalomckee https://emerge.bandcamp.com/album/clutter

cruel love http://saint-de-l-abime.bandcamp.com/track/into

vuos https://raeppen.bandcamp.com/album/vuos

Cascade http://andresrojas.bandcamp.com/album/cascade

The Big Hole (excerpt) https://soundcloud.com/quietchord/bigholeex

The Ninth Travel http://studiousavoidance.bandcamp.com/album/the-ninth-travel

Sunday Morning Session https://www.mixcloud.com/Mr_Frankie/sunday-morning-session-19072015/

James Ross https://soundcloud.com/jrossmusic

Noonshade http://non-rem-records.bandcamp.com/track/noonshade

Norðurljós http://soundscape713.bandcamp.com/album/nor-urlj-s

ANAZANAUT https://anazanaut.bandcamp.com/album/virruble-wellows

Recording setup used for ANAZANAUT, “Virruble Wellows”. All sounds in this recording originated on a prototype “Eleki Ribbon” style Ondes Martenot. This instrument is hand crafted in Japan by ASADEN. It has been provided to ANAZANAUT courtesy of CVGATE. For more information, go to http://www.asaden.net/ or follow them on Twitter @ASADENnet.

Luke Leach https://justlukeleach.bandcamp.com/track/tout-seul

Sonologyst – A Dream inside a Dream

https://sonologyst.bandcamp.com/album/a-dream-inside-a-dream


 

cloud perspective: https://mindencsakatmenet.bandcamp.com/album/cloud-perspective-ep

Thomas Stone : https://soundcloud.com/jecklin

Set locale in Laravel

Create a route for your language selector:

Route::get('language/{lang}', 
           array(
                  'as' => 'language.select', 
                  'uses' => 'LanguageController@select'
                 )
          );

Create your language selectors links in Laravel Blade’s view:

<html><body>

    Please select a Language:

    {{link_to_route('language.select', 'English', array('en'))}}

    {{link_to_route('language.select', 'Portuguese', array('pt'))}}

</body></html>

A Controller:

Class LanguageController extends BaseController {

    public function select($lang)
    {
        Session::put('lang', $lang);

        return Redirect::route('home');
    }

}

Then in your app/start/global.php you can:

App::setLocale(Session::get('lang', 'en'));

source: http://stackoverflow.com/questions/20273956/set-locale-on-the-fly-in-laravel4