w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Update jquery cookie pb after addClass , some div shouldn't take class cookie created
have a look at var $qsts = $(".quest").show(); var $anrs = $(".ans").hide(); $('.quest').click(function(){ var $ans = $(this).next().toggle(10); $anrs.not($ans).hide(); }); $('.ans').change(function(){ var $ans = $(this).closest('.ans'); var $act = $ans.prev().toggleClass('question-active', $ans.find('input:checkbox:checked').length > 0) var items = JSON.parse($.cookie('question-active') || '[]'); var qstName = $act.get(0).className.match(/(questiond*)/)[1]; if($act.hasClass('question-active')){ if($.inArray(qstName, items) == -1){ items.push(qstName) } } else { items.splice($.inArray(qstName, items), 1) } $.cookie('question-active', JSON.stringify(items)) }); var items = JSON.parse($.cookie('question-act

Categories : Jquery

What are the obvious vulnerabilities to using a session identifier cookie and a user_id cleartext cookie?
Well, you can always pass the User Id in cookie; however, another way to edit self is to allow "self" or "me" in the URIs to resolve to the sessions current user for example /users/me/profile/ instead of /users/42/profile/ - then however you need to make sure that no data is cached as it would be quite confusing for the users to see another users' profile data as their own. Actually in my latest project we used both of these approaches simultaneously.

Categories : Javascript

How to use Rack middleware to simultaneously set cookie and send response with cookie in effect
you need to setup your middleware in your application.rb config.middleware.insert_before "ActionDispatch::Cookies", "GeoFilterMiddleware" and in your middleware do something like this: def call(env) status, headers, body = @app.call(env) if from_uk?(env) Rack::Utils.set_cookie_header!(headers, 'country', { :value => 'UK', :path => '/'}) end [status, headers, body] end

Categories : Ruby On Rails

calendar from apps script : every time authorized required. Only work with primary calendar
finally I changed the access to calendar API to CalendarApp service with .getEvents var cal = CalendarApp.getCalendarById(cal_id); var this_year = new Date(2013,0,1); var now = new Date() var events = cal.getEvents(this_year, now, {search: event_name});

Categories : Google Apps Script

android native calendar app get notified OF what is the current date displayed to user on the calendar
if there any broadcast receiver for the navigation on the months and weeks of the native calendar app in order that update my app to load the data of these month if it is not exist ? No.

Categories : Android

Angular-Ui-Calendar: Filter events in calendar based on dropdown selection
Finally I got the solution, I solved the filter problem in angular-ui-calendar. When the end user selects the user from the dropdown(above calendar) it calls "onStaffSelect(userId)" function in the controller. /*on user select*/ $scope.onUserSelect = function(id){ console.log("### onUserSelect is called "+id); if(id==1) $scope.events = [{title: 'Birthday Party',start: new Date(y, m, d + 1, 19, 0),end: new Date(y, m, d + 1, 22, 30),allDay: false, userId: 1}]; }; $scope.myCalendar.fullCalendar( 'removeEvents'); $scope.myCalendar.fullCalendar( 'addEventSource', $scope.events);

Categories : Angularjs

How to instantiate a com.google.api.services.calendar.Calendar object given an oAuth token?
After looking at some of the Google Calendar API's and examples it looks like the best way to assign a token to the Calendar is when initializing it. This takes some setup, take a look at this link: https://developers.google.com/google-apps/calendar/instantiate My apologies if you have already been through it, but it looks like you may be able to make a few adjustments to that example. Right before the Calendar is initialized, this snipped of code is executed: GoogleAccessProtectedResource accessProtectedResource = new GoogleAccessProtectedResource( response.accessToken, httpTransport, jsonFactory, clientId, clientSecret, response.refreshToken); which in turn is used as part of the Calendars initialization. Looking at the documentation for GoogleAccessProtectedResource

Categories : Android

HttpWebRequest: Add Cookie to CookieContainer -> ArgumentException (Parametername: cookie.Domain)
CookieContainers can hold multiple cookies for different websites, therefor a label (the Domain) has to be provided to bind each cookie to each website. The Domain can be set when instantiating the individual cookies like so: Cookie chocolateChip = new Cookie("CookieName", "CookieValue") { Domain = "DomainName" }; An easy way to grab the domain to is to make a Uri (if you aren't using one already) that contains your target url and set the cookie's domain using the Uri.Host property. CookieContainer gaCookies = new CookieContainer(); Uri target = new Uri("http://www.google.com/"); gaCookies.Add(new Cookie("__utmc", "#########") { Domain = target.Host });

Categories : C#

jQuery: remove a cookie when closing the browser (session cookie)
There is some code that worked for me. It should expire when you close the browser because of the date to expire being before now: var vEnd = new Date(); vEnd.setDate(vEnd.getDate() - 1); var endOfCookieText = "; expires=" + vEnd.toGMTString() + "; path=/"; document.cookie = escape('testCookie') + "=" + escape("eat cookies") + endOfCookieText; FIDDLE MODIFIED Note that the fiddle gives a bunch of load errors on the console for me.

Categories : Javascript

Adding cookie to HttpServletRequest and retrieving cookie from HttpServletResponse using Mockito
For the request: construct the array, adding any Cookies you want, then add the behaviour to the mock: final Cookies[] cookies = new Cookies[] { ... }; final HttpServletRequest request = mock(HttpServletRequest.class); given(request.getCookies()).thenReturn(cookies); ... pass to controller/servlet etc ... For the response you create the mock and then verify the addCookie call by either using an ArgumentCaptor to capture the actual cookie passed to addCookie: final ArgumentCapor<Cookie> captor = ArgumentCaptor.forClass(Cookie.class); verify(response).addCookie(captor.capture()); final List<Cookie> cookies = captor.getValue(); ... perform asserion on cookies ... Or build the expected cookie and verify: final Cookie expectedCookie = ... verify(response).addCookie(expe

Categories : Java

SessionAuthenticationModule Cookie Handler not creating HttpOnly secure cookie
I am using the same implementation and do not see your issue using Fiddler2. However maybe the issue is related to your debugging tool? In IE10 debugging tools the secure and http only flags are only displayed when the cookies are first received. If you check using Chrome debugging tools you should see the flags displayed correctly on all requests.

Categories : Asp Net Mvc

Loss of '+' characters when fetching cookie using perl's CGI::Cookie->fetch
Cookie values are url escaped, which means that spaces are replaced with the + character and other punctuation marks are replaced with %xx codes. The CGI::Cookie::fetch method decodes the value, and the spaces in your cookie value are restored. You can use the raw_fetch method if you don't want the cookie values to be decoded.

Categories : Perl

How can I simply pull feeds from Mac Calendar public calendar, in FullCalendar?
Probably the response isn't valid. You can check the response using the Google Chrome inspector or Firebug on Firefox. You are going to need a server-side script to get the data from iCal, convert for the fullcalendar format (here documentation for the "event" object http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) and return a JSON formatted response for the browser.

Categories : Jquery

JQuery Full Calendar - edit calendar view after initialization
If you go through their documentation it is clearly specified. There is a function to change the view. .fullCalendar( 'changeView', viewName ) http://arshaw.com/fullcalendar/docs/views/changeView/

Categories : Javascript

Cookie Code not removing opened element of cookie
Fixed it by using $.map and .join() var openClose = $('.openClose'); openClose.on('click', function() { var cook = ReadCookie('slideHide'), miniParent = $(this).parent().parent().parent().children('.main-content'), miniDisp = miniParent.css('display'); if (miniDisp ==="block") { KillCookie('slideHide'); $(this).parent().parent().parent().children('.main-content').slideUp(); var slide = cook+","+ "#"+$(this).parent().parent().parent().attr("id"); SetCookie('slideHide', slide, 100); } else { $(this).parent().parent().parent().children('.main-content').slideDown(); KillCookie('slideHide'); var newCookie=[], a= $('.module').children('.main-content').filter(":hidden"), c = $.map(a,function(n,i){ return "#"+$(n).p

Categories : Javascript

jQuery cookie plugin creates same cookie instead of read it
$.cookie is only read access if no other parameters (but the cookie's name) are supplied to the method [See the source] If you're interested in reading it, just supply $.cookie('UniqueID') and remove the second parameter. As an FYI, path (and other cookie properties) are only relevant when assigning a value, not retrieving. In other words, you don't need to supply path:'/' to get cookies that are applied to that path, document.cookie should natively perform that check.

Categories : C#

Does a persistent tracker cookie become a session cookie if I setMaxAge(-1)
setMaxAge public void setMaxAge(long expiry) Sets the maximum age of the cookie in seconds. A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age. A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted. Thank you all for your assistance.

Categories : Java

Check if a cookie exists NOT using the jQuery cookie plugin
create a function that returns null or false if the cookie doesn't exist : function getCookie(c_name) { var c_value = document.cookie, c_start = c_value.indexOf(" " + c_name + "="); if (c_start == -1) c_start = c_value.indexOf(c_name + "="); if (c_start == -1) { c_value = null; } else { c_start = c_value.indexOf("=", c_start) + 1; var c_end = c_value.indexOf(";", c_start); if (c_end == -1) { c_end = c_value.length; } c_value = unescape(c_value.substring(c_start, c_end)); } return c_value; } var acookie = getCookie("cookiename"); if (!acookie) { alert("Cookie not found."); } FIDDLE

Categories : Jquery

Create new cookie or add new cookie if one exists using jquery/javascript (or php?)
Your Code seems little strange to me... And if you try it like this: $(document).ready(function() { $("#button").click(function() { if ($.cookie('cookie_1') == null) { $.cookie('cookie_1', $('#phrase_here').text(), {expires: 7}); } else { $.cookie('cookie_2', $('#phrase_here').text(), {expires: 7}); } }); });

Categories : Javascript

"calendar has no source" error when creating a new calendar using EventKit in ios 6
Problem seems to be that the local calendar is hidden when iCloud is enabled so you need to handle both cases (iCloud enabled and not). See this answer for a working solution: http://stackoverflow.com/a/15980556/72176

Categories : Iphone

Calendar shows on icon as well as inline calendar from input box
In showOn, instead of "button" use "both" $(".dob1").datepicker({ hideIfNoPrevNext : true, yearRange : "-95", showOn: "both", buttonImage : rootPath + "images/callender-icon.png", buttonImageOnly : true, changeMonth : true, changeYear : true, maxDate : '-18Y', dateFormat : "mm/dd/yy", buttonText : "Choose date of birth", inline : true });

Categories : Jquery

How To Make Former Form Calendar Always Active (Serious Calendar Problems)
Looks like you get your events through ajax when the month or year changes. You have a couple of options. Trigger the same function on document ready, so your ajax call will get the events. Populate a JSON object with the current month as part of the page. Then, feed that JSON to the same calendar function that populates the events from the ajax results. This way, the user doesn't have to wait for the initial month's events to arrive using ajax. Also, you have a JS error on the page. Look at the console when you load the page and you will see the following: Uncaught TypeError: Object [object Object] has no method 'catcomplete' scripts.js:127 EDIT Solution as mentioned on comment, placed here for visibility. $(function() { $('.ui-datepicker-month').trigger('change') })

Categories : PHP

How to add events to Outlook Calendar or Google Calendar programmatically?
Google Calendar seems to be the best choice, as you can use the Google Calendar API. For an example written in Java, look here. Just make sure to note the GCal API usage limits. Outlook doesn't seem to have some sort of an API, but maybe you can make use of or modify something like the Jpst or java-libpst.

Categories : Java

Anno Domini calendar to Buddhist calendar primefaces 3.5
I once used JQuery datepicker with BE calendar and i used https://code.google.com/p/jquery-ui-datepicker-extension-buddhist-era/ and because primefaces does use JQuery datepicker try to include this extension after jquery and add in your page: <script type="text/javascript"> $(document).ready(function(){ $( ".datepicker").datepicker({ isBE: true, autoConversionField: true }); }); </script> This should do the trick.

Categories : JSF

Google Calendar API not found - Calendar classes missing
To use google calendar api you need two particular libs here they are: Calendar service java: https://developers.google.com/resources/api-libraries/download/calendar/v3/java Google api client java: https://code.google.com/p/google-api-java-client/downloads/detail?name=google-api-java-client-1.15.0-rc.zip&can=2&q= And be sure you import all the required jars. That's all.

Categories : Java

Angular-UI-Calendar: Open popup on calendar dayClick
!!!Solution for AgendaViews!!! Just add the select option in your calendar config array. $scope.uiConfig = { calendar:{ height: 500, editable: true, header:{ left: 'prev,next', center: 'title', right: 'agendaDay agendaWeek' }, select: function(start, end, allDay, jsEvent) { $scope.openPopover(start, end, allDay, jsEvent); } } }; $scope.openPopover= function(start, end, allDay, jsEvent){ $("#myPopover").popover('show'); } Add a div with "myPopover" id in your HTML like: <div id="myPopover"></div> Its working fine for me.... :-)

Categories : Angularjs

Create a transparent Calendar with Tapku Calendar
Finally I get how to make the background color clear in calender view. Change code as below. In TKCalendarMonthView.m (1) Comment/remove below line. + (void) initialize { if (self == [TKCalendarMonthTiles class]) { //tileImage = [UIImage imageWithContentsOfFile:TKBUNDLE(@"calendar/Month Calendar Date Tile.png")]; COMMENT THIS LINE } } (2) In - (void) _setupCurrentTileView:(NSDate*)date method Add [self.currentTile setBackgroundColor:[UIColor clearColor]]; line as below - (void) _setupCurrentTileView:(NSDate*)date{ if(self.currentTile) return; NSDate *month = [date firstOfMonthWithTimeZone:self.timeZone]; NSArray *dates = [TKCalendarMonthTiles rangeOfDatesInMonthGrid:month startOnSunday:self.sunday timeZone:self.timeZone]; NSArray *data = [self.dataSource cal

Categories : Iphone

NullPointerException some times on calendar.get(Calendar.Year)
It means that MainActivity.calenda is null. How do you initialize that reference in your code? Sometimes suggests that you haven't paid any attention to thread safety. I think it makes sense now. You've created a static Calendar, which is initialized to null as coded. You only set that instance to a non-null reference in calls to onCreate method. If you do anything else before calling that method, the reference is still null.

Categories : Android

Calendar returns wrong milliseconds after Calendar.add()
You're adding 3 hours to another calendar instance. Try : final Date now = new Date(); final Calendar cal = Calendar.getInstance(); cal.setTime(now); cal.add(Calendar.HOUR_OF_DAY, 3); SetTime(cal.getTimeInMillis()); As Peter Lawrey and Brian Roach stated, there's no need to create a Date object. So you could just do : final Calendar cal = Calendar.getInstance(); cal.add(Calendar.HOUR_OF_DAY, 3); SetTime(cal.getTimeInMillis());

Categories : Java

Error 404 when creating a calendar with Google Calendar Api v3 using c# .net
Okey, my bad: You can't create a calendar with your own identifier, the purpose of CalendarListEntry.Insert() is to insert a created Calendar into the list of calendars So to create a new calendar one has to: Insert a new Calendar: https://developers.google.com/google-apps/calendar/v3/reference/calendars/insert (DO NOT add id as paramater, this will be automatically created) Insert the ID of the calendar created in step 1 and insert it into the calendarList: https://developers.google.com/google-apps/calendar/v3/reference/calendarList/insert

Categories : Http

Cookie duplicated in document.cookie
The problem was that I had earlier set a cookie with the jquery plugin, which sets the current path as that path for the cookie. The above .Net code sets the path of the added cookie to "/", so there was two different cookies present, which was invisible to me when viewing the document.cookies variable. My solution was to set the path of the jquery cookie to be "/".

Categories : Javascript

Google Calendar API - Not showing calendar
Indeed google calendar api doesn't provide a display widget to integrate calendar to your application. The api only gives you the possibility to retrieve every details about your calendars and their events, and then you'll have to find a way to display it on your screen if you want a nice layout.

Categories : PHP

Custom Calendar and Calendar Adapter
1st fix: I'm not resetting the background. So this fixes that part. Now the views (dates) are not getting repopulated when going previous month. //set background int imageResource = mContext.getResources().getIdentifier("drawable/calendar_cell", null, mContext.getPackageName()); Drawable orgImg = v.getResources().getDrawable(imageResource); v.setBackground(orgImg); 2nd fix: Reusing the calendar object is throwing off your calendar. Create a new calendar object so they don't conflict with each other.

Categories : Android

Google Calendar API V3 - Insert Calendar
Honestly I haven't tried the google api with ruby, but in looking at your error and the google documentation I believe that summary is equal to title (as you stated). Also, in looking at other examples of inserts (maybe not calendar) I notice that the API can take a :body attribute which probably (in your case) contain the actual calendar data (i.e., "summary"). And here it actually mentions request "body" under tryit. So again, I haven't tried this but I would try something like the following: @result = client.execute( :api_method => service.calendars.insert, :parameters => # not sure what parameters the insert needs, :body => JSON.dump(cal), # where cal is the object containing at least "summary". :headers => {'Content-Type' => 'application/json'})

Categories : Ruby On Rails

Creating a subdomain Auth cookie then redirecting to subdomain loses the cookie in asp.net MVC4
I have good news and bad news. The bad news is-- you can't do it. See here for an explanation. Essentially your server is setting a cookie for a domain it does not contain, so the cookie is rejected. The good news is-- you don't want to do this anyway. Your design violates OWASP 2013 A4 (unsecure and unvalidated direct object reference). In this case you are storing user's access permissions as the domain of the cookie, which a hacker can easily modify. Find a different way to designate subdomain access. There are all kinds of ways to do this. Here is one way that is pretty close to your plan: Store the subdomain in the cookie value itself. Create a secure document container that lists the subdomains to which the user is granted access. You could for example store the subdomain

Categories : Asp Net

Cookie Header in PhoneGap: Refused to set unsafe header "Cookie"
The short answer is no, you can't set the Cookie header. The reason for this is that Chrome is your User Agent, so it is required by the HTTP specification to disallow modifications to headers which have security implications. One solution would be to perform an action that allows the server to set the cookie on your XmlHttpRequest object. You say you're already trying to do this but it's not working. I suspect that's because you need to set withCredentials on your ajax request. Add the xhrFields attribute, as follows. var token; $.ajax({ url: "https://server.com/AuthService/api/account/login", crossDomain: true, xhrFields: {withCredentials: true}, type: 'post', async: false, data: { username: "username", password: "password" } }).done(func

Categories : Javascript

Cookie being set, or not set.? Cookie Set to Array()
You don't say if this is what you're doing, but -- If you set the cookie and try to read the cookie during the same execution of the script, the $_COOKIE array will not yet be populated by the cookie. You won't see it till the next time the browser sends a request to the script.

Categories : PHP

In iOS Safari, cookie data gets destroyed on closing browser from background. I don't want to lose cookie data on closing the browser?
You cant use cookies for that. As @Gajotres was suggesting, you need localStorage API. That way your data will persist till your browser's cache is cleared. To set an array (in your case history_url_array) in localStorage, use var obj = [ {"name" : "blah", "age" : "20" }, {"name" : "blee", "age" : "25" } ] localStorage["names"] = JSON.stringify(obj) On page refresh, to get your array back from localStorage, var obj= JSON.parse(localStorage["names"]) The reason for the use of JSON.parse and JSON.stringify - localStorage takes in only string, so you need to parse obj into string. On getting it back from your localStorage, use JSON.parse to re-parse it to JSON. But mind the browser support. IE has been shaky in its support for HTML 5 components. Here's the su

Categories : Javascript

is android calendar API the same as google calendar API for android?
Google Calendar API (v3) is different than so called Android Calendar API. First approach: Google Calendar API: You use it when you are making mostly web apps. It also has a Java client that you can use in your application for making Android application that interacts with Google Calendar or other Google services. When using this library user will still have to authenticate and you have to handle it in your app. https://developers.google.com/google-apps/calendar/ Second approach: Google added Calendar Provider in Android 4.0. You can use it if you are going to support Android 4.0+ only. Your application will not have to handle user authentications. It uses current Calendar of current logged in user on the device. There are two ways of adding an event using this API. 1) Use Intent for

Categories : Java

Cookie not set in mvc 4
Ignore this - see the update below It looks like you are never able to set the cookie. The Accept action in your LandingController is, I assume, the only thing that sets the cookie. However you can never get there because the custom Authorize filter (LandedAttribute) that you've created stops the application from getting there (because the cookie is not set). You probably want to add an [AllowAnonymous] on that action to allow it through so that the cookie can be set. e.g. [AllowAnonymous] public ActionResult Accept() { // body of the action here. } UPDATE I just realised your LandedAttribute is attempting to read the outgoing cookies, not the incoming cookies. You have HttpContext.Current.Response. Use the cookies on the Request, not the Response Your Controller action should

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.