google-closure

Drag and drop events in embedded SVG?

会有一股神秘感。 提交于 2019-12-05 01:53:11
Is there any possibility of receiving drag and drop events from SVG elements within a web page? I tried the Google Closure library, to no avail. Specifically, suppose my page contains <ul id = "list"> <li class="item" id="item1">foo</li> <li class="item">bar</li> <li class="item">baz</li> </ul> And my script contains (Clojurescript/C2) (let [items (select-all ".item") lst (select "#list") target (fx/DragDrop. lst nil)] (dorun (map (fn [item] (let [source (fx/DragDrop. item nil)] (. source (addTarget target)) (. source (init)))) items)) (. target (init))) Then I do get a drag image (ghost),

dynamic script tag loading is not working as expected

冷暖自知 提交于 2019-12-04 20:17:50
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 to do the following: <head> <script type="text/javascript" src="runtime/src-bootstrap.js"></script> <

Google Closure decompiler?

 ̄綄美尐妖づ 提交于 2019-12-04 15:39:11
I was looking for a way to decompile JavaScript that was compiled by Google Closure. I did find a Decompiler class ( https://code.google.com/p/closure-compiler/source/browse/lib/rhino/src/org/mozilla/javascript/Decompiler.java?name=v20140407 ), however I haven't had much luck with it. Anyone try this before or know of some other method? Usually, I just run the code through the Closure Compiler in WHITESPACE mode and enable the pretty printing options. 来源: https://stackoverflow.com/questions/9321648/google-closure-decompiler

How to configure karma-runner (also known as testacular) to work with closure-library

本小妞迷上赌 提交于 2019-12-04 11:15:41
I'm trying to use karma-runner with mocha testing framework to test an application built with closure-library and angularjs. I always get namespace.Application is not defined thanks in advance. here's my config file basePath = ''; files = [ MOCHA, MOCHA_ADAPTER, {pattern: 'vendors/closure-library/closure/goog/base.js', watched: false, included: true, served: true}, {pattern: 'public/javascripts/deps.js', watched: true, included: true, served: true}, {pattern: 'node_modules/expect.js/expect.js', watched: false, included: true, served: true}, {pattern: 'public/javascripts/*.js', watched: true,

Google Closure Editor/WYSIWYG

﹥>﹥吖頭↗ 提交于 2019-12-04 08:26:37
问题 Does anyone have experience with Google Closure Editor/WYSIWYG? I'm thinking of moving from CKEDITOR to Google Closure Editor/WYSIWYG. Ideally I'd love to use the etherpad editor but it doesn't appear that anyone has separated the editor from all the app. Anyhow, for Google Closure Editor/WYSIWYG, does anyone know, does it support the real-time collaborative aspects seen in Google Docs? 回答1: The Google Closure editor is a wrapper around the built-in browser editing capabilities. It is thus

How do I use Google Closure compiler to remove unused JavaScript code?

有些话、适合烂在心里 提交于 2019-12-04 03:28:43
How do I use Google Closure compiler to remove unused code? I am using the JQuery Slider control but am not using anything else within JQuery. So I read that Google Closure compiler in Advanced mode can remove unused code, but I don't know how . I have frontpage.html that links to an external JQuery, JQuery UI and JQuery Slider control from that html page hosted on my site. On my frontpage.html, I also have JavaScript embedded within the HTML that initiates the JQuery Slider control. How do I use I use the online Closure Compiler to evaluate my frontpage.html, JQuery, JQuery UI, and JQuery

WARNING - dangerous use of the global this object

若如初见. 提交于 2019-12-04 03:15:45
问题 In Google Closure Compiler I get the warning WARNING - dangerous use of the global this object Here is an example. The error line and offset refers to the beginning of the word this function aToggle() { if(shown) toggle.show() else toggle.hide() $(this).text(shown ? 'Click to hide' : 'Click to show') shown = !shown } link.onclick = aToggle I would just change it to an anonymous method, but I am re-using aToggle elsewhere in the file, so it needs to be named. I could mark aToggle as /**

How do I add my own JavaScript libs to ClojureScript?

我与影子孤独终老i 提交于 2019-12-04 01:21:59
I want to write a Google Chrome extension, using ClojureScript. With ClojureScript I can use all the Google Closure libs, but afaik access to the Chrome browser is not included in those libs. So I want to wrap all the Chrome stuff in my own JavaScript lib. So far I tried creating my own jar that has a single JavaScript file that just creates a Foo object and exports the constructor. I'v added this jar to the lib directory of the ClojureScript compiler (which also has for example goog.jar), but so far without luck: Exception in thread "main" java.lang.IllegalArgumentException: No implementation

How can I prevent the warning 'Property MyProp1 never defined on MyObject'?

戏子无情 提交于 2019-12-03 23:55:18
问题 I have some HTML that contains a JSON string. In the on DOM ready callback, I have something like this: MyObject = JSON.parse($('#TheJsonString').html()); Later in my code, I write something this: var SomeVar = MyObject.MyProp1; And then when I run the code through the Google closure compiler, I get the warning Property MyProp1 never defined on MyObject. How should the code be written so that it doesn't generate a warning? 回答1: The cleanest way to remove the warning is by defining the

Accessing “this” in Clojurescript

99封情书 提交于 2019-12-03 23:47:22
问题 Is there a way to access the "this" object in clojurescript? I am having issues with event propagation when I wrap an icon with an anchor and try to attach a handlder to the anchor. Without access to "this" in the handler I am constantly dealing with the inner icon firing the event sometimes and the anchor firing other times. edit: As was suggested below, this-as is the way to do this. An example could be (defn my-handler [e] (this-as this (let [data-attr (.data ($ this) "my-attr")] (log data