I have seen some websites stream avi videos from megaupload using divx web player. How would I do this for my site?
Are there open source scripts to do this? How would I get started?
Hi Team,
Can you offer a bit of advice.
I am using a hosted SAAS CMS solution that enables you to create basing apps with a web apps system. I have created a form for members to submit a bunch of images and content to their own area. Everything is working great except if the images being submitted via the form are large, it takes ages for the form to submit and go to the thank you page. I am already using jQuery UI to split the form in to 5 steps and using the jQuery facebox plugin for instructional popups.
My question is, what would be the best way to display a loading gif (in facebox or in another suggested overlay) while the form is being submitted?
Thanks for your help!
Jack
This is both a conceptual and how-to question:
In wiki formatting, or non WYSIWYG editor scenarios, you typically have a textarea for content entry and then an ancillary preview pane to show results, just like StackOverflow. This works fairly well, except with larger amounts of text, such as full page wikis, etc.
I have a concept that I'd like critical feedback/advice on: Envision a two pane layout, with the preview content on the left side, taking up ~ 2/3 of the page, and the textarea on the right side, taking up ~ 1/3 of the page. The textarea would float, to remain in view, even if the user scrolls the browser window. Furthermore, if the user scrolls the textarea content, supposing it has exceeded the textarea's frame size, the page would scroll so that the content presently showing in the textarea syncs/is parallel with the content showing in the browser window.
I'm imagining a wiki scenario, where going back and forth between markup and preview is frustrating. I'm curious what others think; is there anything out there like this? Any suggestions on how to attack this functionality (ideally using jquery)?
Thanks
Hello there!
I'm having a really hard time debugging one of our latest reported bugs. The problem occurs "randomly", not on every page load, sometimes I can "click" around for a minute or two before IE6/7 crashes. By crash I mean that the IE-window shuts down and I get the option to send the crash info to Microsoft.
In FF, Chrome, Safari, IE8 everything is working perfectly.
What the page does is issuing 2 AJAX Jsonp calls and building some menus with the data returned. The data brought back can be from ~500b to approx. 35kb.
The JSON is valid (else it wouldn't have loaded at all in FF etc), and as i told previous, it works for when navigating around the site soemtimes in IE6/7.
I've tested to comment out the callbacks, still crashes. If I remove the $.ajax calls the page will work again.
Whats strange is that if I downgrade to jQuery 1.3.2 everything works in all browsers including IE6/7.
I've taken the crash-logs and looked at them in WinDbg and what happens seems to be a NULL POINTER reference.
The last entries of the stack trace is as follows
mshtml!CTreePos::SourceIndex+0x9
mshtml!CMarkup::InsertElementInternal+0x3a8
mshtml!CDoc::InsertElement+0x98
mshtml!CDocument::get_implementation+0x144
Anyone having a clue what could cause this?
I have a jquery datepicker script and what I want to do is to change "minDate: 10" value by a select box.
$(function() {
$('#hotel').change(function() {
// assign the value to a variable, so you can test to see if it is working
var selectVal = $('#hotel :selected').val();
if( selectVal == "hotel_c" ) {
var date = 10;
}
if( selectVal == "hotel_a" ) {
var date = 15;
}
if( selectVal == "hotel_b" ) {
var date = 6;
}
});
var dates = $('#from, #to').datepicker({
defaultDate: "+1w",
changeMonth: true,
dateFormat: 'yy-m-d',
minDate: 10,
numberOfMonths: 3,
onSelect: function(selectedDate) {
var option = this.id == "from" ? "minDate" : "maxDate";
var instance = $(this).data("datepicker");
var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
dates.not(this).datepicker("option", option, date);
}
});
});
Once a page with a textarea is loaded, I want some textarea to have the focus immediatly if the mouse cursor is inside that textarea. This is the easy part because a onmousehover handler can set the focus.
Now, how to I also set the position of the caret? I would like the caret to be where it would be if the user had clicked using the mouse to set the focus/caret.
The basic use case is :
User clicks on a link and waits (mouse barely moves)
A page is delivered, it contains a big textarea only, full of text
User types using keyboard
Characters are inserted right below the mouse cursor
Today the user has to wait until the caret is visible (at the top left of the textarea) and then click to move the caret before typing.
Thanks!
I'm trying to return a value from (transport) to the calling function, but can't seem to get it to work:
function createXMLHttpRequest( w )
{
var urly = '/users/notes/' + w;
var options = {
method:'get'
, onSuccess: function( transport )
{
x = transport.responseText;
return x;
}
, onFailure: function( transport )
{
var response = transport.responseText;
alert( "FAILED "+ response );
}
};
new Ajax.Request( urly, options );
alert( x );
}
var ai = $( 'addItem' );
ai.onclick = function()
{
// -1 indicates new
addnote( -1, null );
}
x always alerts undefined. Unless I assign x to the Ajax.Request e.g. x=new Ajax.Request(urly,options). It then will alert [Object object]. How can I return the value of transport.responseText to the onclick function?
Is there are any libraries to make ComboBox to select multiline options when expanded. I am looking something similar to Combobox in ExtJS except values have to appear when user clicks down arrow, like in normal dropdown.
Does someone know if its possible to do something like that with ExtJS? Because their own community and support sure doesn’t (http://www.extjs.com/forum/showthread.php?t=94079)
I'm using FeinCMS (https://github.com/feincms/feincms/) and django-ckeditor with file upload support (https://github.com/shaunsephton/django-ckeditor).
I create a FeinCMS content type for RichTextField:
class RichContent(models.Model):
text = RichTextField(_('text'))
class Meta:
abstract = True
verbose_name = _('Rich Text')
verbose_name_plural =_('Rich Text')
def render(self, **kwargs):
context_instance = kwargs.get('context_instance')
return render_to_string('content/page/rich_content.html', {
'page': self,
}, context_instance=context_instance)
But in Django admin, when i select 'Rich Text' and press 'Go', get this error in firebug console:
uncaught exception: [CKEDITOR.editor] The instance "id_richcontent_set-__prefix__-text" already exists.
And textarea in ckeditor do not editable.
I'm wondering - is there any difference in performance of using CSS Transitions vs. any of the various JS animation libraries? (scriptaculous, scripty2, jsAnim, MooTools, $fx, etc, etc).
I've tried various tests in Safari / Google Chrome, and I don't actually see any difference -- I thought that CSS Transitions were supposed to be hardware accelerated.
I'm trying to learn jQuery by implementing a simple menu. I've got <div> elements that act as buttons and have links in them. I'm trying to add onclick events to the divs that navigate the browser to the link's address in the div. This is basically my pseudo-code. What would the real code be? How can I improve this? Any feedback appreciated!
// Iterate over each menu button
$('.masterHeaderMenuButton').each(function () {
// Get the link in each button and set the button's onclick to
// redirect to the link's address
var url = $('a', this).attr('href');
this.click(function () {
window.location.href = url;
});
// If the user is on the page for the current button, hilight it
if (window.location.href === url) {
$('a', this).addClass("masterHeaderMenuButtonSelected");
}
});
Hey,
I have an input text :
<input name="Email" type="text" id="Email" value="[email protected]" />
I want to put a default value like "What's your programming question ? be specific." in StackOverFlow, and when the user click on it the default value disapear.
I'm attempting to write a Ubiquity command that allows you to replace a selected link or URL pointing to an image with that image itself. However, the CmdUtils.setSelection() function (documented here) seems to do nothing if any html tags are present in the selection, making it useless for replacing any links. When selecting plain text, it functions exactly as intended, replacing the text with an <img src="text"/> tag. Is there something I'm missing, or will this function simply not allow me to replace html? If the latter is the case, is there a function or method that will allow me to do this? Any other advice is welcome as well!
CmdUtils.CreateCommand({
name: "fetch-image",
author: {name: "Josh Timmer"},
license: "GPL",
description: "Replaces links or URLs pointing to images with the image itself",
help: "Highlight text or a hyperlink and execute this command",
takes: {"image URL": /.*/},
_getImgUrl: function(itemIq) {
if (itemIq.html.indexOf("<a ",0) < 0)
return itemIq.text;
var refPos = itemIq.html.indexOf("href=\"",0);
if (refPos < 0)
return "Error, no URL found!";
var startPos = itemIq.html.indexOf("\"", refPos);
var endPos = itemIq.html.indexOf("\"", startPos + 1);
startPos += 1;
var url = itemIq.html.substring(startPos, endPos);
return url;
},
preview: function(pblock, input) {
pblock.innerHTML = "Image URL: " + this._getImgUrl(input) + "<br/><br/><img src='" + this._getImgUrl(input) + "'/>";
},
execute: function img_insert(input) {
CmdUtils.setSelection("<img src='" + this._getImgUrl(input) + "'/>");
displayMessage("Executed: " + this._getImgUrl(input));
}
});
I'm using Google Maps and have the map set to height/width=100%.
I noticed that when I resize the browser window, my map marker icons appear to redraw on top of the same location.
Meaning, if I should only have 1 map marker icon on "987 Main St", when I resize the browser window - multiple map marker icons are being now draw on top of "987 Main St" that shouldn't be there.
Any ideas why this is happening and how to prevent it?
UPDATE:
Link to actual code
What I'm trying to do is create a class that I can quickly attach to links, that will fetch and display a thumbnail preview of the document being linked to. Now, I am focusing on ease of use and portability here, I want to simply add a mouseover event to links like this:
<a href="some-document.pdf" onmouseover="new TestClass(this)">Testing</a>
I realize there are other ways I can go about this that would solve my issue here, and I may end up having to do that, but right now my goal is to implement this as above. I don't want to manually add a mouseout event to each link, and I don't want code anywhere other than within the class (and the mouseover event creating the class instance).
The code:
TestClass = new Class({
initialize: function(anchor) {
this.anchor = $(anchor);
if(!this.anchor) return;
if(!window.zzz) window.zzz = 0;
this.id = ++window.zzz;
this.anchor.addEvent('mouseout', function() {
// i need to get a reference to this function
this.hide();
}.bind(this));
this.show();
},
show: function() {
// TODO: cool web 2.0 stuff here!
},
hide: function() {
alert(this.id);
//this.removeEvent('mouseout', ?); // need reference to the function to remove
/*** this works, but what if there are unrelated mouseout events? and the class instance still exists! ***/
//this.anchor.removeEvents('mouseout');
//delete(this); // does not work !
//this = null; // invalid assignment!
//this = undefined; // invalid assignment!
}
});
What currently happens with the above code:
1st time out: alerts 1
2nd time out: alerts 1, 2
3rd time out: alerts 1, 2, 3
etc
Desired behavior:
1st time out: alerts 1
2nd time out: alerts 2
3rd time out: alerts 3
etc
The problem is, each time I mouse over the link, I'm creating a new class instance and appending a new mouseout event for that instance. The class instance also remains in memory indefinitely.
On mouseout I need to remove the mouseout event and destroy the class instance, so on subsequent mouseovers we are starting fresh.
I'm working on a project to develop a cross-browser testing web app. Simply put, I'm tired of having to maintain multiple browsers on the same system and IE in VMware solely for the purpose of testing. Does anyone know if there is any way to change the render kit programmatically? For example, if I insert a URL, I would be able to load the URL and switch the browser render within a frame of some assortment. I am experienced with PHP, JS, and RoR if there is a solution using any of those.
Thank you!
John
This is probably really stupid but i can't find the problem with my code. It fetches a url that returns json and the function is then supposed to return a string:
function getit() {
var ws_url = 'example.com/test.js';
var user = false;
$.getJSON(ws_url, function(data) {
alert('user '+data.user);//shows john
user = data.user || false;
}
);
return user;//should return john but returns false
}
test.js will have something like this:
{"id":"12","username":"ses","user":"john","error":""}
or like this:
{"error":"123"}
I also tried if(data.user){}else{} but it didn't work either..
So what am i missing?
Thanks :)
i make a demo using v2 , and now i want to using v3..
but i found v3 has not many method that v2 has,
ex:
1.map.enableGoogleBar();
2.map.enableScrollWheelZoom();
3.polyline.enableDrawing()
is v3 powerful enough ???
thanks
I've been tinkering around with the excellent Superfish drop-down menu to fit my needs. Here's the result. Still, there are two oddities I need to fix.
Since I changed the font family and font size used for the items in the menu bar, the drop-down menus are aligned incorrectly a few pixels lower than where they should be.
Secondly, when I hover over a menu item that has a submenu, an arrow to the right is displayed but it's not as visible as it should be due to the light background color. Can I change this quickly without making a new arrow image?
I am applying truncation using CSS styles:
.yui-skin-sam td:not(.yui-dt-editable) .yui-dt-liner{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-moz-binding: url('ellipsis.xml#ellipsis');
}
.yui-skin-sam td[class~=yui-dt-editable] .yui-dt-liner{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
(Sidenote: I'm not sure if this is the best way to write my CSS. This is a Firefox specific workaround since truncation on Firefox only sort-of works).
I want a tool-tip to appear over text that is truncated. How do I detect if text is truncated so that I can display a tool-tip?
My extension works on an application, which requires user login. Once the user has logged in, I need to read the cookies and use them in my XMLHttpRequests.
So initially I need to check if the cookie is set, if not, I direct the user to the login page. Once logged in, I need to read the cookies and send it as part of my further requests.
How do I read cookies from a XMLHttpRequest or otherwise (if we don't even know the name of the cookie)
There is to function as getRequestHeader.. but what I need is something like that.
i am calling ajax every second in page..
Here the server page returns randomly generated number,using this number(converted into seconds) i am triggering another function in ajax success .it works
My problem
suppose random number = 5 means trigger() function called after 5 seconds using setTimeout,but rember ajax call is triggering every 1 second so trigger function also called many time.
i want to make ajax call wait untill trigger function execution.Which means i wanna pause that ajax call untill 5 seconds after that resume
How can i do this ?
My coding
//this ajax is called every minute
$.ajax({
type: "POST",
url: 'serverpage',
data: ({pid:1}),
success: function(msg) {
var array = msg.split('/');
if(array[0]==1){
setTimeout(function() { trigger(msg); },array[1]+'000');
}
}
});
//and my trigger function
function trigger(value)
{
alert("i am triggered !");
}
server response maybe
1/2 or 1/5 or 1/ 10 or 1/1
here 1/3(this is converted into seconds)
I have a custom jquery function that I need to bind to two iframe document objects.
Currently it will work with just one doing something like:
$(window.frames["iframeName"].document).bind('textselect', function(e) {
});
what I'm looking to do is something like:
$(window.frames["iframeName"].document,window.frames["iframeName2"].document).bind('textselect', function(e) {
});
This is my code:
/**********************************************************
* remove non-standard characters to give a valid html id *
**********************************************************/
function htmlid(s) {
return s.gsub(/[^A-Z^a-z^0-9^\-^_^:^\.]/, ".");
}
Why does jslint throw this error?
Lint at line 5 character 25: Unescaped '^'.
return s.gsub(/[^A-Z^a-z^0-9^\-^_^:^\.]/, ".");
I am using jQuery's scrollTo plugin to scroll up and down my page, using UP arrow and DOWN arrow.
i have a bunch of div with class "screen", as so: <div class="screen-wrapper">...</div>
What I am trying to do is, when i press UP or DOWN, the window scrolls to the next, or previous div with class of "screen".
I have the keypresses taken care of.
According to the plugin docs, to scroll a window, you use $.scrollTo(...);
Here's the code I have:
$(document).keypress(function(e){
switch (e.keyCode) {
case 40: // down
n = $('.screen-wrapper').next()
$.scrollTo( n, 800 );
break;
case 38: // up
break;
case 37: // left
break;
case 39: // right
break;
}
});
And if it helps, here's the HTML div. I have a few of these on the page, and essentially, am trying to scroll to next one by pressing down arrow:
<div class='screen-wrapper'>
<div class='screen'>
<div class="sections">
<ul>
<li><img src="images/portfolio/sushii-1.png " /></li>
<li><img src="images/portfolio/sushii-2.png" /></li>
<li><img src="images/portfolio/sushii-3.png" /></li>
</ul>
</div>
<div class="next"></div>
<div class="prev"></div>
</div>
And also if it needed, I can provide a link where this is being used if it'll help someone get a better idea.
edit
And, i forgot to mention what the real question here is.
The question/problem is that it won't scroll down past the first element, as seth mentioned.