Commit bd5e53506f690aa70a8ad25cca0ad7c4e653700b

Authored by Fernando Brito
1 parent c1509167
Exists in wikilibras

Wikilibras initial commit

Controller, model, migrations, views, lib, assets
app/controllers/wikilibras/signs_controller.rb 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +class Wikilibras::SignsController < InheritedResources::Base
  2 + actions :index, :new
  3 +
  4 + before_filter :authenticate_user!
  5 +
  6 + def create
  7 + controller = Wikilibras::Controller.new(params[:sign])
  8 + controller.process()
  9 +
  10 + redirect_to @sign, notice: 'Edição criada com sucesso.'
  11 + end
  12 +end
... ...
app/models/wikilibras.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +module Wikilibras
  2 + def self.table_name_prefix
  3 + 'wikilibras_'
  4 + end
  5 +end
... ...
app/models/wikilibras/sign.rb 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +# == Schema Information
  2 +#
  3 +# Table name: wikilibras_signs
  4 +#
  5 +# id :integer not null, primary key
  6 +# name :string(255)
  7 +# video_filename :string(255)
  8 +# owner_id :integer
  9 +# created_at :datetime
  10 +# updated_at :datetime
  11 +#
  12 +
  13 +class Wikilibras::Sign < ActiveRecord::Base
  14 +
  15 +end
... ...
app/views/wikilibras/signs/new.haml 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +- content_for :js do
  2 + = javascript_include_tag "UnityObject2.js"
  3 + = javascript_include_tag "handlebars.runtime-v1.3.0"
  4 +
  5 +- content_for :css_code do
  6 + = stylesheet_link_tag "wikilibras"
  7 +
  8 += javascript_include_tag "wikilibras"
  9 +
  10 +
... ...
config/application.rb
... ... @@ -19,6 +19,8 @@ module Vlibras
19 19 # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
20 20 # config.time_zone = 'Central Time (US & Canada)'
21 21  
  22 + config.assets.paths << Rails.root.join("vendor", "assets", "flash")
  23 +
22 24 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
23 25 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
24 26 config.i18n.enforce_available_locales = false
... ...
config/initializers/assets.rb
... ... @@ -5,5 +5,11 @@ Rails.application.config.assets.precompile += %w( v_libras/requests/workflow.js
5 5 Rails.application.config.assets.precompile += %w( v_libras/videos/index.js )
6 6 Rails.application.config.assets.precompile += %w( jquery.steps.js )
7 7  
  8 +Rails.application.config.assets.precompile += %w( UnityObject2.js )
  9 +Rails.application.config.assets.precompile += %w( handlebars.runtime-v1.3.0.js )
  10 +Rails.application.config.assets.precompile += %w( wikilibras.js )
  11 +Rails.application.config.assets.precompile += %w( wikilibras.css )
  12 +
8 13 Rails.application.config.assets.precompile += %w( v_libras/requests.css )
9   -Rails.application.config.assets.precompile += %w( jquery.steps.css )
10 14 \ No newline at end of file
  15 +Rails.application.config.assets.precompile += %w( jquery.steps.css )
  16 +Rails.application.config.assets.precompile += %w( video-js.swf )
... ...
config/routes.rb
... ... @@ -18,8 +18,14 @@ Rails.application.routes.draw do
18 18 end
19 19  
20 20 resources :videos, :only => [ :index, :show, :destroy ]
  21 + end
21 22  
22   -
  23 + namespace :wikilibras do
  24 + resources :signs do
  25 + # Wikilibras plugins makes a POST request to itself. This redirects it to create method
  26 + post 'new', on: :collection, to: 'signs#create'
  27 + end
23 28 end
24 29  
  30 +
25 31 end
... ...
db/migrate/20140811143409_create_wikilibras_signs.rb 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +class CreateWikilibrasSigns < ActiveRecord::Migration
  2 + def change
  3 + create_table :wikilibras_signs do |t|
  4 + t.string :name
  5 + t.string :video_filename
  6 +
  7 + t.references :owner
  8 +
  9 + t.timestamps
  10 + end
  11 + end
  12 +end
... ...
lib/wikilibras/controller.rb 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +class Wikilibras::Controller
  2 + def initialize(params)
  3 + @params = params
  4 + end
  5 +
  6 + def process
  7 + puts "*" * 50
  8 + puts @params.to_json
  9 + end
  10 +end
0 11 \ No newline at end of file
... ...
vendor/assets/flash/video-js.swf 0 → 100644
No preview for this file type
vendor/assets/javascripts/UnityObject2.js 0 → 100644
... ... @@ -0,0 +1,1693 @@
  1 +/**
  2 + * @fileOverview
  3 + * Defines UnityObject2
  4 + */
  5 +
  6 +
  7 +//TODO: No need to polute the global space, just transfer this control to a 'static' variable insite unityObject!
  8 +/**
  9 + * @namespace
  10 + */
  11 +//var unity = unity || {};
  12 +// We store all unityObject instances in a global scope, needed for IE firstFrameCallback and other internal tasks.
  13 +//unity.instances = [];
  14 +//unity.instanceNumber = 0;
  15 +
  16 +/**
  17 + * Object expected by the Java Installer. We can move those to UnityObject2 if we update the java Installer.
  18 + */
  19 +var unityObject = {
  20 + /**
  21 + * Callback used bt the Java installer to notify the Install Complete.
  22 + * @private
  23 + * @param {String} id
  24 + * @param {bool} success
  25 + * @param {String} errormessage
  26 + */
  27 + javaInstallDone : function (id, success, errormessage) {
  28 +
  29 + var instanceId = parseInt(id.substring(id.lastIndexOf('_') + 1), 10);
  30 +
  31 + if (!isNaN(instanceId)) {
  32 +
  33 + // javaInstallDoneCallback must not be called directly because it deadlocks google chrome
  34 + setTimeout(function () {
  35 +
  36 + UnityObject2.instances[instanceId].javaInstallDoneCallback(id, success, errormessage);
  37 + }, 10);
  38 + }
  39 + }
  40 +};
  41 +
  42 +
  43 +/**
  44 + * @class
  45 + * @constructor
  46 + */
  47 +var UnityObject2 = function (config) {
  48 +
  49 + /** @private */
  50 + var logHistory = [],
  51 + win = window,
  52 + doc = document,
  53 + nav = navigator,
  54 + instanceNumber = null,
  55 + //domLoaded = false,
  56 + //domLoadEvents = [],
  57 + embeddedObjects = [], //Could be removed?
  58 + //listeners = [],
  59 + //styleSheet = null,
  60 + //styleSheetMedia = null,
  61 + //autoHideShow = true,
  62 + //fullSizeMissing = true,
  63 + useSSL = (document.location.protocol == 'https:'), //This will turn off enableUnityAnalytics, since enableUnityAnalytics don't have a https version.
  64 + baseDomain = useSSL ? "https://ssl-webplayer.unity3d.com/" : "http://webplayer.unity3d.com/",
  65 + triedJavaCookie = "_unity_triedjava",
  66 + triedJavaInstall = _getCookie(triedJavaCookie),
  67 + triedClickOnceCookie = "_unity_triedclickonce",
  68 + triedClickOnce = _getCookie(triedClickOnceCookie),
  69 + progressCallback = false,
  70 + applets = [],
  71 + //addedClickOnce = false,
  72 + googleAnalyticsLoaded = false,
  73 + googleAnalyticsCallback = null,
  74 + latestStatus = null,
  75 + lastType = null,
  76 + //beginCallback = [],
  77 + //preCallback = [],
  78 + imagesToWaitFor = [],
  79 + //referrer = null,
  80 + pluginStatus = null,
  81 + pluginStatusHistory = [],
  82 + installProcessStarted = false, //not used anymore?
  83 + kInstalled = "installed",
  84 + kMissing = "missing",
  85 + kBroken = "broken",
  86 + kUnsupported = "unsupported",
  87 + kReady = "ready", //not used anymore?
  88 + kStart = "start",
  89 + kError = "error",
  90 + kFirst = "first",
  91 + //kStandard = "standard",
  92 + kJava = "java",
  93 + kClickOnce = "clickonce", //not used anymore?
  94 + wasMissing = false, //identifies if this is a install attempt, or if the plugin was already installed
  95 + unityObject = null, //The <embed> or <object> for the webplayer. This can be used for webPlayer communication.
  96 + //kApplet = "_applet",
  97 + //kBanner = "_banner",
  98 +
  99 + cfg = {
  100 + pluginName : "Unity Player",
  101 + pluginMimeType : "application/vnd.unity",
  102 + baseDownloadUrl : baseDomain + "download_webplayer-3.x/",
  103 + fullInstall : false,
  104 + autoInstall : false,
  105 + enableJava : true,
  106 + enableJVMPreloading : false,
  107 + enableClickOnce : true,
  108 + enableUnityAnalytics : false,
  109 + enableGoogleAnalytics : true,
  110 + params : {},
  111 + attributes : {},
  112 + referrer : null,
  113 + debugLevel : 0
  114 + };
  115 +
  116 + // Merge in the given configuration and override defaults.
  117 + cfg = jQuery.extend(true, cfg, config);
  118 +
  119 + if (cfg.referrer === "") {
  120 + cfg.referrer = null;
  121 + }
  122 + //enableUnityAnalytics does not support SSL yet.
  123 + if (useSSL) {
  124 + cfg.enableUnityAnalytics = false;
  125 + }
  126 +
  127 + /**
  128 + * Get cookie value
  129 + * @private
  130 + * @param {String} name The param name
  131 + * @return string or false if non-existing.
  132 + */
  133 + function _getCookie(name) {
  134 +
  135 + var e = new RegExp(escape(name) + "=([^;]+)");
  136 +
  137 + if (e.test(doc.cookie + ";")) {
  138 +
  139 + e.exec(doc.cookie + ";");
  140 + return RegExp.$1;
  141 + }
  142 +
  143 + return false;
  144 + }
  145 +
  146 + /**
  147 + * Sets session cookie
  148 + * @private
  149 + */
  150 + function _setSessionCookie(name, value) {
  151 +
  152 + document.cookie = escape(name) + "=" + escape(value) + "; path=/";
  153 + }
  154 +
  155 + /**
  156 + * Converts unity version to number (used for version comparison)
  157 + * @private
  158 + */
  159 + function _getNumericUnityVersion(version) {
  160 +
  161 + var result = 0,
  162 + major,
  163 + minor,
  164 + fix,
  165 + type,
  166 + release;
  167 +
  168 + if (version) {
  169 +
  170 + var m = version.toLowerCase().match(/^(\d+)(?:\.(\d+)(?:\.(\d+)([dabfr])?(\d+)?)?)?$/);
  171 +
  172 + if (m && m[1]) {
  173 +
  174 + major = m[1];
  175 + minor = m[2] ? m[2] : 0;
  176 + fix = m[3] ? m[3] : 0;
  177 + type = m[4] ? m[4] : 'r';
  178 + release = m[5] ? m[5] : 0;
  179 + result |= ((major / 10) % 10) << 28;
  180 + result |= (major % 10) << 24;
  181 + result |= (minor % 10) << 20;
  182 + result |= (fix % 10) << 16;
  183 + result |= {d: 2 << 12, a: 4 << 12, b: 6 << 12, f: 8 << 12, r: 8 << 12}[type];
  184 + result |= ((release / 100) % 10) << 8;
  185 + result |= ((release / 10) % 10) << 4;
  186 + result |= (release % 10);
  187 + }
  188 + }
  189 +
  190 + return result;
  191 + }
  192 +
  193 + /**
  194 + * Gets plugin and unity versions (non-ie)
  195 + * @private
  196 + */
  197 + function _getPluginVersion(callback, versions) {
  198 +
  199 + var b = doc.getElementsByTagName("body")[0];
  200 + var ue = doc.createElement("object");
  201 + var i = 0;
  202 +
  203 + if (b && ue) {
  204 + ue.setAttribute("type", cfg.pluginMimeType);
  205 + ue.style.visibility = "hidden";
  206 + b.appendChild(ue);
  207 + var count = 0;
  208 +
  209 + (function () {
  210 + if (typeof ue.GetPluginVersion === "undefined") {
  211 +
  212 + if (count++ < 10) {
  213 +
  214 + setTimeout(arguments.callee, 10);
  215 + } else {
  216 +
  217 + b.removeChild(ue);
  218 + callback(null);
  219 + }
  220 + } else {
  221 +
  222 + var v = {};
  223 +
  224 + if (versions) {
  225 +
  226 + for (i = 0; i < versions.length; ++i) {
  227 +
  228 + v[versions[i]] = ue.GetUnityVersion(versions[i]);
  229 + }
  230 + }
  231 +
  232 + v.plugin = ue.GetPluginVersion();
  233 + b.removeChild(ue);
  234 + callback(v);
  235 + }
  236 + })();
  237 +
  238 + } else {
  239 +
  240 + callback(null);
  241 + }
  242 + }
  243 +
  244 + /**
  245 + * Retrieves windows installer name
  246 + * @private
  247 + */
  248 + function _getWinInstall() {
  249 + var url = "";
  250 +
  251 + if (ua.x64) {
  252 + url = cfg.fullInstall ? "UnityWebPlayerFull64.exe" : "UnityWebPlayer64.exe";
  253 + } else {
  254 + url = cfg.fullInstall ? "UnityWebPlayerFull.exe" : "UnityWebPlayer.exe";
  255 + }
  256 +
  257 + if (cfg.referrer !== null) {
  258 +
  259 + url += "?referrer=" + cfg.referrer;
  260 + }
  261 + return url;
  262 + }
  263 +
  264 + /**
  265 + * Retrieves mac plugin package name
  266 + * @private
  267 + */
  268 + function _getOSXInstall() {
  269 +
  270 + var url = "UnityPlayer.plugin.zip";
  271 +
  272 + if (cfg.referrer != null) {
  273 +
  274 + url += "?referrer=" + cfg.referrer;
  275 + }
  276 + return url;
  277 + }
  278 +
  279 + /**
  280 + * retrieves installer name
  281 + * @private
  282 + */
  283 + function _getInstaller() {
  284 +
  285 + return cfg.baseDownloadUrl + (ua.win ? _getWinInstall() : _getOSXInstall() );
  286 + }
  287 +
  288 + /**
  289 + * sets plugin status
  290 + * @private
  291 + */
  292 + function _setPluginStatus(status, type, data, url) {
  293 +
  294 + if (status === kMissing) {
  295 + wasMissing = true;
  296 + }
  297 +
  298 + // debug('setPluginStatus() status:', status, 'type:', type, 'data:', data, 'url:', url);
  299 +
  300 + // only report to analytics the first time a status occurs.
  301 + if ( jQuery.inArray(status, pluginStatusHistory) === -1 ) {
  302 +
  303 + //Only send analytics for plugins installs. Do not send if plugin is already installed.
  304 + if (wasMissing) {
  305 + _an.send(status, type, data, url);
  306 + }
  307 + pluginStatusHistory.push(status);
  308 + }
  309 +
  310 + pluginStatus = status;
  311 + }
  312 +
  313 +
  314 + /**
  315 + * Contains browser and platform properties
  316 + * @private
  317 + */
  318 + var ua = function () {
  319 +
  320 + var a = nav.userAgent, p = nav.platform;
  321 + var chrome = /chrome/i.test(a);
  322 +
  323 + //starting from IE 11, IE is using a different UserAgent.
  324 + var ie = false;
  325 + if (/msie/i.test(a)){
  326 + ie = parseFloat(a.replace(/^.*msie ([0-9]+(\.[0-9]+)?).*$/i, "$1"));
  327 + } else if (/Trident/i.test(a)) {
  328 + ie = parseFloat(a.replace(/^.*rv:([0-9]+(\.[0-9]+)?).*$/i, "$1"));
  329 + }
  330 + var ua = {
  331 + w3 : typeof doc.getElementById != "undefined" && typeof doc.getElementsByTagName != "undefined" && typeof doc.createElement != "undefined",
  332 + win : p ? /win/i.test(p) : /win/i.test(a),
  333 + mac : p ? /mac/i.test(p) : /mac/i.test(a),
  334 + ie : ie,
  335 + ff : /firefox/i.test(a),
  336 + op : /opera/i.test(a),
  337 + ch : chrome,
  338 + ch_v : /chrome/i.test(a) ? parseFloat(a.replace(/^.*chrome\/(\d+(\.\d+)?).*$/i, "$1")) : false,
  339 + sf : /safari/i.test(a) && !chrome,
  340 + wk : /webkit/i.test(a) ? parseFloat(a.replace(/^.*webkit\/(\d+(\.\d+)?).*$/i, "$1")) : false,
  341 + x64 : /win64/i.test(a) && /x64/i.test(a),
  342 + moz : /mozilla/i.test(a) ? parseFloat(a.replace(/^.*mozilla\/([0-9]+(\.[0-9]+)?).*$/i, "$1")) : 0,
  343 + mobile: /ipad/i.test(p) || /iphone/i.test(p) || /ipod/i.test(p) || /android/i.test(a) || /windows phone/i.test(a)
  344 + };
  345 +
  346 + ua.clientBrand = ua.ch ? 'ch' : ua.ff ? 'ff' : ua.sf ? 'sf' : ua.ie ? 'ie' : ua.op ? 'op' : '??';
  347 + ua.clientPlatform = ua.win ? 'win' : ua.mac ? 'mac' : '???';
  348 +
  349 + // get base url
  350 + var s = doc.getElementsByTagName("script");
  351 +
  352 + for (var i = 0; i < s.length; ++i) {
  353 +
  354 + var m = s[i].src.match(/^(.*)3\.0\/uo\/UnityObject2\.js$/i);
  355 +
  356 + if (m) {
  357 +
  358 + cfg.baseDownloadUrl = m[1];
  359 + break;
  360 + }
  361 + }
  362 +
  363 + /**
  364 + * compares two versions
  365 + * @private
  366 + */
  367 + function _compareVersions(v1, v2) {
  368 +
  369 + for (var i = 0; i < Math.max(v1.length, v2.length); ++i) {
  370 +
  371 + var n1 = (i < v1.length) && v1[i] ? new Number(v1[i]) : 0;
  372 + var n2 = (i < v2.length) && v2[i] ? new Number(v2[i]) : 0;
  373 + if (n1 < n2) return -1;
  374 + if (n1 > n2) return 1;
  375 + }
  376 +
  377 + return 0;
  378 + };
  379 +
  380 + /**
  381 + * detect java
  382 + */
  383 + ua.java = function () {
  384 +
  385 + if (nav.javaEnabled()) {
  386 +
  387 + var wj = (ua.win && ua.ff);
  388 + var mj = false;//(ua.mac && (ua.ff || ua.ch || ua.sf));
  389 +
  390 + if (wj || mj) {
  391 +
  392 + if (typeof nav.mimeTypes != "undefined") {
  393 +
  394 + var rv = wj ? [1, 6, 0, 12] : [1, 4, 2, 0];
  395 +
  396 + for (var i = 0; i < nav.mimeTypes.length; ++i) {
  397 +
  398 + if (nav.mimeTypes[i].enabledPlugin) {
  399 +
  400 + var m = nav.mimeTypes[i].type.match(/^application\/x-java-applet;(?:jpi-)?version=(\d+)(?:\.(\d+)(?:\.(\d+)(?:_(\d+))?)?)?$/);
  401 +
  402 + if (m != null) {
  403 +
  404 + if (_compareVersions(rv, m.slice(1)) <= 0) {
  405 +
  406 + return true;
  407 + }
  408 + }
  409 + }
  410 + }
  411 + }
  412 + } else if (ua.win && ua.ie) {
  413 +
  414 + if (typeof ActiveXObject != "undefined") {
  415 +
  416 + /**
  417 + * ActiveX Test
  418 + */
  419 + function _axTest(v) {
  420 +
  421 + try {
  422 +
  423 + return new ActiveXObject("JavaWebStart.isInstalled." + v + ".0") != null;
  424 + }
  425 + catch (ex) {
  426 +
  427 + return false;
  428 + }
  429 + }
  430 +
  431 + /**
  432 + * ActiveX Test 2
  433 + */
  434 + function _axTest2(v) {
  435 +
  436 + try {
  437 +
  438 + return new ActiveXObject("JavaPlugin.160_" + v) != null;
  439 + } catch (ex) {
  440 +
  441 + return false;
  442 + }
  443 + }
  444 +
  445 + if (_axTest("1.7.0")) {
  446 +
  447 + return true;
  448 + }
  449 +
  450 + if (ua.ie >= 8) {
  451 +
  452 + if (_axTest("1.6.0")) {
  453 +
  454 + // make sure it's 1.6.0.12 or newer. increment 50 to a larger value if 1.6.0.50 is released
  455 + for (var i = 12; i <= 50; ++i) {
  456 +
  457 + if (_axTest2(i)) {
  458 +
  459 + if (ua.ie == 9 && ua.moz == 5 && i < 24) {
  460 + // when IE9 is not in compatibility mode require at least
  461 + // Java 1.6.0.24: http://support.microsoft.com/kb/2506617
  462 + continue;
  463 + } else {
  464 +
  465 + return true;
  466 + }
  467 + }
  468 + }
  469 +
  470 + return false;
  471 + }
  472 + } else {
  473 +
  474 + return _axTest("1.6.0") || _axTest("1.5.0") || _axTest("1.4.2");
  475 + }
  476 + }
  477 + }
  478 + }
  479 +
  480 + return false;
  481 + }();
  482 +
  483 + // detect clickonce
  484 + ua.co = function () {
  485 +
  486 + if (ua.win && ua.ie) {
  487 + var av = a.match(/(\.NET CLR [0-9.]+)|(\.NET[0-9.]+)/g);
  488 + if (av != null) {
  489 + var rv = [3, 5, 0];
  490 + for (var i = 0; i < av.length; ++i) {
  491 + var versionNumbers = av[i].match(/[0-9.]{2,}/g)[0].split(".");
  492 + if (_compareVersions(rv, versionNumbers) <= 0) {
  493 + return true;
  494 + }
  495 + }
  496 + }
  497 + }
  498 + return false;
  499 +
  500 + }();
  501 +
  502 + return ua;
  503 + }();
  504 +
  505 +
  506 + /**
  507 + * analytics
  508 + * @private
  509 + */
  510 + var _an = function () {
  511 + var uid = function () {
  512 +
  513 + var now = new Date();
  514 + var utc = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDay(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
  515 + return utc.toString(16) + _getRandomInt().toString(16);
  516 + }();
  517 + var seq = 0;
  518 + var _ugaq = window["_gaq"] = ( window["_gaq"] || [] );
  519 +
  520 + _setUpAnalytics();
  521 +
  522 + /**
  523 + * generates random integer number
  524 + * @private
  525 + */
  526 + function _getRandomInt() {
  527 +
  528 + return Math.floor(Math.random() * 2147483647);
  529 + }
  530 +
  531 + /**
  532 + * Checks if there is a need to load analytics, by checking the existance of a _gaq object
  533 + */
  534 + function _setUpAnalytics() {
  535 +
  536 + var gaUrl = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  537 + var ss = doc.getElementsByTagName("script");
  538 + var googleAnalyticsLoaded = false;
  539 + for (var i = 0; i < ss.length; ++i) {
  540 +
  541 + if (ss[i].src && ss[i].src.toLowerCase() == gaUrl.toLowerCase()) {
  542 +
  543 + googleAnalyticsLoaded = true;
  544 + break;
  545 + }
  546 + }
  547 +
  548 + if (!googleAnalyticsLoaded) {
  549 + var ga = doc.createElement("script");
  550 + ga.type = "text/javascript";
  551 + ga.async = true;
  552 + ga.src = gaUrl;
  553 + var s = document.getElementsByTagName("script")[0];
  554 + s.parentNode.insertBefore(ga, s);
  555 + }
  556 +
  557 + var gaAccount = (cfg.debugLevel === 0) ? 'UA-16068464-16' : 'UA-16068464-17';
  558 +
  559 + _ugaq.push(["unity._setDomainName", "none"]);
  560 + _ugaq.push(["unity._setAllowLinker", true]);
  561 + _ugaq.push(["unity._setReferrerOverride", ' '+this.location.toString()]);
  562 +
  563 + _ugaq.push(["unity._setAccount", gaAccount]);
  564 + // $(GoogleRevisionPlaceholder)
  565 + }
  566 +
  567 + /**
  568 + * sends analytics data to unity
  569 + * @private
  570 + */
  571 + function _sendUnityAnalytics(event, type, data, callback) {
  572 +
  573 + if (!cfg.enableUnityAnalytics) {
  574 +
  575 + if (callback) {
  576 +
  577 + callback();
  578 + }
  579 +
  580 + return;
  581 + }
  582 +
  583 + var url = "http://unityanalyticscapture.appspot.com/event?u=" + encodeURIComponent(uid) + "&s=" + encodeURIComponent(seq) + "&e=" + encodeURIComponent(event);
  584 + // $(UnityRevisionPlaceholder)
  585 +
  586 + if (cfg.referrer !== null) {
  587 +
  588 + url += "?r=" + cfg.referrer;
  589 + }
  590 +
  591 + if (type) {
  592 +
  593 + url += "&t=" + encodeURIComponent(type);
  594 + }
  595 +
  596 + if (data) {
  597 +
  598 + url += "&d=" + encodeURIComponent(data);
  599 + }
  600 +
  601 + var img = new Image();
  602 +
  603 + if (callback) {
  604 +
  605 + img.onload = img.onerror = callback;
  606 + }
  607 +
  608 + img.src = url;
  609 + }
  610 +
  611 + /**
  612 + * sends analytics data to google
  613 + * @private
  614 + */
  615 + function _sendGoogleAnalytics(event, type, data, callback) {
  616 +
  617 + if (!cfg.enableGoogleAnalytics) {
  618 +
  619 + if (callback) {
  620 +
  621 + callback();
  622 + }
  623 +
  624 + return;
  625 + }
  626 +
  627 + var url = "/webplayer/install/" + event;
  628 + var join = "?";
  629 +
  630 + if (type) {
  631 +
  632 + url += join + "t=" + encodeURIComponent(type);
  633 + join = "&";
  634 + }
  635 +
  636 + if (data) {
  637 +
  638 + url += join + "d=" + encodeURIComponent(data);
  639 + join = "&";
  640 + }
  641 +
  642 + if (callback) {
  643 +
  644 + _ugaq.push(function () {
  645 + setTimeout(callback,1000);
  646 + //this.googleAnalyticsCallback = callback;
  647 + });
  648 + }
  649 +
  650 + //try to shorten the URL to fit into customVariable
  651 + //it will try to replace the early directories to ..
  652 + var gameUrl = cfg.src;
  653 + if (gameUrl.length > 40) {
  654 + gameUrl = gameUrl.replace("http://","");
  655 + var paths = gameUrl.split("/");
  656 +
  657 + var gameUrlFirst = paths.shift();
  658 + var gameUrlLast = paths.pop();
  659 + gameUrl = gameUrlFirst + "/../"+ gameUrlLast;
  660 +
  661 + while(gameUrl.length < 40 && paths.length > 0) {
  662 + var nextpath = paths.pop();
  663 + if(gameUrl.length + nextpath.length + 5 < 40) {
  664 + gameUrlLast = nextpath + "/" + gameUrlLast;
  665 + } else {
  666 + gameUrlLast = "../" + gameUrlLast;
  667 + }
  668 + gameUrl = gameUrlFirst + "/../"+ gameUrlLast;
  669 + }
  670 + }
  671 + _ugaq.push(['unity._setCustomVar',
  672 + 2, // This custom var is set to slot #1. Required parameter.
  673 + 'GameURL', // The name acts as a kind of category for the user activity. Required parameter.
  674 + gameUrl, // This value of the custom variable. Required parameter.
  675 + 3 // Sets the scope to page-level. Optional parameter.
  676 + ]);
  677 + _ugaq.push(['unity._setCustomVar',
  678 + 1, // This custom var is set to slot #1. Required parameter.
  679 + 'UnityObjectVersion', // The name acts as a kind of category for the user activity. Required parameter.
  680 + "2", // This value of the custom variable. Required parameter.
  681 + 3 // Sets the scope to page-level. Optional parameter.
  682 + ]);
  683 + if (type) {
  684 + _ugaq.push(['unity._setCustomVar',
  685 + 3, // This custom var is set to slot #1. Required parameter.
  686 + 'installMethod', // The name acts as a kind of category for the user activity. Required parameter.
  687 + type, // This value of the custom variable. Required parameter.
  688 + 3 // Sets the scope to page-level. Optional parameter.
  689 + ]);
  690 + }
  691 +
  692 + _ugaq.push(["unity._trackPageview", url]);
  693 + }
  694 +
  695 + return {
  696 + /**
  697 + * sends analytics data. optionally opens url once data has been sent
  698 + * @public
  699 + */
  700 + send : function (event, type, data, url) {
  701 +
  702 + if (cfg.enableUnityAnalytics || cfg.enableGoogleAnalytics) {
  703 +
  704 + debug('Analytics SEND', event, type, data, url);
  705 + }
  706 +
  707 + ++seq;
  708 + var count = 2;
  709 +
  710 + var callback = function () {
  711 +
  712 + if (0 == --count) {
  713 +
  714 + googleAnalyticsCallback = null;
  715 + window.location = url;
  716 + }
  717 + }
  718 +
  719 + if (data === null || data === undefined) {
  720 + data = "";
  721 + }
  722 +
  723 + _sendUnityAnalytics(event, type, data, url ? callback : null);
  724 + _sendGoogleAnalytics(event, type, data, url ? callback : null);
  725 + }
  726 + };
  727 + }();
  728 +
  729 +
  730 +
  731 +
  732 +
  733 + /* Java Install - BEGIN */
  734 +
  735 + /**
  736 + * @private
  737 + */
  738 + function _createObjectElement(attributes, params, elementToReplace) {
  739 +
  740 + var i,
  741 + at,
  742 + pt,
  743 + ue,
  744 + pe;
  745 +
  746 + if (ua.win && ua.ie) {
  747 +
  748 + at = "";
  749 +
  750 + for (i in attributes) {
  751 +
  752 + at += ' ' + i + '="' + attributes[i] + '"';
  753 + }
  754 +
  755 + pt = "";
  756 +
  757 + for (i in params) {
  758 +
  759 + pt += '<param name="' + i + '" value="' + params[i] + '" />';
  760 + }
  761 +
  762 + elementToReplace.outerHTML = '<object' + at + '>' + pt + '</object>';
  763 +
  764 + } else {
  765 +
  766 + ue = doc.createElement("object");
  767 +
  768 + for (i in attributes) {
  769 +
  770 + ue.setAttribute(i, attributes[i]);
  771 + }
  772 +
  773 + for (i in params) {
  774 +
  775 + pe = doc.createElement("param");
  776 + pe.name = i;
  777 + pe.value = params[i];
  778 + ue.appendChild(pe);
  779 + }
  780 +
  781 + elementToReplace.parentNode.replaceChild(ue, elementToReplace);
  782 + }
  783 + }
  784 +
  785 + /**
  786 + * @private
  787 + */
  788 + function _checkImage(img) {
  789 +
  790 + // img element not in the DOM yet
  791 + if (typeof img == "undefined") {
  792 +
  793 + return false;
  794 + }
  795 +
  796 + if (!img.complete) {
  797 +
  798 + return false;
  799 + }
  800 +
  801 + // some browsers always return true in img.complete, for those
  802 + // we can check naturalWidth
  803 + if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
  804 +
  805 + return false;
  806 + }
  807 +
  808 + // no other way of checking, assuming it is ok
  809 + return true;
  810 + }
  811 +
  812 + /**
  813 + * @private
  814 + */
  815 + function _preloadJVMWhenReady(id) {
  816 +
  817 + var needToWait = false;
  818 +
  819 + for (var i = 0; i < imagesToWaitFor.length; i++) {
  820 + if (!imagesToWaitFor[i]) {
  821 + continue;
  822 + }
  823 + var img = doc.images[imagesToWaitFor[i]];
  824 + if (!_checkImage(img)) {
  825 + needToWait = true;
  826 + }
  827 + else {
  828 + imagesToWaitFor[i] = null;
  829 + }
  830 + }
  831 + if (needToWait) {
  832 + // check again in 100ms
  833 + setTimeout(arguments.callee, 100);
  834 + }
  835 + else {
  836 + // preload after a small delay, to make sure
  837 + // the images have actually rendered
  838 + setTimeout(function () {
  839 + _preloadJVM(id);
  840 + }, 100);
  841 + }
  842 + }
  843 +
  844 +
  845 + /**
  846 + * preloads the JVM and the Java Plug-in
  847 + * @private
  848 + */
  849 + function _preloadJVM(id) {
  850 +
  851 + var re = doc.getElementById(id);
  852 +
  853 + if (!re) {
  854 +
  855 + re = doc.createElement("div");
  856 + var lastBodyElem = doc.body.lastChild;
  857 + doc.body.insertBefore(re, lastBodyElem.nextSibling);
  858 + }
  859 +
  860 + var codebase = cfg.baseDownloadUrl + "3.0/jws/";
  861 +
  862 + var a = {
  863 + id : id,
  864 + type : "application/x-java-applet",
  865 + code : "JVMPreloader",
  866 + width : 1,
  867 + height : 1,
  868 + name : "JVM Preloader"
  869 + };
  870 +
  871 + var p = {
  872 + context : id,
  873 + codebase : codebase,
  874 + classloader_cache : false,
  875 + scriptable : true,
  876 + mayscript : true
  877 + };
  878 +
  879 + _createObjectElement(a, p, re);
  880 + jQuery('#' + id).show();
  881 + //setVisibility(id, true);
  882 + }
  883 +
  884 + /**
  885 + * launches java installer
  886 + * @private
  887 + */
  888 + function _doJavaInstall(id) {
  889 +
  890 + triedJavaInstall = true;
  891 + _setSessionCookie(triedJavaCookie, triedJavaInstall);
  892 + var re = doc.getElementById(id);
  893 + var appletID = id + "_applet_" + instanceNumber;
  894 +
  895 + applets[appletID] = {
  896 + attributes : cfg.attributes,
  897 + params : cfg.params,
  898 + callback : cfg.callback,
  899 + broken : cfg.broken
  900 + };
  901 +
  902 + var applet = applets[appletID];
  903 +
  904 + var a = {
  905 + id : appletID,
  906 + type : "application/x-java-applet",
  907 + archive : cfg.baseDownloadUrl + "3.0/jws/UnityWebPlayer.jar",
  908 + code : "UnityWebPlayer",
  909 + width : 1,
  910 + height : 1,
  911 + name : "Unity Web Player"
  912 + };
  913 +
  914 + if (ua.win && ua.ff) {
  915 +
  916 + a["style"] = "visibility: hidden;";
  917 + }
  918 +
  919 + var p = {
  920 + context : appletID,
  921 + jnlp_href : cfg.baseDownloadUrl + "3.0/jws/UnityWebPlayer.jnlp",
  922 + classloader_cache : false,
  923 + installer : _getInstaller(),
  924 + image : baseDomain + "installation/unitylogo.png",
  925 + centerimage : true,
  926 + boxborder : false,
  927 + scriptable : true,
  928 + mayscript : true
  929 + };
  930 +
  931 + for (var i in applet.params) {
  932 +
  933 + if (i == "src") {
  934 +
  935 + continue;
  936 + }
  937 +
  938 + if (applet.params[i] != Object.prototype[i]) {
  939 +
  940 + p[i] = applet.params[i];
  941 +
  942 + if (i.toLowerCase() == "logoimage") {
  943 +
  944 + p["image"] = applet.params[i];
  945 + }
  946 + else if (i.toLowerCase() == "backgroundcolor") {
  947 +
  948 + p["boxbgcolor"] = "#" + applet.params[i];
  949 + }
  950 + else if (i.toLowerCase() == "bordercolor") {
  951 +
  952 + // there's no way to specify border color
  953 + p["boxborder"] = true;
  954 + }
  955 + else if (i.toLowerCase() == "textcolor") {
  956 +
  957 + p["boxfgcolor"] = "#" + applet.params[i];
  958 + }
  959 + }
  960 + }
  961 +
  962 + // Create a dummy div element in the unityPlayer div
  963 + // so that it can be replaced with the 1x1 px applet.
  964 + // The applet will be resized when it has fully loaded,
  965 + // see appletStarted().
  966 + var divToBeReplacedWithApplet = doc.createElement("div");
  967 + re.appendChild(divToBeReplacedWithApplet);
  968 + _createObjectElement(a, p, divToBeReplacedWithApplet);
  969 + jQuery('#' + id).show();
  970 + //setVisibility(appletID, true);
  971 + }
  972 +
  973 + /**
  974 + * @private
  975 + */
  976 + function _jvmPreloaded(id) {
  977 +
  978 + // timeout prevents crash on ie
  979 + setTimeout(function () {
  980 +
  981 + var re = doc.getElementById(id);
  982 +
  983 + if (re) {
  984 + re.parentNode.removeChild(re);
  985 + }
  986 + }, 0);
  987 + }
  988 +
  989 + /**
  990 + * @private
  991 + */
  992 + function _appletStarted(id) {
  993 + // set the size of the applet to the one from cloned attributes
  994 + var applet = applets[id],
  995 + appletElement = doc.getElementById(id),
  996 + childNode;
  997 +
  998 + // the applet might have already finished by now
  999 + if (!appletElement) {
  1000 +
  1001 + return;
  1002 + }
  1003 +
  1004 + appletElement.width = applet.attributes["width"] || 600;
  1005 + appletElement.height = applet.attributes["height"] || 450;
  1006 +
  1007 + // remove all the siblings of the applet
  1008 + var parentNode = appletElement.parentNode;
  1009 + var childNodeList = parentNode.childNodes;
  1010 +
  1011 + for (var i = 0; i < childNodeList.length; i++) {
  1012 +
  1013 + childNode = childNodeList[i];
  1014 + // Compare the child node with our applet element only if
  1015 + // it has the same type. Doing the comparison in other cases just
  1016 + // jumps out of the loop.
  1017 + if (childNode.nodeType == 1 && childNode != appletElement) {
  1018 +
  1019 + parentNode.removeChild(childNode);
  1020 + }
  1021 + }
  1022 + }
  1023 +
  1024 +
  1025 + // java installation callback
  1026 + function _javaInstallDoneCallback(id, success, errormessage) {
  1027 +
  1028 + debug('_javaInstallDoneCallback', id, success, errormessage);
  1029 + //console.log('javaInstallDoneCallback', id, success, errormessage);
  1030 +
  1031 + if (!success) {
  1032 +
  1033 + //var applet = applets[id];
  1034 + _setPluginStatus(kError, kJava, errormessage);
  1035 + //createMissingUnity(id, applet.attributes, applet.params, applet.callback, applet.broken, kJava, errormessage);
  1036 + }
  1037 + }
  1038 +
  1039 + /* Java Install - END */
  1040 +
  1041 +
  1042 + /**
  1043 + * @private
  1044 + */
  1045 + function log() {
  1046 +
  1047 + logHistory.push(arguments);
  1048 +
  1049 + if ( cfg.debugLevel > 0 && window.console && window.console.log ) {
  1050 +
  1051 + console.log(Array.prototype.slice.call(arguments));
  1052 + //console.log.apply(console, Array.prototype.slice.call(arguments));
  1053 + }
  1054 + }
  1055 +
  1056 + /**
  1057 + * @private
  1058 + */
  1059 + function debug() {
  1060 +
  1061 + logHistory.push(arguments);
  1062 +
  1063 + if ( cfg.debugLevel > 1 && window.console && window.console.log ) {
  1064 +
  1065 + console.log(Array.prototype.slice.call(arguments));
  1066 + //console.log.apply(console, Array.prototype.slice.call(arguments));
  1067 + }
  1068 + }
  1069 +
  1070 + /**
  1071 + * appends px to the value if it's a plain number
  1072 + * @private
  1073 + */
  1074 + function _appendPX(value) {
  1075 +
  1076 + if (/^[-+]?[0-9]+$/.test(value)) {
  1077 + value += "px";
  1078 + }
  1079 + return value;
  1080 + }
  1081 +
  1082 +
  1083 +
  1084 +
  1085 + var publicAPI = /** @lends UnityObject2.prototype */ {
  1086 +
  1087 + /**
  1088 + * Get Debug Level (0=Disabled)
  1089 + * @public
  1090 + * @return {Number} Debug Level
  1091 + */
  1092 + getLogHistory: function () {
  1093 +
  1094 + return logHistory; // JSON.stringify()
  1095 + },
  1096 +
  1097 +
  1098 + /**
  1099 + * Get configuration object
  1100 + * @public
  1101 + * @return {Object} cfg
  1102 + */
  1103 + getConfig: function () {
  1104 +
  1105 + return cfg; // JSON.stringify()
  1106 + },
  1107 +
  1108 +
  1109 + /**
  1110 + * @public
  1111 + * @return {Object} detailed info about OS and Browser.
  1112 + */
  1113 + getPlatformInfo: function () {
  1114 +
  1115 + return ua;
  1116 + },
  1117 +
  1118 +
  1119 + /**
  1120 + * Initialize plugin config and proceed with attempting to start the webplayer.
  1121 + * @public
  1122 + */
  1123 + initPlugin: function (targetEl, src) {
  1124 +
  1125 + cfg.targetEl = targetEl;
  1126 + cfg.src = src;
  1127 +
  1128 + debug('ua:', ua);
  1129 + //console.debug('initPlugin this:', this);
  1130 + this.detectUnity(this.handlePluginStatus);
  1131 + },
  1132 +
  1133 +
  1134 + /**
  1135 + * detects unity web player.
  1136 + * @public
  1137 + * callback - accepts two parameters.
  1138 + * first one contains "installed", "missing", "broken" or "unsupported" value.
  1139 + * second one returns requested unity versions. plugin version is included as well.
  1140 + * versions - optional array of unity versions to detect.
  1141 + */
  1142 + detectUnity: function (callback, versions) {
  1143 +
  1144 + // console.debug('detectUnity this:', this);
  1145 + var self = this;
  1146 +
  1147 + var status = kMissing;
  1148 + var data;
  1149 + nav.plugins.refresh();
  1150 +
  1151 + if (ua.clientBrand === "??" || ua.clientPlatform === "???" || ua.mobile ) {
  1152 + status = kUnsupported;
  1153 + } else if (ua.op && ua.mac) { // Opera on MAC is unsupported
  1154 +
  1155 + status = kUnsupported;
  1156 + data = "OPERA-MAC";
  1157 + } else if (
  1158 + typeof nav.plugins != "undefined"
  1159 + && nav.plugins[cfg.pluginName]
  1160 + && typeof nav.mimeTypes != "undefined"
  1161 + && nav.mimeTypes[cfg.pluginMimeType]
  1162 + && nav.mimeTypes[cfg.pluginMimeType].enabledPlugin
  1163 + ) {
  1164 +
  1165 + status = kInstalled;
  1166 +
  1167 + // make sure web player is compatible with 64-bit safari
  1168 + if (ua.sf && /Mac OS X 10_6/.test(nav.appVersion)) {
  1169 +
  1170 + _getPluginVersion(function (version) {
  1171 +
  1172 + if (!version || !version.plugin) {
  1173 +
  1174 + status = kBroken;
  1175 + data = "OSX10.6-SFx64";
  1176 + }
  1177 +
  1178 + _setPluginStatus(status, lastType, data);
  1179 + callback.call(self, status, version);
  1180 + }, versions);
  1181 +
  1182 + return;
  1183 + } else if (ua.mac && ua.ch) { // older versions have issues on chrome
  1184 +
  1185 + _getPluginVersion(function (version) {
  1186 +
  1187 + if (version && (_getNumericUnityVersion(version.plugin) <= _getNumericUnityVersion("2.6.1f3"))) {
  1188 + status = kBroken;
  1189 + data = "OSX-CH-U<=2.6.1f3";
  1190 + }
  1191 +
  1192 + _setPluginStatus(status, lastType, data);
  1193 + callback.call(self, status, version);
  1194 + }, versions);
  1195 +
  1196 + return;
  1197 + } else if (versions) {
  1198 +
  1199 + _getPluginVersion(function (version) {
  1200 +
  1201 + _setPluginStatus(status, lastType, data);
  1202 + callback.call(self, status, version);
  1203 + }, versions);
  1204 + return;
  1205 + }
  1206 + } else if (ua.ie) {
  1207 + var activeXSupported = false;
  1208 + try {
  1209 + if (ActiveXObject.prototype != null) {
  1210 + activeXSupported = true;
  1211 + }
  1212 + } catch(e) {}
  1213 +
  1214 + if (!activeXSupported) {
  1215 + status = kUnsupported;
  1216 + data = "ActiveXFailed";
  1217 + } else {
  1218 + status = kMissing;
  1219 + try {
  1220 + var uo = new ActiveXObject("UnityWebPlayer.UnityWebPlayer.1");
  1221 + var pv = uo.GetPluginVersion();
  1222 +
  1223 + if (versions) {
  1224 + var v = {};
  1225 + for (var i = 0; i < versions.length; ++i) {
  1226 + v[versions[i]] = uo.GetUnityVersion(versions[i]);
  1227 + }
  1228 + v.plugin = pv;
  1229 + }
  1230 +
  1231 + status = kInstalled;
  1232 + // 2.5.0 auto update has issues on vista and later
  1233 + if (pv == "2.5.0f5") {
  1234 + var m = /Windows NT \d+\.\d+/.exec(nav.userAgent);
  1235 + if (m && m.length > 0) {
  1236 + var wv = parseFloat(m[0].split(' ')[2]);
  1237 + if (wv >= 6) {
  1238 + status = kBroken;
  1239 + data = "WIN-U2.5.0f5";
  1240 + }
  1241 + }
  1242 + }
  1243 + } catch(e) {}
  1244 + }
  1245 + }
  1246 +
  1247 + _setPluginStatus(status, lastType, data);
  1248 + callback.call(self, status, v);
  1249 + },
  1250 +
  1251 +
  1252 +
  1253 + /**
  1254 + * @public
  1255 + * @return {Object} with info about Unity WebPlayer plugin status (not installed, loading, running etc..)
  1256 + */
  1257 + handlePluginStatus: function (status, versions) {
  1258 +
  1259 + // Store targetEl in the closure, to be able to get it back if setTimeout calls again.
  1260 + var targetEl = cfg.targetEl;
  1261 +
  1262 + var $targetEl = jQuery(targetEl);
  1263 +
  1264 + switch(status) {
  1265 +
  1266 + case kInstalled:
  1267 +
  1268 + // @todo add support for alternate custom handlers.
  1269 + this.notifyProgress($targetEl);
  1270 + this.embedPlugin($targetEl, cfg.callback);
  1271 + break;
  1272 +
  1273 + case kMissing:
  1274 +
  1275 + this.notifyProgress($targetEl);
  1276 + //this.installPlugin($targetEl);
  1277 +
  1278 + var self = this;
  1279 + var delayTime = (cfg.debugLevel === 0) ? 1000 : 8000;
  1280 +
  1281 + // Do a delay and re-check for plugin
  1282 + setTimeout(function () {
  1283 +
  1284 + cfg.targetEl = targetEl;
  1285 + self.detectUnity(self.handlePluginStatus);
  1286 + }, delayTime);
  1287 +
  1288 + break;
  1289 +
  1290 + case kBroken:
  1291 + // Browser needs to restart after install
  1292 + this.notifyProgress($targetEl);
  1293 + break;
  1294 +
  1295 + case kUnsupported:
  1296 +
  1297 + this.notifyProgress($targetEl);
  1298 + break;
  1299 + }
  1300 +
  1301 + },
  1302 +
  1303 + /**
  1304 + * @public
  1305 + * @return {Object} with detailed plugin info, version number and other info that can be retrieved from the plugin.
  1306 + */
  1307 + /*getPluginInfo: function () {
  1308 +
  1309 + },*/
  1310 +
  1311 + /**
  1312 + * @public
  1313 + */
  1314 + getPluginURL: function () {
  1315 +
  1316 + var url = "http://unity3d.com/webplayer/";
  1317 +
  1318 + if (ua.win) {
  1319 +
  1320 + url = cfg.baseDownloadUrl + _getWinInstall();
  1321 +
  1322 + } else if (nav.platform == "MacIntel") {
  1323 +
  1324 + url = cfg.baseDownloadUrl + (cfg.fullInstall ? "webplayer-i386.dmg" : "webplayer-mini.dmg");
  1325 +
  1326 + if (cfg.referrer !== null) {
  1327 +
  1328 + url += "?referrer=" + cfg.referrer;
  1329 + }
  1330 +
  1331 + } else if (nav.platform == "MacPPC") {
  1332 +
  1333 + url = cfg.baseDownloadUrl + (cfg.fullInstall ? "webplayer-ppc.dmg" : "webplayer-mini.dmg");
  1334 +
  1335 + if (cfg.referrer !== null) {
  1336 +
  1337 + url += "?referrer=" + cfg.referrer;
  1338 + }
  1339 + }
  1340 +
  1341 + return url;
  1342 + },
  1343 +
  1344 + /**
  1345 + * @public
  1346 + */
  1347 + getClickOnceURL: function () {
  1348 +
  1349 + return cfg.baseDownloadUrl + "3.0/co/UnityWebPlayer.application?installer=" + encodeURIComponent(cfg.baseDownloadUrl + _getWinInstall());
  1350 + },
  1351 +
  1352 + /**
  1353 + * Embed the plugin into the DOM.
  1354 + * @public
  1355 + */
  1356 + embedPlugin: function (targetEl, callback) {
  1357 +
  1358 + targetEl = jQuery(targetEl).empty();
  1359 +
  1360 + var src = cfg.src; //targetEl.data('src'),
  1361 + var width = cfg.width || "100%"; //TODO: extract those hardcoded values
  1362 + var height = cfg.height || "100%";
  1363 + var self = this;
  1364 +
  1365 + if (ua.win && ua.ie) {
  1366 + // ie, dom and object element do not mix & match
  1367 +
  1368 + var at = "";
  1369 +
  1370 + for (var i in cfg.attributes) {
  1371 + if (cfg.attributes[i] != Object.prototype[i]) {
  1372 + if (i.toLowerCase() == "styleclass") {
  1373 + at += ' class="' + cfg.attributes[i] + '"';
  1374 + }
  1375 + else if (i.toLowerCase() != "classid") {
  1376 + at += ' ' + i + '="' + cfg.attributes[i] + '"';
  1377 + }
  1378 + }
  1379 + }
  1380 +
  1381 + var pt = "";
  1382 +
  1383 + // we manually add SRC here, because its now defined on the target element.
  1384 + pt += '<param name="src" value="' + src + '" />';
  1385 + pt += '<param name="firstFrameCallback" value="UnityObject2.instances[' + instanceNumber + '].firstFrameCallback();" />';
  1386 +
  1387 + for (var i in cfg.params) {
  1388 +
  1389 + if (cfg.params[i] != Object.prototype[i]) {
  1390 +
  1391 + if (i.toLowerCase() != "classid") {
  1392 +
  1393 + pt += '<param name="' + i + '" value="' + cfg.params[i] + '" />';
  1394 + }
  1395 + }
  1396 + }
  1397 +
  1398 + //var tmpHtml = '<div id="' + targetEl.attr('id') + '" style="width: ' + _appendPX(width) + '; height: ' + _appendPX(height) + ';"><object classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" style="display: block; width: 100%; height: 100%;"' + at + '>' + pt + '</object></div>';
  1399 + var tmpHtml = '<object classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" style="display: block; width: ' + _appendPX(width) + '; height: ' + _appendPX(height) + ';"' + at + '>' + pt + '</object>';
  1400 + var $object = jQuery(tmpHtml);
  1401 + targetEl.append( $object );
  1402 + embeddedObjects.push( targetEl.attr('id') );
  1403 + unityObject = $object[0];
  1404 +
  1405 + } else {
  1406 +
  1407 + // Create and append embed element into DOM.
  1408 + var $embed = jQuery('<embed/>')
  1409 + .attr({
  1410 + src: src,
  1411 + type: cfg.pluginMimeType,
  1412 + width: width,
  1413 + height: height,
  1414 + firstFrameCallback: 'UnityObject2.instances[' + instanceNumber + '].firstFrameCallback();'
  1415 + })
  1416 + .attr(cfg.attributes)
  1417 + .attr(cfg.params)
  1418 + .css({
  1419 + display: 'block',
  1420 + width: _appendPX(width),
  1421 + height: _appendPX(height)
  1422 + })
  1423 + .appendTo( targetEl );
  1424 + unityObject = $embed[0];
  1425 + }
  1426 +
  1427 + //Auto focus the new object/embed, so players dont have to click it before using it.
  1428 + //setTimeout is here to workaround a chrome bug.
  1429 + //we should not invoke focus on safari on mac. it causes some Input bugs.
  1430 + if (!ua.sf || !ua.mac) {
  1431 + setTimeout(function() {
  1432 + unityObject.focus();
  1433 + }, 100);
  1434 + }
  1435 +
  1436 + if (callback) {
  1437 +
  1438 + callback();
  1439 + }
  1440 + },
  1441 +
  1442 + /**
  1443 + * Determine which installation method to use on the current platform, and return an array with their identifiers (i.e. 'ClickOnceIE', 'JavaInstall', 'Manual')
  1444 + * Take into account which previous methods might have been attempted (and failed) and skip to next best method.
  1445 + * @public
  1446 + * @return {String}
  1447 + */
  1448 + getBestInstallMethod: function () {
  1449 +
  1450 + // Always fall back to good old manual (download) install.
  1451 + var method = 'Manual';
  1452 +
  1453 + //We only have manual install for 64bit plugin so far.
  1454 + if (ua.x64)
  1455 + return method;
  1456 +
  1457 + // Is Java available and not yet attempted?
  1458 + if (cfg.enableJava && ua.java && triedJavaInstall === false) {
  1459 +
  1460 + method = 'JavaInstall';
  1461 + }
  1462 + // Is ClickOnce available and not yet attempted?
  1463 + else if (cfg.enableClickOnce && ua.co && triedClickOnce === false) {
  1464 +
  1465 + method = 'ClickOnceIE';
  1466 + }
  1467 +
  1468 + return method;
  1469 + },
  1470 +
  1471 + /**
  1472 + * Tries to install the plugin using the specified method.
  1473 + * If no method is passed, it will try to use this.getBestInstallMethod()
  1474 + * @public
  1475 + * @param {String} method The desired install method
  1476 + */
  1477 + installPlugin: function(method) {
  1478 + if (method == null || method == undefined) {
  1479 + method = this.getBestInstallMethod();
  1480 + }
  1481 +
  1482 + var urlToOpen = null;
  1483 + switch(method) {
  1484 +
  1485 + case "JavaInstall":
  1486 + this.doJavaInstall(cfg.targetEl.id);
  1487 + break;
  1488 + case "ClickOnceIE":
  1489 + triedClickOnce = true;
  1490 + _setSessionCookie(triedClickOnceCookie, triedClickOnce);
  1491 + var $iframe = jQuery("<iframe src='" + this.getClickOnceURL() + "' style='display:none;' />");
  1492 + jQuery(cfg.targetEl).append($iframe);
  1493 + break;
  1494 + default:
  1495 + case "Manual":
  1496 + //doc.location = this.getPluginURL();
  1497 + //urlToOpen = this.getPluginURL();
  1498 + var $iframe = jQuery("<iframe src='" + this.getPluginURL() + "' style='display:none;' />");
  1499 + jQuery(cfg.targetEl).append($iframe);
  1500 + break;
  1501 + }
  1502 +
  1503 + lastType = method;
  1504 + _an.send(kStart, method, null, null);
  1505 +
  1506 + },
  1507 +
  1508 + /**
  1509 + * Trigger event using jQuery(document).trigger()
  1510 + * @public
  1511 + */
  1512 + //TODO: verify its use.
  1513 + trigger: function (event, params) {
  1514 +
  1515 + if (params) {
  1516 +
  1517 + debug('trigger("' + event + '")', params);
  1518 +
  1519 + } else {
  1520 +
  1521 + debug('trigger("' + event + '")');
  1522 + }
  1523 +
  1524 + jQuery(document).trigger(event, params);
  1525 + },
  1526 +
  1527 + /**
  1528 + * Notify observers about onProgress event
  1529 + * @public
  1530 + */
  1531 + notifyProgress: function (targetEl) {
  1532 +
  1533 + //debug('*** notifyProgress ***')
  1534 +
  1535 + if (typeof progressCallback !== "undefined" && typeof progressCallback === "function") {
  1536 +
  1537 + var payload = {
  1538 +
  1539 + ua: ua,
  1540 + pluginStatus: pluginStatus,
  1541 + bestMethod: null,
  1542 + lastType: lastType,
  1543 + targetEl: cfg.targetEl,
  1544 + unityObj: this
  1545 + };
  1546 +
  1547 + if (pluginStatus === kMissing) {
  1548 +
  1549 + payload.bestMethod = this.getBestInstallMethod();
  1550 + }
  1551 +
  1552 + if (latestStatus !== pluginStatus) { //Execute only on state change
  1553 + latestStatus = pluginStatus;
  1554 +
  1555 + progressCallback(payload);
  1556 + }
  1557 + }
  1558 + },
  1559 +
  1560 + /**
  1561 + * Subscribe to onProgress notification
  1562 + * @public
  1563 + */
  1564 + observeProgress: function (callback) {
  1565 +
  1566 + progressCallback = callback;
  1567 + },
  1568 +
  1569 +
  1570 + /**
  1571 + * Callback made by the WebPlayer plugin when the first frame is rendered.
  1572 + * @public
  1573 + */
  1574 + firstFrameCallback : function () {
  1575 +
  1576 + debug('*** firstFrameCallback (' + instanceNumber + ') ***');
  1577 + pluginStatus = kFirst;
  1578 + this.notifyProgress();
  1579 +
  1580 + /*
  1581 + // What?
  1582 + if (status == kFirst) {
  1583 + if (pluginStatus == null) {
  1584 + return;
  1585 + }
  1586 + }
  1587 + */
  1588 +
  1589 + //Webplayer was already installed.
  1590 + //Should only log firstframes if it happened after a install.
  1591 + if (wasMissing === true) {
  1592 + _an.send(pluginStatus, lastType);
  1593 + }
  1594 +
  1595 + //setRunStatus(kFirst, lastType);
  1596 + },
  1597 +
  1598 + /**
  1599 + * Get a string from a session cookie or SessionStorage
  1600 + * @public
  1601 + * @return {String}
  1602 + */
  1603 + /*getSessionString: function (key) {
  1604 +
  1605 + },*/
  1606 +
  1607 + /**
  1608 + * Set a string via a session cookie or SessionStorage
  1609 + * @public
  1610 + */
  1611 + /* setSessionString: function (key, value) {
  1612 +
  1613 + },*/
  1614 +
  1615 + /**
  1616 + * Get a string from a persistent cookie
  1617 + * @public
  1618 + * @return {String}
  1619 + */
  1620 + /*getCookie: function (key) {
  1621 +
  1622 + },*/
  1623 +
  1624 + /**
  1625 + * Set a string to a persistent cookie
  1626 + * @public
  1627 + */
  1628 + /*setCookie: function (key, value, expiryDate) {
  1629 +
  1630 + },*/
  1631 +
  1632 + /**
  1633 + * Exposed private function
  1634 + * @public
  1635 + */
  1636 + setPluginStatus: function (status, type, data, url) {
  1637 +
  1638 + _setPluginStatus(status, type, data, url);
  1639 + },
  1640 +
  1641 + /**
  1642 + * Exposed private function
  1643 + * @public
  1644 + */
  1645 + doJavaInstall : function (id) {
  1646 +
  1647 + _doJavaInstall(id);
  1648 + },
  1649 +
  1650 + /**
  1651 + * Exposed private function
  1652 + * @public
  1653 + */
  1654 + jvmPreloaded : function (id) {
  1655 +
  1656 + _jvmPreloaded(id);
  1657 + },
  1658 +
  1659 + /**
  1660 + * Exposed private function
  1661 + * @public
  1662 + */
  1663 + appletStarted : function (id) {
  1664 +
  1665 + _appletStarted(id);
  1666 + },
  1667 +
  1668 + /**
  1669 + * Exposed private function
  1670 + * @public
  1671 + */
  1672 + javaInstallDoneCallback : function (id, success, errormessage) {
  1673 +
  1674 + _javaInstallDoneCallback(id, success, errormessage);
  1675 + },
  1676 +
  1677 + getUnity: function() {
  1678 + return unityObject;
  1679 + }
  1680 + }
  1681 +
  1682 + // Internal store of each instance.
  1683 + instanceNumber = UnityObject2.instances.length;
  1684 + UnityObject2.instances.push(publicAPI);
  1685 +
  1686 + return publicAPI;
  1687 +
  1688 +};
  1689 +
  1690 +/**
  1691 + * @static
  1692 + **/
  1693 +UnityObject2.instances = [];
0 1694 \ No newline at end of file
... ...
vendor/assets/javascripts/handlebars.runtime-v1.3.0.js 0 → 100644
... ... @@ -0,0 +1,530 @@
  1 +/*!
  2 +
  3 + handlebars v1.3.0
  4 +
  5 +Copyright (C) 2011 by Yehuda Katz
  6 +
  7 +Permission is hereby granted, free of charge, to any person obtaining a copy
  8 +of this software and associated documentation files (the "Software"), to deal
  9 +in the Software without restriction, including without limitation the rights
  10 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11 +copies of the Software, and to permit persons to whom the Software is
  12 +furnished to do so, subject to the following conditions:
  13 +
  14 +The above copyright notice and this permission notice shall be included in
  15 +all copies or substantial portions of the Software.
  16 +
  17 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23 +THE SOFTWARE.
  24 +
  25 +@license
  26 +*/
  27 +/* exported Handlebars */
  28 +var Handlebars = (function() {
  29 +// handlebars/safe-string.js
  30 +var __module3__ = (function() {
  31 + "use strict";
  32 + var __exports__;
  33 + // Build out our basic SafeString type
  34 + function SafeString(string) {
  35 + this.string = string;
  36 + }
  37 +
  38 + SafeString.prototype.toString = function() {
  39 + return "" + this.string;
  40 + };
  41 +
  42 + __exports__ = SafeString;
  43 + return __exports__;
  44 +})();
  45 +
  46 +// handlebars/utils.js
  47 +var __module2__ = (function(__dependency1__) {
  48 + "use strict";
  49 + var __exports__ = {};
  50 + /*jshint -W004 */
  51 + var SafeString = __dependency1__;
  52 +
  53 + var escape = {
  54 + "&": "&amp;",
  55 + "<": "&lt;",
  56 + ">": "&gt;",
  57 + '"': "&quot;",
  58 + "'": "&#x27;",
  59 + "`": "&#x60;"
  60 + };
  61 +
  62 + var badChars = /[&<>"'`]/g;
  63 + var possible = /[&<>"'`]/;
  64 +
  65 + function escapeChar(chr) {
  66 + return escape[chr] || "&amp;";
  67 + }
  68 +
  69 + function extend(obj, value) {
  70 + for(var key in value) {
  71 + if(Object.prototype.hasOwnProperty.call(value, key)) {
  72 + obj[key] = value[key];
  73 + }
  74 + }
  75 + }
  76 +
  77 + __exports__.extend = extend;var toString = Object.prototype.toString;
  78 + __exports__.toString = toString;
  79 + // Sourced from lodash
  80 + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
  81 + var isFunction = function(value) {
  82 + return typeof value === 'function';
  83 + };
  84 + // fallback for older versions of Chrome and Safari
  85 + if (isFunction(/x/)) {
  86 + isFunction = function(value) {
  87 + return typeof value === 'function' && toString.call(value) === '[object Function]';
  88 + };
  89 + }
  90 + var isFunction;
  91 + __exports__.isFunction = isFunction;
  92 + var isArray = Array.isArray || function(value) {
  93 + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
  94 + };
  95 + __exports__.isArray = isArray;
  96 +
  97 + function escapeExpression(string) {
  98 + // don't escape SafeStrings, since they're already safe
  99 + if (string instanceof SafeString) {
  100 + return string.toString();
  101 + } else if (!string && string !== 0) {
  102 + return "";
  103 + }
  104 +
  105 + // Force a string conversion as this will be done by the append regardless and
  106 + // the regex test will do this transparently behind the scenes, causing issues if
  107 + // an object's to string has escaped characters in it.
  108 + string = "" + string;
  109 +
  110 + if(!possible.test(string)) { return string; }
  111 + return string.replace(badChars, escapeChar);
  112 + }
  113 +
  114 + __exports__.escapeExpression = escapeExpression;function isEmpty(value) {
  115 + if (!value && value !== 0) {
  116 + return true;
  117 + } else if (isArray(value) && value.length === 0) {
  118 + return true;
  119 + } else {
  120 + return false;
  121 + }
  122 + }
  123 +
  124 + __exports__.isEmpty = isEmpty;
  125 + return __exports__;
  126 +})(__module3__);
  127 +
  128 +// handlebars/exception.js
  129 +var __module4__ = (function() {
  130 + "use strict";
  131 + var __exports__;
  132 +
  133 + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
  134 +
  135 + function Exception(message, node) {
  136 + var line;
  137 + if (node && node.firstLine) {
  138 + line = node.firstLine;
  139 +
  140 + message += ' - ' + line + ':' + node.firstColumn;
  141 + }
  142 +
  143 + var tmp = Error.prototype.constructor.call(this, message);
  144 +
  145 + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
  146 + for (var idx = 0; idx < errorProps.length; idx++) {
  147 + this[errorProps[idx]] = tmp[errorProps[idx]];
  148 + }
  149 +
  150 + if (line) {
  151 + this.lineNumber = line;
  152 + this.column = node.firstColumn;
  153 + }
  154 + }
  155 +
  156 + Exception.prototype = new Error();
  157 +
  158 + __exports__ = Exception;
  159 + return __exports__;
  160 +})();
  161 +
  162 +// handlebars/base.js
  163 +var __module1__ = (function(__dependency1__, __dependency2__) {
  164 + "use strict";
  165 + var __exports__ = {};
  166 + var Utils = __dependency1__;
  167 + var Exception = __dependency2__;
  168 +
  169 + var VERSION = "1.3.0";
  170 + __exports__.VERSION = VERSION;var COMPILER_REVISION = 4;
  171 + __exports__.COMPILER_REVISION = COMPILER_REVISION;
  172 + var REVISION_CHANGES = {
  173 + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
  174 + 2: '== 1.0.0-rc.3',
  175 + 3: '== 1.0.0-rc.4',
  176 + 4: '>= 1.0.0'
  177 + };
  178 + __exports__.REVISION_CHANGES = REVISION_CHANGES;
  179 + var isArray = Utils.isArray,
  180 + isFunction = Utils.isFunction,
  181 + toString = Utils.toString,
  182 + objectType = '[object Object]';
  183 +
  184 + function HandlebarsEnvironment(helpers, partials) {
  185 + this.helpers = helpers || {};
  186 + this.partials = partials || {};
  187 +
  188 + registerDefaultHelpers(this);
  189 + }
  190 +
  191 + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
  192 + constructor: HandlebarsEnvironment,
  193 +
  194 + logger: logger,
  195 + log: log,
  196 +
  197 + registerHelper: function(name, fn, inverse) {
  198 + if (toString.call(name) === objectType) {
  199 + if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); }
  200 + Utils.extend(this.helpers, name);
  201 + } else {
  202 + if (inverse) { fn.not = inverse; }
  203 + this.helpers[name] = fn;
  204 + }
  205 + },
  206 +
  207 + registerPartial: function(name, str) {
  208 + if (toString.call(name) === objectType) {
  209 + Utils.extend(this.partials, name);
  210 + } else {
  211 + this.partials[name] = str;
  212 + }
  213 + }
  214 + };
  215 +
  216 + function registerDefaultHelpers(instance) {
  217 + instance.registerHelper('helperMissing', function(arg) {
  218 + if(arguments.length === 2) {
  219 + return undefined;
  220 + } else {
  221 + throw new Exception("Missing helper: '" + arg + "'");
  222 + }
  223 + });
  224 +
  225 + instance.registerHelper('blockHelperMissing', function(context, options) {
  226 + var inverse = options.inverse || function() {}, fn = options.fn;
  227 +
  228 + if (isFunction(context)) { context = context.call(this); }
  229 +
  230 + if(context === true) {
  231 + return fn(this);
  232 + } else if(context === false || context == null) {
  233 + return inverse(this);
  234 + } else if (isArray(context)) {
  235 + if(context.length > 0) {
  236 + return instance.helpers.each(context, options);
  237 + } else {
  238 + return inverse(this);
  239 + }
  240 + } else {
  241 + return fn(context);
  242 + }
  243 + });
  244 +
  245 + instance.registerHelper('each', function(context, options) {
  246 + var fn = options.fn, inverse = options.inverse;
  247 + var i = 0, ret = "", data;
  248 +
  249 + if (isFunction(context)) { context = context.call(this); }
  250 +
  251 + if (options.data) {
  252 + data = createFrame(options.data);
  253 + }
  254 +
  255 + if(context && typeof context === 'object') {
  256 + if (isArray(context)) {
  257 + for(var j = context.length; i<j; i++) {
  258 + if (data) {
  259 + data.index = i;
  260 + data.first = (i === 0);
  261 + data.last = (i === (context.length-1));
  262 + }
  263 + ret = ret + fn(context[i], { data: data });
  264 + }
  265 + } else {
  266 + for(var key in context) {
  267 + if(context.hasOwnProperty(key)) {
  268 + if(data) {
  269 + data.key = key;
  270 + data.index = i;
  271 + data.first = (i === 0);
  272 + }
  273 + ret = ret + fn(context[key], {data: data});
  274 + i++;
  275 + }
  276 + }
  277 + }
  278 + }
  279 +
  280 + if(i === 0){
  281 + ret = inverse(this);
  282 + }
  283 +
  284 + return ret;
  285 + });
  286 +
  287 + instance.registerHelper('if', function(conditional, options) {
  288 + if (isFunction(conditional)) { conditional = conditional.call(this); }
  289 +
  290 + // Default behavior is to render the positive path if the value is truthy and not empty.
  291 + // The `includeZero` option may be set to treat the condtional as purely not empty based on the
  292 + // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
  293 + if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
  294 + return options.inverse(this);
  295 + } else {
  296 + return options.fn(this);
  297 + }
  298 + });
  299 +
  300 + instance.registerHelper('unless', function(conditional, options) {
  301 + return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
  302 + });
  303 +
  304 + instance.registerHelper('with', function(context, options) {
  305 + if (isFunction(context)) { context = context.call(this); }
  306 +
  307 + if (!Utils.isEmpty(context)) return options.fn(context);
  308 + });
  309 +
  310 + instance.registerHelper('log', function(context, options) {
  311 + var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
  312 + instance.log(level, context);
  313 + });
  314 + }
  315 +
  316 + var logger = {
  317 + methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
  318 +
  319 + // State enum
  320 + DEBUG: 0,
  321 + INFO: 1,
  322 + WARN: 2,
  323 + ERROR: 3,
  324 + level: 3,
  325 +
  326 + // can be overridden in the host environment
  327 + log: function(level, obj) {
  328 + if (logger.level <= level) {
  329 + var method = logger.methodMap[level];
  330 + if (typeof console !== 'undefined' && console[method]) {
  331 + console[method].call(console, obj);
  332 + }
  333 + }
  334 + }
  335 + };
  336 + __exports__.logger = logger;
  337 + function log(level, obj) { logger.log(level, obj); }
  338 +
  339 + __exports__.log = log;var createFrame = function(object) {
  340 + var obj = {};
  341 + Utils.extend(obj, object);
  342 + return obj;
  343 + };
  344 + __exports__.createFrame = createFrame;
  345 + return __exports__;
  346 +})(__module2__, __module4__);
  347 +
  348 +// handlebars/runtime.js
  349 +var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
  350 + "use strict";
  351 + var __exports__ = {};
  352 + var Utils = __dependency1__;
  353 + var Exception = __dependency2__;
  354 + var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
  355 + var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
  356 +
  357 + function checkRevision(compilerInfo) {
  358 + var compilerRevision = compilerInfo && compilerInfo[0] || 1,
  359 + currentRevision = COMPILER_REVISION;
  360 +
  361 + if (compilerRevision !== currentRevision) {
  362 + if (compilerRevision < currentRevision) {
  363 + var runtimeVersions = REVISION_CHANGES[currentRevision],
  364 + compilerVersions = REVISION_CHANGES[compilerRevision];
  365 + throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
  366 + "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
  367 + } else {
  368 + // Use the embedded version info since the runtime doesn't know about this revision yet
  369 + throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
  370 + "Please update your runtime to a newer version ("+compilerInfo[1]+").");
  371 + }
  372 + }
  373 + }
  374 +
  375 + __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
  376 +
  377 + function template(templateSpec, env) {
  378 + if (!env) {
  379 + throw new Exception("No environment passed to template");
  380 + }
  381 +
  382 + // Note: Using env.VM references rather than local var references throughout this section to allow
  383 + // for external users to override these as psuedo-supported APIs.
  384 + var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
  385 + var result = env.VM.invokePartial.apply(this, arguments);
  386 + if (result != null) { return result; }
  387 +
  388 + if (env.compile) {
  389 + var options = { helpers: helpers, partials: partials, data: data };
  390 + partials[name] = env.compile(partial, { data: data !== undefined }, env);
  391 + return partials[name](context, options);
  392 + } else {
  393 + throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
  394 + }
  395 + };
  396 +
  397 + // Just add water
  398 + var container = {
  399 + escapeExpression: Utils.escapeExpression,
  400 + invokePartial: invokePartialWrapper,
  401 + programs: [],
  402 + program: function(i, fn, data) {
  403 + var programWrapper = this.programs[i];
  404 + if(data) {
  405 + programWrapper = program(i, fn, data);
  406 + } else if (!programWrapper) {
  407 + programWrapper = this.programs[i] = program(i, fn);
  408 + }
  409 + return programWrapper;
  410 + },
  411 + merge: function(param, common) {
  412 + var ret = param || common;
  413 +
  414 + if (param && common && (param !== common)) {
  415 + ret = {};
  416 + Utils.extend(ret, common);
  417 + Utils.extend(ret, param);
  418 + }
  419 + return ret;
  420 + },
  421 + programWithDepth: env.VM.programWithDepth,
  422 + noop: env.VM.noop,
  423 + compilerInfo: null
  424 + };
  425 +
  426 + return function(context, options) {
  427 + options = options || {};
  428 + var namespace = options.partial ? options : env,
  429 + helpers,
  430 + partials;
  431 +
  432 + if (!options.partial) {
  433 + helpers = options.helpers;
  434 + partials = options.partials;
  435 + }
  436 + var result = templateSpec.call(
  437 + container,
  438 + namespace, context,
  439 + helpers,
  440 + partials,
  441 + options.data);
  442 +
  443 + if (!options.partial) {
  444 + env.VM.checkRevision(container.compilerInfo);
  445 + }
  446 +
  447 + return result;
  448 + };
  449 + }
  450 +
  451 + __exports__.template = template;function programWithDepth(i, fn, data /*, $depth */) {
  452 + var args = Array.prototype.slice.call(arguments, 3);
  453 +
  454 + var prog = function(context, options) {
  455 + options = options || {};
  456 +
  457 + return fn.apply(this, [context, options.data || data].concat(args));
  458 + };
  459 + prog.program = i;
  460 + prog.depth = args.length;
  461 + return prog;
  462 + }
  463 +
  464 + __exports__.programWithDepth = programWithDepth;function program(i, fn, data) {
  465 + var prog = function(context, options) {
  466 + options = options || {};
  467 +
  468 + return fn(context, options.data || data);
  469 + };
  470 + prog.program = i;
  471 + prog.depth = 0;
  472 + return prog;
  473 + }
  474 +
  475 + __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {
  476 + var options = { partial: true, helpers: helpers, partials: partials, data: data };
  477 +
  478 + if(partial === undefined) {
  479 + throw new Exception("The partial " + name + " could not be found");
  480 + } else if(partial instanceof Function) {
  481 + return partial(context, options);
  482 + }
  483 + }
  484 +
  485 + __exports__.invokePartial = invokePartial;function noop() { return ""; }
  486 +
  487 + __exports__.noop = noop;
  488 + return __exports__;
  489 +})(__module2__, __module4__, __module1__);
  490 +
  491 +// handlebars.runtime.js
  492 +var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
  493 + "use strict";
  494 + var __exports__;
  495 + /*globals Handlebars: true */
  496 + var base = __dependency1__;
  497 +
  498 + // Each of these augment the Handlebars object. No need to setup here.
  499 + // (This is done to easily share code between commonjs and browse envs)
  500 + var SafeString = __dependency2__;
  501 + var Exception = __dependency3__;
  502 + var Utils = __dependency4__;
  503 + var runtime = __dependency5__;
  504 +
  505 + // For compatibility and usage outside of module systems, make the Handlebars object a namespace
  506 + var create = function() {
  507 + var hb = new base.HandlebarsEnvironment();
  508 +
  509 + Utils.extend(hb, base);
  510 + hb.SafeString = SafeString;
  511 + hb.Exception = Exception;
  512 + hb.Utils = Utils;
  513 +
  514 + hb.VM = runtime;
  515 + hb.template = function(spec) {
  516 + return runtime.template(spec, hb);
  517 + };
  518 +
  519 + return hb;
  520 + };
  521 +
  522 + var Handlebars = create();
  523 + Handlebars.create = create;
  524 +
  525 + __exports__ = Handlebars;
  526 + return __exports__;
  527 +})(__module1__, __module3__, __module4__, __module2__, __module5__);
  528 +
  529 + return __module0__;
  530 +})();
... ...
vendor/assets/javascripts/wikilibras.js 0 → 100644
... ... @@ -0,0 +1,1880 @@
  1 +jQuery(function($) { $.extend({
  2 + form: function(url, data, method) {
  3 + if (method == null) method = 'POST';
  4 + if (data == null) data = {};
  5 +
  6 + var form = $('<form>').attr({
  7 + method: method,
  8 + action: url
  9 + }).css({
  10 + display: 'none'
  11 + });
  12 +
  13 + var addData = function(name, data) {
  14 + if ($.isArray(data)) {
  15 + for (var i = 0; i < data.length; i++) {
  16 + var value = data[i];
  17 + addData(name + '[]', value);
  18 + }
  19 + } else if (typeof data === 'object') {
  20 + for (var key in data) {
  21 + if (data.hasOwnProperty(key)) {
  22 + addData(name + '[' + key + ']', data[key]);
  23 + }
  24 + }
  25 + } else if (data != null) {
  26 + form.append($('<input>').attr({
  27 + type: 'hidden',
  28 + name: String(name),
  29 + value: String(data)
  30 + }));
  31 + }
  32 + };
  33 +
  34 + for (var key in data) {
  35 + if (data.hasOwnProperty(key)) {
  36 + addData(key, data[key]);
  37 + }
  38 + }
  39 +
  40 + return form.appendTo('body');
  41 + }
  42 +}); });
  43 +
  44 +
  45 +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  46 +(function (global){
  47 +/************
  48 +* Templates *
  49 +*************/
  50 +var wlRegisterTpl = require('./templates/wlRegisterTpl');
  51 +var wlChoiceTpl = require('./templates/wlChoiceTpl');
  52 +var wlMainTpl = require('./templates/wlMainTpl');
  53 +var wlChoiceTpl = require('./templates/wlChoiceTpl');
  54 +
  55 +/*******
  56 +* Core *
  57 +********/
  58 +var wlGlobalObjectLogic = require('./core/wlGlobalObject');
  59 +var wlRegisterLogic = require('./core/wlRegister');
  60 +var wlMainLogic = require('./core/wlMain');
  61 +var wlChoiceLogic = require('./core/wlChoice');
  62 +
  63 +/************
  64 +* Instances *
  65 +*************/
  66 +
  67 +var rF, cF, mF;
  68 +
  69 +/*** BEGIN ***/
  70 +
  71 +buildRegisterFrame(); // Build
  72 +
  73 +$('#registerContainer').find('.configurarSinal > button').click(function(e) {
  74 + buildGlobalConfig(); // Build
  75 +
  76 + buildChoiceFrame(); // Build
  77 +
  78 + $('body').on('click', 'polygon:nth-of-type(1)', function(e) {
  79 + configMainFrame(0);
  80 + buildMainFrame();
  81 + });
  82 +
  83 + $('body').on('click', 'polygon:nth-of-type(2)', function(e) {
  84 + configMainFrame(1);
  85 + buildMainFrame();
  86 + });
  87 +
  88 + $('body').on('click', 'polygon:nth-of-type(3)', function(e) {
  89 + configMainFrame(2);
  90 + buildMainFrame();
  91 + });
  92 +});
  93 +
  94 +$('body').on('click', '.continuar', function(e) {
  95 + removeTemplate($('#mainContainer'));
  96 + insertTemplate(Handlebars.templates.wlChoiceTpl());
  97 +
  98 + cF = null;
  99 + cF = new wlChoiceLogic.choiceFrame();
  100 + cF.run();
  101 +});
  102 +
  103 +$('body').on('click', '.gerar', function(e) {
  104 + /* $.ajax({
  105 + type: 'POST',
  106 + url: $(location).attr('href'),
  107 + // url: 'http://0.0.0.0:9000/signal',
  108 + data: wlGlobalConfig.getSignalObject()
  109 + }).done(function(data) {
  110 + console.log(data);
  111 + }); */
  112 +
  113 + var object = { 'sign' : wlGlobalConfig.getSignalObject() };
  114 + object.authenticity_token = $("meta[name='csrf-token']").attr("content");
  115 +
  116 + $.form($(location).attr('href'), object).submit();
  117 +
  118 + console.log(wlGlobalConfig.getSignalObject());
  119 +});
  120 +
  121 +/*** END ***/
  122 +
  123 +/*** Configuration of the Main Frame ***/
  124 +
  125 +function configMainFrame(index) {
  126 + var currentConfigLabels = ['expression', 'rightHand', 'leftHand'];
  127 +
  128 + wlGlobalConfig.setCurrentConfig(currentConfigLabels[index]);
  129 + configQuantityOfTabsAndPanels();
  130 + wlGlobalConfig.setFirstChoice(false);
  131 +};
  132 +
  133 +function configQuantityOfTabsAndPanels() {
  134 + if (wlGlobalConfig.getCurrentConfig() === 'expression') {
  135 + wlGlobalConfig.setQuantityOfTimelineBlocks(1);
  136 + wlGlobalConfig.setQuantityOfTabsAndPanels(1);
  137 + wlGlobalConfig.setPanelLabels(['Expressão Facial']);
  138 + wlGlobalConfig.setTabsLabels(['Expressão']);
  139 + return;
  140 + }
  141 +
  142 + if ((wlGlobalConfig.getCurrentConfig() === 'rightHand') || (wlGlobalConfig.getCurrentConfig() === 'leftHand')) {
  143 + if ((wlGlobalConfig.getTipoMov() === 'circular') || (wlGlobalConfig.getTipoMov() === 'semicircular')) {
  144 + if (wlGlobalConfig.getTipoMov() === 'semicircular') {
  145 + wlGlobalConfig.setQuantityOfTimelineBlocks(8);
  146 + } else if (wlGlobalConfig.getTipoMov() === 'circular') {
  147 + wlGlobalConfig.setQuantityOfTimelineBlocks(7);
  148 + }
  149 +
  150 + wlGlobalConfig.setQuantityOfTabsAndPanels(4);
  151 + wlGlobalConfig.setPanelLabels(['Configurações Iniciais', 'Configuração dos Dedos', 'Configuração da Palma da Mão', 'Localização do Movimento']);
  152 + wlGlobalConfig.setTabsLabels(['Iniciais', 'Dedos', 'Palma da Mão', 'Localização']);
  153 + } else if ((wlGlobalConfig.getTipoMov() === 'retilineo') || (wlGlobalConfig.getTipoMov() === 'pontual')) {
  154 + wlGlobalConfig.setQuantityOfTimelineBlocks(4);
  155 + wlGlobalConfig.setQuantityOfTabsAndPanels(3);
  156 + wlGlobalConfig.setPanelLabels(['Configuração dos Dedos', 'Configuração da Palma da Mão', 'Localização do Movimento']);
  157 + wlGlobalConfig.setTabsLabels(['Dedos', 'Palma da Mão', 'Localização']);
  158 + }
  159 + }
  160 +};
  161 +
  162 +/*** Build Functions ***/
  163 +
  164 +function buildRegisterFrame() {
  165 + insertTemplate(Handlebars.templates.wlRegisterTpl());
  166 +
  167 + rF = new wlRegisterLogic.registerFrame();
  168 + rF.run();
  169 +};
  170 +
  171 +function buildChoiceFrame() {
  172 + removeTemplate($('#registerContainer'));
  173 + insertTemplate(Handlebars.templates.wlChoiceTpl());
  174 +
  175 + cF = new wlChoiceLogic.choiceFrame();
  176 + cF.run();
  177 +};
  178 +
  179 +function buildMainFrame() {
  180 + removeTemplate($('#choiceContainer'));
  181 + insertTemplate(Handlebars.templates.wlMainTpl());
  182 +
  183 + mF = new wlMainLogic.mainFrame();
  184 + mF.run();
  185 +};
  186 +
  187 +function buildGlobalConfig() {
  188 + global.wlGlobalConfig = new wlGlobalObjectLogic.globalConfig();
  189 + global.wlGlobalConfig.run(rF.getParams());
  190 +};
  191 +
  192 +/*** Template Functions ***/
  193 +
  194 +function insertTemplate(template) {
  195 + $('body').prepend(template);
  196 +};
  197 +
  198 +function removeTemplate(template) {
  199 + template.remove();
  200 +};
  201 +}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  202 +},{"./core/wlChoice":2,"./core/wlGlobalObject":3,"./core/wlMain":4,"./core/wlRegister":5,"./templates/wlChoiceTpl":6,"./templates/wlMainTpl":7,"./templates/wlRegisterTpl":8}],2:[function(require,module,exports){
  203 +(function (global){
  204 +var choiceFrame = function() {
  205 +
  206 + /* Function Scope */
  207 + var self = this;
  208 +
  209 + /* Main Variables */
  210 + var choiceContainer;
  211 +
  212 + function _init() {
  213 + self.choiceContainer = $('#choiceContainer');
  214 + };
  215 +
  216 + function _finishChoice(start, end) {
  217 + for (var i = start; i < (end + 1); i++) {
  218 + self.choiceContainer.find('polygon:nth-of-type('+ i +')').attr('class', 'done');
  219 + }
  220 + };
  221 +
  222 + function _activeChoice(start, end) {
  223 + for (var i = start; i < (end + 1); i++)
  224 + self.choiceContainer.find('polygon:nth-of-type('+ i +')').attr('class', 'active');
  225 + };
  226 +
  227 + function _disableChoice(index) {
  228 + self.choiceContainer.find('polygon:nth-of-type('+ index +')').attr('class', 'disabled');
  229 + self.choiceContainer.find('polygon:nth-of-type('+ index +')').unbind('mouseenter');
  230 + };
  231 +
  232 + function _unbindHoverEvent(start, end) {
  233 + for (var i = start; i < (end + 1); i++)
  234 + self.choiceContainer.find('polygon:nth-of-type('+ i +')').unbind('mouseenter');
  235 + };
  236 +
  237 + /* Active choices at the first iteration */
  238 + function _setActiveChoices() {
  239 +
  240 + var globalConfig = global.wlGlobalConfig;
  241 +
  242 + if (!globalConfig.getFirstChoice())
  243 + return;
  244 +
  245 + if (globalConfig.getQuantMaos() === 'uma') {
  246 + _activeChoice(1, 2);
  247 + _disableChoice(3);
  248 + } else if (globalConfig.getQuantMaos() === 'duas') {
  249 + _activeChoice(1, 3);
  250 + }
  251 + };
  252 +
  253 + /* Active choices after the first iteration */
  254 + function _updateChoices() {
  255 + var globalConfig = global.wlGlobalConfig;
  256 +
  257 + if (globalConfig.getFirstChoice())
  258 + return;
  259 +
  260 + if (globalConfig.getQuantMaos() === 'uma') {
  261 + if (globalConfig.isExpressionSet()) {
  262 + _finishChoice(1, 1);
  263 + _unbindHoverEvent(1, 1);
  264 + _activeChoice(2, 2);
  265 + } else if (globalConfig.isRightHandSet()) {
  266 + _finishChoice(2, 2);
  267 + _unbindHoverEvent(2, 2);
  268 + _activeChoice(1, 1);
  269 + }
  270 +
  271 + _disableChoice(3);
  272 + } else if (globalConfig.getQuantMaos() === 'duas') {
  273 + if ((globalConfig.isExpressionSet()) && (globalConfig.isRightHandSet())) {
  274 + _finishChoice(1, 2);
  275 + _unbindHoverEvent(1, 2);
  276 + _activeChoice(3, 3);
  277 + return;
  278 + } else if ((globalConfig.isExpressionSet()) && (globalConfig.isLeftHandSet())) {
  279 + _finishChoice(1, 1);
  280 + _finishChoice(3, 3);
  281 + _unbindHoverEvent(1, 1);
  282 + _unbindHoverEvent(3, 3);
  283 + _activeChoice(2, 2);
  284 + return;
  285 + } else if ((globalConfig.isRightHandSet()) && (globalConfig.isLeftHandSet())) {
  286 + _finishChoice(2, 3);
  287 + _unbindHoverEvent(2, 3);
  288 + _activeChoice(1, 1);
  289 + return;
  290 + }
  291 +
  292 + if (globalConfig.isExpressionSet()) {
  293 + _finishChoice(1, 1);
  294 + _unbindHoverEvent(1, 1);
  295 + _activeChoice(2, 3);
  296 + } else if (globalConfig.isRightHandSet()) {
  297 + _finishChoice(2, 2);
  298 + _unbindHoverEvent(2, 2);
  299 + _activeChoice(1, 1);
  300 + _activeChoice(3, 3);
  301 + } else if (globalConfig.isLeftHandSet()) {
  302 + _finishChoice(3, 3);
  303 + _unbindHoverEvent(3, 3);
  304 + _activeChoice(1, 2);
  305 + }
  306 + }
  307 + };
  308 +
  309 + function _bindHoverChoices() {
  310 +
  311 + var previewField = self.choiceContainer.find('.preview > p');
  312 +
  313 + self.choiceContainer.find('polygon:nth-of-type(1)').on('mouseenter', function(e){
  314 + previewField.text('Expressão Facial');
  315 + });
  316 +
  317 + self.choiceContainer.find('polygon:nth-of-type(2)').on('mouseenter', function(e){
  318 + previewField.text('Mão Direita');
  319 + });
  320 +
  321 + self.choiceContainer.find('polygon:nth-of-type(3)').on('mouseenter', function(e){
  322 + previewField.text('Mão Esquerda');
  323 + });
  324 +
  325 + self.choiceContainer.find('polygon').on('mouseout', function(e) {
  326 + previewField.text('');
  327 + });
  328 + };
  329 +
  330 + return {
  331 + run: function() {
  332 + _init();
  333 + _bindHoverChoices();
  334 + _setActiveChoices();
  335 + _updateChoices();
  336 + }
  337 + }
  338 +};
  339 +
  340 +module.exports.choiceFrame = choiceFrame;
  341 +}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  342 +},{}],3:[function(require,module,exports){
  343 +(function (global){
  344 +var globalConfig = function() {
  345 +
  346 + /* Function Scope */
  347 + var self = this;
  348 +
  349 + /* Global Object */
  350 + var globalConfig;
  351 +
  352 + /* Main Variables */
  353 + var signalObject,
  354 + params,
  355 + name,
  356 + quantMaos,
  357 + tipoMov,
  358 + repeticao;
  359 +
  360 + /* Support Variables */
  361 + var panelLabels,
  362 + tabsLabels,
  363 + quantityOfTabsAndPanels,
  364 + quantityOfTimelineBlocks,
  365 + currentConfig,
  366 + expression,
  367 + rightHand,
  368 + leftHand,
  369 + firstChoice;
  370 +
  371 + function _init(params) {
  372 + self.globalConfig = global.wlGlobalConfig;
  373 + self.params = params;
  374 +
  375 + _initMain();
  376 + _initSupport();
  377 + _initSignalObject();
  378 + };
  379 +
  380 + function _initMain() {
  381 + self.name = self.params.name;
  382 + self.quantMaos = self.params.quantMaos;
  383 + self.tipoMov = self.params.tipoMov;
  384 + self.repeticao = self.params.repeticao;
  385 + };
  386 +
  387 + function _initSupport() {
  388 + switch (self.quantMaos) {
  389 + case 'uma':
  390 + self.expression = false;
  391 + self.rightHand = false;
  392 + self.leftHand = true;
  393 + break;
  394 +
  395 + case 'duas':
  396 + self.expression = false;
  397 + self.rightHand = false;
  398 + self.leftHand = false;
  399 + break;
  400 + }
  401 +
  402 + self.firstChoice = true;
  403 + };
  404 +
  405 + function _initSignalObject() {
  406 + self.signalObject = {
  407 + 'userId': null,
  408 + 'typeOfMovement': null,
  409 + 'qntHands': null,
  410 + 'rightHand': [],
  411 + 'leftHand': [],
  412 + 'facialExp': null,
  413 + 'repetition': self.globalConfig.getRepeticao(),
  414 + 'signName': null
  415 + }
  416 + };
  417 +
  418 + function _setSignalObject(config, params) {
  419 + if (config === 'userId')
  420 + self.signalObject.userId = params;
  421 +
  422 + if (config === 'typeOfMovement')
  423 + self.signalObject.typeOfMovement = params;
  424 +
  425 + if (config === 'qntHands')
  426 + self.signalObject.qntHands = params;
  427 +
  428 + if (config === 'rightHand')
  429 + self.signalObject.rightHand = params;
  430 +
  431 + if (config === 'leftHand')
  432 + self.signalObject.leftHand = params;
  433 +
  434 + if (config === 'facialExp')
  435 + self.signalObject.facialExp = params;
  436 +
  437 + if (config === 'signName')
  438 + self.signalObject.signName = params;
  439 + };
  440 +
  441 + function _setCurrentConfig(current) {
  442 + self.currentConfig = current;
  443 + };
  444 +
  445 + function _setFirstChoice(params) {
  446 + self.firstChoice = params;
  447 + };
  448 +
  449 + function _setPanelLabels(labels) {
  450 + self.panelLabels = labels;
  451 + };
  452 +
  453 + function _setTabsLabels(labels) {
  454 + self.tabsLabels = labels;
  455 + };
  456 +
  457 + function _setQuantityOfTabsAndPanels(quantity) {
  458 + self.quantityOfTabsAndPanels = quantity;
  459 + };
  460 +
  461 + function _setQuantityOfTimelineBlocks(quantity) {
  462 + self.quantityOfTimelineBlocks = quantity;
  463 + };
  464 +
  465 + function _expressionSet(config) {
  466 + self.expression = config;
  467 + };
  468 +
  469 + function _rightHandSet(config) {
  470 + self.rightHand = config;
  471 + };
  472 +
  473 + function _leftHandSet(config) {
  474 + self.leftHand = config;
  475 + };
  476 +
  477 + function _getName() { return self.name; };
  478 + function _getQuantMaos() { return self.quantMaos; };
  479 + function _getTipoMov() { return self.tipoMov; };
  480 + function _getRepeticao() { return self.repeticao; };
  481 + function _getQuantityOfTabsAndPanels() { return self.quantityOfTabsAndPanels; };
  482 + function _getQuantityOfTimelineBlocks() { return self.quantityOfTimelineBlocks; };
  483 + function _getPanelLabels() { return self.panelLabels; };
  484 + function _getTabLabels() { return self.tabsLabels; };
  485 + function _getCurrentConfig() { return self.currentConfig; };
  486 + function _getFirstChoice() { return self.firstChoice; };
  487 + function _getSignalObject() { return self.signalObject; };
  488 +
  489 + function _isExpressionSet() { return self.expression; };
  490 + function _isRightHandSet() { return self.rightHand; };
  491 + function _isLeftHandSet() { return self.leftHand; };
  492 +
  493 + return {
  494 + run: function(params) {
  495 + _init(params);
  496 + },
  497 +
  498 + getName: function() {
  499 + return _getName();
  500 + },
  501 +
  502 + getQuantMaos: function() {
  503 + return _getQuantMaos();
  504 + },
  505 +
  506 + getTipoMov: function() {
  507 + return _getTipoMov();
  508 + },
  509 +
  510 + getRepeticao: function() {
  511 + return _getRepeticao();
  512 + },
  513 +
  514 + isExpressionSet: function() {
  515 + return _isExpressionSet();
  516 + },
  517 +
  518 + isRightHandSet: function() {
  519 + return _isRightHandSet();
  520 + },
  521 +
  522 + isLeftHandSet: function() {
  523 + return _isLeftHandSet();
  524 + },
  525 +
  526 + getQuantityOfTabsAndPanels: function() {
  527 + return _getQuantityOfTabsAndPanels();
  528 + },
  529 +
  530 + getPanelLabels: function() {
  531 + return _getPanelLabels();
  532 + },
  533 +
  534 + getTabLabels: function() {
  535 + return _getTabLabels();
  536 + },
  537 +
  538 + getCurrentConfig: function() {
  539 + return _getCurrentConfig();
  540 + },
  541 +
  542 + getFirstChoice: function() {
  543 + return _getFirstChoice();
  544 + },
  545 +
  546 + getQuantityOfTimelineBlocks: function() {
  547 + return _getQuantityOfTimelineBlocks();
  548 + },
  549 +
  550 + getSignalObject: function() {
  551 + return _getSignalObject();
  552 + },
  553 +
  554 + setCurrentConfig: function(current) {
  555 + _setCurrentConfig(current);
  556 + },
  557 +
  558 + setFirstChoice: function(firstChoice) {
  559 + _setFirstChoice(firstChoice);
  560 + },
  561 +
  562 + setQuantityOfTabsAndPanels: function(quantity) {
  563 + _setQuantityOfTabsAndPanels(quantity);
  564 + },
  565 +
  566 + setPanelLabels: function(labels) {
  567 + _setPanelLabels(labels);
  568 + },
  569 +
  570 + setTabsLabels: function(labels) {
  571 + _setTabsLabels(labels);
  572 + },
  573 +
  574 + setQuantityOfTimelineBlocks: function(quantity) {
  575 + _setQuantityOfTimelineBlocks(quantity);
  576 + },
  577 +
  578 + setSignalObject: function(config, params) {
  579 + _setSignalObject(config, params);
  580 + },
  581 +
  582 + expressionSet: function(config) {
  583 + _expressionSet(config);
  584 + },
  585 +
  586 + rightHandSet: function(config) {
  587 + _rightHandSet(config);
  588 + },
  589 +
  590 + leftHandSet: function(config) {
  591 + _leftHandSet(config);
  592 + }
  593 + }
  594 +};
  595 +
  596 +module.exports.globalConfig = globalConfig;
  597 +}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  598 +},{}],4:[function(require,module,exports){
  599 +(function (global){
  600 +var mainFrame = function() {
  601 +
  602 + /* Function Scope */
  603 + var self = this;
  604 +
  605 + /* wlGlobalConfig Holder Variable */
  606 + var globalConfig;
  607 +
  608 + /* Main Variables */
  609 + var configsObject,
  610 + mainContainer,
  611 + textsContainer,
  612 + tabsContainer,
  613 + panelsContainer,
  614 + avatarContainer,
  615 + timelineContainer;
  616 +
  617 + /* JSON Variables */
  618 + var imagesJSON,
  619 + videosJSON;
  620 +
  621 + /* Support Variables */
  622 + var scrollVelocity,
  623 + isScrolling,
  624 + mainContent,
  625 + timelineClicked;
  626 +
  627 + /* Init Functions */
  628 + function _init() {
  629 + self.globalConfig = global.wlGlobalConfig;
  630 +
  631 + _initMain();
  632 + _initJSON();
  633 + _initSupport();
  634 + _initParametersObject();
  635 + _initSignalObject();
  636 + };
  637 +
  638 + function _initMain() {
  639 + self.mainContainer = $('#mainContainer');
  640 + self.textsContainer = $('#textsContainer');
  641 + self.tabsContainer = $('#tabsContainer');
  642 + self.panelsContainer = $('#panelsContainer');
  643 + self.avatarContainer = $('#avatarContainer');
  644 + self.timelineContainer = $('#timelineContainer');
  645 + };
  646 +
  647 + function _initJSON() {
  648 + self.imagesJSON = null;
  649 + self.videosJSON = null;
  650 + };
  651 +
  652 + function _initSupport() {
  653 + self.scrollVelocity = 2; // PX
  654 + self.isScrolling = false;
  655 +
  656 + // Variável que auxilia ao highlight não ser movido duas vezes,
  657 + // ao ser clicado em um bloco de timeline;
  658 + self.timelineClicked = false;
  659 +
  660 + _setPanelLabel(0);
  661 + };
  662 +
  663 + function _initParametersObject() {
  664 +
  665 + self.configsObject = [];
  666 + var length;
  667 +
  668 + if ((self.globalConfig.getTipoMov() === 'pontual') || (self.globalConfig.getTipoMov() === 'retilineo'))
  669 + length = 3;
  670 +
  671 + if (self.globalConfig.getTipoMov() === 'circular')
  672 + length = 6;
  673 +
  674 + if (self.globalConfig.getTipoMov() === 'semicircular')
  675 + length = 7;
  676 +
  677 + if (self.globalConfig.getCurrentConfig() === 'expression')
  678 + length = 1;
  679 +
  680 + for (var i = 0; i < length; i++)
  681 + self.configsObject.push('');
  682 + };
  683 +
  684 + function _initSignalObject() {
  685 + self.globalConfig.setSignalObject('userId', 0);
  686 + self.globalConfig.setSignalObject('typeOfMovement', self.globalConfig.getTipoMov());
  687 + self.globalConfig.setSignalObject('qntHands', self.globalConfig.getQuantMaos());
  688 + self.globalConfig.setSignalObject('signName', self.globalConfig.getName());
  689 + };
  690 +
  691 + /*
  692 + * Texts and Avatar Image Functions
  693 + */
  694 + function _setPanelLabel(index) {
  695 + var label = self.textsContainer.find('.pLWrapper');
  696 +
  697 + label.text(self.globalConfig.getPanelLabels()[index]);
  698 + };
  699 +
  700 + function _setSignalName() {
  701 + var name = self.textsContainer.find('.sNWrapper');
  702 +
  703 + name.text(self.globalConfig.getName());
  704 + };
  705 +
  706 + function _setAvatarImage() {
  707 +
  708 + var imageWrapper = self.avatarContainer.find('.wrapper');
  709 + var imageURL = self.imagesJSON.avatar;
  710 +
  711 + if (self.globalConfig.getCurrentConfig() === 'expression')
  712 + imageWrapper.css('background-image', 'url(' + imageURL[0] + ')');
  713 + else if (self.globalConfig.getCurrentConfig() === 'rightHand')
  714 + imageWrapper.css('background-image', 'url(' + imageURL[1] + ')');
  715 + else if (self.globalConfig.getCurrentConfig() === 'leftHand')
  716 + imageWrapper.css('background-image', 'url(' + imageURL[2] + ')');
  717 + };
  718 +
  719 + /*
  720 + * DOM Functions
  721 + */
  722 + function _createTabsDOM() {
  723 + var tabs = self.tabsContainer.find('.tabs');
  724 +
  725 + for (var i = 0; i < self.globalConfig.getQuantityOfTabsAndPanels(); i++) {
  726 + if (i === 0)
  727 + tabs.append('<li><p>' + self.globalConfig.getTabLabels()[i] + '</p><span class="arrow active"></span></li>');
  728 + else
  729 + tabs.append('<li><p>' + self.globalConfig.getTabLabels()[i] + '</p><span class="arrow"></span></li>');
  730 + }
  731 + };
  732 +
  733 + function _createPanelsDOM() {
  734 +
  735 + var quantity = self.globalConfig.getQuantityOfTabsAndPanels();
  736 +
  737 + if (quantity === 1) {
  738 + _createPanel_Expression();
  739 + } else if (quantity === 3) {
  740 + _createPanel_Fingers();
  741 + _createPanel_Orientation();
  742 + _createPanel_LocalizationsAndSubLocalizations();
  743 + } else if (quantity === 4) {
  744 + _createPanel_Initial();
  745 + _createPanel_Fingers();
  746 + _createPanel_Orientation();
  747 + _createPanel_LocalizationsAndSubLocalizations();
  748 + }
  749 +
  750 + _createTimeline();
  751 +
  752 + // Atualiza pela primeira vez qual é o atual panel ativo;
  753 + self.mainContent = self.panelsContainer.find('.active').find('.mainContent').find('.wrapper');
  754 +
  755 + function _createTimeline() {
  756 + var timeline = self.timelineContainer.find('.wrapper');
  757 + var length = self.globalConfig.getQuantityOfTimelineBlocks();
  758 +
  759 + for (var i = 0; i < length; i++) {
  760 + if (i === 0)
  761 + timeline.append('<span class="active"></span>');
  762 + else
  763 + timeline.append('<span></span>');
  764 + }
  765 + };
  766 +
  767 + function _createPanel_Expression() {
  768 +
  769 + var panel = '<div class="expression active">' +
  770 + '<div class="scrollUp"></div>' +
  771 + '<div class="mainContent">' +
  772 + '<div class="wrapper">' +
  773 + '</div>' +
  774 + '</div>' +
  775 + '<div class="scrollDown"></div>' +
  776 + '</div>';
  777 +
  778 + self.panelsContainer.append(panel);
  779 + };
  780 +
  781 + function _createPanel_Initial() {
  782 +
  783 + var sentido = ['Horário', 'Anti-Horário'];
  784 + var raio = ['Pequeno', 'Médio', 'Grande'];
  785 + var orientacao = ['Perpendicular', 'Paralelo'];
  786 + var direcao = ['Para Frente', 'Para Trás', 'Para Direita', 'Para Esquerda'];
  787 +
  788 + var panel = '<div class="initial active">' +
  789 + '<div class="scrollUp"></div>' +
  790 + '<div class="mainContent">' +
  791 + '<div class="wrapper">';
  792 +
  793 + if (self.globalConfig.getTipoMov() === 'semicircular') {
  794 + panel += '<div>';
  795 + for (var j = 0; j < sentido.length; j++) { panel += '<span class="vWrapper"></span>'; }
  796 + for (var k = 0; k < sentido.length; k++) { panel += '<div class="label">' + sentido[k] + '</div>'; }
  797 + panel += '</div>';
  798 +
  799 + panel += '<div>';
  800 + for (var l = 0; l < raio.length; l++) { panel += '<span class="vWrapper"></span>'; }
  801 + for (var m = 0; m < raio.length; m++) { panel += '<div class="label">' + raio[m] + '</div>'; }
  802 + panel += '</div>';
  803 +
  804 + panel += '<div>';
  805 + for (var n = 0; n < orientacao.length; n++) { panel += '<span class="vWrapper"></span>'; }
  806 + for (var o = 0; o < orientacao.length; o++) { panel += '<div class="label">' + orientacao[o] + '</div>'; }
  807 + panel += '</div>';
  808 +
  809 + panel += '<div>';
  810 + for (var p = 0; p < direcao.length; p++) { panel += '<span class="vWrapper"></span>'; }
  811 + for (var q = 0; q < direcao.length; q++) { panel += '<div class="label">' + direcao[q] + '</div>'; }
  812 + panel += '</div>';
  813 + }
  814 +
  815 + if (self.globalConfig.getTipoMov() === 'circular') {
  816 + panel += '<div>';
  817 + for (var j = 0; j < sentido.length; j++) { panel += '<span class="vWrapper"></span>'; }
  818 + for (var k = 0; k < sentido.length; k++) { panel += '<div class="label">' + sentido[k] + '</div>'; }
  819 + panel += '</div>';
  820 +
  821 + panel += '<div>';
  822 + for (var l = 0; l < raio.length; l++) { panel += '<span class="vWrapper"></span>'; }
  823 + for (var m = 0; m < raio.length; m++) { panel += '<div class="label">' + raio[m] + '</div>'; }
  824 + panel += '</div>';
  825 +
  826 + panel += '<div style="margin-left: 180px;">';
  827 + for (var n = 0; n < orientacao.length; n++) { panel += '<span class="vWrapper"></span>'; }
  828 + for (var o = 0; o < orientacao.length; o++) { panel += '<div class="label">' + orientacao[o] + '</div>'; }
  829 + panel += '</div>';
  830 + }
  831 +
  832 + panel += '</div>' +
  833 + '</div>' +
  834 + '<div class="scrollDown"></div>' +
  835 + '</div>';
  836 +
  837 + self.panelsContainer.append(panel);
  838 + };
  839 +
  840 + function _createPanel_Fingers() {
  841 +
  842 + if ((self.globalConfig.getTipoMov() === 'pontual') || (self.globalConfig.getTipoMov() === 'retilineo'))
  843 + var panel = '<div class="dedos active">';
  844 + else
  845 + var panel = '<div class="dedos">';
  846 +
  847 + panel += '<div class="scrollUp"></div>' +
  848 + '<div class="mainContent">' +
  849 + '<div class="wrapper">' +
  850 + '</div>' +
  851 + '</div>' +
  852 + '<div class="scrollDown"></div>' +
  853 + '</div>';
  854 +
  855 + self.panelsContainer.append(panel);
  856 + };
  857 +
  858 + function _createPanel_Orientation() {
  859 + var panel = '<div class="orientation">' +
  860 + '<div class="scrollUp"></div>' +
  861 + '<div class="mainContent">' +
  862 + '<div class="wrapper">' +
  863 + '</div>' +
  864 + '</div>' +
  865 + '<div class="scrollDown"></div>' +
  866 + '</div>';
  867 +
  868 + self.panelsContainer.append(panel);
  869 + };
  870 +
  871 + function _createPanel_LocalizationsAndSubLocalizations() {
  872 +
  873 + var panel = '<div class="localizations">' +
  874 + '<div class="mainContent">' +
  875 + '<div class="wrapper">' +
  876 + '</div>' +
  877 + '<div class="floatWrapper">';
  878 +
  879 + for (var i = 0; i < 4; i++) {
  880 + panel += '<div>' +
  881 + '<div class="scrollUp"></div>' +
  882 + '<img class="close" src="/system/wikilibras/images/close.png">' +
  883 + '<div class="innerWrapper"></div>' +
  884 + '<div class="scrollDown"></div>' +
  885 + '</div>';
  886 + }
  887 +
  888 + panel += '</div>' +
  889 + '</div>' +
  890 + '</div>';
  891 +
  892 + self.panelsContainer.append(panel);
  893 + };
  894 + };
  895 +
  896 + /*
  897 + * Loading Functions
  898 + */
  899 + function _loadingImagesAndVideos() {
  900 +
  901 + var quantity = self.globalConfig.getQuantityOfTabsAndPanels();
  902 +
  903 + if (quantity === 1) {
  904 + _populatePanel_Expression();
  905 + } else if (quantity === 3) {
  906 + _populatePanel_Fingers();
  907 + _populatePanel_Orientation();
  908 + _populatePanel_LocalizationAndSubLocalization();
  909 + } else if (quantity === 4) {
  910 + _populatePanel_Initial();
  911 + _populatePanel_Fingers();
  912 + _populatePanel_Orientation();
  913 + _populatePanel_LocalizationAndSubLocalization();
  914 + }
  915 + };
  916 +
  917 + function _populatePanel(element, jsonObject) {
  918 +
  919 + var length = jsonObject.length;
  920 +
  921 + for (var i = 0; i < length; i++) {
  922 + element.append('<span></span>');
  923 + element.children().last().css('background-image', 'url(' + jsonObject[i] + ')');
  924 + }
  925 + };
  926 +
  927 + function _populatePanel_Expression() {
  928 +
  929 + var expressoes = self.panelsContainer.find('.expression').find('.mainContent').find('.wrapper'),
  930 + expressoesImages = self.imagesJSON.expressao;
  931 +
  932 + _populatePanel(expressoes, expressoesImages);
  933 + };
  934 +
  935 + function _populatePanel_Initial() {
  936 +
  937 + var initialVideosJSON = self.videosJSON.iniciais,
  938 + initialBlocks = self.panelsContainer.find('.vWrapper'),
  939 + initialLabels = self.panelsContainer.find('.label'),
  940 + length = initialBlocks.length,
  941 + perpendicular,
  942 + paralelo;
  943 +
  944 + var direcaoPerpen = $([initialBlocks[7], initialBlocks[8]]),
  945 + labelsPerpen = $([initialLabels[7], initialLabels[8]]),
  946 + direcaoParal = $([initialBlocks[9], initialBlocks[10]]),
  947 + labelsParal = $([initialLabels[9], initialLabels[10]]);
  948 +
  949 + for (var i = 0; i < length; i++) {
  950 + initialBlocks.eq(i).append(
  951 + '<video class="video" width="100" height="150">' +
  952 + '<source src="' + initialVideosJSON.mp4[i] + '" type="video/mp4">' +
  953 + '<source src="' + initialVideosJSON.webm[i] + '" type="video/webm">' +
  954 + '</video>');
  955 +
  956 + if (i === 5)
  957 + perpendicular = initialBlocks.eq(i);
  958 +
  959 + if (i === 6)
  960 + paralelo = initialBlocks.eq(i);
  961 + };
  962 +
  963 + perpendicular.click(function(e) {
  964 + direcaoParal.css('display', 'none');
  965 + labelsParal.css('display', 'none');
  966 + direcaoPerpen.css('display', 'inline');
  967 + labelsPerpen.css('display', 'block');
  968 + });
  969 +
  970 + paralelo.click(function(e) {
  971 + direcaoPerpen.css('display', 'none');
  972 + labelsPerpen.css('display', 'none');
  973 + direcaoParal.css('display', 'inline');
  974 + labelsParal.css('display', 'block');
  975 + });
  976 + };
  977 +
  978 + function _populatePanel_Fingers() {
  979 +
  980 + var dedos = self.panelsContainer.find('.dedos').find('.mainContent').find('.wrapper'),
  981 + dedosImages = self.imagesJSON.dedos;
  982 +
  983 + _populatePanel(dedos, dedosImages);
  984 + };
  985 +
  986 + function _populatePanel_Orientation() {
  987 +
  988 + var palma_mao = self.panelsContainer.find('.orientation').find('.mainContent').find('.wrapper'),
  989 + palmaMaoImages = self.imagesJSON.palma_mao;
  990 +
  991 + _populatePanel(palma_mao, palmaMaoImages);
  992 + };
  993 +
  994 + function _populatePanelSubLocalization(element, jsonObject) {
  995 +
  996 + var length = jsonObject.mp4.length;
  997 +
  998 + for (var i = 0; i < length; i++) {
  999 + element.append('<span></span>');
  1000 + element.children().last().append(
  1001 + '<video class="video" width="134" height="185">' +
  1002 + '<source src="' + jsonObject.mp4[i] + '" type="video/mp4">' +
  1003 + '<source src="' + jsonObject.webm[i] + '" type="video/webm">' +
  1004 + '</video>');
  1005 + };
  1006 + };
  1007 +
  1008 + function _populatePanel_LocalizationAndSubLocalization() {
  1009 +
  1010 + var localizacao = self.panelsContainer.find('.localizations').find('.mainContent').find('.wrapper'),
  1011 + sublocalizacao = self.panelsContainer.find('.localizations').find('.mainContent').find('.floatWrapper'),
  1012 + localizacaoImages = self.imagesJSON.localizacao;
  1013 +
  1014 + _populatePanel(localizacao, localizacaoImages);
  1015 +
  1016 + for (var i = 0; i < 4; i++) {
  1017 + if (i < 2)
  1018 + _populatePanel(sublocalizacao.children().eq(i).find('.innerWrapper'), self.imagesJSON.sublocalizacao[i]);
  1019 +
  1020 + if (i === 2)
  1021 + _populatePanelSubLocalization(sublocalizacao.children().eq(i).find('.innerWrapper'), self.videosJSON.sublocalizacao.media);
  1022 +
  1023 + if (i === 3)
  1024 + _populatePanelSubLocalization(sublocalizacao.children().eq(i).find('.innerWrapper'), self.videosJSON.sublocalizacao.grande);
  1025 + }
  1026 + };
  1027 +
  1028 + /*
  1029 + * Bind Events Functions
  1030 + */
  1031 + function _bindEventsOfTabsAndPanels() {
  1032 +
  1033 + var tabs = self.tabsContainer.find('.tabs').children();
  1034 + var panels = self.panelsContainer.children();
  1035 +
  1036 + $.each(panels, function(index){
  1037 + tabs.eq(index).click(function(e) {
  1038 + // Itera todas os panels e remove a class .active
  1039 + panels.removeClass('active');
  1040 + // Adiciona a class .active ao panel clicado
  1041 + panels.eq(index).addClass('active');
  1042 + // Itera todas as arrows das tabs e remove a class .active
  1043 + tabs.find('.arrow').removeClass('active');
  1044 + // Adiciona a class .active a arrow da tab clicada
  1045 + tabs.eq(index).find('.arrow').addClass('active');
  1046 + // Atualiza o label do panel
  1047 + _setPanelLabel(index);
  1048 + // Guarda em memória qual o panel ativo, para que os scrolls down e up possam manipulá-lo
  1049 + _updateCurrentPanel('tabs');
  1050 + // Caso esteja no panel de sublocalização, dispara o evento clique do botão fechar
  1051 + $('.close').trigger('click');
  1052 +
  1053 + // Se a configuração atual for a de Expressão Facial, não há necessidade de registrar
  1054 + // o evento de click nas tabs;
  1055 + if (self.globalConfig.getCurrentConfig() === 'expression')
  1056 + return;
  1057 +
  1058 + if (self.globalConfig.getTipoMov() === 'semicircular') {
  1059 + switch (index) {
  1060 + case 0:
  1061 + if (!self.timelineClicked)
  1062 + _moveHighlighter(0);
  1063 +
  1064 + break;
  1065 + case 1:
  1066 + if (!self.timelineClicked)
  1067 + _moveHighlighter(4);
  1068 +
  1069 + break;
  1070 + case 2:
  1071 + if (!self.timelineClicked)
  1072 + _moveHighlighter(5);
  1073 +
  1074 + break;
  1075 + case 3:
  1076 + if (!self.timelineClicked)
  1077 + _moveHighlighter(6);
  1078 +
  1079 + break;
  1080 + }
  1081 + }
  1082 +
  1083 + if (self.globalConfig.getTipoMov() === 'circular') {
  1084 + switch (index) {
  1085 + case 0:
  1086 + if (!self.timelineClicked)
  1087 + _moveHighlighter(0);
  1088 +
  1089 + break;
  1090 + case 1:
  1091 + if (!self.timelineClicked)
  1092 + _moveHighlighter(3);
  1093 +
  1094 + break;
  1095 + case 2:
  1096 + if (!self.timelineClicked)
  1097 + _moveHighlighter(4);
  1098 +
  1099 + break;
  1100 + case 3:
  1101 + if (!self.timelineClicked)
  1102 + _moveHighlighter(5);
  1103 +
  1104 + break;
  1105 + }
  1106 + }
  1107 +
  1108 + if (self.globalConfig.getTipoMov() === 'retilineo') {
  1109 + switch (index) {
  1110 + case 0:
  1111 + if (!self.timelineClicked)
  1112 + _moveHighlighter(0);
  1113 +
  1114 + break;
  1115 + case 1:
  1116 + if (!self.timelineClicked)
  1117 + _moveHighlighter(1);
  1118 +
  1119 + break;
  1120 + case 2:
  1121 + if (!self.timelineClicked)
  1122 + _moveHighlighter(2);
  1123 +
  1124 + break;
  1125 + }
  1126 + }
  1127 +
  1128 + if (self.globalConfig.getTipoMov() === 'pontual') {
  1129 + switch (index) {
  1130 + case 0:
  1131 + if (!self.timelineClicked)
  1132 + _moveHighlighter(0);
  1133 +
  1134 + break;
  1135 + case 1:
  1136 + if (!self.timelineClicked)
  1137 + _moveHighlighter(1);
  1138 +
  1139 + break;
  1140 + case 2:
  1141 + if (!self.timelineClicked)
  1142 + _moveHighlighter(2);
  1143 +
  1144 + break;
  1145 + }
  1146 + }
  1147 + });
  1148 + });
  1149 + };
  1150 +
  1151 + function _moveHighlighter(index) {
  1152 +
  1153 + var blocks = self.timelineContainer.find('.wrapper').children();
  1154 +
  1155 + blocks.removeClass('active');
  1156 + blocks.eq(index).addClass('active');
  1157 + };
  1158 +
  1159 + function _updateCurrentPanel(type) {
  1160 + if (type === 'tabs')
  1161 + self.mainContent = self.panelsContainer.find('.active').find('.mainContent').find('.wrapper');
  1162 + else if (type === 'blocks')
  1163 + self.mainContent = self.panelsContainer.find('.localizations').find('.mainContent').find('.floatWrapper').find('.active').find('.innerWrapper');
  1164 + };
  1165 +
  1166 + function _bindLocalizationPanelEvents() {
  1167 +
  1168 + var localizationBlocks = self.panelsContainer.find('.localizations').find('.mainContent').find('.wrapper').children();
  1169 + var floatWrapper = self.panelsContainer.find('.localizations').find('.mainContent').find('.floatWrapper');
  1170 +
  1171 + $.each(localizationBlocks, function(index, block){
  1172 + $(block).click(function() {
  1173 + floatWrapper.css('top', 0);
  1174 + floatWrapper.children().removeClass('active');
  1175 + floatWrapper.children().eq(index).addClass('active');
  1176 + _updateCurrentPanel('blocks');
  1177 + });
  1178 + });
  1179 +
  1180 + $('.close').click(function(e) {
  1181 + if (floatWrapper.css('top') === '0px')
  1182 + floatWrapper.css('top', -320 + 'px');
  1183 + });
  1184 + };
  1185 +
  1186 + function _bindTimelineBlocksEvents() {
  1187 +
  1188 + var tabs = self.tabsContainer.find('.tabs').children();
  1189 + var timelineBlocks = self.timelineContainer.find('.wrapper').children();
  1190 +
  1191 + if (timelineBlocks.length === 1)
  1192 + return;
  1193 +
  1194 + if (self.globalConfig.getTipoMov() === 'semicircular') {
  1195 + $.each(timelineBlocks, function(index, block){
  1196 +
  1197 + // Iniciais
  1198 + if ((index === 0) || (index === 1) || (index === 2) || (index === 3)) {
  1199 + timelineBlocks.eq(index).click(function(e) {
  1200 + self.timelineClicked = true;
  1201 + tabs.eq(0).trigger('click');
  1202 + _moveHighlighter(index);
  1203 + self.timelineClicked = false;
  1204 + });
  1205 + }
  1206 +
  1207 + // Dedos
  1208 + if (index === 4) {
  1209 + timelineBlocks.eq(index).click(function(e) {
  1210 + self.timelineClicked = true;
  1211 + tabs.eq(1).trigger('click');
  1212 + _moveHighlighter(index);
  1213 + self.timelineClicked = false;
  1214 + });
  1215 + }
  1216 +
  1217 + // Palma da Mão
  1218 + if (index === 5) {
  1219 + timelineBlocks.eq(index).click(function(e) {
  1220 + self.timelineClicked = true;
  1221 + tabs.eq(2).trigger('click');
  1222 + _moveHighlighter(index);
  1223 + self.timelineClicked = false;
  1224 + });
  1225 + }
  1226 +
  1227 + // Localização
  1228 + if ((index === 6) || (index === 7)) {
  1229 + timelineBlocks.eq(index).click(function(e) {
  1230 + self.timelineClicked = true;
  1231 + tabs.eq(3).trigger('click');
  1232 + _moveHighlighter(index);
  1233 + self.timelineClicked = false;
  1234 + });
  1235 + }
  1236 + });
  1237 + }
  1238 +
  1239 + if (self.globalConfig.getTipoMov() === 'circular') {
  1240 + $.each(timelineBlocks, function(index, block){
  1241 +
  1242 + // Iniciais
  1243 + if ((index === 0) || (index === 1) || (index === 2)) {
  1244 + timelineBlocks.eq(index).click(function(e) {
  1245 + self.timelineClicked = true;
  1246 + tabs.eq(0).trigger('click');
  1247 + _moveHighlighter(index);
  1248 + self.timelineClicked = false;
  1249 + });
  1250 + }
  1251 +
  1252 + // Dedos
  1253 + if (index === 3) {
  1254 + timelineBlocks.eq(index).click(function(e) {
  1255 + self.timelineClicked = true;
  1256 + tabs.eq(1).trigger('click');
  1257 + _moveHighlighter(index);
  1258 + self.timelineClicked = false;
  1259 + });
  1260 + }
  1261 +
  1262 + // Palma da Mão
  1263 + if (index === 4) {
  1264 + timelineBlocks.eq(index).click(function(e) {
  1265 + self.timelineClicked = true;
  1266 + tabs.eq(2).trigger('click');
  1267 + _moveHighlighter(index);
  1268 + self.timelineClicked = false;
  1269 + });
  1270 + }
  1271 +
  1272 + // Localização
  1273 + if ((index === 5) || (index === 6)) {
  1274 + timelineBlocks.eq(index).click(function(e) {
  1275 + self.timelineClicked = true;
  1276 + tabs.eq(3).trigger('click');
  1277 + _moveHighlighter(index);
  1278 + self.timelineClicked = false;
  1279 + });
  1280 + }
  1281 + });
  1282 + }
  1283 +
  1284 + if ((self.globalConfig.getTipoMov() === 'retilineo') || (self.globalConfig.getTipoMov() === 'pontual')) {
  1285 + $.each(timelineBlocks, function(index, block){
  1286 +
  1287 + // Dedos
  1288 + if (index === 0) {
  1289 + timelineBlocks.eq(index).click(function(e) {
  1290 + self.timelineClicked = true;
  1291 + tabs.eq(0).trigger('click');
  1292 + _moveHighlighter(index);
  1293 + self.timelineClicked = false;
  1294 + });
  1295 + }
  1296 +
  1297 + // Palma da Mão
  1298 + if (index === 1) {
  1299 + timelineBlocks.eq(index).click(function(e) {
  1300 + self.timelineClicked = true;
  1301 + tabs.eq(1).trigger('click');
  1302 + _moveHighlighter(index);
  1303 + self.timelineClicked = false;
  1304 + });
  1305 + }
  1306 +
  1307 + // Localização
  1308 + if ((index === 2) || (index === 3)) {
  1309 + timelineBlocks.eq(index).click(function(e) {
  1310 + self.timelineClicked = true;
  1311 + tabs.eq(2).trigger('click');
  1312 + _moveHighlighter(index);
  1313 + self.timelineClicked = false;
  1314 + });
  1315 + }
  1316 + });
  1317 + }
  1318 + };
  1319 +
  1320 + function _bindInitialVideosEvents(){
  1321 +
  1322 + $(".video").bind('mouseover', function() {
  1323 + this.play();
  1324 + }).bind('mouseout', function() {
  1325 + this.currentTime = 0;
  1326 + this.pause();
  1327 + });
  1328 + };
  1329 +
  1330 + function _bindScrollEvents() {
  1331 +
  1332 + $('.scrollUp').bind('mouseover', function() {
  1333 + self.isScrolling = true;
  1334 + _scrollContent('up');
  1335 + }).bind('mouseout', function() {
  1336 + self.isScrolling = false;
  1337 + });
  1338 +
  1339 + $('.scrollDown').bind('mouseover', function() {
  1340 + self.isScrolling = true;
  1341 + _scrollContent('down');
  1342 + }).bind('mouseout', function() {
  1343 + self.isScrolling = false;
  1344 + });
  1345 + };
  1346 +
  1347 + function _scrollContent(direction) {
  1348 + var velocity = (direction === 'up' ? '-=' + self.scrollVelocity + 'px' : '+=' + self.scrollVelocity + 'px');
  1349 +
  1350 + self.mainContent.animate({
  1351 + scrollTop: velocity
  1352 + }, 1, function() {
  1353 + if (self.isScrolling)
  1354 + _scrollContent(direction);
  1355 + });
  1356 + };
  1357 +
  1358 + /*
  1359 + * JSON Functions
  1360 + */
  1361 + function _getResourcesPath(callback) {
  1362 + $.getJSON('/system/wikilibras/resources.json').done(function(json) {
  1363 + self.imagesJSON = json.images;
  1364 + self.videosJSON = json.videos;
  1365 + callback();
  1366 + }
  1367 + );
  1368 + };
  1369 +
  1370 + function _bindConfigChoicesEvents() {
  1371 +
  1372 + var expressoes = self.panelsContainer.find('.expression').find('.mainContent').find('.wrapper').children();
  1373 + var expressoes_values = ['Exp_9', 'Exp_1', 'Exp_3', 'Exp_2', 'Exp_17', 'Exp_4', 'Exp_5', 'Exp_6', 'Exp_7', 'Exp_8', 'Exp_10', 'Exp_16', 'Exp_12', 'Exp_11', 'Exp_14', 'Exp_15'];
  1374 +
  1375 + $.each(expressoes, function(index, element) {
  1376 + $(element).click(function(e) {
  1377 + _setConfigsObject('expressao', expressoes_values[index]);
  1378 + _checkConfigsObject();
  1379 + });
  1380 + });
  1381 +
  1382 + if (self.globalConfig.getCurrentConfig() === 'expression')
  1383 + return;
  1384 +
  1385 + if ((self.globalConfig.getTipoMov() === 'semicircular') || (self.globalConfig.getTipoMov() === 'circular')) {
  1386 +
  1387 + var iniciais = self.panelsContainer.find('.initial').find('.mainContent').find('.wrapper').children();
  1388 + var iniciais_values = {
  1389 + 'sentido': ['horario', 'anti-horario'],
  1390 + 'raio': ['pequeno', 'medio', 'grande'],
  1391 + 'orientacao': ['perpendicular', 'paralelo'],
  1392 + 'direcao': ['para-frente', 'para-tras', 'para-direita', 'para-esquerda'],
  1393 + };
  1394 +
  1395 + $.each(iniciais, function(index, element) {
  1396 +
  1397 + switch(index) {
  1398 + case 0:
  1399 + var length = (iniciais.eq(index).children().length / 2);
  1400 +
  1401 + $.each(iniciais.eq(index).children(), function(index, element) {
  1402 + if (index < length) {
  1403 + $(element).first().click(function(e) {
  1404 + _moveHighlighter(1);
  1405 + _setConfigsObject('sentido', iniciais_values.sentido[index]);
  1406 + _checkConfigsObject();
  1407 + });
  1408 + }
  1409 + });
  1410 + break;
  1411 +
  1412 + case 1:
  1413 + var length = (iniciais.eq(index).children().length / 2);
  1414 +
  1415 + $.each(iniciais.eq(index).children(), function(index, element) {
  1416 + if (index < length) {
  1417 + $(element).first().click(function(e) {
  1418 + _moveHighlighter(2);
  1419 + _setConfigsObject('raio', iniciais_values.raio[index]);
  1420 + _checkConfigsObject();
  1421 + });
  1422 + }
  1423 + });
  1424 + break;
  1425 +
  1426 + case 2:
  1427 + var length = (iniciais.eq(index).children().length / 2);
  1428 +
  1429 + $.each(iniciais.eq(index).children(), function(index, element) {
  1430 + if (index < length) {
  1431 + $(element).first().click(function(e) {
  1432 + if (self.globalConfig.getTipoMov() === 'circular')
  1433 + _triggerTab('inicial');
  1434 +
  1435 + if (self.globalConfig.getTipoMov() === 'semicircular')
  1436 + _moveHighlighter(3);
  1437 +
  1438 + _setConfigsObject('orientacao', iniciais_values.orientacao[index]);
  1439 + _checkConfigsObject();
  1440 + });
  1441 + }
  1442 + });
  1443 + break;
  1444 +
  1445 + case 3:
  1446 + var length = (iniciais.eq(index).children().length / 2);
  1447 +
  1448 + $.each(iniciais.eq(index).children(), function(index, element) {
  1449 + if (index < length) {
  1450 + $(element).first().click(function(e) {
  1451 + _triggerTab('inicial');
  1452 + _setConfigsObject('direcao', iniciais_values.direcao[index]);
  1453 + _checkConfigsObject();
  1454 + });
  1455 + }
  1456 + });
  1457 + break;
  1458 + }
  1459 + });
  1460 + }
  1461 +
  1462 + var dedos = self.panelsContainer.find('.dedos').find('.mainContent').find('.wrapper').children();
  1463 +
  1464 + $.each(dedos, function(index, element) {
  1465 + $(element).click(function(e) {
  1466 + _triggerTab('dedos');
  1467 + _setConfigsObject('dedos', 'conf_' + (index + 1));
  1468 + _checkConfigsObject();
  1469 + });
  1470 + });
  1471 +
  1472 + var palmas = self.panelsContainer.find('.orientation').find('.mainContent').find('.wrapper').children();
  1473 + var palmas_values = ['Ori_1', 'Ori_7', 'Ori_2', 'Ori_8', 'Ori_3', 'Ori_9', 'Ori_4', 'Ori_10', 'Ori_5', 'Ori_6', 'Ori_12', 'Ori_11'];
  1474 +
  1475 + $.each(palmas, function(index, element) {
  1476 + $(element).click(function(e) {
  1477 + _triggerTab('palma_mao');
  1478 + _setConfigsObject('palma_mao', palmas_values[index]);
  1479 + _checkConfigsObject();
  1480 + });
  1481 + });
  1482 +
  1483 + var localizacoes = self.panelsContainer.find('.localizations').find('.mainContent').find('.wrapper').children(),
  1484 + sublocalizacoes = self.panelsContainer.find('.localizations').find('.mainContent').find('.floatWrapper').children();
  1485 + //localizacoes_values = ['cabeca', 'tronco', 'distancia_media', 'distancia_grande'],
  1486 + sublocalizacoes_values = {
  1487 + 'cabeca': ['Pa_6', 'Pa_35', 'Pa_38', 'Pa_50', 'Pa_57', 'Pa_60'],
  1488 + 'tronco': ['Pa_15', 'Pa_18', 'Pa_24', 'Pa_27', 'Pa_44', 'Pa_66'],
  1489 + 'distancia_media': ['Pa_7', 'Pa_16', 'Pa_19', 'Pa_25', 'Pa_28', 'Pa_36', 'Pa_39', 'Pa_45', 'Pa_48', 'Pa_61'],
  1490 + 'distancia_grande': ['Pa_8', 'Pa_17', 'Pa_20', 'Pa_26', 'Pa_29', 'Pa_37', 'Pa_40', 'Pa_46', 'Pa_49', 'Pa_62']
  1491 + };
  1492 +
  1493 + $.each(localizacoes, function(index, element) {
  1494 + $(element).click(function(e) {
  1495 + _moveHighlighter((wlGlobalConfig.getQuantityOfTimelineBlocks() - 1));
  1496 + //_setConfigsObject('localizacao', localizacoes_values[index]);
  1497 + });
  1498 +
  1499 + switch(index) {
  1500 + case 0:
  1501 + $.each(sublocalizacoes.eq(0).find('.innerWrapper').children(), function(index, element) {
  1502 + $(element).click(function(e){
  1503 + $('.close').trigger('click');
  1504 + _setConfigsObject('sublocalizacao', sublocalizacoes_values.cabeca[index]);
  1505 + _checkConfigsObject();
  1506 + });
  1507 + });
  1508 + break;
  1509 +
  1510 + case 1:
  1511 + $.each(sublocalizacoes.eq(1).find('.innerWrapper').children(), function(index, element) {
  1512 + $(element).click(function(e){
  1513 + $('.close').trigger('click');
  1514 + _setConfigsObject('sublocalizacao', sublocalizacoes_values.tronco[index]);
  1515 + _checkConfigsObject();
  1516 + });
  1517 + });
  1518 + break;
  1519 +
  1520 + case 2:
  1521 + $.each(sublocalizacoes.eq(2).find('.innerWrapper').children(), function(index, element) {
  1522 + $(element).click(function(e){
  1523 + $('.close').trigger('click');
  1524 + _setConfigsObject('sublocalizacao', sublocalizacoes_values.distancia_media[index]);
  1525 + _checkConfigsObject();
  1526 + });
  1527 + });
  1528 + break;
  1529 +
  1530 + case 3:
  1531 + $.each(sublocalizacoes.eq(3).find('.innerWrapper').children(), function(index, element) {
  1532 + $(element).click(function(e){
  1533 + $('.close').trigger('click');
  1534 + _setConfigsObject('sublocalizacao', sublocalizacoes_values.distancia_grande[index]);
  1535 + _checkConfigsObject();
  1536 + });
  1537 + });
  1538 + break;
  1539 + }
  1540 + });
  1541 + };
  1542 +
  1543 + function _setConfigsObject(category, value) {
  1544 +
  1545 + switch(category) {
  1546 + case 'expressao':
  1547 + self.configsObject[0] = value;
  1548 + return;
  1549 + break;
  1550 +
  1551 + case 'sentido':
  1552 + self.configsObject[0] = value;
  1553 + break;
  1554 +
  1555 + case 'raio':
  1556 + self.configsObject[1] = value;
  1557 + break;
  1558 +
  1559 + case 'orientacao':
  1560 + self.configsObject[2] = value;
  1561 + break;
  1562 +
  1563 + case 'direcao':
  1564 + self.configsObject[3] = value;
  1565 + break;
  1566 + }
  1567 +
  1568 + if ((self.globalConfig.getTipoMov() === 'pontual') || (self.globalConfig.getTipoMov() === 'retilineo'))
  1569 + var indexArray = [0, 1, 2];
  1570 +
  1571 + if (self.globalConfig.getTipoMov() === 'circular')
  1572 + var indexArray = [3, 4, 5];
  1573 +
  1574 + if (self.globalConfig.getTipoMov() === 'semicircular')
  1575 + var indexArray = [4, 5, 6];
  1576 +
  1577 + switch(category) {
  1578 + case 'dedos':
  1579 + self.configsObject[indexArray[0]] = value;
  1580 + break;
  1581 +
  1582 + case 'palma_mao':
  1583 + self.configsObject[indexArray[1]] = value;
  1584 + break;
  1585 +
  1586 + // case 'localizacao':
  1587 + // self.configsObject[indexArray[2]] = value;
  1588 + // break;
  1589 +
  1590 + case 'sublocalizacao':
  1591 + self.configsObject[indexArray[2]] = value;
  1592 + break;
  1593 + }
  1594 + };
  1595 +
  1596 + function _checkConfigsObject() {
  1597 + var length = self.configsObject.length;
  1598 +
  1599 + for (var i = 0; i < length; i++) {
  1600 + if (self.configsObject[i] === '')
  1601 + return false;
  1602 + }
  1603 +
  1604 + if (self.globalConfig.getCurrentConfig() === 'expression') {
  1605 + self.globalConfig.expressionSet(true);
  1606 + self.globalConfig.setSignalObject('facialExp', self.configsObject[0]);
  1607 + }
  1608 + else if (self.globalConfig.getCurrentConfig() === 'rightHand') {
  1609 + self.globalConfig.rightHandSet(true);
  1610 + self.globalConfig.setSignalObject('rightHand', self.configsObject);
  1611 + }
  1612 + else if (self.globalConfig.getCurrentConfig() === 'leftHand') {
  1613 + self.globalConfig.leftHandSet(true);
  1614 + self.globalConfig.setSignalObject('leftHand', self.configsObject);
  1615 + }
  1616 +
  1617 + // Imprime as configurações escolhidas a cada passo
  1618 + //console.log(self.configsObject);
  1619 + _showCheckPoint();
  1620 + };
  1621 +
  1622 + function _showCheckPoint() {
  1623 + var checkpoint = self.mainContainer.find('.checkpoint');
  1624 +
  1625 + if ((self.globalConfig.isExpressionSet()) && (self.globalConfig.isRightHandSet()) && (self.globalConfig.isLeftHandSet())) {
  1626 + checkpoint.find('.continuar').addClass('desactive');
  1627 + checkpoint.find('.gerar').removeClass('desactive');
  1628 + }
  1629 +
  1630 + if (checkpoint.hasClass('desactive')) {
  1631 + checkpoint.removeClass('desactive');
  1632 + }
  1633 + };
  1634 +
  1635 + function _bindCheckPointEvents() {
  1636 + var checkpoint = self.mainContainer.find('.checkpoint');
  1637 +
  1638 + checkpoint.find('.voltar').click(function(e) {
  1639 + if (!checkpoint.hasClass('desactive')) {
  1640 + checkpoint.addClass('desactive');
  1641 + }
  1642 + });
  1643 + };
  1644 +
  1645 + function _triggerTab(category) {
  1646 + var tabs = self.tabsContainer.find('.tabs').children();
  1647 +
  1648 + if (category === 'inicial')
  1649 + tabs.eq(1).trigger('click');
  1650 +
  1651 + if (category === 'dedos') {
  1652 + if ((self.globalConfig.getTipoMov() === 'pontual') || (self.globalConfig.getTipoMov() === 'retilineo'))
  1653 + tabs.eq(1).trigger('click');
  1654 +
  1655 + if (self.globalConfig.getTipoMov() === 'circular')
  1656 + tabs.eq(2).trigger('click');
  1657 +
  1658 + if (self.globalConfig.getTipoMov() === 'semicircular')
  1659 + tabs.eq(2).trigger('click');
  1660 + }
  1661 +
  1662 + if (category === 'palma_mao') {
  1663 + if ((self.globalConfig.getTipoMov() === 'pontual') || (self.globalConfig.getTipoMov() === 'retilineo'))
  1664 + tabs.eq(2).trigger('click');
  1665 +
  1666 + if (self.globalConfig.getTipoMov() === 'circular')
  1667 + tabs.eq(3).trigger('click');
  1668 +
  1669 + if (self.globalConfig.getTipoMov() === 'semicircular')
  1670 + tabs.eq(3).trigger('click');
  1671 + }
  1672 + };
  1673 +
  1674 + return {
  1675 + run: function() {
  1676 + _init();
  1677 +
  1678 + _getResourcesPath(function() {
  1679 + // Creating DOM
  1680 + _createTabsDOM();
  1681 + _createPanelsDOM();
  1682 +
  1683 + // Setting Texts and Avatar
  1684 + _setSignalName();
  1685 + _setAvatarImage();
  1686 +
  1687 + // Loading Images and Videos
  1688 + _loadingImagesAndVideos();
  1689 +
  1690 + // Bind Events
  1691 + _bindScrollEvents();
  1692 + _bindEventsOfTabsAndPanels();
  1693 + _bindConfigChoicesEvents();
  1694 + _bindInitialVideosEvents();
  1695 + _bindLocalizationPanelEvents();
  1696 + _bindTimelineBlocksEvents();
  1697 + _bindCheckPointEvents();
  1698 + });
  1699 + }
  1700 + }
  1701 +};
  1702 +
  1703 +module.exports.mainFrame = mainFrame;
  1704 +}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  1705 +},{}],5:[function(require,module,exports){
  1706 +var registerFrame = function() {
  1707 +
  1708 + /* Function Scope */
  1709 + var self = this;
  1710 +
  1711 + /* Main Variables */
  1712 + var params,
  1713 + registerContainer,
  1714 + isConfigSet;
  1715 +
  1716 + function _init() {
  1717 + self.params = { name: '', quantMaos: '', tipoMov: '', repeticao: '' };
  1718 + self.registerContainer = $('#registerContainer');
  1719 + self.isConfigSet = [false, false, false, false];
  1720 + };
  1721 +
  1722 + function _bindFieldsEvents() {
  1723 + var demoFields = self.registerContainer.find('.demoField');
  1724 +
  1725 + self.registerContainer.find('.nomeDoSinal').on('blur', 'input', function(e) {
  1726 + if ($(this).val() !== '') {
  1727 + self.params['name'] = $(this).val().toLowerCase();
  1728 + self.isConfigSet[0] = true;
  1729 + _setColor(1, true);
  1730 + } else {
  1731 + self.isConfigSet[0] = false;
  1732 + _setColor(1, false);
  1733 + }
  1734 + _validateFields();
  1735 + });
  1736 +
  1737 + self.registerContainer.find('.quantMaos').on('click', 'button', function(e) {
  1738 + self.params['quantMaos'] = $(this).val();
  1739 + demoFields.eq(0).find('div').text($(this).text());
  1740 + _setColor(2, true);
  1741 + self.isConfigSet[1] = true;
  1742 + _validateFields();
  1743 + });
  1744 +
  1745 + self.registerContainer.find('.tipoMov').on('click', 'button', function(e) {
  1746 + self.params['tipoMov'] = $(this).val();
  1747 + demoFields.eq(1).find('div').text($(this).text());
  1748 + _setColor(3, true);
  1749 + self.isConfigSet[2] = true;
  1750 + _validateFields();
  1751 + });
  1752 +
  1753 + self.registerContainer.find('.repeticao').on('click', 'button', function(e) {
  1754 + self.params['repeticao'] = $(this).val();
  1755 + demoFields.eq(2).find('div').text($(this).text());
  1756 + _setColor(4, true);
  1757 + self.isConfigSet[3] = true;
  1758 + _validateFields();
  1759 + });
  1760 + };
  1761 +
  1762 + function _validateFields() {
  1763 + var confSinalButton = self.registerContainer.find('.configurarSinal').find('button');
  1764 +
  1765 + var all = false,
  1766 + aux = 0;
  1767 +
  1768 + for (var i = 0; i < self.isConfigSet.length; i++) {
  1769 + if (self.isConfigSet[i])
  1770 + aux++;
  1771 + }
  1772 +
  1773 + all = (aux === 4) ? true : false;
  1774 +
  1775 + if (all) {
  1776 + confSinalButton.removeClass('disabled');
  1777 + }
  1778 + else {
  1779 + if (!confSinalButton.hasClass('disabled'))
  1780 + confSinalButton.addClass('disabled');
  1781 + }
  1782 + };
  1783 +
  1784 + function _setColor(index, isSet) {
  1785 + var spanFields = self.registerContainer.find('.registroContent');
  1786 +
  1787 + if (isSet)
  1788 + spanFields.find('> div:nth-of-type('+ index +')').find('span').css('color', '#50C53A');
  1789 + else
  1790 + spanFields.find('> div:nth-of-type('+ index +')').find('span').css('color', '#C93030');
  1791 + };
  1792 +
  1793 + function _setValuesButtons() {
  1794 + var buttons = self.registerContainer.find('button');
  1795 + var values = ['uma', 'duas', 'retilineo', 'pontual', 'circular', 'semicircular', 'sem-repeticao', 'com-repeticao'];
  1796 +
  1797 + for (var i = 0; i < (buttons.length - 1); i++) {
  1798 + buttons.eq(i).attr('value', values[i]);
  1799 + }
  1800 + };
  1801 +
  1802 + function _getParams() {
  1803 + return self.params;
  1804 + };
  1805 +
  1806 + function _bindUnityCommunication() {
  1807 + return null;
  1808 +
  1809 + var u = new UnityObject2({ width: 250, height: 280, params: { enableDebugging: "0" }});
  1810 + u.initPlugin($('.unity'), "/system/wikilibras/unity/avatar.unity3d");
  1811 +
  1812 + $('.tipoMov > button:nth-of-type(1)').click(function() {
  1813 + u.getUnity().SendMessage("hozana", "playRetilineo", "");
  1814 + });
  1815 +
  1816 + $('.tipoMov > button:nth-of-type(2)').click(function() {
  1817 + u.getUnity().SendMessage("hozana", "playPontual", "");
  1818 + });
  1819 +
  1820 + $('.tipoMov > button:nth-of-type(3)').click(function() {
  1821 + u.getUnity().SendMessage("hozana", "playCircular", "");
  1822 + });
  1823 +
  1824 + $('.tipoMov > button:nth-of-type(4)').click(function() {
  1825 + u.getUnity().SendMessage("hozana", "playSemiCircular", "");
  1826 + });
  1827 + };
  1828 +
  1829 + return {
  1830 + run: function() {
  1831 + _init();
  1832 + _setValuesButtons();
  1833 + _bindFieldsEvents();
  1834 + _bindUnityCommunication();
  1835 + },
  1836 +
  1837 + getParams: function() {
  1838 + return _getParams();
  1839 + }
  1840 + }
  1841 +}
  1842 +
  1843 +module.exports.registerFrame = registerFrame;
  1844 +},{}],6:[function(require,module,exports){
  1845 +(function() {
  1846 + var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
  1847 +templates['wlChoiceTpl'] = template(function (Handlebars,depth0,helpers,partials,data) {
  1848 + this.compilerInfo = [4,'>= 1.0.0'];
  1849 +helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1850 +
  1851 +
  1852 +
  1853 + return "<div id=\"choiceContainer\">\n <div class=\"wrapper\">\n <div class=\"texts\">\n <div class=\"description\">\n <p>Escolha a parte do corpo<br>que deseja configurar:</p>\n </div>\n <div class=\"preview\">\n <p></p>\n </div>\n </div>\n <div class=\"choices\">\n <div>\n <svg width=\"230\" height=\"310\" viewPort=\"0 0 230 310\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <polygon class=\"done\" points=\"70,51,70,69,72,79,75,86,78,92,84,99,90,105,98,110,103,112,108,113,111,114,119,114,125,112,131,110,137,106,141,103,145,98,150,92,153,86,156,78,158,71,158,62,158,51,157,43,154,37,149,27,145,22,141,17,134,12,126,8,119,7,108,7,100,9,94,12,88,16,83,21,79,27,75,33,72,42,71,46\"/>\n \n <polygon points=\"3,123,3,129,3,141,6,153,11,162,14,167,17,170,22,174,27,177,32,179,36,179,43,179,46,178,49,177,53,175,57,173,61,170,63,166,67,161,69,157,71,152,73,146,74,141,74,133,74,121,73,118,72,113,69,107,66,101,63,98,60,93,55,90,50,87,45,85,42,84,35,84,32,85,26,87,23,89,18,93,14,97,11,101,8,107,6,112,5,115\"/>\n\n <polygon points=\"155,123,155,130,155,140,155,144,157,150,159,156,162,161,165,167,169,170,173,174,177,177,183,179,188,180,195,180,198,179,204,177,208,174,213,169,218,163,222,155,225,146,226,139,227,131,226,124,225,118,221,107,217,100,211,93,205,89,199,86,194,84,187,84,184,85,182,85,177,87,172,91,168,94,164,99,161,104,159,110,157,116\"/>\n </svg>\n </div>\n </div>\n </div>\n</div>";
  1854 + });
  1855 +})();
  1856 +},{}],7:[function(require,module,exports){
  1857 +(function() {
  1858 + var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
  1859 +templates['wlMainTpl'] = template(function (Handlebars,depth0,helpers,partials,data) {
  1860 + this.compilerInfo = [4,'>= 1.0.0'];
  1861 +helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1862 +
  1863 +
  1864 +
  1865 + return "<div id=\"mainContainer\">\n <div class=\"checkpoint desactive\">\n <div class=\"voltar\">\n <p>Voltar</p>\n </div>\n <div class=\"continuar\">\n <p>Continuar</p>\n </div>\n <div class=\"gerar desactive\">\n <p>Gerar Sinal</p>\n </div>\n </div>\n <div id=\"textsContainer\">\n <div class=\"panelLabel\">\n <span class=\"pLWrapper\"></span>\n </div>\n <div class=\"signalName\">\n <span class=\"sNWrapper\"></span>\n </div>\n </div>\n <div id=\"tabsContainer\">\n <ul class=\"tabs\"></ul>\n </div>\n <div id=\"panelsContainer\">\n </div>\n <div id=\"avatarContainer\">\n <span class=\"wrapper\"></span>\n </div>\n <div class=\"clearfix\"></div>\n <div id=\"timelineContainer\">\n <div class=\"wrapper\"></div>\n </div>\n</div>";
  1866 + });
  1867 +})();
  1868 +},{}],8:[function(require,module,exports){
  1869 +(function() {
  1870 + var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
  1871 +templates['wlRegisterTpl'] = template(function (Handlebars,depth0,helpers,partials,data) {
  1872 + this.compilerInfo = [4,'>= 1.0.0'];
  1873 +helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1874 +
  1875 +
  1876 +
  1877 + return "<div id=\"registerContainer\">\n <div id=\"title\">\n <div class=\"registroTitle\"><p>Registro do Sinal</p></div>\n <div class=\"demoTitle\"><p>Demo</p></div>\n </div>\n <div id=\"content\">\n <div class=\"registroContent\">\n <div class=\"nomeDoSinal\">\n <span class=\"label\">Nome do Sinal</span>\n <div class=\"clearfix\"></div>\n <input type=\"text\">\n </div>\n <div class=\"quantMaos\">\n <span class=\"label\">Quantidade de Mãos</span>\n <div class=\"clearfix\"></div>\n <button class=\"btn btn-large btn-sample\">Uma Mão</button>\n <button class=\"btn btn-large btn-sample\">Duas Mãos</button>\n </div>\n <div class=\"tipoMov\">\n <span class=\"label\">Tipo do Movimento</span>\n <div class=\"clearfix\"></div>\n <button class=\"btn btn-large btn-sample\">Retilíneo</button>\n <button class=\"btn btn-large btn-sample\">Pontual</button>\n <button class=\"btn btn-large btn-sample\">Circular</button>\n <button class=\"btn btn-large btn-sample\">SemiCircular</button>\n </div>\n <div class=\"repeticao\">\n <span class=\"label\">Repetição</span>\n <div class=\"clearfix\"></div>\n <button value=\"sem-repeticao\" class=\"btn btn-large btn-sample\">Sem Repetição</button>\n <button value=\"com-repeticao\" class=\"btn btn-large btn-sample\">Com Repetição</button>\n </div>\n <div class=\"configurarSinal\">\n <button class=\"btn btn-large btn-success disabled\">Configurar Sinal</button>\n </div>\n </div>\n <div class=\"demoContent\">\n <div class=\"demoField\">\n <div></div>\n </div>\n <div class=\"demoField\">\n <div></div>\n </div>\n <div class=\"demoField\">\n <div></div>\n </div>\n <div class=\"unity\"></div>\n </div>\n </div>\n</div>";
  1878 + });
  1879 +})();
  1880 +},{}]},{},[1])
0 1881 \ No newline at end of file
... ...
vendor/assets/stylesheets/wikilibras.css 0 → 100644
... ... @@ -0,0 +1,940 @@
  1 +@font-face {
  2 + font-family: 'trajan_pro';
  3 + src: url('/system/wikilibras/fonts/trajan_pro.woff') format('woff');
  4 +}
  5 +.btn {
  6 + display: inline-block;
  7 + *display: inline;
  8 + padding: 4px 12px;
  9 + margin-bottom: 0;
  10 + *margin-left: .3em;
  11 + font-size: 14px;
  12 + line-height: 20px;
  13 + color: #333333;
  14 + text-align: center;
  15 + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  16 + vertical-align: middle;
  17 + cursor: pointer;
  18 + background-color: #f5f5f5;
  19 + *background-color: #e6e6e6;
  20 + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  21 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  22 + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  23 + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  24 + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  25 + background-repeat: repeat-x;
  26 + border: 1px solid #cccccc;
  27 + *border: 0;
  28 + border-color: #e6e6e6 #e6e6e6 #bfbfbf;
  29 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  30 + border-bottom-color: #b3b3b3;
  31 + -webkit-border-radius: 4px;
  32 + -moz-border-radius: 4px;
  33 + border-radius: 4px;
  34 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
  35 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  36 + *zoom: 1;
  37 + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  38 + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  39 + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  40 +}
  41 +.btn:active,
  42 +.btn.active {
  43 + background-color: #cccccc \9;
  44 +}
  45 +.btn:first-child {
  46 + *margin-left: 0;
  47 +}
  48 +.btn:hover,
  49 +.btn:focus {
  50 + color: #333333;
  51 + text-decoration: none;
  52 + background-position: 0 -15px;
  53 + -webkit-transition: background-position 0.1s linear;
  54 + -moz-transition: background-position 0.1s linear;
  55 + -o-transition: background-position 0.1s linear;
  56 + transition: background-position 0.1s linear;
  57 +}
  58 +.btn:focus {
  59 + outline: thin dotted #333;
  60 + outline: 5px auto -webkit-focus-ring-color;
  61 + outline-offset: -2px;
  62 +}
  63 +.btn.active,
  64 +.btn:active {
  65 + background-image: none;
  66 + outline: 0;
  67 + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  68 + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  69 + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  70 +}
  71 +.btn-large {
  72 + padding: 11px 19px;
  73 + font-size: 17.5px;
  74 + -webkit-border-radius: 6px;
  75 + -moz-border-radius: 6px;
  76 + border-radius: 6px;
  77 + padding: 9px 13px 6px 13px !important;
  78 + font-size: 14px;
  79 + font-family: 'trajan_pro';
  80 +}
  81 +.btn-success {
  82 + color: #ffffff;
  83 + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  84 + background-color: #5bb75b;
  85 + *background-color: #51a351;
  86 + background-image: -moz-linear-gradient(top, #62c462, #51a351);
  87 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
  88 + background-image: -webkit-linear-gradient(top, #62c462, #51a351);
  89 + background-image: -o-linear-gradient(top, #62c462, #51a351);
  90 + background-image: linear-gradient(to bottom, #62c462, #51a351);
  91 + background-repeat: repeat-x;
  92 + border-color: #51a351 #51a351 #387038;
  93 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  94 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
  95 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  96 +}
  97 +.btn-success:hover,
  98 +.btn-success:focus,
  99 +.btn-success:active,
  100 +.btn-success.active,
  101 +.btn-success.disabled,
  102 +.btn-success[disabled] {
  103 + color: #ffffff;
  104 + background-color: #51a351;
  105 + *background-color: #499249;
  106 +}
  107 +.btn-success:active,
  108 +.btn-success.active {
  109 + background-color: #408140 \9;
  110 +}
  111 +.btn-sample {
  112 + color: #545454;
  113 + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  114 + background-color: #A1A1A1;
  115 + *background-color: #A1A1A1;
  116 + background-image: -moz-linear-gradient(top, #d9d9d9, #a1a1a1);
  117 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#d9d9d9), to(#a1a1a1));
  118 + background-image: -webkit-linear-gradient(top, #d9d9d9, #a1a1a1);
  119 + background-image: -o-linear-gradient(top, #d9d9d9, #a1a1a1);
  120 + background-image: linear-gradient(to bottom, #d9d9d9, #a1a1a1);
  121 + background-repeat: repeat-x;
  122 + border-color: #aeaeae;
  123 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D9D9D9', endColorstr='#A1A1A1', GradientType=0);
  124 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  125 + font-family: 'trajan_pro';
  126 +}
  127 +.btn-sample:hover,
  128 +.btn-sample:focus,
  129 +.btn-sample:active,
  130 +.btn-sample.active {
  131 + color: #545454;
  132 + background-color: #A1A1A1;
  133 + *background-color: #003bb3;
  134 +}
  135 +#registerContainer {
  136 + font-family: 'trajan_pro';
  137 + width: 940px;
  138 + height: 550px;
  139 + background-color: #ebebeb;
  140 + border: 3px solid #cccccc;
  141 + margin: 0 auto;
  142 +}
  143 +#registerContainer #title {
  144 + width: 100%;
  145 + height: 50px;
  146 +}
  147 +#registerContainer #title > div {
  148 + position: relative;
  149 + height: 50px;
  150 + border-bottom: 3px solid #cccccc;
  151 +}
  152 +#registerContainer #title > div > p {
  153 + margin: 0;
  154 + font-size: 28px;
  155 + margin-top: 10px;
  156 +}
  157 +#registerContainer #title .registroTitle {
  158 + width: 607px;
  159 + float: left;
  160 +}
  161 +#registerContainer #title .registroTitle > p {
  162 + margin-left: 164px;
  163 +}
  164 +#registerContainer #title .demoTitle {
  165 + width: 330px;
  166 + float: right;
  167 + border-left: 3px solid #cccccc;
  168 +}
  169 +#registerContainer #title .demoTitle > p {
  170 + margin-left: 123px;
  171 +}
  172 +#registerContainer #content > div {
  173 + position: relative;
  174 + height: 500px;
  175 +}
  176 +#registerContainer #content .registroContent {
  177 + width: 607px;
  178 + float: left;
  179 +}
  180 +#registerContainer #content .registroContent > div {
  181 + width: 325px;
  182 + margin: 0 auto;
  183 + border: 1px solid gray;
  184 + position: relative;
  185 +}
  186 +#registerContainer #content .registroContent > div > span {
  187 + background-color: #ebebeb;
  188 + position: relative;
  189 + font-size: 14px;
  190 + top: -9px;
  191 + left: 4px;
  192 + padding: 2px;
  193 + color: #C93030;
  194 +}
  195 +#registerContainer #content .registroContent > div > button {
  196 + display: block;
  197 + position: relative;
  198 + float: left;
  199 + color: #4a4a4a;
  200 +}
  201 +#registerContainer #content .registroContent > div .disabled {
  202 + pointer-events: none;
  203 + opacity: 0.5;
  204 +}
  205 +#registerContainer #content .registroContent .nomeDoSinal {
  206 + height: 60px;
  207 + top: 20px;
  208 +}
  209 +#registerContainer #content .registroContent .nomeDoSinal > input {
  210 + font-size: 20px;
  211 + padding-top: 5px;
  212 + font-family: 'trajan_pro';
  213 + width: 305px;
  214 + height: 25px;
  215 + position: relative;
  216 + left: 7px;
  217 + bottom: 1px;
  218 +}
  219 +#registerContainer #content .registroContent .quantMaos {
  220 + height: 60px;
  221 + top: 40px;
  222 +}
  223 +#registerContainer #content .registroContent .quantMaos > button {
  224 + margin-left: 36px;
  225 + top: -5px;
  226 +}
  227 +#registerContainer #content .registroContent .tipoMov {
  228 + height: 120px;
  229 + top: 60px;
  230 +}
  231 +#registerContainer #content .registroContent .tipoMov > button {
  232 + margin-left: 28px;
  233 + margin-top: 15px;
  234 + top: -14px;
  235 +}
  236 +#registerContainer #content .registroContent .tipoMov > button:nth-of-type(1) {
  237 + left: 8px;
  238 +}
  239 +#registerContainer #content .registroContent .tipoMov > button:nth-of-type(2) {
  240 + left: 20px;
  241 +}
  242 +#registerContainer #content .registroContent .tipoMov > button:nth-of-type(n+3) {
  243 + left: 10px;
  244 +}
  245 +#registerContainer #content .registroContent .repeticao {
  246 + height: 65px;
  247 + top: 80px;
  248 +}
  249 +#registerContainer #content .registroContent .repeticao > button {
  250 + margin-left: 11px;
  251 + top: -3px;
  252 +}
  253 +#registerContainer #content .registroContent .configurarSinal {
  254 + height: 75px;
  255 + top: 94px;
  256 + border: 0;
  257 +}
  258 +#registerContainer #content .registroContent .configurarSinal > button {
  259 + top: 8px;
  260 + left: 39px;
  261 + color: white;
  262 +}
  263 +#registerContainer #content .registroContent .configurarSinal > .btn-large {
  264 + padding: 18px 26px 15px 22px !important;
  265 + font-size: 19px;
  266 +}
  267 +#registerContainer #content .demoContent {
  268 + width: 330px;
  269 + float: right;
  270 + border-left: 3px solid #cccccc;
  271 +}
  272 +#registerContainer #content .demoContent .demoField {
  273 + width: 290px;
  274 + height: 40px;
  275 + position: relative;
  276 + left: 40px;
  277 + background: url('/system/wikilibras/images/demo_bg.png') no-repeat;
  278 + background-size: 250px 40px;
  279 +}
  280 +#registerContainer #content .demoContent .demoField:nth-of-type(1) {
  281 + top: 20px;
  282 +}
  283 +#registerContainer #content .demoContent .demoField:nth-of-type(2) {
  284 + top: 40px;
  285 +}
  286 +#registerContainer #content .demoContent .demoField:nth-of-type(3) {
  287 + top: 60px;
  288 +}
  289 +#registerContainer #content .demoContent .demoField > div {
  290 + width: 86%;
  291 + height: 100%;
  292 + font-size: 25px;
  293 + text-align: center;
  294 + position: relative;
  295 + top: 9px;
  296 +}
  297 +#registerContainer #content .demoContent .unity {
  298 + border: 1px solid black;
  299 + width: 250px;
  300 + height: 280px;
  301 + position: relative;
  302 + left: 40px;
  303 + top: 80px;
  304 +}
  305 +#choiceContainer {
  306 + width: 940px;
  307 + height: 550px;
  308 + background-color: #ebebeb;
  309 + border: 3px solid #cccccc;
  310 + margin: 0 auto;
  311 +}
  312 +#choiceContainer .wrapper {
  313 + width: 750px;
  314 + height: 350px;
  315 + margin: 0 auto;
  316 + margin-top: 100px;
  317 +}
  318 +#choiceContainer .wrapper div {
  319 + position: relative;
  320 +}
  321 +#choiceContainer .wrapper .texts {
  322 + float: left;
  323 + width: 450px;
  324 + height: 350px;
  325 +}
  326 +#choiceContainer .wrapper .texts > div {
  327 + margin: 0 auto;
  328 +}
  329 +#choiceContainer .wrapper .texts > div > p {
  330 + font-family: 'trajan_pro';
  331 + position: relative;
  332 + margin: 0;
  333 + color: #798088;
  334 +}
  335 +#choiceContainer .wrapper .texts .description {
  336 + background: url('/system/wikilibras/images/choice/big_desc.png') no-repeat;
  337 + background-size: 350px 170px;
  338 + width: 350px;
  339 + height: 170px;
  340 + top: 40px;
  341 +}
  342 +#choiceContainer .wrapper .texts .description p {
  343 + width: 330px;
  344 + font-size: 19px;
  345 + top: 65px;
  346 + left: 23px;
  347 +}
  348 +#choiceContainer .wrapper .texts .preview {
  349 + background: url('/system/wikilibras/images/choice/small_desc.png') no-repeat;
  350 + background-size: 340px 80px;
  351 + width: 350px;
  352 + height: 80px;
  353 + top: 60px;
  354 +}
  355 +#choiceContainer .wrapper .texts .preview p {
  356 + width: 320px;
  357 + font-size: 25px;
  358 + text-align: center;
  359 + top: 27px;
  360 +}
  361 +#choiceContainer .wrapper .choices {
  362 + float: right;
  363 + width: 300px;
  364 + height: 100%;
  365 +}
  366 +#choiceContainer .wrapper .choices > div {
  367 + background: url('/system/wikilibras/images/choice/avatar.png') no-repeat;
  368 + border: 2px solid black;
  369 + width: 230px;
  370 + height: 310px;
  371 + top: 20px;
  372 + left: 10px;
  373 +}
  374 +#choiceContainer .wrapper .choices > div svg .active {
  375 + stroke: red;
  376 + stroke-width: 3;
  377 + fill-opacity: 0;
  378 +}
  379 +#choiceContainer .wrapper .choices > div svg .active:hover {
  380 + fill: red;
  381 + fill-opacity: .2;
  382 + cursor: pointer;
  383 +}
  384 +#choiceContainer .wrapper .choices > div svg .done {
  385 + stroke: #07FF00;
  386 + stroke-width: 3;
  387 + fill: #07FF00;
  388 + fill-opacity: 0.5;
  389 +}
  390 +#choiceContainer .wrapper .choices > div svg .disabled {
  391 + stroke-opacity: 0;
  392 + fill-opacity: 0;
  393 +}
  394 +#mainContainer {
  395 + width: 940px;
  396 + height: 550px;
  397 + background-color: #ebebeb;
  398 + border: 3px solid #cccccc;
  399 + margin: 0 auto;
  400 +}
  401 +#mainContainer .checkpoint {
  402 + width: 940px;
  403 + height: 550px;
  404 + position: absolute;
  405 + background-color: black;
  406 + z-index: 10;
  407 + opacity: 0.9;
  408 +}
  409 +#mainContainer .checkpoint.desactive {
  410 + display: none;
  411 +}
  412 +#mainContainer .checkpoint .voltar {
  413 + width: 200px;
  414 + height: 150px;
  415 + position: relative;
  416 + background: url('/system/wikilibras/images/voltar.png') no-repeat;
  417 + background-position: center top;
  418 + top: 180px;
  419 + margin-left: 190px;
  420 + float: left;
  421 + cursor: pointer;
  422 +}
  423 +#mainContainer .checkpoint .voltar > p {
  424 + font-family: 'trajan_pro';
  425 + color: white;
  426 + margin: 0;
  427 + position: relative;
  428 + font-size: 34px;
  429 + top: 110px;
  430 + left: 35px;
  431 +}
  432 +#mainContainer .checkpoint .voltar:hover > p {
  433 + color: #fe4b4b;
  434 +}
  435 +#mainContainer .checkpoint .continuar {
  436 + width: 220px;
  437 + height: 180px;
  438 + position: relative;
  439 + background: url('/system/wikilibras/images/continuar.png') no-repeat;
  440 + background-size: 100px;
  441 + background-position: 71px 2px;
  442 + top: 172px;
  443 + left: 120px;
  444 + float: left;
  445 + cursor: pointer;
  446 +}
  447 +#mainContainer .checkpoint .continuar > p {
  448 + font-family: 'trajan_pro';
  449 + color: white;
  450 + margin: 0;
  451 + position: relative;
  452 + font-size: 34px;
  453 + top: 120px;
  454 +}
  455 +#mainContainer .checkpoint .continuar:hover > p {
  456 + color: #2ee7f0;
  457 +}
  458 +#mainContainer .checkpoint .continuar.desactive {
  459 + display: none;
  460 +}
  461 +#mainContainer .checkpoint .gerar {
  462 + width: 230px;
  463 + height: 153px;
  464 + position: relative;
  465 + background: url('/system/wikilibras/images/gerar.png') no-repeat;
  466 + background-position: 60px top;
  467 + top: 170px;
  468 + left: 120px;
  469 + float: left;
  470 + cursor: pointer;
  471 +}
  472 +#mainContainer .checkpoint .gerar > p {
  473 + font-family: 'trajan_pro';
  474 + color: white;
  475 + margin: 0;
  476 + position: relative;
  477 + font-size: 34px;
  478 + top: 120px;
  479 +}
  480 +#mainContainer .checkpoint .gerar:hover > p {
  481 + color: #80ff70;
  482 +}
  483 +#mainContainer .checkpoint .gerar.desactive {
  484 + display: none;
  485 +}
  486 +#mainContainer #textsContainer {
  487 + position: relative;
  488 + width: 920px;
  489 + height: 50px;
  490 + top: 10px;
  491 + left: 10px;
  492 + font-family: 'trajan_pro';
  493 +}
  494 +#mainContainer #textsContainer .panelLabel {
  495 + width: 300px;
  496 + height: 100%;
  497 + position: relative;
  498 + float: left;
  499 +}
  500 +#mainContainer #textsContainer .panelLabel .pLWrapper {
  501 + font-size: 1em;
  502 + position: relative;
  503 + top: 18px;
  504 +}
  505 +#mainContainer #textsContainer .signalName {
  506 + width: 350px;
  507 + height: 100%;
  508 + position: relative;
  509 + float: right;
  510 + right: 140px;
  511 +}
  512 +#mainContainer #textsContainer .signalName .sNWrapper {
  513 + font-size: 1em;
  514 + position: relative;
  515 + top: 18px;
  516 + float: right;
  517 +}
  518 +#mainContainer #tabsContainer {
  519 + position: relative;
  520 + width: 160px;
  521 + top: 20px;
  522 + left: 10px;
  523 + float: left;
  524 + font-family: 'trajan_pro';
  525 +}
  526 +#mainContainer #tabsContainer a {
  527 + text-decoration: none;
  528 +}
  529 +#mainContainer #tabsContainer .tabs {
  530 + width: 100%;
  531 + height: 100%;
  532 + margin: 0;
  533 + padding: 0;
  534 + list-style-type: none;
  535 +}
  536 +#mainContainer #tabsContainer .tabs li {
  537 + width: 100%;
  538 + height: 55px;
  539 + margin-bottom: 5px;
  540 + color: white;
  541 + background: linear-gradient(to bottom, #5c79bf, #3c5898);
  542 +}
  543 +#mainContainer #tabsContainer .tabs li p {
  544 + position: relative;
  545 + top: 20px;
  546 + left: 10px;
  547 + margin: 0;
  548 +}
  549 +#mainContainer #tabsContainer .tabs li:nth-of-type(1) .arrow {
  550 + top: 0;
  551 +}
  552 +#mainContainer #tabsContainer .tabs li:nth-of-type(2) .arrow {
  553 + top: 60px;
  554 +}
  555 +#mainContainer #tabsContainer .tabs li:nth-of-type(3) .arrow {
  556 + top: 120px;
  557 +}
  558 +#mainContainer #tabsContainer .tabs li:nth-of-type(4) .arrow {
  559 + top: 180px;
  560 +}
  561 +#mainContainer #tabsContainer .tabs li:hover {
  562 + cursor: pointer;
  563 + border-left: 2px solid #0a0b6e;
  564 +}
  565 +#mainContainer #tabsContainer .tabs li:hover p {
  566 + left: 8px;
  567 +}
  568 +#mainContainer #tabsContainer .tabs li .arrow {
  569 + position: absolute;
  570 + float: left;
  571 + left: 160px;
  572 + width: 0;
  573 + height: 0;
  574 + border-top: 27.5px solid transparent;
  575 + border-bottom: 27.5px solid transparent;
  576 + border-left: 12px solid #4d69ac;
  577 +}
  578 +#mainContainer #tabsContainer .tabs li .arrow.active {
  579 + z-index: 3;
  580 +}
  581 +#mainContainer #panelsContainer {
  582 + position: relative;
  583 + width: 620px;
  584 + height: 350px;
  585 + top: 20px;
  586 + left: 10px;
  587 + float: left;
  588 + /*
  589 + * BEGIN - Panels Principais
  590 + */
  591 +
  592 + /*
  593 + * END - Panels Principais
  594 + */
  595 +
  596 +}
  597 +#mainContainer #panelsContainer > div {
  598 + position: absolute;
  599 + width: 100%;
  600 + height: 100%;
  601 + z-index: 1;
  602 + background-color: #cccccc;
  603 +}
  604 +#mainContainer #panelsContainer > .active {
  605 + z-index: 2;
  606 +}
  607 +#mainContainer #panelsContainer .scrollUp {
  608 + width: 590px;
  609 + height: 30px;
  610 + background-color: white;
  611 + position: relative;
  612 + top: 10px;
  613 + left: 15px;
  614 + background: #808080 url('/system/wikilibras/images/up.png') no-repeat center;
  615 + background-size: 30px 30px;
  616 + opacity: 0.5;
  617 + -webkit-transition: all 0.5s ease;
  618 + transition: all 0.5s ease;
  619 +}
  620 +#mainContainer #panelsContainer .scrollUp:hover {
  621 + opacity: 1;
  622 +}
  623 +#mainContainer #panelsContainer .scrollDown {
  624 + width: 590px;
  625 + height: 30px;
  626 + background-color: white;
  627 + position: relative;
  628 + top: 20px;
  629 + left: 15px;
  630 + background: #808080 url('/system/wikilibras/images/down.png') no-repeat center;
  631 + background-size: 30px 30px;
  632 + opacity: 0.5;
  633 + -webkit-transition: all 0.5s ease;
  634 + transition: all 0.5s ease;
  635 +}
  636 +#mainContainer #panelsContainer .scrollDown:hover {
  637 + opacity: 1;
  638 +}
  639 +#mainContainer #panelsContainer .mainContent {
  640 + width: 590px;
  641 + height: 260px;
  642 + position: relative;
  643 + top: 15px;
  644 + left: 15px;
  645 + overflow: hidden;
  646 +}
  647 +#mainContainer #panelsContainer .mainContent .wrapper {
  648 + width: 100%;
  649 + height: 100%;
  650 + overflow: auto;
  651 +}
  652 +#mainContainer #panelsContainer .mainContent ::-webkit-scrollbar {
  653 + display: none;
  654 +}
  655 +#mainContainer #panelsContainer > div.expression .mainContent .wrapper > span {
  656 + width: 110px;
  657 + height: 110px;
  658 + background-color: black;
  659 + position: relative;
  660 + margin-right: 10px;
  661 + margin-bottom: 10px;
  662 + float: left;
  663 + /*
  664 + * Hack para reencaixar os span's dentro do .wrapper no Firefox (-5px)
  665 + */
  666 +
  667 + cursor: pointer;
  668 +}
  669 +@-moz-document url-prefix() {
  670 + #panelsContainer > div.expression .mainContent .wrapper > span {
  671 + margin-right: 5px !important;
  672 + }
  673 +}
  674 +#mainContainer #panelsContainer > div.expression .mainContent .wrapper > span:nth-of-type(-n+5) {
  675 + margin-top: 4px;
  676 +}
  677 +#mainContainer #panelsContainer > div.expression .mainContent .wrapper > span:nth-of-type(5n+5) {
  678 + margin-right: 0;
  679 +}
  680 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper {
  681 + /*
  682 + * Hack para reencaixar os span's dentro do .wrapper no Firefox (-11px)
  683 + */
  684 +
  685 +}
  686 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div {
  687 + position: relative;
  688 + float: left;
  689 + border: 1px solid black;
  690 + margin-bottom: 20px;
  691 + width: 224px;
  692 + height: 198px;
  693 +}
  694 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div > span {
  695 + width: 100px;
  696 + height: 150px;
  697 + margin-top: 10px;
  698 + position: relative;
  699 + float: left;
  700 + cursor: pointer;
  701 +}
  702 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div > span:nth-of-type(1) {
  703 + margin-left: 7px;
  704 +}
  705 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div > span:nth-of-type(3) {
  706 + margin-left: 7px;
  707 +}
  708 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div > span:nth-of-type(2) {
  709 + margin-left: 10px;
  710 +}
  711 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div > span:nth-of-type(4) {
  712 + margin-left: 10px;
  713 +}
  714 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div .label {
  715 + font-family: 'trajan_pro';
  716 + font-size: 12px;
  717 + text-align: center;
  718 + padding-top: 6px;
  719 + position: relative;
  720 + float: left;
  721 + width: 100px;
  722 + height: 19px;
  723 + margin-top: 7px;
  724 + margin-left: 7px;
  725 +}
  726 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div .label:nth-of-type(2) {
  727 + margin-left: 10px;
  728 +}
  729 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:not( :nth-of-type(2)) .label:last-of-type {
  730 + margin-left: 10px;
  731 +}
  732 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(3) {
  733 + margin-left: 59px;
  734 +}
  735 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(4) {
  736 + margin-left: 20px;
  737 +}
  738 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(4) > span:nth-of-type(-n+4) {
  739 + display: none;
  740 +}
  741 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(4) .label:nth-of-type(-n+4) {
  742 + display: none;
  743 +}
  744 +@-moz-document url-prefix() {
  745 + #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(2) {
  746 + margin-left: 5px !important;
  747 + }
  748 +}
  749 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(2) {
  750 + width: 342px;
  751 + height: 198px;
  752 + margin-left: 20px;
  753 +}
  754 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(2) > span:nth-of-type(n+2) {
  755 + margin-left: 14px;
  756 +}
  757 +#mainContainer #panelsContainer > div.initial .mainContent .wrapper > div:nth-of-type(2) .label:nth-of-type(n+2) {
  758 + margin-left: 14px;
  759 +}
  760 +#mainContainer #panelsContainer > div.dedos .mainContent .wrapper > span {
  761 + width: 87px;
  762 + height: 110px;
  763 + background-color: black;
  764 + position: relative;
  765 + margin-right: 13.6px;
  766 + margin-bottom: 13.6px;
  767 + float: left;
  768 + /*
  769 + * Hack para reencaixar os span's dentro do .wrapper no Firefox (-5px)
  770 + */
  771 +
  772 + cursor: pointer;
  773 +}
  774 +@-moz-document url-prefix() {
  775 + #panelsContainer > div.dedos .mainContent .wrapper > span {
  776 + margin-right: 8.6px !important;
  777 + }
  778 +}
  779 +#mainContainer #panelsContainer > div.dedos .mainContent .wrapper > span:nth-of-type(-n+6) {
  780 + margin-top: 8.6px;
  781 +}
  782 +#mainContainer #panelsContainer > div.dedos .mainContent .wrapper > span:nth-of-type(6n+6) {
  783 + margin-right: 0;
  784 +}
  785 +#mainContainer #panelsContainer > div.orientation .mainContent .wrapper > span {
  786 + width: 125px;
  787 + height: 175px;
  788 + background-color: black;
  789 + position: relative;
  790 + margin-right: 30px;
  791 + margin-bottom: 30px;
  792 + float: left;
  793 + /*
  794 + * Hack para reencaixar os span's dentro do .wrapper no Firefox (-11px)
  795 + */
  796 +
  797 + cursor: pointer;
  798 +}
  799 +@-moz-document url-prefix() {
  800 + #panelsContainer > div.orientation .mainContent .wrapper > span {
  801 + margin-right: 18px !important;
  802 + }
  803 +}
  804 +#mainContainer #panelsContainer > div.orientation .mainContent .wrapper > span:nth-of-type(-n+4) {
  805 + margin-top: 10px;
  806 +}
  807 +#mainContainer #panelsContainer > div.orientation .mainContent .wrapper > span:nth-of-type(4n+4) {
  808 + margin-right: 0px;
  809 +}
  810 +#mainContainer #panelsContainer > div.localizations .mainContent {
  811 + height: 320px;
  812 +}
  813 +#mainContainer #panelsContainer > div.localizations .mainContent .wrapper > span {
  814 + width: 134px;
  815 + height: 185px;
  816 + background-color: black;
  817 + position: relative;
  818 + margin-right: 18px;
  819 + margin-top: 67.5px;
  820 + float: left;
  821 + cursor: pointer;
  822 +}
  823 +#mainContainer #panelsContainer > div.localizations .mainContent .wrapper > span:nth-of-type(4) {
  824 + margin-right: 0;
  825 +}
  826 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper {
  827 + width: 100%;
  828 + height: 320px;
  829 + top: -320px;
  830 + position: absolute;
  831 + -webkit-transition: all 0.3s linear;
  832 + transition: all 0.3s linear;
  833 + overflow: hidden;
  834 +}
  835 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div {
  836 + position: absolute;
  837 + width: 100%;
  838 + height: 320px;
  839 + z-index: 1;
  840 + background-color: #cccccc;
  841 +}
  842 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .scrollUp {
  843 + top: 0;
  844 + left: 0;
  845 + width: 550px;
  846 +}
  847 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .scrollDown {
  848 + top: -23px;
  849 + left: 0;
  850 +}
  851 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .innerWrapper {
  852 + width: 590px;
  853 + height: 255px;
  854 + position: relative;
  855 + overflow: auto;
  856 + top: -28px;
  857 +}
  858 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .innerWrapper > span {
  859 + width: 134px;
  860 + height: 185px;
  861 + background-color: black;
  862 + position: relative;
  863 + margin-right: 18px;
  864 + margin-bottom: 20px;
  865 + float: left;
  866 + /*
  867 + * Hack para reencaixar os span's dentro do .wrapper no Firefox (-11px)
  868 + */
  869 +
  870 + cursor: pointer;
  871 +}
  872 +@-moz-document url-prefix() {
  873 + #panelsContainer > div.localizations .mainContent .floatWrapper .innerWrapper > span {
  874 + margin-right: 9px !important;
  875 + }
  876 +}
  877 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .innerWrapper > span:nth-of-type(-n+4) {
  878 + margin-top: 10px;
  879 +}
  880 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .innerWrapper > span:nth-of-type(4n+4) {
  881 + margin-right: 0px;
  882 +}
  883 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper > div .close {
  884 + width: 28px;
  885 + height: 28px;
  886 + position: relative;
  887 + float: right;
  888 + cursor: pointer;
  889 + top: -30px;
  890 +}
  891 +#mainContainer #panelsContainer > div.localizations .mainContent .floatWrapper .active {
  892 + z-index: 2 !important;
  893 +}
  894 +#mainContainer #avatarContainer {
  895 + position: relative;
  896 + width: 130px;
  897 + height: 177px;
  898 + top: 100px;
  899 + left: 19px;
  900 + float: left;
  901 + border: 2px solid gray;
  902 +}
  903 +#mainContainer #avatarContainer > .wrapper {
  904 + width: 120px;
  905 + height: 167px;
  906 + position: absolute;
  907 + left: 5px;
  908 + top: 5px;
  909 +}
  910 +#mainContainer #timelineContainer {
  911 + position: relative;
  912 + width: 940px;
  913 + height: 110px;
  914 + top: 30px;
  915 +}
  916 +#mainContainer #timelineContainer .wrapper {
  917 + position: relative;
  918 + width: 940px;
  919 + height: 110px;
  920 + text-align: center;
  921 +}
  922 +#mainContainer #timelineContainer .wrapper > span {
  923 + position: relative;
  924 + display: inline-block;
  925 + width: 90px;
  926 + height: 90px;
  927 + top: 10px;
  928 + margin-left: 21px;
  929 + background-color: gray;
  930 + z-index: 1;
  931 +}
  932 +#mainContainer #timelineContainer .wrapper > span:first-of-type {
  933 + margin-left: 0px;
  934 +}
  935 +#mainContainer #timelineContainer .wrapper > span.active {
  936 + outline: 5px solid #324787;
  937 +}
  938 +#mainContainer .clearfix {
  939 + clear: both;
  940 +}
... ...