Uploadify in Zend Framework - zend-framework

I use uplodify to upload files in zend.
<link href="/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/uploadify/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/uploadify/swfobject.js"></script>
<script type="text/javascript" src="/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#file_upload').uploadify({
'uploader': '/uploadify/uploadify.swf',
'script': '/upload/upload',
'cancelImg': '/uploadify/cancel.png',
'folder': '/uploadify/uploads',
'auto': true
});
});
</script>
<input id="file_upload" name="file_upload" type="file" />
This code is in view part index.phtml.
But when i run my web application i see in my web devloper tool it shows in console
NetworkError: 404 Not Found - http://localhost/upload/uploadify.swf?preventswfcaching=1317192234400
Help me to solv this problem....

"Some of the option names have changed in v3 to be more intuitive. The 'uploader' option should now point to the php script. The 'swf' option will point to the flash file. "
http://www.uploadify.com/forums/discussion/7296/uploader-being-rewritten-in-v3.0.0/p1
part of code:
$("#gallery").uploadify({
id : jQuery(this).attr('id'),
langFile : 'http://www.static-xxx.nu/uploader/uploadifyLang_en.js',
swf : 'http://www.static-xxx.nu/uploader/uploadify.swf',
uploader : '/uploadify/galleri.php',

The path specified is wrong somewhere.
In jquery function, it is given as;
'uploader': '/uploadify/uploadify.swf',
Check from where request is going for "upload/uploadify.swf" to get a 404 error.
also, if you are using a .htaccess file, make sure the request for these files are not denied.

Related

CoffeeScript from CDN above 1.4.0 cannot call JavaScript function

CoffeeScript code is not working when the 1.10.0 version coffee-script.min.js is linked.
<!DOCTYPE html>
<html lang="en">
<head> <meta charset='utf-8'> </head>
<body>
<div id="myDiv">Content</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js" > </script>
<!--
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.4.0/coffee-script.min.js" > </script>
-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.10.0/coffee-script.min.js" > </script>
<script type="text/coffeescript" >
$("#myDiv").text "New Content"
alert "Hello world"
</script>
</html>
The latest working CDN coffee-script.min.js is 1.4.0. What is the problem?
Those script hosted in CDN are not for browser, I think.
I tried your code, and as you say it did not work and there was the following console log.
Uncaught ReferenceError: require is not defined
require is a specification of commonJS and it is not implemented in browser default.
If you would not like to compile and make it work easily, the code below is available.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
</head>
<body>
<div id="myDiv">Content</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script type="text/javascript" src="http://coffeescript.org/extras/coffee-script.js"></script>
<script type="text/coffeescript">
$("#myDiv").text "New Content"
alert "Hello world"
</script>
</html>
This way is introduced at the official site.
http://coffeescript.org/
While it's not recommended for serious use, CoffeeScripts may be included directly within the browser using tags. The source includes a compressed and minified version of the compiler (Download current version here, 39k when gzipped) as extras/coffee-script.js. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.
Error in packaging on the part of the CDN provider, see here:
https://github.com/jashkenas/coffeescript/issues/3811
https://github.com/cdnjs/cdnjs/issues/4869

Getting a 404 when trying to run a qunit test

I'm using the trial webide and trying to run myqunittest.qunit.html from the /test-resources folder. by using the url /test-resources/myqunittest.qunit.html. However it simply returns a 404 error whenever I attempt to run it.
Is this a problem with defining the resources? I don't understand how, for example, view/Main.view.xml can be found but not anything in the test-resources folder (I've tried just creating a simple js or html file containing a single line and it still 404'd).
I've copied the page directly from the qunit help page, QUnit Testing Fundamentals, this code seems to imply it should just work without any reference to the rest of the app.
I've tried various combinations of sap.ui.localResources and data-sap-ui-resourceroots in both html files to no avail.
My folder structure is as follows:
myapp
test-resources
myqunittest.qunit.html
view
Main.controller.js
Main.view.xml
index.html
myqunittest.qunit.html
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script id="sap-ui-bootstrap"
type="text/javascript"
src="resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-noConflict="true">
</script>
<link rel="stylesheet" href="resources/sap/ui/thirdparty/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="resources/sap/ui/thirdparty/qunit.js"></script>
<script type="text/javascript" src="resources/sap/ui/qunit/qunit-junit.js"></script>
<script type="text/javascript" src="resources/sap/ui/qunit/QUnitUtils.js"></script>
</head>
<body>
<div id="qunit"></div>
</body>
</html>
index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
data-sap-ui-resourceroots='{"myapp": "./"}'
data-sap-ui-theme="sap_bluecrystal">
</script>
<script>
sap.ui.localResources("view");
var app = new sap.m.App({initialPage:"idMain"});
var page = sap.ui.view({id:"idMain", viewName:"myapp.view.Main", type:sap.ui.core.mvc.ViewType.XML});
app.addPage(page);
app.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
In your index.html you are loading ui5 relatively to the index.html in a resources folder
so on your server there is another folder
myapp
resources
sap-ui-core.js
test-resources
myqunittest.qunit.html
view
Main.controller.js
Main.view.xml
index.html
The problem is, that you are loading the core also relatively to your test-resources. You probably need to go 1 directory up.
so in myqunittest.qunit.html
change the bootstrap to
<script src="../resources/sap-ui-core.js"
Best regards,
Tobias
The SAP WebIDE adds neo-app.json to a project you create. It contains this entry:
{
"path": "/test-resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/test-resources"
},
"description": "SAPUI5 Test Resources"
}
This is interfering with creating my own test-resources folder (one doesn't already exist in the project), and was causing the 404 error. Removing this entry has fixed my problem.

Tinymce is not Displaying at at all

Hy There...!
I have some problems when its come to Jquery ..............
Here i am trying to use TinyMCE Text Editor... I had download its Js File and some code with it mention it in there site...
But When i see my index.HTML it is all Blank.....
Which i don't understand Please Any Help or hint will be appreciated........
Thanks in Advance ... Here Is The Code
<html>
<head>
<script type="text/javascript" src="tinymce.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea"
});
</script>
</head>
<body>
<form method="post" action="index.html">
<textarea name="content" style="width:100%" class="mceEditor"></textarea>
</form>
</body>
</html>
I believe you are not linking the tinymce.js file correctly. Make sure it's linked correctly relative to the directory of index.html file.
I used the same markup you provided and made it work in jsFiddle using the script from TinyMCE CDN.
http://jsfiddle.net/AHXXT/

soundmanager2 not streaming audio inline in Firefox 9

This is so bizarre. I basically copied the source from this demo.
But for some reason, the audio is not playing inline, and is just getting loaded in the browser (Firefox 9). I really don't get why the demo works, but my code doesn't :(
This is what's in my <head>
<script type="text/javascript" src="static/javascript/soundmanager2.js"></script>
<script type="text/javascript" src="static/javascript/mp3-player-button.js"></script>
<script>
soundManager.url = 'static/swf/'; // required: path to directory containing SM2 SWF
files
</script>
and heres how i'm calling it-
<a href="media/English_Commercial Demo.mp3" title="Play" class="sm2_button">English
Commercial Demo</a>

jqGrid table off of DOM

I am trying to get jqGrid to work off a DOM table that already exists. I am a little confused with some of the instructions to do this however... For instance, I read this on one particular help site...
http://www.secondpersonplural.ca/jqgriddocs/_2h30t8wte.htm
When he says this:
"the new release of jquery.jqGrid.js defaults to this module being enabled, so ensure that grid.tbltogrid.js and grid.tbltogrid-min.js are copied to the appropriate folder. If you do not wish to include this function, make the appropriate change to jquery.jqGrid.js."
What is he talking about?
Also, the Jquery grid download site gave me this set of instructions:
"In order to use this module you should mark the Table to Grid (in Other modules) when you download the grid. For more information refer to Download.
For Developers - this is the grid.tbltogrid.js in the src directory."
Now I had the Table to Grid module marked when I downloaded.
What would I should be doing to get this done?
What function should I be calling, currently I am calling...
(function () {
tableToGrid(".table1", {});
});
That seems a little bit wrong.
UPDATE: Added what I reference
Here are the scripts that I reference... Ignore the DataTable scripts... I will soon be removing them once I can confirm that this works.
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="~/Content/jqUIcss/jquery-ui-1.8.14.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="~/Content/jqGrid/ui.jqgrid.css" />
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jquery-1.5.1.min.js")%>"></script>
<link href="../../Content/dataTable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=ResolveClientUrl("~/Scripts/jqUI/jquery-ui-1.8.14.custom.min.js")%>"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script>
Assuming you did download the components correctly and included them in your application through <script> tags, all you seem to have to do is:
tableToGrid('#table_name')
where the table name is the id of the table you're trying to convert.
Edit: Note the #, whereas you used . and what seems to be a table ID. . signifies a class name.
<script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript"> </script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"></script>
Added these scripts and things seem to be fine.