diff --git a/hifive/src/main/webapp/src/h5.ui.FormController.js b/hifive/src/main/webapp/src/h5.ui.FormController.js index c23fcf24..74822e3e 100644 --- a/hifive/src/main/webapp/src/h5.ui.FormController.js +++ b/hifive/src/main/webapp/src/h5.ui.FormController.js @@ -684,7 +684,7 @@ /** * validate時にエラーがあった時、エラーバルーンを表示するプラグイン *

- * baloonプラグインには以下の設定項目があります。 + * balloonプラグインには以下の設定項目があります。 *

* * @@ -711,10 +711,10 @@ *

* * @class - * @name h5.ui.validation.ErrorBaloon + * @name h5.ui.validation.ErrorBalloon */ var controller = { - __name: 'h5.ui.validation.ErrorBaloon', + __name: 'h5.ui.validation.ErrorBalloon', _executedOnValidate: false, _messageOutputController: h5.ui.validation.MessageOutputController, _setting: {}, @@ -723,8 +723,8 @@ * プラグイン設定を行う * * @private - * @memberOf h5.ui.validation.ErrorBaloon - * @param {Object} setting bsBaloonプラグイン設定オブジェクト + * @memberOf h5.ui.validation.ErrorBalloon + * @param {Object} setting bsBalloonプラグイン設定オブジェクト */ _setSetting: function(setting) { this._setting = setting; @@ -743,7 +743,7 @@ *

* * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param {ValidationResult} result */ _onValidate: function(result) { @@ -757,13 +757,13 @@ *

* * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param element * @param name * @param {ValidationResult} validationResult */ _onFocus: function(element, name, validationResult) { - this._setErrorBaloon(element, name, validationResult, 'focus'); + this._setErrorBalloon(element, name, validationResult, 'focus'); }, /** @@ -773,13 +773,13 @@ *

* * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param element * @param name * @param {ValidationResult} validationResult */ _onBlur: function(element, name, validationResult) { - this._setErrorBaloon(element, name, validationResult, 'blur'); + this._setErrorBalloon(element, name, validationResult, 'blur'); }, /** @@ -789,13 +789,13 @@ *

* * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param element * @param name * @param {ValidationResult} validationResult */ _onKeyup: function(element, name, validationResult) { - this._setErrorBaloon(element, name, validationResult, 'keyup'); + this._setErrorBalloon(element, name, validationResult, 'keyup'); }, /** @@ -804,10 +804,10 @@ * 表示されているバルーンを削除します *

* - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon */ reset: function() { - this._hideBaloon(); + this._hideBalloon(); this._executedOnValidate = false; }, @@ -815,13 +815,13 @@ * バルーンをセット * * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param element * @param name * @param {ValidationResult} validationResult * @param {string} type 要素で発生したイベントタイプ */ - _setErrorBaloon: function(element, name, validationResult, type) { + _setErrorBalloon: function(element, name, validationResult, type) { if (!this._executedOnValidate) { // _onValidateが1度も呼ばれていなければ何もしない return; @@ -844,7 +844,7 @@ || (element !== document.activeElement && !$(document.activeElement).closest( element).length)) { // フォーカスが外れた時、該当要素または該当要素内の要素にフォーカスが当たっていない場合は非表示にする - this._hideBaloon(); + this._hideBalloon(); return; } var placement = propSetting.placement || DEFAULT_PLACEMENT; @@ -859,11 +859,11 @@ } if (ev.isValid) { // validならバルーンを隠す - this._hideBaloon(); + this._hideBalloon(); return; } // invalidならバルーン表示 - this._showBaloon(target, placement, container, this._messageOutputController + this._showBalloon(target, placement, container, this._messageOutputController .getMessageByValidationResult(validationResult, ev.name)); })); return; @@ -872,12 +872,12 @@ && validationResult.invalidReason[name]; if (!invalidReason) { // validateエラーがないときはhideして終了 - this._hideBaloon(); + this._hideBalloon(); return; } // validateエラーがあるとき - this._showBaloon(target, placement, container, this._messageOutputController + this._showBalloon(target, placement, container, this._messageOutputController .getMessageByValidationResult(validationResult, name)); }, @@ -885,20 +885,20 @@ * バルーンを表示 * * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param target * @param placement * @param message */ - _showBaloon: function(target, placement, container, message) { - this._hideBaloon(); - var baloonCtrl = this._baloonController; - if (!baloonCtrl) { - var c = h5.core.controller(this.rootElement, h5.ui.components.BaloonController); + _showBalloon: function(target, placement, container, message) { + this._hideBalloon(); + var balloonCtrl = this._balloonController; + if (!balloonCtrl) { + var c = h5.core.controller(this.rootElement, h5.ui.components.BalloonController); this.manageChild(c); c.readyPromise.done(this.own(function() { - this._baloonController = c; - this._showBaloon(target, placement, container, message); + this._balloonController = c; + this._showBalloon(target, placement, container, message); })); return; } @@ -906,38 +906,38 @@ target: target, container: container }; - var baloon = this._baloonController.create(message, option); + var balloon = this._balloonController.create(message, option); // 吹き出しの表示 - baloon.show({ + balloon.show({ target: target, direction: placement }); - this._currentBaloon = baloon; - this._currentBaloonTarget = target; + this._currentBalloon = balloon; + this._currentBalloonTarget = target; }, /** * バルーンを非表示 * * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon * @param target * @param placement * @param message */ - _hideBaloon: function(target, placement, container, message) { - if (this._currentBaloon) { - this._currentBaloon.dispose(); - this._currentBaloon = null; + _hideBalloon: function(target, placement, container, message) { + if (this._currentBalloon) { + this._currentBalloon.dispose(); + this._currentBalloon = null; } - this._currentBaloonTarget = null; + this._currentBalloonTarget = null; }, /** * メッセージ出力コントローラの設定 * * @private - * @memberOf h5.ui.validation.ErrorBaloon + * @memberOf h5.ui.validation.ErrorBalloon */ _setChildSetting: function() { var setting = this._setting; @@ -966,17 +966,17 @@ * このプラグインはBootstrapに依存します。Bootstrapのtooltipを使用して表示してています。 *

*

- * API仕様は{@link h5.ui.validation.ErrorBaloon}と同じです。 + * API仕様は{@link h5.ui.validation.ErrorBalloon}と同じです。 *

*

* プラグインの設定方法は、{@link h5.ui.FormController.setSetting}をご覧ください。 *

* * @class - * @name h5.ui.validation.BootstrapErrorBaloon + * @name h5.ui.validation.BootstrapErrorBalloon */ var controller = { - __name: 'h5.ui.validation.BootstrapErrorBaloon', + __name: 'h5.ui.validation.BootstrapErrorBalloon', /** * バルーンの削除 @@ -985,24 +985,24 @@ *

* * @private - * @memberOf h5.ui.validation.BootstrapErrorBaloon + * @memberOf h5.ui.validation.BootstrapErrorBalloon */ - _hideBaloon: function() { + _hideBalloon: function() { // 常にバルーンは一つのみ表示している実装のため、その1つのバルーンを非表示 - $(this._currentBaloonTarget).tooltip('hide'); + $(this._currentBalloonTarget).tooltip('hide'); }, /** * bootstrapのtooltipを使ってバルーンを表示 * * @private - * @memberOf h5.ui.validation.BootstrapErrorBaloon + * @memberOf h5.ui.validation.BootstrapErrorBalloon * @param target * @param placement * @param container * @param message */ - _showBaloon: function(target, placement, container, message) { + _showBalloon: function(target, placement, container, message) { $(target).attr({ 'data-placement': placement, 'data-container': container, @@ -1015,11 +1015,11 @@ trigger: 'manual' }); $(target).tooltip('show'); - this._currentBaloonTarget = target; + this._currentBalloonTarget = target; } }; - // 他のメソッドやプロパティはErrorBaloonから流用 - controller = $.extend({}, h5.ui.validation.ErrorBaloon, controller); + // 他のメソッドやプロパティはErrorBalloonから流用 + controller = $.extend({}, h5.ui.validation.ErrorBalloon, controller); h5.core.expose(controller); })(); @@ -1447,13 +1447,13 @@ var DEFAULT_PLUGINS = { style: h5.ui.validation.Style, composition: h5.ui.validation.Composition, - baloon: h5.ui.validation.ErrorBaloon, - bsBaloon: h5.ui.validation.BootstrapErrorBaloon, + balloon: h5.ui.validation.ErrorBalloon, + bsBalloon: h5.ui.validation.BootstrapErrorBalloon, message: h5.ui.validation.Message, asyncIndicator: h5.ui.validation.AsyncIndicator }; - // プラグインの表示リセットメui.validation.BootstrapErrorBaloonソッド名 + // プラグインの表示リセットメui.validation.BootstrapErrorBalloonソッド名 var PLUGIN_METHOD_RESET = 'reset'; // デフォルトで用意しているvalidateルール生成関数 @@ -1633,7 +1633,7 @@ *

 		 * {
 		 * 	output: { // 各プラグイン毎の設定
-		 * 		baloon: { // キー名にプラグイン名
+		 * 		balloon: { // キー名にプラグイン名
 		 * 			placement: 'top' // 設定プロパティと値を記述
 		 * 		},
 		 * 		message: {...},
@@ -1644,7 +1644,7 @@
 		 * 			displayName: '名前', // 設定プロパティと値を記述
 		 * 			message: '必須です', // 設定プロパティと値を記述
 		 * 			output: { // 各プロパティについて各プラグイン固有の設定
-		 * 				baloon: {
+		 * 				balloon: {
 		 * 					placement: 'left' // 設定プロパティと値を記述
 		 * 				},
 		 * 				message: {
@@ -1714,7 +1714,7 @@
 		 * 
* *
false
- *

メッセージを表示するプラグイン(message, composition, baloonで共通)

+ *

メッセージを表示するプラグイン(message, composition, balloonで共通)

* * * @@ -1758,7 +1758,7 @@ * * *
設定プロパティ名デフォルトルール毎にデフォルトのメッセージが用意されており、それらが使用されます。
- *

フォーム入力要素基準でエラー表示を行うプラグイン(style,message,baloon,asyncIndicatorで共通)

+ *

フォーム入力要素基準でエラー表示を行うプラグイン(style,message,balloon,asyncIndicatorで共通)

* * * @@ -1782,8 +1782,8 @@ *
  • {@link h5.ui.validation.AsyncIndicator} *
  • {@link h5.ui.validation.Composition} *
  • {@link h5.ui.validation.Message} - *
  • {@link h5.ui.validation.BootstrapErrorBaloon} - *
  • {@link h5.ui.validation.ErrorBaloon} + *
  • {@link h5.ui.validation.BootstrapErrorBalloon} + *
  • {@link h5.ui.validation.ErrorBalloon} *
  • * * - * + * * * * - * + * * * * diff --git a/hifive/src/main/webapp/src/h5.ui.components.BaloonController.js b/hifive/src/main/webapp/src/h5.ui.components.BalloonController.js similarity index 79% rename from hifive/src/main/webapp/src/h5.ui.components.BaloonController.js rename to hifive/src/main/webapp/src/h5.ui.components.BalloonController.js index 3a67e049..3ca27813 100644 --- a/hifive/src/main/webapp/src/h5.ui.components.BaloonController.js +++ b/hifive/src/main/webapp/src/h5.ui.components.BalloonController.js @@ -15,19 +15,19 @@ * */ (function() { - var fwLogger = h5.log.createLogger('h5.ui.components.BaloonController'); + var fwLogger = h5.log.createLogger('h5.ui.components.BalloonController'); - var MSG_CANNOT_CALL_METHOD_DISPOSED = fwLogger.info('dispose済みのBaloonは操作できません'); + var MSG_CANNOT_CALL_METHOD_DISPOSED = fwLogger.info('dispose済みのBalloonは操作できません'); /** 吹き出し(三角の部分)の大きさ * */ var ARROW_SIZE = 34; /** - * Baloonクラス + * Balloonクラス * * @class */ - function Baloon(arrowboxTmpl, content, option) { + function Balloon(arrowboxTmpl, content, option) { // display:noneで追加する this._$arrowbox = $(arrowboxTmpl).css('display', 'none'); this.setContent(content); @@ -36,8 +36,8 @@ // targetも指定されてなければbodyを親要素とする var container = option && option.container || option.target.parentElement || document.body; $(container).append(this._$arrowbox); - // Baloonインスタンスを要素に持たせる - this._$arrowbox.data('validation-baloon', this); + // Balloonインスタンスを要素に持たせる + this._$arrowbox.data('validation-balloon', this); option = option || {}; // クラスの追加 @@ -45,7 +45,7 @@ this._$arrowbox.addClass(option.cls); } } - $.extend(Baloon.prototype, { + $.extend(Balloon.prototype, { show: function(option) { if (this._isDisposed) { fwLogger.info(MSG_CANNOT_CALL_METHOD_DISPOSED); @@ -133,9 +133,9 @@ }); /** - * BaloonController定義 + * BalloonController定義 * - * @name h5.ui.components.BaloonController + * @name h5.ui.components.BalloonController * @namespace */ var arrowboxController = { @@ -143,46 +143,46 @@ /** * コントローラ名 * - * @memberOf h5.ui.components.BaloonController + * @memberOf h5.ui.components.BalloonController * @type String */ - __name: 'h5.ui.components.BaloonController', + __name: 'h5.ui.components.BalloonController', /** * ライフサイクルイベント __ready * - * @memberOf h5.ui.components.BaloonController + * @memberOf h5.ui.components.BalloonController * @param context */ __init: function(context) { - this.view.register('baloon', '
    '); + this.view.register('balloon', '
    '); }, /** - * Baloonインスタンスを作って返す + * Balloonインスタンスを作って返す * - * @memberOf h5.ui.components.BaloonController + * @memberOf h5.ui.components.BalloonController * @param {String|DOM|jQuery} content 吹き出しの中身 */ create: function(content, option) { - var $baloon = this.view.get('baloon'); + var $balloon = this.view.get('balloon'); - return new Baloon($baloon, content, option); + return new Balloon($balloon, content, option); }, /** - * BaloonのDOM要素からBaloonインスタンスを取得して返す + * BalloonのDOM要素からBalloonインスタンスを取得して返す * - * @memberOf h5.ui.components.BaloonController + * @memberOf h5.ui.components.BalloonController * @param {DOM|jQuery|String} elm 要素またはセレクタ */ - getBaloonFromElement: function(elm) { + getBalloonFromElement: function(elm) { var $elm = $(elm); if ($elm.length > 1) { - fwLogger.error('getBaloonFromElementには一つの要素または、一つの要素にマッチするセレクタを渡してください。'); + fwLogger.error('getBalloonFromElementには一つの要素または、一つの要素にマッチするセレクタを渡してください。'); } - return $elm.data('validation-baloon'); + return $elm.data('validation-balloon'); } };
    設定プロパティ名バリデート時にバリデート失敗した項目についてメッセージを表示する
    baloonballoonバリデート時にバリデート失敗した項目についてバルーンメッセージを表示する
    bsBaloonbsBalloonバリデート時にバリデート失敗した項目についてブートストラップでバルーンメッセージを表示する(bootstrap依存)