NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

.controller('HomeCtrl', function ($scope, $rootScope, MyServices, $location, $timeout) {​
$scope.PreferredLocation = {​
LngLat: "",
LocationName: "",
Url: ""
}​;
$scope.SelectedDate_Event = 'Select Date';
$('#drop-down').modal('hide');
$scope.RandomLocationObj = null;
var Localdate = new Date();
var Todaydate = Localdate.getFullYear() + '-' + ('0' + (Localdate.getMonth() + 1)).slice(-2) + '-' + ('0' + Localdate.getDate()).slice(-2);
var TommorowDate = new Date();
TommorowDate.setDate(Localdate.getDate() + 1);
TommorowDate = TommorowDate.getFullYear() + '-' + ('0' + (TommorowDate.getMonth() + 1)).slice(-2) + '-' + ('0' + TommorowDate.getDate()).slice(-2);
var WeeklyDate = new Date();
WeeklyDate.setDate(Localdate.getDate() + 7);
WeeklyDate = WeeklyDate.getFullYear() + '-' + ('0' + (WeeklyDate.getMonth() + 1)).slice(-2) + '-' + ('0' + WeeklyDate.getDate()).slice(-2);
$scope.DiscoverPage = function () {​
MyServices.RedirectToUrl('s/all/AppEvent');
}​;
$scope.BecomePartner = function () {​
window.open(baseUrl + 'vendor/create', '_blank')
}​;
$scope.Eventurnup = function () {​
window.open('https://www.eventurnup.com', '_blank')
}​;
$scope.ItemToBeShown = 16;
$scope.CategoriesToBeShown = 4;

$scope.ShowMore = function () {​
$scope.ItemToBeShown = $scope.ItemToBeShown + 9;
}​;
$scope.ShowMoreCategories = function () {​
$scope.CategoriesToBeShown = $scope.CategoriesToBeShown + 4;
}​;
$scope.EventList = undefined;
$scope.userMood = {​
EventCategory: null,
DayType: 'Any',
LatLong: null
}​;
var markers = [];
var ItemImages = [];
var marker;
var map;
var infowindow;
var options = {​}​;
google.maps.visualRefresh = true;

$scope.SubmitInterest = function (obj) {​
var CategoryUrl = null;
var Choosedate = null;

if (!obj) {​
CategoryUrl = 'all-events';
Choosedate = 'any';
}​
else {​
if (!obj.ChooseDate) {​
Choosedate = 'any';
}​ else {​ Choosedate = obj.ChooseDate; }​
if (!obj.CategoryName) {​
CategoryUrl = 'all-events';
}​ else {​ CategoryUrl = obj.CategoryName.EventCategoryName; }​
}​


MyServices.RedirectToUrl('city/' + $rootScope.PreferredLocation.Url + '/' + CategoryUrl + '?latlng='+$rootScope.PreferredLocation.LngLat+'&daytype=' + Choosedate);

}​
function initMap() {​
MyServices.show();
//$scope.RandomLocation = $rootScope.PreferredLocation!=null ? $rootScope.PreferredLocation.LocationName : 'Atlanta';
var points = MyServices.GetLocation();
var point = 'POINT(' + points.lng + ' ' + points.lat + ')'; //window.localStorage.getItem('MainPoint') == null ? '' : 'POINT(' + window.localStorage.getItem('MainPoint').replace(',', ' ') + ')';

$rootScope.PreferredLocation = MyServices.GetPreferredLocation();
$scope.location = $rootScope.PreferredLocation.LocationName;

MyServices.GetVendorList('WEBEvent', point).then(function (data) {​
$scope.EventList = data.data.Results;
$scope.PreviousEventListArray1 = $scope.EventList;
$scope.EventList = groupBy($scope.EventList);
$scope.PreviousEventListArray2 = $scope.EventList;
if ($rootScope.EventSortBy == 'Day') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return Date.parse(a.EventDateParseStr) - Date.parse(b.EventDateParseStr) }​);
}​
else if ($rootScope.EventSortBy == 'Distance') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return a.Distance - b.Distance }​);
}​
else if ($rootScope.EventSortBy == 'Price') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return a.Price - b.Price }​);
}​

}​);
}​;

MyServices.EventCategories().then(function (data) {​
if (data.data.Status) {​
$scope.EventCategoriesList = data.data.Results;
}​
}​);

$scope.EventSortFunction = function () {​
window.localStorage.removeItem("EventSortBy");
window.localStorage.setItem("EventSortBy", $scope.EventSortBy);
if ($scope.EventSortBy == 'Day') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return Date.parse(a.EventDateParseStr) - Date.parse(b.EventDateParseStr) }​);
}​
else if ($scope.EventSortBy == 'Distance') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return a.Distance - b.Distance }​);
}​
else if ($scope.EventSortBy == 'Price') {​
$scope.EventList = $scope.EventList.sort(function (a, b) {​ return a.Price - b.Price }​);
}​
}​

function GooglePlaces(input, type) {​
var componentForm = {​
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
}​;

var autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.addListener('place_changed', function () {​
var place = autocomplete.getPlace();
$scope.PreferredLocation.LocationName = place.formatted_address;
var tempPoint = {​
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng()
}​;
$scope.PreferredLocation.LngLat = (place.geometry.location.lng() + "," + place.geometry.location.lat());
for (var i = 0; i < place.address_components.length; i++) {​
var addressType = place.address_components[i].types[0];
if (addressType == "locality") {​
$scope.PreferredLocation.Url = place.address_components[i].short_name;
}​
if (componentForm[addressType]) {​
var val = place.address_components[i][componentForm[addressType]];
if (addressType == "country") {​
val = place.address_components[i].short_name;
$scope.PreferredLocation.Url = (val + "--" + $scope.PreferredLocation.Url).replace(" ", "-").toLowerCase();
}​
}​
}​
MyServices.SetPreferredLocation($scope.PreferredLocation);
if (type == "") {​
MyServices.SetLocation(tempPoint.lat, tempPoint.lng);
initMap();
}​

}​);
}​;

$scope.disableTap = function () {​
container = document.getElementsByClassName('pac-container');
// disable ionic data tab
angular.element(container).attr('data-tap-disabled', 'true');
// leave input field if google-address-entry is selected
angular.element(container).on("click", function () {​
document.getElementById('pac-input').blur();
}​);
}​;

function initGooglePlace() {​
var point = MyServices.GetLocation();

if (point) {​

FindLocationByLatLng(point.lat, point.lng);

}​ else {​
navigator.geolocation.getCurrentPosition(function (position) {​
var lat = parseFloat(position.coords.latitude);
var lng = parseFloat(position.coords.longitude);
//due to call back issue rewriting code
MyServices.SetLocation(lat, lng);
FindLocationByLatLng(lat, lng);
//initMap();

}​, function (err) {​

var lat = parseFloat('33.753746');
var lng = parseFloat('-84.386330');
FindLocationByLatLng(lat, lng);
MyServices.SetLocation(lat, lng);

}​, {​ maximumAge: 60000, timeout: 5000, enableHighAccuracy: true }​);
}​

var input = document.getElementById('pac-input');
GooglePlaces(input, "");

}​;
infowindow = new google.maps.InfoWindow();
function addMarkerWithTimeout(position, timeout, place, vendorID) {​
window.setTimeout(function () {​
var marker = new google.maps.Marker({​
position: position,
map: map,
animation: google.maps.Animation.DROP,
icon: 'https://maps.google.com/mapfiles/ms/icons/green-dot.png'
}​);
markers.push(marker);
google.maps.event.addListener(marker, 'mouseover', function () {​
var url = 'v/' + vendorID + '/' + place.replace(/ /g, '-') + '?TicketDate=' + new Date().format('DD-MMM-YYYY');
infowindow.setContent('<a href=' + url + ' target="_blank">' + place + '</a>');
infowindow.open(map, this);
}​);
}​, timeout);
}​
function FindLocationByLatLng(lat, lng) {​
var geocoder =new google.maps.Geocoder();;
var latlng = new google.maps.LatLng(lat, lng);
geocoder.geocode({​ 'latLng': latlng }​, function (results, status) {​
if (status == google.maps.GeocoderStatus.OK) {​
if (results[1]) {​
//formatted address
$scope.PreferredLocation.LngLat = (lng + "," + lat);

for (var i = 0; i < results[0].address_components.length; i++) {​
var addressType = results[0].address_components[i].types[0];

//there are different types that might hold a city admin_area_lvl_1 usually does in come cases looking for sublocality type will be more appropriate
if (addressType == "locality") {​
$scope.PreferredLocation.Url = results[0].address_components[i].short_name;
$scope.PreferredLocation.LocationName = results[0].address_components[i].short_name;
}​
if (addressType == "country") {​
var val = results[0].address_components[i].short_name;
$scope.PreferredLocation.Url = (val + "--" + $scope.PreferredLocation.Url).replace(" ", "-").toLowerCase();
}​
}​
//city data
MyServices.SetPreferredLocation($scope.PreferredLocation);
initMap();

}​ else {​
console.log("No results found");
}​
}​ else {​
console.log("Geocoder failed due to: " + status);
}​
}​);

}​
$scope.VendorClick = function (val) {​
MyServices.RedirectToUrl('ve/' + val.VendorUrl + '?TicketDate=' + new Date().format('YYYY-MM-DD')); //$state.go('app.details', {​ 'name': val.VendorName.replace(/ /g, '+'), 'date': +new Date() }​);
}​;
$scope.EventDetails = function (event) {​
MyServices.RedirectToUrl('event/' + event.EventUrl); //$state.go('app.evdetails', {​ id: event.EventId, name: event.EventName.replace(/ /g, '+') }​);
}​;
initGooglePlace();

$scope.ViewEvents = function (categoryName) {​
categoryName = categoryName.replace(/ /g, '-');
MyServices.RedirectToUrl('es/' + categoryName + '?city=' + $rootScope.PreferredLocation.Url + '&latlng=' + $rootScope.PreferredLocation.LngLat);
}​;

$scope.clearText = function () {​
$scope.location = '';
}​;
$scope.clearSearchText = function () {​
$scope.filterKeyword = '';
$scope.SearchEventsList = null;
}​;

$scope.getEventDetails = function (Day) {​
$scope.EventList = [];
if (Day == 'Today') {​
var tmpArray = [];
angular.forEach($scope.PreviousEventListArray1, function (item) {​
if (Date.parse(Todaydate) >= Date.parse(item.EventDateParseStr)) {​
tmpArray.push(item);
}​
}​);
$scope.EventList = tmpArray;
$scope.EventList = groupBy($scope.EventList, 'BatchId');
}​
if (Day == 'Tomorrow') {​
var tmpArray = [];
angular.forEach($scope.PreviousEventListArray1, function (item) {​
if (Date.parse(TommorowDate) == Date.parse(item.EventDateParseStr)) {​
tmpArray.push(item);
}​
}​);
$scope.EventList = tmpArray;
$scope.EventList = groupBy($scope.EventList, 'BatchId');

}​
if (Day == 'Weekly') {​
var tmpArray = [];
angular.forEach($scope.PreviousEventListArray1, function (item) {​
if (Date.parse(WeeklyDate) >= Date.parse(item.EventDateParseStr)) {​
tmpArray.push(item);
}​
}​);
$scope.EventList = tmpArray;
$scope.EventList = groupBy($scope.EventList, 'BatchId');

}​
if (Day == 'More') {​
$scope.EventList = $scope.PreviousEventListArray2;
}​
}​

$scope.SelectedEventDate = function (date) {​
var tmpArray = [];
angular.forEach($scope.PreviousEventListArray1, function (item) {​
if (Date.parse(date) == Date.parse(item.EventDateParseStr)) {​
tmpArray.push(item);
}​
}​);
$scope.EventList = tmpArray;
$scope.EventList = groupBy($scope.EventList, 'BatchId');
}​
$scope.loadImages = function () {​
}​

function groupBy(collection) {​
var GroupEventList = [];
collection.forEach(element => {​
let isIn = false;
if (element.BatchId == null) {​
GroupEventList.push(element);
}​
else {​
for (let i = 0; i < GroupEventList.length; i++) {​
if (GroupEventList[i].BatchId == element.BatchId) {​
isIn = true;
break;
}​
}​
if (!isIn) {​
GroupEventList.push(element);
}​
}​
}​);
return GroupEventList;
}​

$scope.MarketDetails = function (event) {​
MyServices.RedirectToUrl('market/' + event.ShopUrl.replace(' ','-')); //$state.go('app.evdetails', {​ id: event.EventId, name: event.EventName.replace(/ /g, '+') }​);

}​
}​)
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.