How to include external CSS in moovweb project - moovweb

I want to include JQuery mobile CSS in moovweb project
[http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css.]
The project is not created using Jquery Mobile template.
I know to insert an external js file , say:
insert("script", type: "text/javascript", src: asset("javascript/mobile.js"));
Is it the same for an external CSS?
Thanks,
Ambika

Got it !!
insert_top("link", rel: "stylesheet", href:"http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css")

Related

How to export static HTML from Svelte without Surge or Vercel?

I want to publish my Svelte web app to GitHub pages and based my application on the template https://github.com/sveltejs/template. When I run npm run build, public/build/bundle.js is created but no index.html. All the tutorials I found talk about how to deploy Sapper projects, or to use external tools like Vercel and Surge, but is it possible to just build Svelte without any external tools? All I want is a static HTML page that I can copy to GitHub pages.
Edit: See the accepted answer for the general approach, however for non-root-directory-deployment, you still need to make the paths relative. I created a pull request at https://github.com/sveltejs/template/pull/239.
In svelte, index.html is a static file which will import your bundle.js and run it.
index.html is located at /public/index.html while your bundle.js is located at /public/build/bundle.js
in svelte template, index.html imports /build/bundle.js using a script tag to initialize the application.
while deploying, you just need to upload the whole /public folder and everything should be operational.

How to use the same path prefix for resources (css and images) for development and production environment?

I am linking to resources such as css or image files in the application made with UI5 but I am facing a problem.
Usually, the path are for example:
return "css/style1.css"; // for a stylesheet inside the folder css
return "img/image.jpg"; // for a image inside the folder img
And once the application deployed it works fine but when running with SAP Web IDE both are not found resulting in the 404-error.
So for running in SAP Web IDE, showing the style and image the path is:
return "../../../../../webapp/css/style1.css"; #for a stylesheet inside folder css
return "../../../../../webapp/img/image.jpg"; #for a image inside folder img
And that is working running with SAP Web IDE but it's not clean. And I'm not sure either if it can work once it's deployed.
Is it a possible configuration or trick to be able to use standard link and run the app with SAP Web IDE for seing the result before to deploy?
There is a solution to create a model for this:
In model.js:
createImageRoot: function() {
var oModel = new JSONModel({
path: sap.ui.require.toUrl("the.namespace") // available since 1.58. Otherwise, use jQuery.sap.getModulePath instead.
});
oModel.setDefaultBindingMode("OneWay");
return oModel;
},
In Component.js, add in the init method
this.setModel(models.createImageRoot(), "imageRoot");
And then for example :
return this.getView().getModel("imageRoot").getProperty("/path") + "img/image.jpg"

Tinymce external plugin in the project directory doesn't work

We have our own Tinymce external plugin to add 'accordion' control, which is placed in a directory in the project folder. We simply used,
external_plugins : {{'accordion':'/Modules/TinyMCEPlugins/accordion/editor_plugin_src.js'}},
toolbar1 : 'accordion',
But, this does not pick the plugin. Is it something wrong with defining the path to the external plugin?
The URL used for external_plugins needs to be a web URL that can be accessed at runtime by the browser.
Guessing that path is not the URL the browser can use. Are there errors in the browser’s console?
You have to host that js file server side. Convert it into a link, and GET the router.
Example:
external_plugins : {"accordian" : "http://example.com/public/TinyMCEPlugins/accordian/editor_plugin_src.js},

Cannot view scss files while working with Ionic on dev tools

I'm trying out some very basic Ionic tutorials from Ionic website (Ionic Tutorial), and i want to be able to view and modify scss from dev tools.
The app functions correctly, css classes i've added in scss files work correctly as well but i see a main.css file instead of the foo.css from which it was compiled. I can even view typescript files on dev tools and debug, which means source map for js->ts is working. It's the css-> scss that's not working.
I can see these files on www/build
main.js
main.map.js
main.css
main.map.css
Which means the source map is generated correctly.
I have also enabled css source maps in chrome from
- DevTools -> Settings ->Sources -> Enable CSS source maps
I would mark this as duplicate but it seems like i cannot. Answer can be found on this SO postenter link description here. Basically,
You'll need to extend your sass.config.js file, by default source mapping for sass is disabled.
config/sass.config.js:
module.exports = {
sourceMap: true,
}
package.json:
"config": {
"ionic_sass": "./config/sass.config.js",
}
I can verify that this works.

PhoneGap + WP7: how to use a plugin

How do I integrate a plugin with PhoneGap on Windows Phone 7?
I've found tutorials for iOS, Android and BlackBerry, but nothing about WP7.
I've put the .cs file in the Plugins folder, but I'm not sure it is enough.
To integrate a wp7 plugin with phonegap these are the general steps :
Include the plugin definition and js implementation javascrtip file in your html page head section
[script type="text/javascript" charset="utf-8" src="myPlugin.js"][/script]
in your code you need to call it like:
navigator.plugins.myPluginName.myPluginFunction(parameters);
you may need to make few additions in your html as per plugin required.
Also check for entry for myplugin in WMAppManifest.xml
I have used myPlugin as an reference so please replace the name with your actual plugin name.
Hope this help you
~K
The problem was in the .js file.
PhoneGap is now called Cordova, so the js files of old plugins have to be updated with the new class name.