How to disable Tern synchronization in Eclipse Luna? - javascript

I use Eclipse Luna SP2 for Java EE for some JavaScript development.
Every now and then (mostly on .js file open but also on some timer) I get the following popup error
An internal error occurred during: "Synchronizing script resources with Tern server...".
loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader)
previously initiated loading for a different type with name "org/apache/http/HttpEntity"
I don't need Tern functionality and I would like to disable it or at least get rid of the popup error
I googled about but could not find any relevant information.
For the moment I tried to disable all validators and to change the .js editor but no luck by now.
Any idea?

I think it's the same problem than issue 273 The 0.8.0 didn't set the version of packages of org.apache.http in the MANIFEST.MF.
Please install 0.10.0 version.

Go to Properties of the project > JavaScript > Include Path > Source and remove the whole project. Click on "Add Folder" and give the required path for your JS. Like projectname/src/pages.Ionic 2

Related

Visual composer doesn't load and gives TypeError: _.template(...).trim is not a function

My visual composer plugin doesn't work. It stuck on the loading page. And it gives an error "TypeError: .template(...).trim is not a function"
Error is on this line of code:
this.$controls = $(.template(template, data, vc.template_options).trim()).addClass('vc_controls');
Please help me to fix this out.
Here is the error which I get:
If you are unable to solve this error by upgrading or downgrading your theme or plugin, you could at least make the below changes.
1. Open the following two files:
wp-content\plugins\js_composer\assets\js\frontend_editor\frontend_editor.js
wp-content\plugins\js_composer\assets\js\frontend_editor\custom_views.js
2. Replace
this.$controls = $( _.template( template, data, vc.template_options ).trim() ).addClass( 'vc_controls' );
with
this.$controls = $( ( "vc.template_options" ).trim() ).addClass( 'vc_controls' );
This will surely work.
Solution Goto file /wp-content/plugins/js_composer_salient/assets/js/dist/backend.min.js around line 4045:
======> Replace the code
html2element: function(html) {
var $template, attributes = {},
template = html;
$template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
attributes[attr.name] = attr.value
}), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent()
},
Upgrade to Visual Composer version 4.11.2+
Note Wordpress 4.5 compatibility was fixed on 13th April:
https://wpbakery.atlassian.net/wiki/display/VC/Release+Notes
You should try to fix this by up/downgrading your theme/plugin. But if you, like me, can't solve it this way and just need to do a quick hack to get past this particular problem, the following worked for me.
Edit the following two files:
wp-content\plugins\js_composer\assets\js\frontend_editor\frontend_editor.js
wp-content\plugins\js_composer\assets\js\frontend_editor\custom_views.js
Change a single line in each of them, adding (). Change:
this.$controls = $( _.template( template, data, vc.template_options ).trim() ).addClass( 'vc_controls' );
to:
this.$controls = $( _.template( template, data, vc.template_options )().trim() ).addClass( 'vc_controls' );
As Shady sherif said at Maulik's suggestion, this is what I've changed in 2 places at frontend-editor.min.js and it worked!! Thanks to you both!
Change this:
this.$controls=$(_.template(template,data,_.extend({},vc.template_options,{ evaluate:/\{#([\s\S]+?)#}/g})).trim()).addClass("vc_controls");
With this:
this.$controls=$(("vc.template_options").trim()).addClass("vc_controls");
UPDATE:
in current updates none of this is needed just replace the plugin
I had problem with WPBakery Page Builder in version 6.0.2.
Wordpress: Version 5.2.1
ERROR: Uncaught TypeError: window.vc.frame_window.jQuery is not a function at window.vc.ShortcodesBuilder.buildFromContent (frontend-editor.min.js? Ver = 6.0.2: 10)
     at Object.vc.build (frontend-editor.min.js? ver = 6.0.2: 10)
     at frontend-editor.min.js? ver = 6.0.2: 10
I was reluctant to upgrade, as there might be a bug. (But it is a fact that an update is bug fix)
Since the update to version 6.0.3 was not successful.
Solution:
Mine was restoring the backup of the whole site.
Tip: Never forget Backup.
This article suggests rolling back your worpress version prior to 4.5. http://forums.artbees.net/t/urgent-wordpress-4-5-broken-vc-backend-editor-workaround-fix-in-comments/2734
This is where you can find older versions of wp to install https://wordpress.org/download/release-archive/30
I haven't tried this myself just a suggestion.
If this is still a problem for you I solved this same error I was getting by manually updating my theme through ftp. I downloaded the latest version of the theme because automatic updates were not working. I kept wordpress version 4.5. Here are the steps I took as follows.
I renamed the theme example x-updating once uploaded named the current theme x-previous then changed x-updating to x and deleted x-previous.
I updated js_composer the same way as step 1. Uploaded latest version of js_composer which was bundled with the theme. This is updated in plugins outside the theme. At this point you should be able to update visual composer from the wp dashboard if it hasn't already.
This got vc working again but left me with some weird errors happening in vc_templates vc_column.php file. I had to manually comment out the trouble code to get the errors to go away.
These 3 steps are a little nerve racking if you are not familiar with uploading files directly to your public_html root directory of your website. Some themes may offer support and do the ftp uploading for you if you provide them with ftp username password.
One more thing to do is clear your cache for your website. In chrome you can clear your cache by going to chrome://settings/cookies enter website.com in the search bar and click remove all clearing all locally stored data for your website. Manual updating themes and plugins is recommended only if auto updates aren't possible then you do the above. For my theme and this same exact error in question I followed these really well-done steps https://community.theme.co/kb/updating-your-theme-and-plugins/. However this will be different depending which theme you have. And if you would rather roll back your wp version you can follow my original suggestion. But for me I like to have everything new and up-to-date.
One more important note if you do have this theme then I had to delete x-shortcodes plugin from plugins direcotry of my website because my updated theme uses cornerstone instead of x-shortcodes to process important shortcodes to make vc work properly. Another thing to know is none of your data should be harmed while uploading plugins and themes all the data/content is stored safely in your data-base not in your theme.
I tried the following solutions:
maulik`s (but there was no such files on my plugin folder - frontend_editor.js and custom_views.js, just a "vendors" folder on "/wp-content/plugins/js_composer/assets/js/frontend_editor"),
Amritosh pandey`s solution (does not work even after cache & history cleaning),
Berein`s solution (does not work too).
I solved the problem by using a Amritoshpandey's solution:
https://gist.github.com/levantoan/519bb0d42c9f7bd6c4d78ef1686bb848
("The following code has completely corrected my problems, I can load the page, add, clone, remove, etc")
The Amritoshpandey's code should be pasted in /wp-content/plugins/js_composer/assets/js/dist/backend.min.js instead of:
render:function(){var $shortcode_template_el=$("#vc_shortcode-template-"+this.model.get("shortcode"));if($shortcode_template_el.is("script"))this.html2element(_.template($shortcode_template_el.html(),this.model.toJSON(),vc.templateOptions["default"]));else{var params=this.model.get("params");$.ajax({type:"POST",url:window.ajaxurl,data:{action:"wpb_get_element_backend_html",data_element:this.model.get("shortcode"),data_width:_.isUndefined(params.width)?"1/1":params.width,_vcnonce:window.vcAdminNonce},dataType:"html",context:this}).done(function(html){this.html2element(html)})}return this.model.view=this,this.$controls_buttons=this.$el.find(".vc_controls > :first"),this},
If you have Visual Composer 4.9, just replace these 2 files from archive
- frontend-editor.min.js
- backend.min.js
path: /wp-content/plugins/js_composer/assets/js/dist
Don't forget to make a backup of your files.
https://yadi.sk/d/JH4cbtnH3UoU3F
click "download add"
(tested with VC 4.9 & WP 4.9.5)
I used version 4.10 and upload the file assets/js/frontend-editor.min.js to the same file in 4.12 version.
Note: I keep my version and update only this file. I things this issues risen after update my php version, but i dont sure about that.
That`s work fine.
I get this file here: https://www.downloadfreethemes.io/visual-composer-v5-0-1-page-builder-for-wordpress/
I have theme license.
Replacing file
> wp-content\plugins\js_composer\assets\js\frontend_editor\frontend_editor.js
> wp-content\plugins\js_composer\assets\js\frontend_editor\custom_views.js
is not a solution, you can download cracked version and resolve it:
https://www86.zippyshare.com/v/fguQVId6/file.html
1.Please Deactivate the plugin
2.Delete all the files from plugin folder (js_composer folder)
3.Download the Latest Version of Visual Composer
4.Add new Plugin --> and select the downloaded plugin -->Upload --->Activate

"Open Declaration", etc., pops up "The resource is not on a include path of a javascript project" in a Nodeclipse MEAN project

In Nodeclipse, "Open Declaration" "Open Type Hierarchy" and "Open Call Hierarchy" all seem to always pop up a message saying "The resource is not on a include path of a javascript project". This issue was encountered with an existing MEAN stack project (available at pactvote.com) that I'm just getting started on. This is my first time working with MEAN and Nodeclipse. If you want to try and replicate this with the above-mentioned project, you may have to increase memory usage in eclipse.ini and implement the workaround described at https://github.com/Nodeclipse/nodeclipse-1/issues/159 . I downloaded Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64. The only plugin installed is MercurialEclipse 2.1. I thought of trying to fiddle with the build path, but when I right-clicked on the project and moused over Build Path it said "No actions available." I didn't see anything to change in the project properties either.
The project was created with WebStorm.
Why is this issue occurring and how do I fix it?

Simogeo FileManager View/Upload

I've tried to set up Simogeo's FileManager but I can only get half of it working.
My plan is to set it to a specific folder (../imgs/gallery) and allow the client to upload, download, rename, remove files - basically change the ones displayed on a specific page (../gallery.html).
Right now though, I can't get the FileManager to work properly. In it's absolutely simplest form (that is, uploading the extracted files to my /www/ root and duplicating filemanager.config.js.default to filemanager.config.js) it will allow me to create a folder and upload files but the second I do that, it'll just keep 'loading' something. Nothing shows, nothing is usable and a refresh will completely remove it from view.
The files are being created/uploaded in the ../userfiles/ folder which I can change in the future but it's just not working even in a pure setting.
(also, the instructions request changing a file ../connectors/php/filemanager.config.php, which for the life of me, I cannot find. ../connectors/php/default.config.php exists but doesn't follow the instructions very well if I was to substitute that.)
EDIT: I tried the 0.8 version, having no problems. It's a shame the up-to-date one doesn't work for me.
Are you sure permissions are set correctly on your folder ?
You could try :
chmod -R 0777 /path/to/filemanager/userfiles/
or (asserting you're running apache with www-data user :
chown -R www-data:www-data /path/to/filemanager/
You may also have a look to the configuration wiki page and sample page.
(also, the instructions request changing a file ../connectors/php/filemanager.config.php, which for the life of me, I cannot find. ../connectors/php/default.config.php exists but doesn't follow the instructions very well if I was to substitute that.)
Thanks for pointing this out. It is updated.
In my case the problem arose when migrating a site from dedicated hosting with PHP 5.3 to shared hosting with PHP 5.4, all of a sudden the file manager started behaving as described by the original poster. I updated to the latest FileManger version (2.0.0-dev) but still the same.
A look at the server error log showed a fatal error in connectors/php/filemanager.class.php on line #1312 where require_once('./inc/vendor/wideimage/lib/WideImage.php') failed to open the file. Checking the path there is no "vendor" directory so I removed that from the path and the server error went away. But still the same loading graphic.
I then considered that PHP 5.4.x wants to have the TimeZone set and depending on the server configuration may throw warnings or errors, even fatal ones in the background. So I added date_default_timezone_set ('America/Toronto'); at the top of the file connectors/php/filemanager.php and after that everything worked perfect. This may not be the optimal solution but it worked for me. If you try it of course change the TimeZone to your own.
This one had me pulling my hair out for a while, hope it helps someone.

Using AjaxMin without installing

I'm trying to use AjaxMin without installing it. From this link ( http://ajaxmin.codeplex.com/wikipage?title=AjaxMinTask ) I thought the UsingTask tag would let me do it, but I keep getting this error:
E:......csproj (487): The "AjaxMin" task could not be instantiated from "E:...\libraries\AjaxMinTask.dll". System.IO.FileNotFoundException: Could not load file or assembly 'AjaxMin, Version=4.79.4762.18504, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' or one of its dependencies. The system cannot find the file specified. File name: 'AjaxMin, Version=4.79.4762.18504, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' at Microsoft.Ajax.Minifier.Tasks.AjaxMin..ctor() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
E:......Web.csproj (487): The "AjaxMin" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
I also tried this ( Could not load file or assembly App_Licenses ), but it still doesn't work. Any ideas?
fyi - adding the dll as a reference did not work. we ended up adding the AjaxMin dll and exes to the repository, creating a manifest.xml, then adding the following as a pre-build step:
"$(SolutionDir)\libraries\AjaxMin" -clobber -xml "$(ProjectDir)\AjaxMin\manifest.xml"
we also added the minified files to the repository so they are copied to the publish area. not the most elegant solution, but it works for our situation.

Visual Studio 2008 jQuery IntelliSense sporadically fails, restarting VS fixes

Right off the bat, this is not your standard "I can't get javascript IntelliSense to work in Visual Studio." For the record:
I'm using Visual Studio 2008
I have installed SP 1
I have installed the hotfix for -vsdoc.js documentation files KB958502
I am developing a suite of interrelated jQuery plugins to be packaged as resources in a class library. So within a directory, I have (as an example):
jquery-vsdoc.js
core.js
plug1.js
plug2.js
In core.js, I have the following at the top of the file:
/// <reference path="jquery-vsdoc.js" />
Then in each of the plug#.js, I have:
/// <reference path="jquery-vsdoc.js" />
/// <reference path="core.js" />
The IntelliSense works initially, even including the additions from core.js when working in the plugins. However, sometimes the slightest change, even adding and removing a space from the reference XML tags, or pressing Ctrl-Shift-J, results in the dreaded "Error updating JScript IntelliSense: Client-side script IntelliSense information was not generated due to an error in an external script reference." Except it was working with that external script reference just a second ago!
For the jquery-vsdoc.js, I am using Comment Version 1.3.2b (that's what it says in the file) from http://jqueryjs.googlecode.com/files/jquery-1.3.2-vsdoc2.js. I am omitting the version number from the file so that I don't have to change a bunch of references when it's inevitably updated.
So what could be the problem? Restarting Visual Studio is proving to be a horribly inelegant (and time-consuming) workaround.
Have you tried increasing the IntelliSense timeout?
By default, every IntelliSense request
is only allowed 15s to execute. This
is to prevent IntelliSense from
scripts with infinite loops. If you
have a large script or slower machine,
it may make sense to increase the
timeout limit. The timeout value
store within following registry keys
(depending on if your are using
Express or the full product). The
value is in milliseconds so choose
something greater than 15000.
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\HTML
Editor\JsFailsafeTimeout
HKEY_CURRENT_USER\Software\Microsoft\VWDExpress\9.0\HTML
Editor\JsFailsafeTimeout
Does closing and opening the file reset the state?
Open the task manager and watch the processes. Do you see a process called "typelibbuilder.exe" get started when you press Ctrl-Shift-J?
I'm trying to image what sort of problems might require a restart of VS. The processing of references (to which that message pertains) is done in a new and separate process every time you press Ctrl-Shift-J (unless processing has been disabled in which case you would see a different message). It almost sounds like the communication between VS and typelibbuilder or some other necessary component is failing.
In SP1, you shouldn't need to reference the "-vsdoc" files directly. If you reference "foo.js" and there is a "foo-vsdoc.js" file next to it, then VS will use the vsdoc version to generate intellisense. I doubt that is related to your problem though.
I know this isn't much consolation, but we've drastically improved performance and reliability of Javascript Intellisense in Visual Studio 2010. Beta1 is currently available to MSDN subscribers (although it is beta and there are still some bugs in it).
If you can get reliable repro steps, you could also file a bug report at http://connect.microsoft.com/.
I dont know if this will help you, but I've encountered the following bug in VS 2008 JS intellisense:
When adding jQuery as a reference in an external file, and then I update JS I get:
'XmlHttpRequest is undefined' on the line:
return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
It seems like the JS intellisense engine is actually executing some of the jQuery code (more than likely to inspect it so it can provide some more information about it). However it looks like window.ActiveXObject is null to the engine, and so it falls into the 'new XMLHttpRequest()' block - which also fails.
I hacked a workaround that breaks all browsers except IE - so not a good solution. My fix changes the following:
xhr: function()
{
// hack to fix VS 2008 intellisense... note this breaks any browser
// except IE
var objXhr = { open: function() { },
setRequestHeader: function() { }
};
return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : objXhr;
},
Now my intellisense works.
You may want to disable JavaScript intellisense in Visual Studio.
When SP1 is installed you can disable JavaScript intellisense.
Go to Tools, Options...
The Options dialog will show up.
Navigate to the following node in the left hand sided panel:
Text Editor :: JScript :: General
Disable the following options (in the group Statement Completion):
* Auto list members
* Parameter information

Categories