Search Results

Search found 21060 results on 843 pages for 'content disposition'.

Page 93/843 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • Keeping User-Input UITextVIew Content Constrained to Its Own Frame

    - by siglesias
    Trying to create a large textbox of fixed size. This problem is very similar to the 140 character constraint problem, but instead of stopping typing at 140 characters, I want to stop typing when the edge of the textView's frame is reached, instead of extending below into the abyss. Here is what I've got for the delegate method. Seems to always be off by a little bit. Any thoughts? - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { BOOL edgeBump = NO; CGSize constraint = textView.frame.size; CGSize size = [[textView.text stringByAppendingString:text] sizeWithFont:textView.font constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap]; CGFloat height = size.height; if (height > textView.frame.size.height) { edgeBump = YES; } if([text isEqualToString:@"\b"]){ return YES; } else if(edgeBump){ NSLog(@"EDGEBUMP!"); return NO; } return YES; } EDIT: As per Max's suggestion below, here is the code that works: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { CGSize constraint = textView.frame.size; NSString *whatWasThereBefore = textView.text; textView.text = [textView.text stringByReplacingCharactersInRange:range withString:text]; if (textView.contentSize.height >= constraint.height) { textView.text = whatWasThereBefore; } return NO; }

    Read the article

  • Centre content vertically in a <div>

    - by Ben
    Hi, this is probably very simple to do, but I can't quite get it right. I have a <div> which contains two <a> tags. I would like the <a> tags to be both centred vertically and horizontally. I have set them to centre horizontally by setting the text-align:center; on the div, but can't figure out how to vertically centre them. How would I go about doing this? Thanks.

    Read the article

  • JS DOM: Get elements by text content.

    - by hristo
    Hello! I am looking for a way to perform fulltext search on the DOM tree with JS. In two words, I would like to retrieve the list of text nodes which contain a given string. I've tried mootools' Element.getElements ( ':contains[string]' ) but I can't get it to work with strings containing whitespace. I'm thinking about simply indexing all text nodes and checking against each node for the string being searched for, but, in my project, there's no way of telling when the DOM updates in order to maintain such an index up-to-date. Any better ideas? Thanks

    Read the article

  • UIWebview isn't displaying content I want it to display

    - by Knodel
    In my app I have a UIWebView which loads different rtf files. I use this function to load these files: - (void)loadFile:(NSString*)file { NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; NSString* sourceFilePath = [resourcePath stringByAppendingPathComponent:file]; NSURL* url = [NSURL fileURLWithPath:sourceFilePath isDirectory:NO]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; [webview loadRequest:request]; } The UIWebView displays nothing. When I enter the debugger, the file string value is which I need, but resourcePath and sourceFilePath values are "nil". What am I doing wrong? Thanks in advance!

    Read the article

  • jQuery focus on content of input / textarea - not working properly in IE8

    - by katebp
    I want the input fields on my site to select all the text when the user first clicks on them, but in IE8 the text is selected for a split second then reverts back to normal. Works fine in FF. My js code: $(document).ready(function () { //HTML DOM document is ready // Add this behavior to all text fields $("input[type='text'], textarea").live("focus", function(){ // Select field contents this.focus(); }); }); Any ideas? I've tried adding ".select()" after "this" and bizarrely enough it works, but throws loads of js errors in FF and IE. Thanks

    Read the article

  • Print UITableView that has content off screen?

    - by Daniel
    Hi I have an iOS app that has the ability to print a UITableView. However, only th part of the tableview that is shown is printed. Is there a way to print the whole tableview, even if it has not been drawn yet? Here is the code I am using to print: UIGraphicsBeginImageContext(self.mainTableView.contentSize); [self.mainTableView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIPrintInteractionController *printer = [UIPrintInteractionController sharedPrintController]; printer.printingItem = viewImage; UIPrintInfo *info = [UIPrintInfo printInfo]; printer.printInfo = info; UIPrintInteractionCompletionHandler completionHandler = ^(UIPrintInteractionController *pic, BOOL completed, NSError *error) { if (!completed && error) NSLog(@"FAILED! due to error in domain %@ with error code %u: %@", error.domain, error.code, [error localizedDescription]); }; UIButton * printButton = (UIButton *)sender; if(UIUserInterfaceIdiomPad == [[UIDevice currentDevice] userInterfaceIdiom]){ [printer presentFromRect:printButton.frame inView:self.view animated:YES completionHandler:completionHandler]; } else { [printer presentAnimated:YES completionHandler:completionHandler]; }

    Read the article

  • can't save form content to database, help plsss!!

    - by dana
    i'm trying to save 100 caracters form user in a 'microblog' minimal application. my code seems to not have any mystakes, but doesn't work. the mistake is in views.py, i can't save the foreign key to user table models.py looks like this: class NewManager(models.Manager): def create_post(self, post, username): new = self.model(post=post, created_by=username) new.save() return new class New(models.Model): post = models.CharField(max_length=120) date = models.DateTimeField(auto_now_add=True) created_by = models.ForeignKey(User, blank=True) objects = NewManager() class NewForm(ModelForm): class Meta: model = New fields = ['post'] # widgets = {'post': Textarea(attrs={'cols': 80, 'rows': 20}) def save_new(request): if request.method == 'POST': created_by = User.objects.get(created_by = user) date = request.POST.get('date', '') post = request.POST.get('post', '') new_obj = New(post=post, date=date, created_by=created_by) new_obj.save() return HttpResponseRedirect('/') else: form = NewForm() return render_to_response('news/new_form.html', {'form': form},context_instance=RequestContext(request)) i didn't mention imports here - they're done right, anyway. my mistake is in views.py, when i try to save it says: local variable 'created_by' referenced before assignment it i put created_py as a parameter, the save needs more parameters... it is really weird help please!!

    Read the article

  • How to use JQuery to remove dynamic content?

    - by ed.talmadge
    I have an html page that is generated by a CMS. I cannot modify the page, but can add JavaScript. Each time the page loads, a JavaScript function (that I cannot modify) dynamically inserts a paragraph onto the page. How can I use JQuery to .remove() that paragraph whenever it is loaded? For example, when the page first loads, it look like this (blank): <div></div> Then, a few seconds later, a JavaScript function (that I have no control over) adds a paragraph to the page. The page then looks like this: <div><p id="foo">bar</p></div> How can I use JQuery to remove the paragraph with id=foo each time it is dynamically loaded onto the page?

    Read the article

  • Android: SQLite content accessing error

    - by vnshetty
    I've following code, it gives run time error as below... why? try{ String myPath = DB_PATH + DB_NAME; mDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY); }catch(SQLiteException e){} Runtime Error: :sqlite returned: error code = 1, msg = no such table: android_metadata :SELECT locale FROM android_metadata failed :Failed to setLocale() when constructing, closing the database :android.database.sqlite.SQLiteException: no such table: android_metadata

    Read the article

  • Stopping jQuery Jumping to Newly Loaded Content.

    - by Damien
    I have a div with is replaced upon certain user actions. These actions are performed under the div that is being replaced and in the case that the div is too large to fit completely into the view window, along with the buttons used to change it underneath, the browser will jump to the top of the newly loaded div. Which is annoying. Does anyone know of a way to stop these? Cheers. Here is the jQuery code. ChartContent is a small blob of html function UpdateChartImage(ChartContent) { //do updates on div here var existingChart = $("#" + $(ChartContent).attr("id")); existingChart.fadeOut("fast", function() { existingChart.replaceWith(ChartContent); }).fadeIn("fast"); } Incidentally I have prevented the button from doing it's default behaviour so I don't think it's related to that.

    Read the article

  • Updating iOS application content which include images

    - by azamsharp
    I am working on a Vegetable gardening application. Apart from the vegetable name and description I also have vegetable image. Currently, I have all the images in the Supported Files folder in the Xcode project. But later on I want to update the application dynamically without having the user download a new version. When the user updates the application or downloads new data from the server that data will include the images. Can I store those images in the supporting file folder or somewhere where they can be references by just the name. RELATED QUESTION: I will also allow the user to take pictures of their vegetables and then write notes about the vegetables like "just planted", "about to harvest" etc. What is the recommended approach for storing pictures/photos. I can always store them in the user's photo library and then store the reference in the local database and then fetch and display the picture using the reference. The problem with that approach might be that if the user accidentally deletes the picture from the library then it will no longer be displayed in my application. The only way I see if to store the picture in the app local database as a BLOB.

    Read the article

  • Retrieving content of a txt file from URL to Android

    - by eightx2
    I would like to be able to retrieve contents of a .txt file from the internet, and load it in an EditText. I tried using the code on this page: Reading Text File From Server on Android It didn't work, as you might have guessed. I've read on numerous sites about this type of problem, but I can't get anything to work. Someone suggested AndroidHttpClient (http://developer.android.com/reference/android/net/http/AndroidHttpClient.html), but I simply can't find any examples with this. As I'm a newbie in Android programming, I would love if someone could please give me a small example.

    Read the article

  • Using input type="submit" to change content

    - by Conti
    Okay, I'm pretty sure I'm missing something very obvious here, but I just couldn't find a proper solution so far. What I'm trying to do is simple: Have a user write something into a form, have him submit the form, and write that input into a textarea on the same page. This is my code: <html><head></head> <body> <form name='registration'> <label for="input">Input:</label> <input type="text" id="input"/> <input type="submit" id="submit" value="Submit" onclick="execute()"/> </form> <div id="results"> <span>Result</span> <span><textarea cols="30" rows="5" id="resulttext" readonly="readonly"></textarea> </span> </div> <script> function execute() { var result = document.getElementById("input").value document.getElementById("resulttext").value=result; } </script> </body> </html> Now what happens if I enter something into the form is that the textarea briefly shows my input before reverting back to showing nothing. My guess is that the textarea field is only changed for the duration of the execute() function. When I change input type="submit" to a <button> everything works as intended, but I'm pretty sure I'm not supposed to do that.

    Read the article

  • Images with unknown content: Dangerous for a browser?

    - by chris_l
    Let's say I allow users to link to any images they like. The link would be checked for syntactical correctness, escaping etc., and then inserted in an <img src="..."/> tag. Are there any known security vulnerabilities, e.g. by someone linking to "evil.example.com/evil.jpg", and evil.jpg contains some code that will be executed due to a browser bug or something like that? (Let's ignore CSRF attacks - it must suffice that I will only allow URLs with typical image file suffixes.)

    Read the article

  • jquery focus on content editable without selecting everything

    - by Mark
    I have a contenteditable element that I want to focus, but only insofar as to place the cursor at the front of the element, rather selecting everything. elem.trigger('focus'); with jquery selects the entire element in chrome. How can I get it to behave the way I want, or is focus perhaps not what I'm looking for. Thanks

    Read the article

  • Dynamic content in a Gridview

    - by mariki
    I have a gridview with couple of columns,I want to achieve the following: If user is NOT authorized display normal columns. If user IS authorized: set mouseover event for first column text and display some buttons (that are not available for NOT authorized users) in a second column when user hover over(using javascript) the first column. I am have 2 difficulties: The first one where and when should I create the buttons? I have 2 options, I can create those button on design time, in gridviews template and just set Visible value to false and then in codebehind set it to true if user is authorized. The second option would be creating this buttons dynamically in gridview_RowCreated event (or any other event) if user is authorized. The Second difficulty is setting the javascript event to show the buttons, the event should be added only if user is authorized! Note that event and buttons should have some kind of id match for Javascript function to know what should it hide/unhide when event is triggered. What should I do, what is the best practice? I know this is a long question, but please try to help :)

    Read the article

  • protecting my web site content from external

    - by Testadmin
    Hai I heard about external access of a web site using curl by the following code $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://example.com'); $buffer=curl_exec($curl_handle); curl_close($curl_handle); I want to protect my web site from this external access. I am using Php. how will I protect my web site? Does any one know?

    Read the article

  • MySQL get content from web page (or other network resource)

    - by Rescommunes
    Is it possible to open a curl like object in MySQL? What I would like to do is create procedure which would check to see if a certain value is returned from a specific URL like http://example.com/inschedule?id=200&time=20m. The returned result would be a simple string like 1 or 0. I know it is better to have a script do this by putting a entry into a table etc. However, it would be much less complex for me to be able to do it this way. Thanks

    Read the article

  • Query - Trying to SUM one field based on content of another field

    - by ShaneL
    Table: DayOfWeek Enrollments Monday 35 Monday 12 Saturday 25 Tuesday 15 Monday 9 Tuesday 15 Basically I'm trying to sum the total enrolments for each day. so the Output will look like: DayOfWeek Enrollments Monday 56 Saturday 25 Tuesday 30 I've spent around 4 hours trying to work this out trying many many different ways but no luck. The problem I'm having is i can count how many enrollments for each day but can't have it aligned with the correct day when i run the query e.g. I want The total to be on the same line as the day it was calculated from. (I hope that is clear enough)

    Read the article

  • Writing Content Between Firefox Tabs

    - by GregH
    I am trying to write some values that I extract from a page (via JS/JQuery) opened in a tab in Firefox, to another opened page in a different tab within Firefox. Is this possible? Basically, I am trying to write some values I extract to a Google document that I have open in a different tab. I can see the "document" value in the DOM for my Google Document is something like: Doc?docid=0AQyS4r3XWCQ7ZGZ3dnE2OHNfMTNmcHE2OHAzMg&hl=en Can I just write to that document?

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >