From: Editor Lionbridge Date: Fri, 9 Jun 2017 11:43:31 +0000 (+0300) Subject: Update code lines in Studio based on new rules X-Git-Tag: GitHub/PR#40/tizen-studio~142^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F133273%2F2;p=sdk%2Fonline-doc.git Update code lines in Studio based on new rules This is a manual cherry-pick from the #130909 change in the tizen_3.0 branch. The cherry-pick is not identical, because the branches have some synch differences, but the same code-related checks have been made and all found issues fixed. PS2: Rebase Change-Id: Ib353ce21f9f6010fa82d003492bbccd6a96c3fe1 --- diff --git a/org.tizen.studio/html/common_tools/emulator_features.htm b/org.tizen.studio/html/common_tools/emulator_features.htm index cd0bb64..6bb18b4 100644 --- a/org.tizen.studio/html/common_tools/emulator_features.htm +++ b/org.tizen.studio/html/common_tools/emulator_features.htm @@ -360,7 +360,7 @@ The appending value of the configuration file is removed when the user changes t <!--Hardware key region size and position--> <region left="233" top="882" width="74" height="74"/> <keycode>139</keycode> <!--Keycode value--> - <!--This line to be displayed when mouse hovers over the hardware key region--> + <!--This line is displayed when mouse hovers over hardware key region--> <tooltip>Home</tooltip> <!--Defined keyboard shortcut--> <shortcut>F1</shortcut> diff --git a/org.tizen.studio/html/native_tools/component_attributes_n.htm b/org.tizen.studio/html/native_tools/component_attributes_n.htm index 55e6f83..5b99988 100644 --- a/org.tizen.studio/html/native_tools/component_attributes_n.htm +++ b/org.tizen.studio/html/native_tools/component_attributes_n.htm @@ -519,7 +519,7 @@
 <scroller scrollbar_v="auto" align_v="fill" visible="true" weight_v="1" pack_h="123"
           content_min_h="false" weight_h="1" scrollbar_h="auto" align_h="fill" propagate_events="true"
-          pack_w="276" pack_x=v433" pack_y="173" style="default" id="scroller1" content_min_w="false">
+          pack_w="276" pack_x="v433" pack_y="173" style="default" id="scroller1" content_min_w="false">
 </scroller>
 
diff --git a/org.tizen.studio/html/native_tools/manifest_elements_n.htm b/org.tizen.studio/html/native_tools/manifest_elements_n.htm index dde54a1..80f3ff5 100644 --- a/org.tizen.studio/html/native_tools/manifest_elements_n.htm +++ b/org.tizen.studio/html/native_tools/manifest_elements_n.htm @@ -145,8 +145,11 @@

For example:

-<background-category value="download"/> <!--For the API version 2.4 or higher-->
-<metadata key="http://tizen.org/metadata/background-category/download"/> <!--For the API version lower than 2.4-->
+<!--For the API version 2.4 or higher-->
+<background-category value="download"/>
+
+<!--For the API version lower than 2.4-->
+<metadata key="http://tizen.org/metadata/background-category/download"/>
 

<datacontrol> Element

diff --git a/org.tizen.studio/html/native_tools/t_trace_n.htm b/org.tizen.studio/html/native_tools/t_trace_n.htm index 1f10ea7..161939e 100644 --- a/org.tizen.studio/html/native_tools/t_trace_n.htm +++ b/org.tizen.studio/html/native_tools/t_trace_n.htm @@ -97,7 +97,7 @@
  1. Open the command prompt and move to the T-trace script directory:
    -$ cd TIZEN_STUDIO/tools/ttrace
    +$ cd <TIZEN_STUDIO>/tools/ttrace
     
  2. Run the T-trace script with applicable options: diff --git a/org.tizen.studio/html/web_tools/config_editor_w.htm b/org.tizen.studio/html/web_tools/config_editor_w.htm index 7f10c6e..536c7e8 100644 --- a/org.tizen.studio/html/web_tools/config_editor_w.htm +++ b/org.tizen.studio/html/web_tools/config_editor_w.htm @@ -1264,11 +1264,11 @@
  3. Example:

    <tizen:ime>
    -    <tizen:uuid>6135122a-a428-40d2-8feb-a75f462c202c</tizen:uuid>
    -    <tizen:languages>
    -        <tizen:language>en-us</tizen:language>
    -        <tizen:language>de-de</tizen:language>
    -    </tizen:languages>
    +   <tizen:uuid>6135122a-a428-40d2-8feb-a75f462c202c</tizen:uuid>
    +   <tizen:languages>
    +      <tizen:language>en-us</tizen:language>
    +      <tizen:language>de-de</tizen:language>
    +   </tizen:languages>
     </tizen:ime>
     
     <tizen:category name="http://tizen.org/category/ime"/>
    @@ -1288,8 +1288,8 @@
  4. 1 or more
  5. Example:

    <tizen:languages>
    -  <tizen:language>en-us</tizen:language>
    -  <tizen:language>de-de</tizen:language>
    +   <tizen:language>en-us</tizen:language>
    +   <tizen:language>de-de</tizen:language>
     </tizen:languages>
    diff --git a/org.tizen.studio/html/web_tools/js_analyzer_w.htm b/org.tizen.studio/html/web_tools/js_analyzer_w.htm index 4171d32..91b841f 100644 --- a/org.tizen.studio/html/web_tools/js_analyzer_w.htm +++ b/org.tizen.studio/html/web_tools/js_analyzer_w.htm @@ -97,24 +97,26 @@

    This rule is supported by the JSLint and the Google Closure Linter. They say that "When you fail to specify var, the variable gets placed in the global context, potentially clobbering existing values. Also, if there is no declaration, it is hard to tell in what scope a variable lives."

    -
    function func1() {
    -   /* The foo function is defined without the var keyword */
    -   foo = function() {
    -      alert('func1');
    -   };
    -
    -   /* When the foo function is called, the foo function is not clear */
    -   foo();
    +
    +function func1() {
    +    /* The foo function is defined without the var keyword */
    +    foo = function() {
    +        alert('func1');
    +    };
    +
    +    /* When the foo function is called, the foo function is not clear */
    +    foo();
     }
     function func2() {
    -   /* The other foo function is defined without var keyword */
    -   foo = function() {
    -      alert('func2');
    -   };
    +    /* The other foo function is defined without var keyword */
    +    foo = function() {
    +        alert('func2');
    +    };
     
    -   /* When the foo function is called, the foo function is not clear */
    -   foo();
    -}
    + /* When the foo function is called, the foo function is not clear */ + foo(); +} +

    The JSA displays the following message:

    @@ -126,10 +128,12 @@ function func2() {

    In the following example, the statement var arguments = []; in the function overwrites the reserved keyword arguments. As a result, the reserved keyword arguments in functions lose the feature to access the arguments of the function.

    -
    function func() {
    -   /* 'arguments' has been predefined as a reserved keyword */
    -   var arguments = [];
    -}
    +
    +function func() {
    +    /* 'arguments' has been predefined as a reserved keyword */
    +    var arguments = [];
    +}
    +

    The JSA displays the following message:

    @@ -143,19 +147,23 @@ function func2() {

    This rule is introduced in the Google JavaScript Style Guide. They say that "The ability to create closures is perhaps the most useful and often overlooked feature of JS.One thing to keep in mind, however, is that a closure keeps a pointer to its enclosing scope. As a result, attaching a closure to a DOM element can create a circular reference and thus, a memory leak.".

    -
    var outer = function() {
    -   /* Warning case, be careful */
    -   var x = 0;
    +
    +var outer = function() {
    +    /* Warning case, be careful */
    +    var x = 0;
     
    -   return function() {
    -      /* Variable x of the outer function is captured in the inner function */
    +    return function() {
    +        /* Variable x of the outer function is captured in the inner function */
     
    -      return ++x;
    -   }
    -}
    +        return ++x;
    +    }
    +};
     var x = -1;
     
    -/* The inner function of function outer is assigned to variable test outside function outer */
    +/*
    +   The inner function of function outer is assigned to variable test
    +   outside function outer
    +*/
     var test = outer();
     
     /* Whenever the test is called, the result can be different from the expectation */
    @@ -179,17 +187,19 @@ test();

    This rule is described in the Google JavaScript Coding Style Guide. They say that "Extra comma and semicolon can make error.".

    -
    function func() {
    -   for (var i = 0; i < 10; i++) {
    -      /* Extra semicolon */
    -      x++;;
    -      /* Extra semicolon after the 'for' statement */
    -   };
    -
    -   return x;
    +
    +function func() {
    +    for (var i = 0; i < 10; i++) {
    +        /* Extra semicolon */
    +        x++;;
    +        /* Extra semicolon after the 'for' statement */
    +    };
    +
    +    return x;
     /* Extra semicolon after the function definition statement */
     };
    -var result = func();
    +var result = func(); +

    The JSA displays the following message:

    @@ -203,9 +213,10 @@ var result = func();

    This rule is introduced by the Google JavaScript Style Guide. They say that "In modern JavaScript engines, changing the number of properties on an object is much slower than reassigning the values. The delete keyword should be avoided except when it is necessary to remove a property from an object's iterated list of keys, or to change the result of if (key in obj)."

    -
    function Obj() {
    -   this.value = 10;
    -};
    +
    +function Obj() {
    +    this.value = 10;
    +}
     var obj = new Obj();
     
     /* Deleting properties of objects can make the performance of the program worse */
    @@ -221,9 +232,11 @@ delete obj.value;

    This rule is introduced by the Google JavaScript Style Guide. They say that "The whitespace at the beginning of each line can't be safely stripped at compile time; whitespace after the slash will result in tricky errors; and while most script engines support this, it is not part of ECMAScript".

    -
    /* Multi-line string literals can create a problem */
    +
    +/* Multi-line string literals can create a problem */
     var str = 'The Test String \
    -   for Positive TC';
    + for Positive TC'; +

    The JSA displays the following message:

    @@ -237,13 +250,15 @@ var str = 'The Test String \

    This rule is introduced by the Google Javascript Style Guide. They say that "Array constructors are error-prone due to their arguments".

    -
    var x = 1
    +
    +var x = 1
     
    -/* If the variable x is 1, the array arr1 is the array whose length is 1, not arr[0] is 1 */
    +/* If the variable x is 1, array arr1 is the array whose length is 1, not arr[0] is 1 */
     var arr1 = new Array(x);
     
     /* The array arr2 is the array which has 3 values, 1, 2, and 3 */
    -var arr2 = new Array(1, 2, 3);
    +var arr2 = new Array(1, 2, 3); +

    The JSA displays the following message:

    @@ -257,10 +272,12 @@ var arr2 = new Array(1, 2, 3);

    This rule is introduced by the Google Javascript Style Guide. They say that "Modifying builtins like Object.prototype and Array.prototype are strictly forbidden. It leads to hard to debug issues in production and should be avoided."

    -
    /* Modifying the function in prototype of built-in object makes debugging difficult */
    +
    +/* Modifying the function in prototype of built-in object makes debugging difficult */
     Object.prototype.create = function() {
    -   alert('Warning!');
    -};
    + alert('Warning!'); +}; +

    The JSA displays the following message:

    @@ -274,16 +291,17 @@ Object.prototype.create = function() {

    This rule is introduced by the Google Javascript Style Guide. They say that "There's no reason to use wrapper objects for primitive types, plus they are dangerous".

    -
    /* The variable bool is not false. It is an object with the value false */
    +
    +/* The variable bool is not false. It is an object with the value false */
     var bool = new Boolean(false);
     
     /* bool is always true */
     if (bool) {
    -   alert('true');
    +    alert('true');
    +} else {
    +    alert('false');
     }
    -else {
    -   alert('false');
    -}
    +

    The JSA displays the following message:

    @@ -297,12 +315,14 @@ else {

    This rule is introduced both by the JSLint and the Google Javascript Style Guide. They say that "for-in loops are often incorrectly used to loop over the elements in an Array. This is however very error prone because it does not loop from 0 to length - 1 but over all the present keys in the object and its prototype chain."

    -
    var arr = ['a', 'b', 'c'];
    +
    +var arr = ['a', 'b', 'c'];
     
     /* The variable key is not 'a', 'b', and 'c'. It is 0, 1, and 2 */
     for (var key in arr) {
    -   alert(key);
    -}
    + alert(key); +} +

    The JSA displays the following message:

    @@ -316,7 +336,8 @@ for (var key in arr) {
     /* The temp function needs the closing brace */
     function temp() {
    -   var a = 'ddd';
    + var a = 'ddd'; +

    The JSA displays the following message:

    [Syntax Error]Missing closing brace } character.
    @@ -332,9 +353,10 @@ function temp() { var a = 10; var b = 5; for (var i = 0; i < b; i++) { - a += i; - /* init i; -} + a += i; + /* init i; +} +

    The JSA displays the following message:

    [Syntax Error]Missing closing comment "*/".
    @@ -349,8 +371,9 @@ for (var i = 0; i < b; i++) { /* Setting value for MAX is not correct, missing single quote */ var MAX = 20; for (var i = 0; i < 10; i++) { - MAX = 'tt; -} + MAX = 'tt; +} +

    The JSA displays the following message:

    [Syntax Error]Missing closing single-quote ' character.
    @@ -364,8 +387,9 @@ for (var i = 0; i < 10; i++) {
     /* The declaration of a needed semicolon in the end */
     function tempx() {
    -   var a = 'ddd'
    -}
    + var a = 'ddd' +} +

    The JSA displays the following message:

    [CodingRule] Do not omit semicolon at the end of a declaration.
    @@ -376,11 +400,12 @@ function tempx() {

    In the following example, setting the value for the abc with the = operator in the new line is not correct. The operator must be in the same line as abc. The JSA detects it and creates an alarm.

    -
    /* Setting value for abc is not correct, do no begin with operator = */
    +
    +/* Setting value for abc is not correct, do no begin with operator = */
     var variable_sum = 1;
     var b = 2;
     var abc
    -   = 10 + variable_sum + b;
    +    = 10 + variable_sum + b;
     

    The JSA displays the following message:

    @@ -394,8 +419,9 @@ var abc
     if (true) {
    -   var a = "aa";
    -}
    + var a = "aa"; +} +

    The JSA displays the following message:

    [[CodingRule] Do not use double-quotes instead of single-quotes for string.
    @@ -422,7 +448,7 @@ var abc = [1, 2, 3,]; /* Do Not Use Wrong Opening Brace */ if (true) { - var test = 'test'; + var test = 'test'; } @@ -468,12 +494,13 @@ tizen.filesystem.resolve('images'

    In the following example, the tizen.filesystem.resolve() function needs an error callback as its third argument. Because the error callback does not exist, the JSA detects it and creates an alarm.

    -
    tizen.filesystem.resolve('images',
    -                         function(dir) {
    -                            console.log("Mount point Name is " +  dir.path);
    -                         }
    -                         /* Error callback required as the third argument */
    -);
    +
    +tizen.filesystem.resolve('images', function(dir) {
    +    console.log('Mount point Name is ' +  dir.path);
    +}
    +/* Error callback required as the third argument */
    +);
    +

    The JSA displays the following message:

    @@ -485,8 +512,13 @@ tizen.filesystem.resolve('images'

    In the following example, the tizen.calendar.getCalendars() is a function that can throw exceptions, so it must be wrapped by a try-catch statement. Because the try-catch statement does not exist, the JSA detects it and creates an alarm.

    -
    /* tizen.calendar.getCalendars API can make exceptions, so it should be wrapped in a try-catch statement */
    -tizen.calendar.getCalendars('EVENT', calendarListCallback, errorCallback);
    +
    +/*
    +   tizen.calendar.getCalendars API can make exceptions,
    +   so it should be wrapped in a try-catch statement
    +*/
    +tizen.calendar.getCalendars('EVENT', calendarListCallback, errorCallback);
    +

    The JSA displays the following message:

    @@ -498,14 +530,18 @@ tizen.calendar.getCalendars('EVENT', calendarListCallback, errorCallback);

    In the following example, the tizen.contact.getAddressBooks() function needs arguments whose type is the function instead of the string and the undefined, so the JSA detects it and makes an alarm.

    -
    var addressBooksCB = 'notFucntion';
    +
    +var addressBooksCB = 'notFucntion';
     try {
    -   /* The arguments of tizen.contact.getAddressBooks API must be function types instead of strings and undefined */
    -   tizen.contact.getAddressBooks(addressBooksCB, undefined);
    +    /*
    +       Arguments of tizen.contact.getAddressBooks API must be
    +       function types instead of strings and undefined
    +    */
    +    tizen.contact.getAddressBooks(addressBooksCB, undefined);
    +} catch (e) {
    +    /* Error handling */
     }
    -catch (e) {
    -   /* Error handling */
    -}
    +

    The JSA displays the following message:

    @@ -518,20 +554,24 @@ catch (e) {

    In the following example, the constructor tizen.Contact() function needs a dictionary object as the first argument. If the keys of the dictionary object are different from the spec, the JSA detects it and creates an alarm.

    -
    var validContactObj = new tizen.Contact({
    -   name: new tizen.ContactName({
    -      firstName: 'Jeffrey',
    -      lastName: 'Hyman',
    -      nicknames: ['joey ramone']
    -   }),
    -   emails: [new tizen.ContactEmailAddress('user@domain.com')],
    -   phoneNumbers: [new tizen.ContactPhoneNumber('666666666')]
    +
    +var validContactObj = new tizen.Contact({
    +    name: new tizen.ContactName({
    +        firstName: 'Jeffrey',
    +        lastName: 'Hyman',
    +        nicknames: ['joey ramone']
    +    }),
    +    emails: [new tizen.ContactEmailAddress('user@domain.com')],
    +    phoneNumbers: [new tizen.ContactPhoneNumber('666666666')]
     });
     
    -var invalidContactObj = new tizen.Contact(
    -{
    -   /* The first argument, whose type is dictionary, of tizen.Contact API does not have the property 'foo' */
    -   foo: 'I'm not an member of Contact'
    +var invalidContactObj = new tizen.Contact({ + /* + First argument, whose type is dictionary, of tizen.Contact API + does not have the property 'foo' + */ + foo: 'I'm not an member of Contact' +

    The JSA displays the following message:

    @@ -548,10 +588,13 @@ function onsuccess() { /* ... */ } function onerror() { /* ... */ } try { - /* Source code in Web App for Tizen 2.3 wearable platform, but 'open()' is defined in mobile-2.3 */ - tizen.archive.open('downloads/some_archive.zip', 'r', onsuccess, onerror); + /* + Source code in Web App for Tizen 2.3 wearable platform, + but 'open()' is defined in mobile-2.3 + */ + tizen.archive.open('downloads/some_archive.zip', 'r', onsuccess, onerror); } catch (e) { - /* ... */ + /* ... */ } @@ -648,19 +691,19 @@ tizen.application.launch('targetApp0.main', onsuccess);
     /* JavaScript snippets */
     function exitApp() {
    -   document.addEventListener('tizenhwkey', function(e) {
    -      if (e.keyName == 'back') {
    -         try {
    -            tizen.application.getCurrentApplication().exit();
    -         } catch (error) {
    -            console.error('getCurrentApplication(): ' + error.message);
    -         }
    -      }
    +    document.addEventListener('tizenhwkey', function(e) {
    +        if (e.keyName == 'back') {
    +            try {
    +                tizen.application.getCurrentApplication().exit();
    +            } catch (error) {
    +                console.error('getCurrentApplication(): ' + error.message);
    +            }
    +        }
        });
     }
     
     function runtime() {
    -   exitApp(); /* Add the function call for memory leak */
    +    exitApp(); /* Add the function call for memory leak */
     }
     
    @@ -690,19 +733,19 @@ function runtime() {
     /* JavaScript snippets */
     var init = function() {
    -   document.addEventListener('tizenhwkey', function(e) {
    -      if (e.keyName == 'back') {
    -         try {
    -            tizen.application.getCurrentApplication().exit();
    -         } catch (error) {
    -            console.error('getCurrentApplication(): ' + error.message);
    -         }
    -      }
    -   });
    -}
    +    document.addEventListener('tizenhwkey', function(e) {
    +        if (e.keyName == 'back') {
    +            try {
    +                tizen.application.getCurrentApplication().exit();
    +            } catch (error) {
    +                console.error('getCurrentApplication(): ' + error.message);
    +            }
    +        }
    +    });
    +};
     
     function command(num) {
    -   init(); /* Add the function call for memory leak */
    +    init(); /* Add the function call for memory leak */
     }
     
    diff --git a/org.tizen.studio/html/web_tools/web_simulator_features_w.htm b/org.tizen.studio/html/web_tools/web_simulator_features_w.htm index c844454..6a89bc8 100644 --- a/org.tizen.studio/html/web_tools/web_simulator_features_w.htm +++ b/org.tizen.studio/html/web_tools/web_simulator_features_w.htm @@ -123,43 +123,41 @@

    Figure: Packages and Applications panel

    Packages and Applications panel

    The following sample code demonstrates how to receive the INSTALLED, UPDATED, and UNINSTALLED events for changes in the installed packages list. If you select Sample Package from the available packages list and click Install, the "The package "Sample Package" is installed" message is displayed in the console, and for each application in the package, the oninstalled event is generated. You can subscribe to these application events by registering the tizen.application.addAppInfoEventListener interface.

    -
    var packageEventCallback =
    -{
    -   oninstalled: function(packageInfo)
    -   {
    -      console.log('The package "' + packageInfo.name + '" is installed');
    -   },
    -   onupdated: function(packageInfo)
    -   {
    -      console.log('The package "' + packageInfo.name + '" is updated');
    -   },
    -   onuninstalled: function(packageId)
    -   {
    -      console.log('The package "' + packageId + '" is uninstalled');
    -   }
    +
    +var packageEventCallback = {
    +    oninstalled: function(packageInfo) {
    +        console.log('The package "' + packageInfo.name + '" is installed');
    +    },
    +    onupdated: function(packageInfo) {
    +        console.log('The package "' + packageInfo.name + '" is updated');
    +    },
    +    onuninstalled: function(packageId) {
    +        console.log('The package "' + packageId + '" is uninstalled');
    +    }
     };
     
    -tizen.package.setPackageInfoEventListener(packageEventCallback);
    +tizen.package.setPackageInfoEventListener(packageEventCallback); +

    Preinstalled Packages and Applications In Mobile Applications

    A Sample Package is preinstalled in the simulator and contains 2 sample applications: Tizen dialer for making phone calls, and Tizen sender for sending SMS messages. Many sample applications, such as CallLog, use the Tizen Application API to invoke these service applications. Since the simulator allows you to run only 1 application at a time, the Application Module Message window is available, which can provide return data for success callback and simulate application launch failure.

    The following sample code demonstrates how to define an application control and invoke the http://tizen.org/appcontrol/operation/send_text service provided by the Tizen sender application. You can use the Application Module Message window to simulate the success value for the success callback or an error message for the error callback.

    -
    var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/send_text',
    +
    +var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/send_text',
                                                   'sms:' + phoneNumber);
     
    -tizen.application.launchAppControl(appControl, null, function()
    -{
    -   console.log('launch app service ...');
    +tizen.application.launchAppControl(appControl, null, function() {
    +    console.log('launch app service ...');
     }, function(e) {/* Error handling */},
     {
    -   onsuccess: function()
    -   {
    -      console.log('Message service launch success');
    -   },
    -   onfailure: function(er) {/* Error handling */}
    -});
    + onsuccess: function() { + console.log('Message service launch success'); + }, + onfailure: function(er) {/* Error handling */} +}); +

    Figure: Providing application callback data

    Providing application callback data

    @@ -248,9 +246,10 @@ tizen.application.launchAppControl(appControl, null, function()

    The Download panel allows you to create a simulated download object with custom size, MIME type, and download speed. All simulated download objects support start, cancel, pause, and resume operations, and provide status feedback mechanism. You can use the simulated download object created by the panel to test various conditions for your application.

    The panel contains 2 predefined simulated download objects: http://tizen.org/small_file.zip and http://tizen.org/big_file.zip. When an object is selected from the drop-down list, its details are displayed at the bottom half of the panel. The panel also allows you to add, remove, and update download objects. Details, such as URL, MIME type, file size, and speed, are configurable.

    The following sample code demonstrates how to start the download process and set a listener callback to monitor the status of the download. By adjusting the parameter of the download object, you can verify that you application behaves correctly in different scenarios.

    -
    request = tizen.DownloadRequest("http://tizen.org/small_file.zip")
    -downloadId = tizen.download.start(request)
    -tizen.download.setListener(downloadId, listener)
    +
    +request = tizen.DownloadRequest('http://tizen.org/small_file.zip');
    +downloadId = tizen.download.start(request);
    +tizen.download.setListener(downloadId, listener);
     

    Figure: Download panel

    @@ -264,14 +263,13 @@ tizen.download.setListener(downloadId, listener)

    Notification panel with empty notification

    The following sample code demonstrates how to create a status notification. When it is posted with the post() method, the details of the notification are displayed on the panel, as shown in the figure below.

    -
    -notification = new tizen.StatusNotification("PROGRESS", "Notification Sample",
    -{
    -   content: "sample content",
    -   iconPath: file:///images/icons/icon.png,
    -   soundPath: file:///sounds/alert.wav,
    -   vibration: true,
    -   progressValue: 67
    +
    +notification = new tizen.StatusNotification('PROGRESS', 'Notification Sample', {
    +    content: 'sample content',
    +    iconPath: file:///images/icons/icon.png,
    +    soundPath: file:///sounds/alert.wav,
    +    vibration: true,
    +    progressValue: 67
     });