google-closure

Adding sub-properties to an existing property-list in jsdoc

送分小仙女□ 提交于 2019-12-10 09:23:13
问题 I am trying to automate a particular module in our JS library and am stuck at a point where I want to define a set of properties (lets say an object that goes as construction parameter of a class). /** * This function initiates world peace! * @constructor * @param {object} defaults - The options to initiate peace. * @param {number} defaults.issues - The number of issues being taken up. * @param {string} defaults.source - The name of the location where process starts. */ var WorldPeace =

Using Google Closure's @typedef tag

五迷三道 提交于 2019-12-10 04:22:51
问题 Google's Closure compiler has an "@typedef" tag, but is it OK to use them in your code? (I know it'll work, but is it frowned upon?) So here's my type /** * The plan object's typedef * @typedef {Object} */ Types.Plan = { "style": "bordersmall", "width": "50%", "height": "40%", "x": "20%", "y": "10%", "clickable": true, "moveable": true }; And then I can use that type in my JSDoc annotations. This allows my IDE to give me autocomplete on the passed parameter So the declared object isn't used

dynamic script tag loading is not working as expected

人走茶凉 提交于 2019-12-09 23:25:51
问题 We have an application that uses both the google closure and dojo libraries. We have the following in our index page which works as expected: <script type="text/javascript" src="runtime/src/lib/google-closure-rev26/closure/goog/base.js"></script> <script type="text/javascript" src="runtime/src/lib/dojo_release_132_src/dojo/dojo.js"></script> <script type="text/javascript" src="runtime/src/core/loader.js"></script> We would like to use only one script tag in the actual html source. So we tried

File upload functionality in google closure?

爱⌒轻易说出口 提交于 2019-12-08 09:58:56
问题 I am creating a project on google app engine. Here I am trying to upload a file to blobstore. I have an html file with multiple forms, where each form has a file upload button <input type="file"> Now as soon as user selects a file using this button the file must start uploading to GAE blobstore. I have the python code which can do this uploading stuff but I am not able to link my backend (python) code to the file I've browsed. Also, as there are multiple forms the page must not get refreshed.

Google Closure Templates generates multiple JavaScript files for each language instead of single JavaScript code base with separate resource files

纵然是瞬间 提交于 2019-12-08 04:15:56
问题 I'm using Google Closure Template in order to write my application's UI using JavaScript. Look at this question for the detailed reason of why I'm using Google Closure Template. I want it to be multilingual. I see that there is a --locales switch and also looked at the samples provided in the project here and here. In the README_FOR_EXAMPLES files it is written that + simple_generated_en.js, features_generated_en.js, simple_generated_x-zz.js, features_generated_x-zz.js The JS files generated

In Google Closure how can I get a property from a DOM element?

試著忘記壹切 提交于 2019-12-08 03:31:03
问题 I can set elements with setProperties, but there does not seem to be a getProperties to get an attribute value. Can anyone help? 回答1: If you just want to return the attribute value use raw javascript method getAttribute(att_name). Or if you get an attribute node by name from the current element use getAttributeNode(att_name) var elem = goog.dom.getElement(element); var attr = elem.getAttribute('name'); var attrNode = elem.getAttributeNode('name'); 来源: https://stackoverflow.com/questions

problems creating custom event dispatcher in google closure library

笑着哭i 提交于 2019-12-07 12:01:03
问题 I'm trying to create a custom event dispatcher in google closure js library. I'm basing this code off of the animation class in the fx folder, yet I keep getting this error.. "goog.events is undefined" yet I'm including the events package at the top. here is my code. goog.provide('test.util.Animation'); goog.provide('test.util.Animation.EventType'); goog.provide('test.util.AnimationEvent'); goog.require('goog.events'); goog.require('goog.events.EventTarget'); goog.require('goog.events

Google closure variable window/event/console/… is undeclared error

◇◆丶佛笑我妖孽 提交于 2019-12-07 07:41:46
问题 I'm trying to compile one of my HTML5 project using Google Closure. I'm recieving several errors that I don't know how to solve. In fact, it's the same error but for different variables. Here the errors messages: variable window is undeclared variable event is undeclared variable console is undeclared variable Audio is undeclared These variables are Javascript built-in variables. If I compile this same project directly in command-line, it works. But, in my case, I need to compile this project

Looking for a template engine which can be used in Java and JavaScript [closed]

。_饼干妹妹 提交于 2019-12-07 06:22:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . As the title says, I'm currently looking for a template engine that works with Java and Javascript. The idea is that my ajax json objects can use the same template files to render stuff client-side like Java is doing it server-side. I know there is google-closure-template but it is working with guice 2.0 and my

ignore compiler warning from one file in Google Closure

拈花ヽ惹草 提交于 2019-12-07 02:15:37
问题 I'm using an external library (Phonegap) in a fairly large Closure project. Unfortunately Phonegap generates a ton was compiler warnings (all "dangerous use of this"). Enough that it makes searching through the compiler output for warning about my own code pretty annoying. Is there a way to silence just the warnings from one file? 回答1: I suppose you mean type warnings when you are using VERBOSE or checkTypes. Put the following into any file: /** * @fileoverview * @suppress {checkTypes} */ to