Commit ee0fe0e62ad432ecb7b47a68190c68d02d79bc15
1 parent
af81d6f3
Lexicon Issue
Showing
3 changed files
with
87 additions
and
24 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants","UserModules","LoginMessageConstants","AdminService", "AdminConstants", "UserTypeConstants", | |
4 | -function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, AdminConstants, UserTypeConstants) { | |
3 | +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants","UserModules","LoginMessageConstants","AdminService","$http", "AdminConstants", "UserTypeConstants", | |
4 | +function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, AdminConstants, UserTypeConstants, $http) { | |
5 | 5 | |
6 | 6 | //$scope.pageToOpen = { |
7 | 7 | // name: 'MainMenu' |
... | ... | @@ -332,11 +332,79 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
332 | 332 | $("#messageModal").modal('show'); |
333 | 333 | } |
334 | 334 | } |
335 | + | |
336 | + | |
337 | + $(document).ready(function () { | |
338 | + // getUserDetails(); | |
339 | + | |
340 | + // var ajaxResult = []; | |
341 | + // var ajaxResult1 = []; | |
342 | + $rootScope.isLexiconTabClicked = true; | |
343 | + $rootScope.lexiconData = function () { | |
344 | + if ($rootScope.isLexiconTabClicked == true) { | |
345 | + $rootScope.isLexiconTabClicked = false; | |
346 | + $.ajax({ | |
347 | + url: '~/../content/data/json/da/uc_dat_default.json', | |
348 | + dataType: "json", | |
349 | + success: function (result) { | |
350 | + $(result.root.uc.al.lx).each(function (key, value) { | |
351 | + // alert(this._tl); | |
352 | + $('#lexiconLangDropdown').append('<option val="' + this._id + '">' + this._tl + '</option>') | |
353 | + }); | |
335 | 354 | |
355 | + } | |
336 | 356 | |
337 | - $(document).ready(function () { | |
338 | - // getUserDetails(); | |
357 | + }); | |
358 | + } | |
359 | + $('#lexiconLangDropdown').change(function () { | |
360 | + $rootScope.isLexiconLanguageClicked = true; | |
361 | + $('#laxiconLangAdd').removeAttr('disabled'); | |
362 | + $('#laxicanlanguageChagne').removeAttr('disabled'); | |
363 | + $rootScope.selectedId = $("#lexiconLangDropdown option:selected").attr('val'); | |
364 | + $rootScope.selectedText = $("#lexiconLangDropdown option:selected").text(); | |
365 | + }); | |
366 | + | |
367 | + $('#laxiconLangAdd').click(function () { | |
368 | + if($rootScope.isLexiconLanguageClicked == true){ | |
369 | + $rootScope.isLexiconLanguageClicked = false; | |
370 | + $("#lexiconLangDropdown :selected").remove(); | |
371 | + $('#secondLax').append('<option val="' + $rootScope.selectedId + '">' + $rootScope.selectedText + '</option>'); | |
372 | + } | |
373 | + }); | |
374 | + | |
375 | + $('#secondLax').change(function () { | |
376 | + $rootScope.isActiveLexiconLanguageClicked = true; | |
377 | + $rootScope.secondlaxdid = $("#secondLax option:selected").attr('val'); | |
378 | + $rootScope.secondlaxtext = $("#secondLax option:selected").text(); | |
379 | + | |
380 | + }); | |
381 | + | |
382 | + $("#laxiconLangRemove").click(function () { | |
383 | + if ($rootScope.isActiveLexiconLanguageClicked == true) { | |
384 | + $rootScope.isActiveLexiconLanguageClicked = false; | |
385 | + $("#secondLax :selected").remove(); | |
386 | + $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>'); | |
387 | + } | |
388 | + }); | |
339 | 389 | |
390 | + $("#laxicanlanguageChagne").click(function () { | |
391 | + if ($rootScope.isLexiconLanguageClicked == true) | |
392 | + { | |
393 | + $rootScope.isLexiconLanguageClicked = false; | |
394 | + var primarylaxiid = $("#lexiconLangDropdown option:selected").attr('val'); | |
395 | + var primarylaxicantext = $("#lexiconLangDropdown option:selected").text(); | |
396 | + $("#lexiconLangDropdown :selected").remove(); | |
397 | + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $('#primarylaxican').val() + '</option>'); | |
398 | + $('#primarylaxican').val(primarylaxicantext); | |
399 | + $('#primarylaxican').attr("name", primarylaxiid); | |
400 | + } | |
401 | + | |
402 | + }); | |
403 | + } | |
404 | + | |
405 | + | |
406 | + | |
407 | + | |
340 | 408 | |
341 | 409 | $(function () { |
342 | 410 | var colpick = $('.demo').each(function () { |
... | ... | @@ -2978,6 +3046,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
2978 | 3046 | |
2979 | 3047 | $('#listManager').draggable(); |
2980 | 3048 | |
3049 | + | |
2981 | 3050 | |
2982 | 3051 | $rootScope.islistManagerEventAlredayDispachted = true; |
2983 | 3052 | |
... | ... | @@ -3374,7 +3443,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3374 | 3443 | top: 70, |
3375 | 3444 | left: 1, |
3376 | 3445 | }, |
3377 | - size: { width: $(window).outerWidth(), height: $(window).outerHeight() + 60}, | |
3446 | + size: { width: $(window).outerWidth(), height: $(window).outerHeight() + 60}, | |
3447 | + //size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, | |
3378 | 3448 | }); |
3379 | 3449 | } |
3380 | 3450 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/content/data/json/da/uc_dat_default.json
0 → 100644
1 | +{ "root": {"uc": {"pl": {"lx": {"_id": "1", "_tl": "English" } }, "al": { "lx": [ {"_id": "2", "_tl": "English (Undergraduate)" }, {"_id": "3", "_tl": "Swedish" }, {"_id": "4", "_tl": "German" }, {"_id": "5", "_tl": "Spanish" }, {"_id": "6", "_tl": "Hungarian" }, {"_id": "7", "_tl": "Italian" }, {"_id": "8", "_tl": "French" }, {"_id": "9", "_tl": "Portuguese" }, {"_id": "10", "_tl": "Japanese (Kanji)" }, {"_id": "11", "_tl": "Japanese (Yomi)" } ] }, "sl": null, "sktn": {"_id": "W" }, "mst": {"_st": "1" }, "an": {"_st": "1" }, "fn": {"_fml": "Arial", "_wht": "normal", "_stl": "normal", "_sz": "12" } } }} | |
0 | 2 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -464,7 +464,7 @@ |
464 | 464 | <!-- Nav tabs --> |
465 | 465 | <ul class="nav nav-tabs" role="tablist"> |
466 | 466 | <li role="presentation" ng-class="{'active':SettingsTab==1}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(1)">Appearance</a></li> |
467 | - <li role="presentation" ng-class="{'active':SettingsTab==2}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(2)">Lexicons</a></li> | |
467 | + <li role="presentation" ng-class="{'active':SettingsTab==2}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(2);lexiconData()">Lexicons</a></li> | |
468 | 468 | <li role="presentation" ng-class="{'active':SettingsTab==3}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(3)">Dissectible</a></li> |
469 | 469 | |
470 | 470 | </ul> |
... | ... | @@ -490,33 +490,25 @@ |
490 | 490 | <div class="col-sm-6"> |
491 | 491 | <div class="form-group"> |
492 | 492 | <label for="SystemFont" class="font13">Primary Lexicon</label> |
493 | - <input type="text" class="form-control" value="English" disabled> | |
494 | - <button class="btn btn-sm btn-success btn-block marginTop5">Change</button> | |
495 | - </div> | |
493 | + <input type="text" id="primarylaxican" class="form-control" value="English" name="1" disabled> | |
494 | + <button class="btn btn-sm btn-success btn-block marginTop5" id="laxicanlanguageChagne" disabled>Change</button> | |
495 | +</div> | |
496 | 496 | |
497 | 497 | <div class="form-group"> |
498 | 498 | <label for="SystemFont" class="font13">Secondary Lexicon</label> |
499 | - <textarea class="form-control" rows="3"></textarea> | |
499 | + <!--<textarea class="form-control" rows="3">--> | |
500 | + <select class="form-control" size="5" id="secondLax"></select> | |
501 | + <!--</textarea>--> | |
500 | 502 | </div> |
501 | 503 | <div class="form-group"> |
502 | - <button class="btn btn-sm btn-success" disabled>Add</button> | |
503 | - <button class="btn btn-sm btn-success">Remove</button> | |
504 | + <button class="btn btn-sm btn-success" id="laxiconLangAdd" disabled>Add</button> | |
505 | + <button class="btn btn-sm btn-success" id="laxiconLangRemove">Remove</button> | |
504 | 506 | </div> |
505 | 507 | </div> |
506 | 508 | <div class="col-sm-6"> |
507 | 509 | <div class="form-group"> |
508 | - <label for="SystemFont" class="font13">Available Lexicon</label> | |
509 | - <select multiple class="form-control" size="8"> | |
510 | - <option selected value="1">English</option> | |
511 | - <option>French</option> | |
512 | - <option>German</option> | |
513 | - <option>Hungarian</option> | |
514 | - <option>Italian</option> | |
515 | - <option>Japanese (Kanji)</option> | |
516 | - <option>Japanese (Yomi)</option> | |
517 | - <option>Portuguese</option> | |
518 | - <option>Spanish</option> | |
519 | - <option>Swedish</option> | |
510 | + <label for="SystemFont" class="font13">Available mkk Lexicon</label> | |
511 | + <select class="form-control" size="8" id="lexiconLangDropdown"> | |
520 | 512 | </select> |
521 | 513 | </div> |
522 | 514 | <p class="font11"><strong>Note :</strong> Some languages require special system fonts to display correctly</p> | ... | ... |