Dojo build ends up with warnings, but why? - javascript

I am new to dojo and I am trying to learn how to build an application with the utilities giving in dojo version 1.11.2. I raed this tutorial Creating builds - Dojo Toolkit Tutorial and try it by myself.
I have this structure:
My app.profile.js looks like this:
var profile = (function(){
return {
basePath: "./src",
releaseDir: "../../app",
releaseName: "dev",
action: "release",
layerOptimize: "closure",
optimize: "closure",
cssOptimize: "comments",
mini: true,
stripConsole: "warn",
selectorEngine: "lite",
defaultConfig: {
hasCache:{
"dojo-built": 1,
"dojo-loader": 1,
"dom": 1,
"host-browser": 1,
"config-selectorEngine": "lite"
},
async: 1
},
staticHasFeatures: {
"config-deferredInstrumentation": 0,
"config-dojo-loader-catches": 0,
"config-tlmSiblingOfDojo": 0,
"dojo-amd-factory-scan": 0,
"dojo-combo-api": 0,
"dojo-config-api": 1,
"dojo-config-require": 0,
"dojo-debug-messages": 0,
"dojo-dom-ready-api": 1,
"dojo-firebug": 0,
"dojo-guarantee-console": 1,
"dojo-has-api": 1,
"dojo-inject-api": 1,
"dojo-loader": 1,
"dojo-log-api": 0,
"dojo-modulePaths": 0,
"dojo-moduleUrl": 0,
"dojo-publish-privates": 0,
"dojo-requirejs-api": 0,
"dojo-sniff": 1,
"dojo-sync-loader": 0,
"dojo-test-sniff": 0,
"dojo-timeout-api": 0,
"dojo-trace-api": 0,
"dojo-undef-api": 0,
"dojo-v1x-i18n-Api": 1,
"dom": 1,
"host-browser": 1,
"extend-dojo": 1
},
packages:[{
name: "dojo",
location: "dojo"
},{
name: "dijit",
location: "dijit"
},{
name: "dojox",
location: "dojox"
},{
name: "app",
location: "app"
}],
layers: {
"dojo/dojo": {
include: [ "dojo/dojo", "dojo/i18n", "dojo/domReady",
"app/main", "app/run" ],
customBase: true,
boot: true
},
"app/Dialog": {
include: [ "app/Dialog" ]
}
}
};
})();
My package.json has this content:
{
"name": "app",
"description": "carDealer",
"version": "1.0",
"keywords": ["JavaScript", "Dojo", "Toolkit", "DojoX"],
"maintainers": [{
"name": "XY"
}],
"contributors": [{
"name": "XY"
}],
"licenses": [{
"type": "AFLv2.1",
"url": "http://bugs.dojotoolkit.org/browser/dojox/trunk/LICENSE#L43"
},{
"type": "BSD",
"url": "http://bugs.dojotoolkit.org/browser/dojox/trunk/LICENSE#L13"
}],
"bugs": "https://github.com/example/issues",
"repositories": [{
"type": "git",
"url": "http://github.com/example.git",
"path": "packages/app"
}],
"dependencies": {
"dojo": "~1.10.4",
"dijit": "~1.10.4",
"dojox": "~1.10.4"
},
"main": "src",
"homepage": "http://not-set-yet.com/",
"dojoBuild": "app.profile.js"
}
Always I am trying to make a test build with the given build.bat in the Powershell of the windows OS, I get this failure messages and warnings:
Please if you have any advice, let me know. I hate this configuration things. Want to get started with hacking. Many thx in advance.
Best regards.

Your app.profile.js is located in carDealerBackend/src.
In the profile you define basePath: "./src".
So it searches in carDealerBackend/src/src.
Try to change basePath to ".".

Related

can't load jQuery [duplicate]

$("#ID").hide();
i add ESLint to my project .
everything is fine, except symbol $.
i get error: [eslint] '$' is not defined. (no-undef)
my .eslintrc.json (note: it has additional rules set to disallow jquery functions when there's an equivalent javascript one):
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"dollar-sign",
"jquery"
],
"rules": {
"indent": [
"error" ,
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"jquery/no-ajax": 2,
"jquery/no-animate": 2,
"jquery/no-attr": 2,
"jquery/no-bind": 2,
"jquery/no-class": 2,
"jquery/no-clone": 2,
"jquery/no-closest": 2,
"jquery/no-css": 2,
"jquery/no-data": 2,
"jquery/no-deferred": 2,
"jquery/no-delegate": 2,
"jquery/no-each": 2,
"jquery/no-fade": 2,
"jquery/no-filter": 2,
"jquery/no-find": 2,
"jquery/no-global-eval": 2,
"jquery/no-has": 2,
"jquery/no-hide": 2,
"jquery/no-html": 2,
"jquery/no-in-array": 2,
"jquery/no-is": 2,
"jquery/no-map": 2,
"jquery/no-merge": 2,
"jquery/no-param": 2,
"jquery/no-parent": 2,
"jquery/no-parents": 2,
"jquery/no-parse-html": 2,
"jquery/no-prop": 2,
"jquery/no-proxy": 2,
"jquery/no-serialize": 2,
"jquery/no-show": 2,
"jquery/no-sizzle": 2,
"jquery/no-slide": 2,
"jquery/no-text": 2,
"jquery/no-toggle": 2,
"jquery/no-trigger": 2,
"jquery/no-trim": 2,
"jquery/no-val": 2,
"jquery/no-wrap": 2,
"dollar-sign/dollar-sign": [
2,
"ignoreProperties"
]
}
you can see that I have added two plugins: eslint-plugin-dollar-sign and eslint-plugin-jquery.
why does not work this rule ?
"dollar-sign/dollar-sign": [
2,
"ignoreProperties"
]
You are missing
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
$ is not declared as a global without jquery environment enabled. Because of that, you are getting a no-undef error, saying that you are using variable that haven't been declared.
https://eslint.org/docs/user-guide/configuring#specifying-environments
You can specify environments using a comment inside of your JavaScript file, use the following format:
Add the line below as a comment at the beginning of your JavaScript file.
/* eslint-env jquery */
The eslinter will stop throwing undefined on '$' because it will know you are working with jQuery.
You can also add this line to the top of your js file:
/* global $ */
To prevent warning over "$", or for any other global like "varName":
/* global varName */
In .eslintrc.js
Add
{
"globals": {
"$": true
}
}
See https://eslint.org/docs/user-guide/configuring#specifying-globals
"env": {
....
"jquery": true
},
is really help.

Nightwatch : An occurred error while retrieving a new session

In my react project, I would like to use nightwatch as testing tool. I'm actually using Nightwatch v1.0.4 and selenium-server-standalone-3.9.1.jar on windows.
And this is my config (nightwatch.json) :
{
"src_folders": [
"tests"
],
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"disable_colors": false,
"test_workers": false,
"selenium": {
"start_process": true,
"host": "localhost",
"port": 4444,
"server_path": "./bin/selenium-server-standalone-3.9.1.jar",
"log_path": "./logs",
"cli_args": {
"webdriver.chrome.driver": "./bin/chromedriver"
}
},
"desiredCapabilities": {
"browserName": "chrome",
"acceptSslCerts": true
},
"test_settings": {
"default": {
"webdriver": {
"server_path": "./bin/chromedriver",
"cli_args": [
"--log",
"debug"
]
},
"disable_colors": false,
"screenshots": {
"enabled": false,
"path": ""
},
"request_timeout_options": {
"timeout": 60000,
"retry_attempts": 5
},
"default_path_prefix" : "",
"desiredCapabilities": {
"browserName": "chrome",
"acceptInsecureCerts": true
}
},
"chrome": {
"webdriver": {
"port": 9515,
"default_path_prefix": "",
"server_path": "./bin/chromedriver",
"cli_args": [
"--verbose"
]
},
"desiredCapabilities": {
"browserName": "chrome",
"loggingPrefs": {
"driver": "INFO",
"server": "OFF",
"browser": "INFO"
}
}
}
}
}
And my test file (tests/index.js):
const host = 'http://localhost:3000'
module.exports = {
'Demo test' : function (browser) {
browser
.url('http://google.com')
.waitForElementVisible('body', 1000)
.pause(5000)
.end();
}
}
When I run nightwatch, it gives me the following error:
Can anyone tell me what I'm doing wrong please ?
Your ChromeDriver version -which you've mentioned as v2.9 is pretty old.
As of the ChromeDriver download page, as per your Chrome version, you should use ChromeDriver version above 2.36 - I would recommend the latest 2.38

Why Rich file manager insert filemanager.config.json instead of insert image to text field

I've used Rich file manager with Laravel5.3.20 as the default configuration as below
Javascript
<script>
CKEDITOR.replace( 'textarea', {
filebrowserBrowseUrl: '{!! url('gallery/index.html') !!}',
///ImageBrowser : true,
autoUpdateElement:true,
language:'en'
});
</script>
Images in textarea url is wrong.
<p><img alt="" src="http://website.dev/gallery/connectors/php/filemanager.php?mode=readfile&path=%2Fae.jpg&config=filemanager.config.json&time=1477642950519" style="height:960px; width:720px" /></p>
All files, folder and sub folder have already update to userfiles
But it image url which i have to insert into Database with textarea go wrong as above url.
FileManager.configure.json
{
"_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file",
"options": {
"culture": "en",
"lang": "php",
"theme": "flat-dark",
"defaultViewMode": "grid",
"localizeGUI": true,
"showFullPath": false,
"showTitleAttr": false,
"browseOnly": false,
"showConfirmation": true,
"showThumbs": true,
"searchBox": true,
"listFiles": true,
"fileSorting": "NAME_ASC",
"folderPosition": "bottom",
"quickSelect": false,
"charsLatinOnly": false,
"splitterWidth": 200,
"splitterMinWidth": 200,
"dateFormat": "d M Y H:i",
"serverRoot": true,
"fileRoot": false,
"fileConnector": false,
"fileRootSizeLimit": false,
"baseUrl": false,
"capabilities": ["select", "upload", "download", "rename", "move", "replace", "delete"],
"logger": false,
"plugins": []
},
"security": {
"allowFolderDownload": false,
"allowChangeExtensions": false,
"allowNoExtension": false,
"normalizeFilename": true,
"uploadPolicy": "DISALLOW_ALL",
"uploadRestrictions": [
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg",
"txt",
"pdf",
"odp",
"ods",
"odt",
"rtf",
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx",
"csv",
"ogv",
"avi",
"mkv",
"mp4",
"webm",
"m4v",
"ogg",
"mp3",
"wav",
"zip",
"rar"
]
},
"exclude": {
"unallowed_files": [
".htaccess",
"web.config"
],
"unallowed_dirs": [
"_thumbs",
".CDN_ACCESS_LOGS",
"cloudservers"
],
"unallowed_files_REGEXP": "/^\\./",
"unallowed_dirs_REGEXP": "/^\\./"
},
"upload": {
"multiple": true,
"paramName": "files",
"chunkSize": false,
"numberOfFiles": 5,
"fileSizeLimit": 16000000,
"overwrite": false,
"imagesOnly": false
},
"images": {
"imagesExt": [
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg"
],
"main": {
"autoOrient": true,
"maxWidth": 1280,
"maxHeight": 1024
},
"thumbnail": {
"enabled": true,
"cache": true,
"dir": "_thumbs/",
"crop": true,
"maxWidth": 64,
"maxHeight": 64
}
},
"videos": {
"showVideoPlayer": true,
"videosExt": [
"ogv",
"mp4",
"webm",
"m4v"
],
"videosPlayerWidth": 400,
"videosPlayerHeight": 222
},
"audios": {
"showAudioPlayer": true,
"audiosExt": [
"ogg",
"mp3",
"wav"
]
},
"pdfs": {
"showPdfReader": true,
"pdfsExt": [
"pdf",
"odt",
"odp",
"ods"
],
"pdfsReaderWidth": "640",
"pdfsReaderHeight": "480"
},
"docs": {
"showGoogleViewer": true,
"docsExt": [
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx"
],
"docsReaderWidth": "640",
"docsReaderHeight": "480"
},
"edit": {
"enabled": true,
"lineNumbers": true,
"lineWrapping": true,
"codeHighlight": false,
"theme": "elegant",
"editExt": [
"txt",
"csv"
]
},
"customScrollbar": {
"enabled": true,
"theme": "inset-2-dark",
"button": true
},
"extras": {
"extra_js": [],
"extra_js_async": true
},
"icons": {
"path": "images/fileicons/",
"folder": "_Open.png",
"parent": "_Parent.png",
"default": "default.png"
},
"url": "https://github.com/servocoder/RichFilemanager",
"version": "1.0.6"
}
The version that you use doesn't support absolute paths in preview links, it builds preview urls via connector request path only.It was done because some users keep connector file separate from the client-side scripts (different servers and so on). After some discussions it was decided to support both options: absolute path (by default) and connector path (configurable). The feature that you need will be included in the next major release 2.0. Some discussion on your problem is here.

Simogeo FileManager does not show the images

I have Simogeo FileManager version 2.0.0.
I extracted it in root/tools, changed the config file, set up the permissions, hooked it to tinymce and everything seemed to work. The tinymce opens the popup window with FileManager. I can create a folder, change folder and upload files.
Problem is when I upload file(s) I cannot see them in the FileManager but they are uploaded in the directories I created. The only thing I can see are directories.
I am testing it on Windows 8.1 with uwAmp, PHP 5.3.24 or PHP 5.4.31.
Config file:
{
"_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file",
"options": {
"culture": "en",
"lang": "php",
"theme": "flat-dark",
"defaultViewMode": "grid",
"autoload": true,
"showFullPath": false,
"showTitleAttr": false,
"browseOnly": false,
"showConfirmation": true,
"showThumbs": true,
"generateThumbnails": true,
"searchBox": true,
"listFiles": true,
"fileSorting": "default",
"chars_only_latin": true,
"dateFormat": "d M Y H:i",
"serverRoot": true,
"fileRoot": false,
"relPath": false,
"logger": false,
"capabilities": ["select", "download", "rename", "delete", "replace"],
"plugins": []
},
"security": {
"allowFolderDownload": false,
"allowChangeExtensions": false,
"allowNoExtension": false,
"uploadPolicy": "DISALLOW_ALL",
"uploadRestrictions": [
"jpg",
"jpeg",
"gif",
"png",
"svg",
"txt",
"pdf",
"odp",
"ods",
"odt",
"rtf",
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx",
"csv",
"ogv",
"mp4",
"webm",
"m4v",
"ogg",
"mp3",
"wav",
"zip",
"rar"
]
},
"upload": {
"multiple": true,
"number": 5,
"overwrite": false,
"imagesOnly": false,
"fileSizeLimit": 16
},
"exclude": {
"unallowed_files": [
".htaccess",
"web.config"
],
"unallowed_dirs": [
"_thumbs",
".CDN_ACCESS_LOGS",
"cloudservers"
],
"unallowed_files_REGEXP": "/^\\./",
"unallowed_dirs_REGEXP": "/^\\./"
},
"images": {
"imagesExt": [
"jpg",
"jpeg",
"gif",
"png",
"svg"
],
"resize": {
"enabled":true,
"maxWidth": 1280,
"maxHeight": 1024
}
},
"videos": {
"showVideoPlayer": true,
"videosExt": [
"ogv",
"mp4",
"webm",
"m4v"
],
"videosPlayerWidth": 400,
"videosPlayerHeight": 222
},
"audios": {
"showAudioPlayer": true,
"audiosExt": [
"ogg",
"mp3",
"wav"
]
},
"edit": {
"enabled": true,
"lineNumbers": true,
"lineWrapping": true,
"codeHighlight": false,
"theme": "elegant",
"editExt": [
"txt",
"csv"
]
},
"customScrollbar": {
"enabled": true,
"theme": "inset-2-dark",
"button": true
},
"extras": {
"extra_js": [],
"extra_js_async": true
},
"icons": {
"path": "images/fileicons/",
"directory": "_Open.png",
"default": "default.png"
},
"url": "https://github.com/simogeo/Filemanager",
"version": "2.0.0-dev"
}
The problem was with the type in referer.
tinymce was passing ?type=image and filemanager expected ?type=images
Are you sure listFiles option is set to true inc config file ?
See the related doc : https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file
listFiles Default value true. Display files in right column (filetree). If set to false, will display only folders. Can take value true or false.
For further help, could you copy-paste an URL or at least your config file!?

DOJO custom build for DOJOX Gantt Chart

I tried to create a dojo custom build for DOJO (version 1.9.3) with the following profile.
var profile = (function() {
return {
releaseDir: "../release",
basePath: "../../",
action: "release",
mini: true,
selectorEngine: "lite",
layerOptimize: "closure",
cssOptimize: "comments",
packages:[{
name: "dojo",
location: "dojo"
},{
name: "dijit",
location: "dijit"
},{
name: "dojox",
location: "dojox"
}],
layers: {
"dojo/dojo": {
includeLocales: ["en-gb","en-us"],
include: [
"dojox/gantt/GanttTaskControl",
"dojox/gantt/GanttChart",
"dojox/gantt/GanttProjectItem",
"dojox/gantt/GanttResourceItem",
"dojox/gantt/GanttProjectControl",
"dojox/gantt/TabMenu"
],
boot: true
}
},
defaultConfig: {
hasCache:{
"dojo-built": 1,
"dojo-loader": 1,
"dom": 1,
"host-browser": 1,
"host-node": 0,
"config-selectorEngine": "lite"
},
async: 1
},
staticHasFeatures: {
"config-dojo-loader-catches": 0,
"config-tlmSiblingOfDojo": 0,
"dojo-log-api": 0,
"dojo-sync-loader": 0,
"dojo-timeout-api": 0,
"dojo-sniff": 0,
"dojo-cdn": 0,
"config-strip-strict": 0,
"dojo-loader-eval-hint-url": 1,
"dojo-firebug": 0,
"dojo-debug-messages": 0
}
};
})();
It is created the dojo.js file successfully in the release folder, but when I try to create an instance for GanttChart it is failing with the following error message.
Cannot read property 'GanttChart' of undefined.
While debugging I found, dojox does not have any properties or methods init.
Can someone help me to fix this?
Thanks a lot.

Categories

Resources