This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dojox/gfx.js | |
| define(['dojo/_base/kernel'], function(dojo){ | |
| var gfx = dojo.getObject("gfx", true, dojox); | |
| // this is actualy added in dojox/gfx/_base.js | |
| dojo.mixin(gfx, { | |
| switchTo: function(renderer){ | |
| var ns = gfx[renderer]; | |
| if(ns){ | |
| dojo.mixin(gfx, ns); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(["dojo/_base/config", "./" + (function(){ | |
| var renderer, sl, flag, match; | |
| while(!renderer){ | |
| // Have a way to force a GFX renderer, if so desired. | |
| // Useful for being able to serialize GFX data in a particular format. | |
| if(dojo.config.forceGfxRenderer){ | |
| renderer = dojo.config.forceGfxRenderer; | |
| break; | |
| } | |
| var renderers = (typeof dojo.config.gfxRenderer === "string" ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var globalEval = (function(global, doc){ | |
| global.__dojoEvalInfo__ = {}; | |
| var resultId = 0, | |
| head = doc.getElementsByTagName("head")[0] || doc.documentElement; | |
| return function(text){ | |
| var script = doc.createElement("script"), | |
| id = resultId++, sText, result; | |
| script.type = "text/javascript"; | |
| sText = "__dojoEvalInfo__[" + id + "].result = eval(__dojoEvalInfo__[" + id + "].text);"; | |
| global.__dojoEvalInfo__[id] = { text: text }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ${if | |
| or{ | |
| {def:h_X-Malware_found} | |
| { | |
| and{ | |
| {def:h_X-Spam_score:} | |
| {>{$h_X-Spam_score_int:}{80}} | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define.async(["dep1", "dep2"], function(loaded, dep1, dep2){ | |
| someAsyncOperation(function(){ | |
| loaded({ | |
| /* module definition here */ | |
| }); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name project.local; | |
| root /path/to/project; | |
| access_log /var/log/nginx/project.local.access.log; | |
| error_log /var/log/nginx/project.local.error.log; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var listeners = {}; | |
| function addEventListener(event, callback, capture){ | |
| if(!listeners[event]){ | |
| listeners[event] = []; | |
| } | |
| listeners[event].push(callback); | |
| } | |
| function removeEventListener(event, callback, capture){ | |
| if(listeners[event]){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function poller(callback, delay){ | |
| var polling, timeout; | |
| function set(time){ | |
| timeout = setTimeout(function(){ | |
| // if a timeout is already scheduled in IE, | |
| // clearTimeout won't remove it from the schedule | |
| if(!polling || polling != time){ return; } | |
| callback(); | |
| set(time); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| has.add("activex", typeof ActiveXObject != "undefined"); | |
| getXhr = function(){ | |
| throw new Error("XMLHttpRequest is unavailable"); | |
| }; | |
| if(has("native-xhr") && !has("dojo-force-activex-xhr")){ | |
| getXhr = function(){ | |
| return new XMLHttpRequest(); | |
| }; | |
| }else if(has("activex")){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(["./has"], function(has){ | |
| // An ES5 shim for older browsers for Dojo 2.0. | |
| // Please note that this is much larger than dojo/array in 1.7 for a few reasons: | |
| // * Feature tests | |
| // * Addition of Array#reduce, Array#reduceRight, Function#bind | |
| var ap = Array.prototype, | |
| fp = Function.prototype; | |
| has.add("array-indexof", !!ap.indexOf); | |
| has.add("array-foreach", !!ap.forEach); |