frontend

How to develop rails app for shopify with ScriptTags

只愿长相守 提交于 2019-12-06 13:42:35
I have a shopify app deployed in Heroku, developed in Rails. I need call a javascript function from any shopify store's frontend. I've read this article ( http://www.shopify.com/technology/3033852-shopify-api-update-scripttags-javascript-insertion ), but I don't understand it... Where do I have to put this code: HTTP POST http://their-shop.myshopify.com/admin/scripttags <?xml version="1.0" encoding="UTF-8"?> <script-tag> <src>http://example.com/your-awesome-script.js</src> <event>onload</event> </script-tag> What should be the src tag (for my deployed rails app), and where should I put the

What's the most efficient and reliable method to test CSS design in multiple legacy browsers?

青春壹個敷衍的年華 提交于 2019-12-06 12:49:31
问题 I'd be very interested to hear what professional developers think about this, particularly frontend developers. How do you go about testing your designs in multiple browsers? Do you use virtual machines, each with a different version of Internet Explorer installed? What is your setup/workflow? So, what's the most efficient and reliable way to test a design in several legacy web browsers? Thank you. 回答1: I mostly use Spoon virtualization. They removed IE from the service aftyer Microsoft told

User Authentication for API from React App

三世轮回 提交于 2019-12-06 11:10:41
问题 I have a simple API built in Nodal which allows a user to create a new job (essentially a work order for a service business). The API is using OAuth, so in order to create a new job, the user has to first obtain a token by authenticating via username and password. The frontend is going to be built in React. In order to access the site, the user will have to log in with their username and password, at which point they'll be given a token to make API calls. Two questions: 1) How do I securely

how to change the pagination bullet in a swiper to text?

左心房为你撑大大i 提交于 2019-12-06 11:03:29
问题 In my project : http://moransh4.github.io/Luca/ I need to change the swiper-pagination-bullet at the last section to this: The "active" change to green. I read ( from : http://idangero.us/swiper/api/) that i can customize with this : paginationBulletRender: function (index, className) { return '<span class="' + className + '">' + (index + 1) + '</span>'; } Sorry i go lost with it, How to do it? 回答1: You should instead use paginationCustomRender to create custom design.Define your names in

use velocity template engine in js page

流过昼夜 提交于 2019-12-06 09:41:48
i know there's some nodejs modules to use apache velocity in node like those addresses in that question's response. could be done to use it as a, says, mustache replacement via, maybe, browserify.js? how would you do that as a workflow? I suspect it would be a better implementation on Liferay's frontend template development, so the frontender can serve to the java team html already velocity templating aware. Thanks a lot. You can directly use velocityjs on browser after using browserify on it. Installation First install velocityjs in your node_modules $> npm install velocityjs Now from your

How to pass Express response object to frontend JS object

你。 提交于 2019-12-06 09:32:13
问题 My controller is sending lat/lng data to my Handlebars view via res.render. res.render('coords', viewModel); 'viewModel' contains an array of objects, with each object containing a name of a location, lat, and lng. I want to take this information and plot markers on a Google map in my view. When I attempt to inject the data by way of Handlebars into an inline JS variable... <script> var viewMarkers = {{viewModel}}; console.log(viewMarkers); </script> I get this in my console... <script> var

How to publish Polymer 3.x custom element?

夙愿已清 提交于 2019-12-06 08:53:15
问题 I am learning polymer3.x. I made a dummy polymer element. Now i wanted to know how to publish online and use it in some other framework(eg: angular app). I completed the requirements as mentioned in https://www.webcomponents.org, included License file tagged versions added README file But while doing "preview element" i got Error - 12: Missing bower.json. Currently, only Bower is supported. From Polymer version 3, the Polymer team recommends npm instead of Bower . How to publish my polymer

Set Base Image Programmatically

匆匆过客 提交于 2019-12-06 07:48:35
问题 I've got this problem that I can't solve. Partly because I can't explain it with the right terms. I'm new to this so sorry for this clumsy question. Below you can see an overview of my goal. I am trying to sell Similar product in my magento for this i wrote some code that every thing is working fine.. But i have only one problem with images.. that is I am getting all images of current product but the base image is not selected, How can i set the very first image as base image Programmatically

Designing Javascript frontend <-> C++ backend communication

北战南征 提交于 2019-12-06 05:54:42
问题 In my nearest future I will have to make a system with C++ backend and web frontend (requirements). At the moment, I don't know much more about it. I think that Frontend will be triggering data delivery, not backend - so no need for Comet-like things. Because of possibly little experience in this field, I'd really appreciate your comments about design decisions I made. First of all, I don't like the option of generating HTML from C++. So, C++ backend will have to communicate with Javascript

HTML file upload “no file selected” text style

巧了我就是萌 提交于 2019-12-06 05:04:50
I am building a html form that needs file upload. While I got the file upload part working, I am unable to get the styling of form upload button and " No file selected" text. My desired markup is Is there a way to do it? PS: Please ignore the green text ( "Upload a screen shot"). I have that working. Current behavior the button and the "no file chosen" is in the same line. HTML Code: <div class="formField"> <label for="fileToUpload">Upload a screen shot (optional) </label> <input type="file" name="fileToUpload" id="fileToUpload"/> </div> File inputs can't be styled with CSS alone. You'll need